cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping Multiple Segments

0 Kudos

Hi all,

I am not sure how to make this scenario work, you are welcome to share your thoughts.
My requirement is I need to create a multiple segment inside a xml file and inside this segment
there could be a 0:unbounded occurrence of another segment.


Here is an example of the xml structure.

<supply>

    <supply_code>PEN033</Supply_code>

    <unit_code>PC</unit_code>

    <sites>

        <site>PRN03</site>

    </sites>   

    <sites>

        <site>TER01</site>

    </sites>   

    <sites>

        <site>CRN05</site>

    </sites>   

</supply>

<supply>

    <supply_code>ERS004</Supply_code>

    <unit_code>PC</unit_code>

    <sites>

        <site>PRN03</site>

    </sites>   

    <sites>

        <site>CRN05</site>

    </sites>   

</supply>



Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Topeqejj,

Since the source structure is not given, here is a general rule for dealing with unbounded segments:

1. The first unbounded target segment you have is supply. The output context should only contain one context change. If there are two or more context changes, only the entries in the first context change are created in the target mapping. For example:

Will create two supply nodes.

2. The second unbounded target segment you have is sites. The number of context change in the display queue depends on the number of contexts in step 1. In our example, there are two contexts in step 1 therefore, you need two context changes containing all the entries. For example:

Will create three sites for the first supply node and two sites for the second supply node. The splitByValue:eachValue will ensure that there is a value for site.

Regards,

Mark

Answers (2)

Answers (2)

suman_sourabh
Participant
0 Kudos

Hi Topeqejj,

Please make your requirement more clear with Input and Output structure.

Regards,
Suman

former_member186851
Active Contributor
0 Kudos

Hello Top,

What is the end-end flow,Just create a structure with both root and sub nodes as 0-unbounded.