on 09-25-2008 3:46 PM
Hi All,
Could you please suggest me the solution?
My mapping is like is:
Condition1.
If (Child1 == Field1) and Field2==1 then Value should be mapped to targetVal1 at the target side.
Condition2.
If (Child1 == Field1) and Field2==2 then Value should be mapped to targetVal2 at the target side.
Condition3.
If (Child1 == Field1) and Field2==3 then Value should be mapped to targetVal3 at the target side.
Source structure
Header 0...unbound
Child1 0...1
Child2 0...unbound
Field1 0...1
Field2 0...1
Child 3 0...unbound
Value 0...1
Target Structure:
Target
targetVal1
targetVal2
targetVal3
All the fields in the source structure are in Header context.
If all conditions are satisfied, targetVal1, targetVal2 and targetVal3 will be populated at the target side.
Problem is:
In absences of Field 1 and Field 2 fields in the above structure and Child 3 segment exits, the Value is populating when the condition 1 is true.
For Example:
For this case I should get the value as u201CTwou201D in my target field but I am getting as u201COneu201D which is wrong. <Header>
< Child1>ABC </Child1>
< /Child2>
<Child3>
<Value>One</Value>
</Child3>
</Child2>
< Child2>
<Field1>ABC</Field1>
<Field2>1</Field1>
<Child3>
<Value>Two</Value>
</Child3>
</Child2>
</Child1>
Can someone help me out please?
Regards,
Praveen Kumar
Hi,
It will be the context problem.
Change the target values occurances 0-unbounded.
Map like below.
Child1equalS(TextFunction)
Field1 and(Boolean)IfwithoutElse(then)mapValue---Target
Field2equalS(TextFunction)
Constant(1 or 2 or 3)
Child1contextHeader
Field1contextParentOf Header
Field2contextParentOf Header
ValuecontextParentOf Header
Hope it will solve your problem.
Regards,
Prakasu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try by using SplitByValue(each value) and Collapse Context after each input field like,
child1>SpliByValue>CollapseContext-->your present logic.
do it for each input field from source structure.
Regards,
Rohit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hey praveen,
As per your logic the value that is returning is correct...
see
If (Child1 == Field1) and Field2==1 then Value should be mapped to targetVal1 at the target side.
in ur input Child1==Field1 (i.e. ABC==ABC) and Field2=1 then it will give the first value from the Value field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
value field shdn't be with header context...change it to child context...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.