Author |
Message
|
Sam Uppu |
Posted: Fri Jun 14, 2013 1:02 pm Post subject: Graphical mapping node |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Hi All,
I am using WMB V8's Graphical mapping node to transform XML to COBOL.
On my COBOL copybook, we have 4 groups(A, B, C ,D) of elements. When i do mapping, i see only two group(A, D) of elements in the response. The two missing groups have "occurs depending on clause". I mapped using the for-each function on graphical map.
I don't understand what the issue is, could not all elements in output field.
Can you guys pls help me.
Thanks
Sam |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jun 15, 2013 4:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
In your map did you populate correctly the depending on field?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Sat Jun 15, 2013 12:00 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
When i do mapping, i see only two group(A, D) of elements in the response |
Put a Trace node before and after the map. The problem might be with the parsing of the message, not with the mapping. Either way, the Mapping node has no knowledge of the COBOL 'occurs depending on' setting, so that is not the issue. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Mon Jun 17, 2013 5:57 am Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
When i look at the trace, i dont see the B and C group in the trace. I see A and D mapping only. i am not sure if mapping node is ignoring the "occurs depending on" elements. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Mon Jun 17, 2013 6:37 am Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
i am using For each function to map the elements on C and D. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jun 17, 2013 7:44 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Sam,
If I understand you correctly, the fields do not exist in the message tree at all. My guess is that your message model is incorrect. If you post the Trace node output then we may be able to help. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Mon Jun 17, 2013 9:02 am Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Hi guys,
I cleaned my workspace and did mapping again. I am able to see the groups populating now. Not sure wat was the issue earlier.
I have one more question :
how do we get the number of occurences of an element using mapping node?
I have to populate the number of occurences of XML element to a cobol field.
Do we have any function like cardinality in ESQL? |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jun 17, 2013 9:09 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
NEVER use "the number of occurrences" to loop over a message tree.
IN ESQL or otherwise.
YES, the v7 and v8 map nodes provide LOOP functions that let you iterate over the existing number of occurrences. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Mon Jun 17, 2013 10:21 am Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Thanks mqjeff.
For looping thru the number of occurrences , i have used "For each" function.
I have a cobol elements ws-occurs which should be populated with the count of number of occurrences. I want to know if there is any function to calculate the number occurences of a field. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jun 18, 2013 3:28 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I assume that you want to do this in the Mapping node. If you simply drag a line from the input array element to an integer element then the Mapping node should automatically create a transform that counts the number of array elements.
[edit]Actually it creates a ForEach loop by default. You can change that to fn:count(), which you will find under the 'Math functions' section.[/edit] |
|
Back to top |
|
 |
|