Author |
Message
|
wbirookie |
Posted: Mon Jan 19, 2009 5:26 pm Post subject: Initializing OutputRoot to Blanks or Null |
|
|
Novice
Joined: 16 Jan 2009 Posts: 13
|
How to initialize OutputRoot to blanks or null, I have an ESQL that send muliple messages to Single MQ, The first message was good but when the program loops and assigned another message to the Que, the first message remains there, so the next one append to first one and so on. I tried to call CopyEntireMessage but I am getting some error and CopyMessageHeader doesnt solve the problem. The data comes from AS/400 database and send to MQ as an XML. Any help will be greatly appreciated.
thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 19, 2009 7:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
show us the code  _________________ MQ & Broker admin |
|
Back to top |
|
 |
wbirookie |
Posted: Mon Jan 19, 2009 10:14 pm Post subject: |
|
|
Novice
Joined: 16 Jan 2009 Posts: 13
|
Heres the scenario, the program read from header file and loop through the detail file put the data into output message and send to MQ, then loop back to the header until all data was read. The propagate worked fine but the message was not cleared/initialized appending the message to the previous message. The program is triggered so the only data on the MQInput was a dummy. I hope everything is cleared. Heres the code.
*****************************************************
CREATE COMPUTE MODULE CreateXMLNSMessage
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
DECLARE x INT 1;
DECLARE k INT;
DECLARE Count INT;
DECLARE Dtl INT;
SET Count = CARDINALITY(Environment.IXSB005P[]);
WHILE (x<=Count) DO
CALL CopyMessageHeaders();
SET OutputRoot.XMLNS.Envelope.PO[x].ASBPartnerID=Environment.IXSB005P[x].ASBPID;
SET OutputRoot.XMLNS.Envelope.PO[x].POHeader.PONumber=Environment.IXSB005P[x].CUSPO;
SET OutputRoot.XMLNS.Envelope.PO[x].POHeader[i].ASBOrderNumber=Environment.IXSB005P[x].ASBORD;
SET OutputRoot.XMLNS.Envelope.PO[x].POHeader[i].PODisposition=Environment.IXSB005P[x].PODISP;
SET OutputRoot.XMLNS.Envelope.PO[x].POHeader[i].PODispositionComments=Environment.IXSB005P[x].POREJR;
-- Detail Records
SET k=1;
SET Dtl = CARDINALITY(Environment.IXSB006P[]);
WHILE (k<=Dtl) DO
IF( Environment.IXSB005P[x].CUSPO = Environment.IXSB006P[k].CUSPO) THEN
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].ItemNumber = Environment.IXSB006P[k].CUSITM;
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].AvyItemNumber = Environment.IXSB006P[k].AVYITM;
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].ArtworkNumber = Environment.IXSB006P[k].ARWKID;
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].ItemSequence = Environment.IXSB006P[k].ITMSEQ;
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].Qty = CAST(Environment.IXSB006P[k].POQTY as CHARACTER);
END IF;
SET k=k+1;
END WHILE;
PROPAGATE DELETE NONE;
RETURN TRUE;
SET x=x+1;
END WHILE;
PROPAGATE DELETE NONE;
RETURN FALSE;
END; |
|
Back to top |
|
 |
gregop |
Posted: Tue Jan 20, 2009 12:11 am Post subject: |
|
|
Voyager
Joined: 24 Nov 2006 Posts: 81
|
Use PROPAGATE without the DELETE NONE parameters to clear OutputRoot. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jan 20, 2009 2:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gregop wrote: |
Use PROPAGATE without the DELETE NONE parameters to clear OutputRoot. |
The last propagate, while needed when you have data doesn't take into account the rare case where you have no data.
By the way I would remove the return true in the first loop.
The return false looks right...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
wbirookie |
Posted: Tue Jan 20, 2009 6:54 am Post subject: |
|
|
Novice
Joined: 16 Jan 2009 Posts: 13
|
Propage without not generate some error and stops after processing first record, and return false immediately exits the loop and processed only one record. I tried that too. Thanks for all your help. |
|
Back to top |
|
 |
