I am stuck in the issue .
I have two Input Fields
1) External Notes
2) Internal Notes
I want to map them to the destination node "Comments"
IF
External Notes is coming (do mapping)
Internal Notes is coming (do mapping)
Both filds are coming ( do mapping)
No field is coming ( Don't Map)
I have performed following tasks :
1) Check the logical existance if the node is coming.
2) used Equal fuctoid to confirm if the value is true . Logical existance = true - > pass true to OR Operator
3) Logical OR which performs Logical OR to both Fields .
4) value mapping to set the value .
This logic is working fine for the following scenarios :
a) InternalNotes come ( mapped successfully)
b) Both values (inter & exter ) comes (Mapped Successfully)
c) Extrnal Notes Comes ( Not Mapped)
I have tried alot but did not get anything why this External Value is not being mapped .
Please help me .
Thanks
Following should be the output for below Input messages :
INPUT 1:
<InternalNotes>
<Value>Internal notes value</Value>
</InternalNotes>
OUTPUT 1:
<Comments>
<Name>Comments</Name>
<Operation>Append</Operation>
<Value>Internal notes value</Value>
</Comments>
INPUT 2:
<ExternalNotes>
<Value>External notes value</Value>
</ExternalNotes>
OUTPUT 2:
<Comments>
<Name>Comments</Name>
<Operation>Append</Operation>
<Value>External notes value</Value>
</Comments>
INPUT 3:
<ExternalNotes>
<Value>External notes value</Value>
</ExternalNotes>
<InternalNotes>
<Value>Internal notes value</Value>
</InternalNotes>
OUTPUT 3:
<Comments>
<Name>Comments</Name>
<Operation>Append</Operation>
<Value>External notes value .
Internal Notes value
</Value>
</Comments>
This is a straightforward mapping if you use
xslt
- look here to convert your map toxslt
.For example:
This converts the following:
To this:
You haven't mentioned what the output should look like with no matches, but you'll obviously at least need a root element. More elegant xslt solutions are possible, I'm sure, but you get the idea :)