on 03-06-2008 5:06 PM
Hi Guys,
I have 2 messages on source side and 1 message on the target side
Source side
Message-1
<node1>
<elment1> 0..1
Message-2
<node2> 0..unbounded
<element2> 0.1
Target side
Message-3
<node3> 0..1
<element3> 1.1
I have mapped
node2>SplitByValue(EachValue)>node3
element1-->element3
I need to make element3 occur under each occurance of node3.
any help would be appreciated
Thanks,
Srini
Edited by: srinivas kapu on Mar 6, 2008 11:07 AM
Srini,
UseoneAsMany will do the logic.
element1,element2(don't change context), element2 (ChangeContext)->SplitByValue (Each Value)--> element3.
raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First you need to change the ocurance of Target fields Node and element to 0-Unbounded and 1-unbounded respectively.
Then just map Node2 ->SplitByValue->Node3
For element field use as below
Element1 ---> FormatByExample ---> SplitByValue -
>Element3
Node2 (2nd parameter)
If this will not work then just create UDF with cache paramter Queue and paste below code
Pass input values as
Node2--->A
element1--->B
//Write your code
for(int i=0; i<A.length;i++)
result.addValue(B[0]);
Thanks
Swarup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Swarup,
I tried
Element 1 - FormatByExample - SplitByValue - Element 3
Node 2
I got the exception
The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Function formatByExample: Queues have not equal number of values.] in class com.sap.aii.mappingtool.flib3.NodeFunctions method formatByExample[, ] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:Messages/ns0:Message1/ns2:ClearingHousePaymentOrderConfirmation/ClearingHousePaymentOrder/Settlement/ResultDescription. The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Function formatByExample: Queues have not equal number of values.] in class com.sap.aii.mappingtool.flib3.NodeFunctions method formatByExample[, ] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:284)
I need to try the UDF
Thanks,
Srini
Srini,
As I said earlier, in your case we can't apply FormatByExample. If you want to know the exact usage of FormatByExample, then refer the below links
http://www.flickr.com/photos/8764045@N06/2264815255/sizes/o/
http://www.flickr.com/photos/8764045@N06/2264815257/sizes/o/
In the link Just go thru the logic applied for Date field, it will give u clear picture.
raj.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.