wbirookie |
Posted: Wed Jan 21, 2009 10:24 am Post subject: Error on Propagate Statement |
|
|
Novice
Joined: 16 Jan 2009 Posts: 13
|
This is the error I am getting when I use propagate on my ESQL. The next message assigned to my OutputRoot was not getting processed. I create a trace and this is the error message I got. I am really frustrated for this simple program and I cant make it work. Any help will be appreciated. I have already posted my code previously.
OutputRoot.XMLNS.Envelope.POAcknowledgement.POAcknowledgementDetail.Item[y].ItemNumber = Environment.IXSB066PX[k].CUSITM;'' at ('.OPNA_BILL_ONLY_Compute1.Main', '34.6').
2009-01-21 09:37:59.303180 2888 UserTrace BIP2539I: Node 'OPNA_BILL_ONLY.GenXMLMsg': Evaluating expression ''k'' at ('.OPNA_BILL_ONLY_Compute1.Main', '34.121'). This resolved to ''k''. The result was ''2''.
2009-01-21 09:37:59.303199 2888 UserTrace BIP2539I: Node 'OPNA_BILL_ONLY.GenXMLMsg': Evaluating expression ''k'' at ('.OPNA_BILL_ONLY_Compute1.Main', '34.121'). This resolved to ''k''. The result was ''2''.
2009-01-21 09:37:59.303226 2888 UserTrace BIP2539I: Node 'OPNA_BILL_ONLY.GenXMLMsg': Evaluating expression ''Environment.IXSB066PX[k].CUSITM'' at ('.OPNA_BILL_ONLY_Compute1.Main', '34.99'). This resolved to ''Environment.IXSB066PX[2].CUSITM''. The result was ''ROW... Root Element Type=50331648 NameSpace='' Name='CUSITM' Value='777112090100001'''.
2009-01-21 09:37:59.303260 2888 UserTrace BIP2539I: Node 'OPNA_BILL_ONLY.GenXMLMsg': Evaluating expression ''y'' at ('.OPNA_BILL_ONLY_Compute1.Main', '34.83'). This resolved to ''y''. The result was ''2''.
2009-01-21 09:37:59.376354 2888 Error BIP2628E: Exception condition detected on input node 'OPNA_BILL_ONLY.MQInput'.
The input node 'OPNA_BILL_ONLY.MQInput' detected an error whilst processing a message. The message flow has been rolled-back and, if the message was being processed in a unit of work, it will remain on the input queue to be processed again. Following messages will indicate the cause of this exception.
Check the error messages which follow to determine why the exception was generated, and take action as described by those messages.
2009-01-21 09:37:59.376369 2888 RecoverableException BIP2230E: Error detected whilst processing a message in node 'OPNA_BILL_ONLY.GenXMLMsg'.
The message broker detected an error whilst processing a message in node 'OPNA_BILL_ONLY.GenXMLMsg'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error.
2009-01-21 09:37:59.376377 2888 RecoverableException BIP2488E: ('.OPNA_BILL_ONLY_Compute1.Main', '34.6') Error detected whilst executing the SQL statement ''SET OutputRoot.XMLNS.Envelope.POAcknowledgement.POAcknowledgementDetail.Item[y].ItemNumber = Environment.IXSB066PX[k].CUSITM;''.
The message broker detected an error whilst executing the given statement. An exception has been thrown to cut short the SQL program.
See the following messages for details of the error.
2009-01-21 09:37:59.376403 2888 RecoverableException BIP2498E: ('.OPNA_BILL_ONLY_Compute1.Main', '34.10') : An error occurred when navigating to path element '6' of the field reference at the given location.
Further messages are generated that provide details of the error.
Correct the syntax of your ESQL expression in node ''.OPNA_BILL_ONLY_Compute1.Main'', around line and column ''34.10'', then redeploy the message flow.
2009-01-21 09:37:59.376411 2888 RecoverableException BIP2436E: Invalid indexed assignment to '2'.
No indexed elements from the named array exist. In order to assign a value to an element with index n, where 'n' is a positive integer, n-1 elements with the same name must already exist.
Correct the logic of the program redeploy the message flow. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jan 21, 2009 11:08 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
mgk |
Posted: Wed Jan 21, 2009 11:13 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hello.
You have changed the code since your first post as the error mentions a variable called "y" when the code does not have one. However, it is a good guess (if your new code is similar) that you get an error because you increment variables (x and y?) at the bottom of the loop, so on the second time around you try to access an element that does not exist in the OutputRoot tree. This is because the index (in the error message y) is now 2, but the tree is empty because you removed the DELETE NONE. Therefore, for OutputRoot, the index should be 1 each time around. So change the code to not increment the index into the OutputRoot tree at the top level...
Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
wbirookie |
Posted: Wed Jan 21, 2009 12:03 pm Post subject: XML Problem |
|
|
Novice
Joined: 16 Jan 2009 Posts: 13
|
HI and thanks for your time. By the way I will send you my ESQL and the result of the process, and my expected result whick for 3 weeks now I am not able to accomplished. I have 3 Header records and I want the Detail Records show after each header tree. I wish you could help me. This is my code.
CREATE COMPUTE MODULE OPNA_BILL_ONLY_Compute1
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputRoot.MQMD = InputRoot.MQMD;
DECLARE DateTimeStp CHARACTER;
DECLARE ackTimeStp CHARACTER;
DECLARE pattern CHARACTER 'yyyy-MM-dd"T"HH.mm.ss';
DECLARE x INT;
DECLARE k INT;
DECLARE y INT;
DECLARE Count INT;
DECLARE Dtl INT;
set x = 1;
SET Count = CARDINALITY(Environment.IXSB055PX[]);
WHILE (x<=Count) DO
SET OutputRoot.XMLNS.Envelope.PO[x].ASBPartnerID=Environment.IXSB055PX[x].ASBPID;
SET OutputRoot.XMLNS.Envelope.PO[x].POHeader.PONumber=Environment.IXSB055PX[x].CUSPO;
SET OutputRoot.XMLNS.Envelope.PO[x].POHeader.ASBOrderNumber=Environment.IXSB055PX[x].ASBORD;
SET ackTimeStp = CAST(Environment.IXSB055PX[x].ACKTMS AS CHARACTER);
SET DateTimeStp = SUBSTRING(ackTimeStp FROM 1 FOR 10)||'T'||SUBSTRING(ackTimeStp FROM 12 FOR 2)||':'||SUBSTRING(ackTimeStp FROM 15 FOR 2)||':'||SUBSTRING(ackTimeStp FROM 18 FOR 2);
SET OutputRoot.XMLNS.Envelope.PO[x].POHeader.AcknowledgmentTimestamp=DateTimeStp;
SET OutputRoot.XMLNS.Envelope.PO[x].POHeader.PODisposition=Environment.IXSB055PX[x].PODISP;
SET OutputRoot.XMLNS.Envelope.PO[x].POHeader.PODispositionComments=Environment.IXSB055PX[x].POREJR;
set Environment.CustomerNo = Environment.IXSB055PX[x].CUSPO;
SET k=1;
SET Dtl = CARDINALITY(Environment.IXSB066PX[]);
WHILE (k<=Dtl) DO
IF( Environment.IXSB055PX[x].CUSPO = Environment.IXSB066PX[k].CUSPO) THEN
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].ItemNumber = Environment.IXSB066PX[k].CUSITM;
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].AvyItemNumber = Environment.IXSB066PX[k].AVYITM;
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].ArtworkNumber = Environment.IXSB066PX[k].ARWKID;
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].ItemSequence = Environment.IXSB066PX[k].ITMSEQ;
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].Qty = CAST(Environment.IXSB066PX[k].POQTY as CHARACTER);
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].ItemDisposition = Environment.IXSB066PX[k].ITDISP;
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].ItemDispositionComments = Environment.IXSB066PX[k].ITREJR;
END IF;
SET k=k+1;
END WHILE;
SET x=x+1;
END WHILE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER;
DECLARE J INTEGER;
SET I = 1;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
This is the result I am getting.
<Envelope>
<PO>
<ASBPartnerID>ECI </ASBPartnerID>
<POHeader>
<PONumber>10451 </PONumber>
<ASBOrderNumber>752 </ASBOrderNumber>
<AcknowledgmentTimestamp>2009-01-09T11:48:09</AcknowledgmentTimestamp>
<PODisposition>PASS </PODisposition>
<PODispositionComments> </PODispositionComments>
</POHeader>
<PODetail>
<Item>
<ItemNumber>777112090100001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3106 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>2</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112090100001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3106 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>2</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112097000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3107 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112097000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3107 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112092000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3108 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112092000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3108 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112090000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3109 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112090000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3109 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112092100001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3110 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>5</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112092100001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3110 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>5</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112090000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3111 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>2</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112090000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3111 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>2</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
</PODetail>
</PO>
<PO>
<ASBPartnerID>ECI </ASBPartnerID>
<POHeader>
<PONumber>10452 </PONumber>
<ASBOrderNumber>753 </ASBOrderNumber>
<AcknowledgmentTimestamp>2009-01-09T11:48:16</AcknowledgmentTimestamp>
<PODisposition>PASS </PODisposition>
<PODispositionComments> </PODispositionComments>
</POHeader>
</PO>
<PO>
<ASBPartnerID>ECI </ASBPartnerID>
<POHeader>
<PONumber>10456 </PONumber>
<ASBOrderNumber>754 </ASBOrderNumber>
<AcknowledgmentTimestamp>2009-01-09T11:48:22</AcknowledgmentTimestamp>
<PODisposition>PASS </PODisposition>
<PODispositionComments> </PODispositionComments>
</POHeader>
</PO>
</Envelope>
My expected XML will look like this.
<Envelope>
<PO>
<ASBPartnerID>ECI </ASBPartnerID>
<POHeader>
<PONumber>10451 </PONumber>
<ASBOrderNumber>752 </ASBOrderNumber>
<AcknowledgmentTimestamp>2009-01-09T11:48:09</AcknowledgmentTimestamp>
<PODisposition>PASS </PODisposition>
<PODispositionComments> </PODispositionComments>
</POHeader>
<PODetail>
<Item>
<ItemNumber>777112090100001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3106 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>2</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112090100001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3106 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>2</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112097000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3107 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112097000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3107 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112092000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3108 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112092000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3108 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
</PODetail>
<ASBPartnerID>ECI </ASBPartnerID>
<POHeader>
<PONumber>10452 </PONumber>
<ASBOrderNumber>753 </ASBOrderNumber>
<AcknowledgmentTimestamp>2009-01-09T11:48:16</AcknowledgmentTimestamp>
<PODisposition>PASS </PODisposition>
<PODispositionComments> </PODispositionComments>
</POHeader>
<PODetail>
<Item>
<ItemNumber>777112090000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3109 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112090000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3109 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112092100001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3110 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>5</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112092100001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3110 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>5</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
</PODetail>
<ASBPartnerID>ECI </ASBPartnerID>
<POHeader>
<PONumber>10456 </PONumber>
<ASBOrderNumber>754 </ASBOrderNumber>
<AcknowledgmentTimestamp>2009-01-09T11:48:22</AcknowledgmentTimestamp>
<PODisposition>PASS </PODisposition>
<PODispositionComments> </PODispositionComments>
</POHeader>
<PODetail>
<Item>
<ItemNumber>777112090000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3111 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>2</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112090000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3111 </ArtworkNumber>
<ItemSequence>0</ItemSequence>
<Qty>2</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
</PODetail>
</PO>
</Envelope> |
|
Back to top |
|
 |
