Author |
Message
|
Venkatpabolu |
Posted: Thu May 02, 2013 8:27 pm Post subject: Memory Allocation - PROPAGATE |
|
|
Newbie
Joined: 04 Mar 2013 Posts: 9
|
Hi,
I am going through a PDF that teaches ESQL coding... below pasted text is from that PDF. In case two when PROPAGATE DELETE NONE is issued, the next step is ' SET outputroot = inputroot', why should we again initialize outputroot ? My understanding is that outputroot still has data assigned in an instruction prior to PROPAGATE.
Case 1:
SET OutputRoot = InputRoot;
PROPAGATE; SET OutputRoot = InputRoot;
PROPAGATE TO TERMINAL ’Out1’;
SET OutputRoot = InputRoot;
PROPAGATE TO LABEL ’ThirdCopy’;
In the above example, the content of OutputRoot is reset before each PROPAGATE, because by default the node clears the output message buffer and reclaims the memory when the PROPAGATE statement completes. An alternative method is to instruct the node not to clear the output message on the first two PROPAGATE statements, so that the message is available for routing to the next destination. The code to do this iS:
Case 2 :
SET OutputRoot = InputRoot;
PROPAGATE DELETE NONE;
SET OutputRoot = InputRoot;
PROPAGATE TO TERMINAL ’Out1’
DELETE NONE;
SET OutputRoot = InputRoot;
PROPAGATE TO LABEL ’ThirdCopy’;
If you do not initialize the output buffer, an empty message is generated, and the message flow detects an error and throws an exception.
Can someone help me answer ? |
|
Back to top |
|
 |
Esa |
Posted: Thu May 02, 2013 11:13 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
You are right. If the message is propagated with DELETE NONE, there is no need to copy the input message to OutputRoot again. On the contrary, depending on what is being done in the flow, in some rare cases it might be even harmful. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 03, 2013 5:42 am Post subject: Re: Memory Allocation - PROPAGATE |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Venkatpabolu wrote: |
I am going through a PDF that teaches ESQL coding. |
What PDF? Sourced from where? Post a link. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Esa |
Posted: Fri May 03, 2013 7:38 am Post subject: Re: Memory Allocation - PROPAGATE |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Venkatpabolu wrote: |
Can someone help me answer ? |
Somebody has written a pdf for preparing for a certification test? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri May 03, 2013 8:06 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You should copy InputRoot to OutputRoot when it makes sense.
If you don't know when it makes sense, then run experiments and read the documentation and think about what you read and think about the experiments.
It's easy to learn things using this simple technique. |
|
Back to top |
|
 |
Esa |
Posted: Fri May 03, 2013 11:32 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
mqjeff wrote: |
You should copy InputRoot to OutputRoot when it makes sense.
|
Like when you need to modify it just a bit.
@Venkatpabolu:
Now here's the next exercise for you:
Would you believe that you can propagate InputRoot directly without having to copy it to OutputRoot?
Try to figure out how to do it! |
|
Back to top |
|
 |
|