You can use removeContext() to delete all the top contexts for an element. This deletes all top hierarchy levels, so that all elements of the target queue are assigned to a root element of the source queue
SplitByValue() is the counterpart to removeContexts(): Instead of deleting a context, you can insert a context change in the source value queue
You can insert a context change in the queue after each value, after each change to the value, or after each tag without a value
collapseContexts()copies the first value from all contexts to one context. Empty contexts are replaced with an empty string.
Consider the above example , if you use collapseContext instead of splitByValue() and occurence of room in the target is 1 to unbounded
then you will get room node only one time in the target because collapseContext() just take first value from all context to one context .
Example 2 :On collapseContext()
In the first target field mapping personalId is passed to SplitByValue because personalId is in the same context and I want to put it in diffrent context for each value of personalId
then in each context there will be only one value( see the display queue goto design tab then right click on the the field and select displayQueue) then the result of splitByValue is passsed to collapseContext to copy first value from each context as there is only one value here in each context it will create room node in the target as many times as there are values in the display queue of collapseContext().
Use One As Many
It Requires 3 inputs.
1. The values from the first mapped element(Company Code).Each context must have single value in the queue.
2. The occurrences from the mapped second element (Order Number).Context must be same to which is mapped in the first value(Company Code).
3. The structure of the 3rd mapped element (OrderNumber).
So The useOneAsMany takes the above mentioned inputs and creates the target structure as shown in the below diagrams.
Not only for the 1-1 ocuurance.We have to use Use one as many function for 0-Unbounded occurance also.
Simple example of use one as many function.
Source and Target Structure:
Queue and Context Formation:
Context of PO_No and item details are same.