Ric-Tic |
Posted: Wed Jan 21, 2009 7:35 pm Post subject: Re: XML Problem |
|
|
Apprentice
Joined: 18 Nov 2003 Posts: 38 Location: Zurich, Switzerland
|
Quote: |
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].ItemNumber = Environment.IXSB066PX[k].CUSITM; |
Doesn't the .PO. need to have an index on it? ie change it to .PO[x]. Otherwise every detail will get "attached" to the first PO occurrence in the output message |
|
Back to top |
|
 |
wbirookie |
Posted: Mon Jan 26, 2009 10:16 am Post subject: XML Qoutput in Order... |
|
|
Novice
Joined: 16 Jan 2009 Posts: 13
|
I am still hoping somebody can help me on my problem. I know its not really complicated and dont want to give up. Still waiting for some expert to give me some direction. Thank you. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jan 26, 2009 3:44 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I am still hoping somebody can help me on my problem |
You are more likely to get help if you make it easy for us.
- When you post code, use [code] tags so that we get to see the indentation
- When you post code, make it as short as possible. Remove things which are not part of the problem.
- If your XML output is not correct, tell us where the problems are. Don't just list two versions of your XML and expect us to compare them for you.
In other words, please use some of your own time if you want us to use ours  |
|
Back to top |
|
 |
