|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQSI - Compute - Multiple Output Messages |
« View previous topic :: View next topic » |
Author |
Message
|
vikram.sharma |
Posted: Mon Nov 24, 2003 5:08 am Post subject: MQSI - Compute - Multiple Output Messages |
|
|
Newbie
Joined: 24 Nov 2003 Posts: 1
|
Hi ,
Lets assume that i have data in a flat file and i need to create an IDOC out of it.
10 records comprise one single message and i need to create a single IDOC .
Now my requirement changes to:for each record in the file i need to create a separate IDOC.
My understanding is that, a compute node will help to create messages and it will only create a single message for a single transaction.
I would like to understand that,is it possible to create a single message(IDOC) for every record in the file.for example in this case 10 IDOC messages.
Please explain in detail as to whether this is possible.
If yes wht would be the settings in the compute node for this to work.
As mentioned earlier,input type is MRM .
Please give me details on how my ESQL would be looking like .
Thanks in advance.
Vikram |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Nov 24, 2003 5:33 am Post subject: Re: MQSI - Compute - Multiple Output Messages |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Please see the documentation on the function called 'PROPOGATE'. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Missam |
Posted: Mon Nov 24, 2003 8:08 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Hi
You Said you have ten records in your flat input.That means you have to loop every time you read input record.at the end of the loop you say PROPAGATE and add RETURN FALSE as the last statement of the compute node..
Here is the example for both input and output XML Messages.
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
DECLARE J INTEGER;
SET J = 1;
DECLARE K INTEGER;
SET K = CARDINALITY(InputRoot.XML."YourMessage"[]);
WHILE(J <= K) DO
SET OutputRoot.Properties.MessageSet = InputRoot.Properties.MessageSet;
SET OutputRoot.Properties.MessageDomain = InputRoot.Properties.MessageDomain;
SET OutputRoot.Properties.MessageType = InputRoot.Properties.MessageType;
SET OutputRoot.Properties.MessageFormat = InputRoot.Properties.MessageFormat;
SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.MQRFH = InputRoot.MQRFH;
SET OutputRoot.MQRFH2 = InputRoot.MQRFH2;
SET OutputRoot.XML.YourMessage = InputRoot.XML."YourMessage"[J];
PROPAGATE;
SET J = J + 1;
END WHILE;
RETURN FALSE;
Thanx
Sam |
|
Back to top |
|
 |
vignesh.gopal |
Posted: Mon Nov 24, 2003 10:21 pm Post subject: it works... |
|
|
Novice
Joined: 23 Dec 2002 Posts: 24
|
Hey ,Sam is right,
to add to it,please find the ESQL we used for our flow.
The input data is
<?xml version="1.0"?>
<a>
<Details>
<Name>Wipro1 </Name>
<Age> 24 </Age>
</Details>
<Details>
<Name>Wipro2 </Name>
<Age> 25 </Age>
</Details>
</a>
in the compute node,use "copy headers.." and in the ESQL use,
DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
DECLARE J INTEGER 0;
DECLARE K INTEGER 0;
SET K = CARDINALITY(InputBody.a.Details[]);
WHILE J < K DO
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
SET OutputRoot.Properties.MessageFormat = 'XML';
SET OutputRoot.XML.(XML.XmlDecl)='';
SET OutputRoot.XML.(XML.XmlDecl).(XML.Version)='1.0';
SET OutputRoot.XML.(XML.XmlDecl).(XML."Encoding")='UTF-8';
SET OutputRoot.XML.(XML.XmlDecl).(XML.Standalone)='no';
SET J = J + 1;
SET OutputRoot.XML.a.Details=InputBody.a.Details[J];
PROPAGATE;
END WHILE;
RETURN FALSE;
............
As far as the propagate is concerned,it removes the tree once it reads the messages,tht is the reason we make the tree available to the entire looping.
hope this helps.
regards
Vignesh |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|