cancel
Showing results for 
Search instead for 
Did you mean: 

when contex change i wana get the value from source if condition is true

Former Member
0 Kudos

HI Forum users,

my source structure is

root

charc

value

my target structure is

detail

no

desc

properties

value1

value2

value3

in my scenario root value will be 1-unbounded charc value will be changing when context changed, but my requirement is the charc corressponding values i need to pass the properties-value1,value2,value3.

eg:

root

charc = color

vaue= 10

root

charc= length

value=20

root

charc=width

value=30

for this it have condition that is if charc= color then pass the value other wise pass blank spaces

then output values: properties-value1=10,:if condition is true

properties-value2=blank spaces,if condition is false

properties-value3=30,if condition is true

how to do this one in the mapping and in reciver jms file content conversion fixed length

Edited by: SWATHIP on Feb 19, 2011 1:59 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

This requirement is very simple.

Use standard function equals to check whether charc has color then use boolean if else and map it to target field.

If condition map it to directly to the target field

else means pass empty string using constant.

Sarvesh also mentioned also very similar.

Former Member
0 Kudos

thanks for your response. but my requirement is when root context changed i am not able to pass the charc values to corresponding target element

eg:

root

charc=color

value=10

output vale of value1is 10

it should have to check all the values of charc and map to the corresponding target values

target fields are vaalue1,value2,value3.

output like this:10,blankspaces(when if condition is false),30

please reply to me fastly

Former Member
0 Kudos

Use RemoveContext, Sort(Descending), CollapseContextafter just before your target field.. e.g..

Charc---Ifelse logic---RemoveContext---Sort(Descending)---CollapseContext---target

former_member581827
Participant
0 Kudos

Havent you tried using Exists Function Like

IF char--> Exists->IF then Map Char to Target else pass Constant with value space to Target.

Thanks,

Chandra.

Former Member
0 Kudos

Thanks for your response.

Charc -removeContext --sortByKey

Value-removeContext--sortByKey

Charc- equals-removeContext-sort --if then else

if condition is true then i passed the value based on sort by key.

else i passed as constant with balnk spces.

now my object is working

Thanks

Former Member
0 Kudos

Try with "IfElse", "equalS", & "Constant" function e.g.

if charc equals Constant("color") then map value ELSE map Constant ("empty") to VALUE1

Apply same logic for VALUE2 & VALUE3.