rekarm01 |
Posted: Mon Jan 26, 2009 4:13 pm Post subject: Re: XML Qoutput in Order... |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
wbirookie wrote: |
I am still hoping somebody can help me on my problem. I know its not really complicated and dont want to give up. Still waiting for some expert to give me some direction. Thank you. |
Ric-Tic wrote: |
Code: |
SET OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].ItemNumber = Environment.IXSB066PX[k].CUSITM; |
Doesn't the .PO. need to have an index on it? ie change it to .PO[x]. Otherwise every detail will get "attached" to the first PO occurrence in the output message |
Did you try appending a subscript '[x]' to 'PO', as Ric-Tic suggested? If so, did that help? If it didn't help, then what happened? |
|
Back to top |
|
 |
wbirookie |
Posted: Fri Jan 30, 2009 9:08 am Post subject: Propage Issue. |
|
|
Novice
Joined: 16 Jan 2009 Posts: 13
|
I fixed the issue when I add subscript to PO[x]. All the data went in correctly in one message, Thanks for your help, I think I'm making program with my first program. My problem here was sending one message each to the message que through the loop. If I have 3 records I will have 3 message in my Que. I can fullfill this if I used PROPAGE DELETE NONE, but the output que is not cleared after the first message so the next message will have previous message and so on. If I only use PROPAGATE, the trace log showed it process the first one and when it loop, I got some error. BIP2436E, Invalid index assignment to '2'. I know propage delete the message tree but how will I fullfill this without exiting the program. Thanks again for all your inputs. |
|
Back to top |
|
 |
|