Quantcast
Channel: SCN : All Content - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 7030

Mapping Logic: Value of source field to be output on another sequence of target field

$
0
0

Hi Guys,

 

I would like to seek for your expertise.

 

I have the following source XML format:

 

<SourceMessage>
     <row>
          <tax></tax>
          <amount></amount>
     </row>
     <row>
          <tax></tax>
          <amount></amount>
     </row>
     <row>
          <tax></tax>
          <amount></amount>
     </row>
</SourceMessage>

 

For my target message, I have the following XML format:

 

<TargetMessage>
     <TargetSegment>
          <amount></amount>
     </TargetSegment>
     <TargetSegment>
          <amount></amount>
     </TargetSegment>
     <TargetSegment>
          <amount></amount>
     </TargetSegment>
</TargetMessage>

 

If my tax field has a value from the source XML, the amount will be produced on the <amount> field under the 3rd occurrence of <TargetSegment>.
And the other <amount> fields which do not have value or null for <tax> will be produced in 1st and 2nd occurrences of <TargetSegment>.

 

Example:

If my second occurrence of <row> has

<tax>123</tax>

<amount>1234</amount>,

the amount will be produced in the <amount> field under the 3rd occurrence of <TargetSegment>.

 

How can I create this logic in my mapping?

 

Thanks and Regards,

Neil


Viewing all articles
Browse latest Browse all 7030

Trending Articles