Author |
Message
|
MQGuy2000 |
Posted: Wed Oct 06, 2004 1:55 pm Post subject: What does propagate do |
|
|
Centurion
Joined: 20 Jul 2003 Posts: 131
|
Gurus
Pardon me for being novice. Can you please explain me about the propagate statement in layman terms.
What does it do? where should it be used?
thanks a lot |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 06, 2004 2:09 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It send the current OutputRoot to the output terminal of the node you are in.
It then clears the entire OutputRoot tree.
It then returns control to your ESQL, immediately after the Propagate statement.
It is typically used for breaking up an incoming message into smaller messages.
For instance, if I have an incoming message that has ten records in it, I could use a loop and PROPAGATE to process each record individually, rather than having to process all ten.
Some pseudo-code:
Code: |
Copy Message Headers
Loop over each record in the Input message
Create an Output message that contains one record
Propagate
Copy Message Headers (reconstruct Output tree)
end loop
return false
|
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kirani |
Posted: Wed Oct 06, 2004 5:23 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Or use this ...
Code: |
Loop over each record in the Input message
Copy Message Headers
Create an Output message that contains one record
Propagate
end loop
return false
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
mgk |
Posted: Thu Oct 07, 2004 12:46 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
There are two other things PROPOGATE does that sometimes catch people out:
When PROPOGATE returns it:
1: It Clears ALL Output* Trees (OutputLocalEnvironment, OutputExeptionList) as well as OutputRoot.
2: It invalidates ALL esql REFERENCES into ANY of the Output* trees (that it just cleared), to stop you having any dangling references trying to point to elements that no longer exist in that tree.
So, you need to re-setup your references after propogate as well as your trees / headers (if you are using references)...
Cheers, _________________ 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 |
|
 |
RocknRambo |
Posted: Thu Oct 07, 2004 5:54 am Post subject: |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
If ur looking to understand what and where can v use PROPOGATE statement... with simple scenarios....
It can be used many scenarios.....one of them
following the example provided in ESQL manual...
if u have one xml which contains....1 header and N children.... and the requirement is send out N Messages, each Message representing a child, u can use it.
It can also be used in destinationlist....like if u have more one queue in the destinationlist and requirement is to send the same message to the queues...then PROPAGATE can be used.
hope this helps in better startup.
-sanu |
|
Back to top |
|
 |
MQGuy2000 |
Posted: Thu Oct 07, 2004 11:38 am Post subject: |
|
|
Centurion
Joined: 20 Jul 2003 Posts: 131
|
Thanks Guys for your explanation. |
|
Back to top |
|
 |
|