Author |
Message
|
mystro |
Posted: Mon Apr 02, 2012 7:17 pm Post subject: For Loop on Mapping Node |
|
|
Newbie
Joined: 02 Apr 2012 Posts: 5
|
Hi all,
Was hoping someone could shed some light.
i currently have an array of data which has multiple address fields - this is the trace log i've applied before i apply it to the mapping node.
(0x03000000:PCDataField):record_date = '2012-03-27' (CHARACTER)
(0x03000000:PCDataField):current_status = 'C' (CHARACTER)
(0x01000000:Folder ):RecordAdditionalValues = (
(0x01000000:Folder):EntityContactInformation = (
(0x03000000:PCDataField):address_id = '195995' (CHARACTER)
(0x03000000:PCDataField):entity_id = '1' (CHARACTER)
(0x03000000:PCDataField):start_date = 'null' (CHARACTER)
(0x03000000:PCDataField):end_date = 'null' (CHARACTER)
(0x03000000:PCDataField):address_type = 'WORK_NO' (CHARACTER)
(0x03000000:PCDataField):kyc_address_flag = 'null' (CHARACTER)
(0x03000000:PCDataField):address_line_1 = '+61295197711' (CHARACTER)
(0x03000000:PCDataField):address_line_2 = 'null' (CHARACTER)
(0x03000000:PCDataField):address_line_3 = 'null' (CHARACTER)
(0x03000000:PCDataField):address_line_4 = 'null' (CHARACTER)
(0x03000000:PCDataField):address_line_5 = 'null' (CHARACTER)
(0x03000000:PCDataField):suburb = 'null' (CHARACTER)
(0x03000000:PCDataField):state = 'null' (CHARACTER)
(0x03000000:PCDataField):postcode = 'null' (CHARACTER)
(0x03000000:PCDataField):country = 'null' (CHARACTER)
(0x03000000:PCDataField):record_date = '2012-03-29' (CHARACTER)
(0x03000000:PCDataField):current_status = 'C' (CHARACTER)
(0x03000000:PCDataField):address_id = '195996' (CHARACTER)
(0x03000000:PCDataField):entity_id = '1' (CHARACTER)
(0x03000000:PCDataField):start_date = 'null' (CHARACTER)
(0x03000000:PCDataField):end_date = 'null' (CHARACTER)
(0x03000000:PCDataField):address_type = 'FAX_NO' (CHARACTER)
(0x03000000:PCDataField):kyc_address_flag = 'null' (CHARACTER)
(0x03000000:PCDataField):address_line_1 = '+61295652261' (CHARACTER)
(0x03000000:PCDataField):address_line_2 = 'null' (CHARACTER)
(0x03000000:PCDataField):address_line_3 = 'null' (CHARACTER)
(0x03000000:PCDataField):address_line_4 = 'null' (CHARACTER)
(0x03000000:PCDataField):address_line_5 = 'null' (CHARACTER)
(0x03000000:PCDataField):suburb = 'null' (CHARACTER)
(0x03000000:PCDataField):state = 'null' (CHARACTER)
(0x03000000:PCDataField):postcode = 'null' (CHARACTER)
(0x03000000:PCDataField):country = 'null' (CHARACTER)
(0x03000000:PCDataField):record_date = '2012-03-29' (CHARACTER)
(0x03000000:PCDataField):current_status = 'C' (CHARACTER)
Within the mapping node i do a for $source/Records/Record/RecordAdditionalValues/EntityContactInformation/address_id to be the source which is set to loop although it repeats the results in the out rather than providing an output at each instance of address_id. e.g.
<NS1:Entity_Contact_Information>
<NS1:Contact_Type Global_Code="WORK_NO" />
<NS1:Address_Line1>+61294761919</NS1:Address_Line1>
<NS1:Address_Line2>null</NS1:Address_Line2>
</NS1:Entity_Contact_Information>
<NS1:Entity_Contact_Information>
<NS1:Contact_Type Global_Code="WORK_NO" />
<NS1:Address_Line1>+61294761919</NS1:Address_Line1>
<NS1:Address_Line2>null</NS1:Address_Line2>
</NS1:Entity_Contact_Information>
<NS1:Entity_Contact_Information>
<NS1:Contact_Type Global_Code="WORK_NO" />
<NS1:Address_Line1>+61294761919</NS1:Address_Line1>
<NS1:Address_Line2>null</NS1:Address_Line2>
</NS1:Entity_Contact_Information>
I've tried a million methods although all my results vary, i've reviewed the standards for the "for" loop and looked even on the forums although i havent found anything in relation to this - should it just be done through a Java or ESQL compute node?
Thanks in Advance  |
|
Back to top |
|
 |
mystro |
Posted: Mon Apr 02, 2012 11:57 pm Post subject: |
|
|
Newbie
Joined: 02 Apr 2012 Posts: 5
|
just a note aswell, the client really wants in a mapping node rather than a compute if possible.. thanks all!! |
|
Back to top |
|
 |
Esa |
Posted: Tue Apr 03, 2012 12:13 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
You are not going to get a flood of replies, because most developers are not using the old (pre V8 ) mapping node. ESQL or java are more productive, mainly because you don't have to struggle with mysterious problems like the one you are experiencing now.
The few times I have worked with the mapping node - as an instructor running WMB 6 and 6.1 classes, where the mapping excercise nicely demonstrated how buggy the node was - I had to open the map in a text editor and examine the generated XML to figure out what had gone wrong. The thing is that the user interface does not always correctly reflect the XML.
Have you tried examining the map XML? |
|
Back to top |
|
 |
Omuch |
Posted: Tue Apr 03, 2012 1:10 am Post subject: Re: For Loop on Mapping Node |
|
|
Acolyte
Joined: 23 Mar 2012 Posts: 54
|
mystro wrote: |
Within the mapping node i do a for $source/Records/Record/RecordAdditionalValues/EntityContactInformation/address_id to be the source which is set to loop although it repeats the results in the out rather than providing an output at each instance of address_id.
|
Can you write cleary what is the hierarchy format of the Input?
I dont understand why you do a for loop on $source/Records/Record/RecordAdditionalValues/EntityContactInformation/address_id and not on $source/Records/Record/RecordAdditionalValues/EntityContactInformation? |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Apr 03, 2012 1:26 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Esa wrote: |
You are not going to get a flood of replies, because most developers are not using the old (pre V8 ) mapping node. |
At the risk of hijacking the thread
You can't really be serious about that statement. IMHO the majority of sites will be using V8 in POC and evaluation tests and not in a serious move into production use.
I know that there will be exceptions but AFAIK, in the real world many are still using 6.1 with a planned move to 7.0 immenent. Going to V8 is just far to much of an unknown to them at this stage (ie less than 6 months since its release and with no released FixPack available (room for egg on face there if it was released in the last few days).
There is a lot for the devs to learn. Apart from the new mapping node you have DFDL.
If you have the luxury to have the time and the ability to get upto speed with V8 then great but I think this is not the case for a good number of us. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Esa |
Posted: Tue Apr 03, 2012 1:33 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
smdavies99 wrote: |
You can't really be serious about that statement. IMHO the majority of sites will be using V8 in POC and evaluation tests and not in a serious move into production use.
|
OK. I rephrase it and drop my great expectations on the new mapping node:
You are not going to get a flood of replies, because most developers are not using the mapping node. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Apr 03, 2012 1:39 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I don't think the mapping node lets you output more than one message, that is that it lets you use propagate. |
|
Back to top |
|
 |
Esa |
Posted: Tue Apr 03, 2012 2:19 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
mqjeff wrote: |
I don't think the mapping node lets you output more than one message, that is that it lets you use propagate. |
I don't think the OP is trying to split the message. The problem seems to be that he gets the correct number of Entity_Contact_Information elements, but they all contain the same data - probably from the last record which he seems to have omitted from the trace log sample. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Apr 03, 2012 2:26 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Esa wrote: |
mqjeff wrote: |
I don't think the mapping node lets you output more than one message, that is that it lets you use propagate. |
I don't think the OP is trying to split the message. The problem seems to be that he gets the correct number of Entity_Contact_Information elements, but they all contain the same data - probably from the last record which he seems to have omitted from the trace log sample. |
I guess I wasn't clear on the meaning of
Quote: |
it repeats the results in the out rather than providing an output at each instance of address_id |
|
|
Back to top |
|
 |
mystro |
Posted: Tue Apr 03, 2012 2:07 pm Post subject: |
|
|
Newbie
Joined: 02 Apr 2012 Posts: 5
|
hi all,
Thank you for you all your response.
Just to some up, yes you are right, i have the correct number of Entity_Contact_Information elements, but they all contain the same data which is my issue.
As most of you have said, it is true there is not much on pre V7 for the mapping node.
Responding to Omuch:
I do the loop on address_id rather than EntityContactInformation because if i leave it only for EntityContactInformation i have 1 result retrieve rather than the number of address_id's - hope this makes sense. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 03, 2012 7:40 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The problem I see here is that you have a single EntityContactInformation structure with below it the address structure detail repeated twice....
To make it work better you should have defined a group level for the address structure ...
This would allow you the hierarchy:
EntityContactInformation
Code: |
-- address structure
--- address fields
-- address structure
--- address fields |
and would make your problem so much easier to handle...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|