Author |
Message
|
datspats |
Posted: Sat Jul 28, 2007 6:28 am Post subject: Usages of PROPAGATE not clear |
|
|
Voyager
Joined: 12 Apr 2007 Posts: 80 Location: Mumbai
|
Hello,
I want to use PROPAGATE node in my flow as per requirement, In my compute node,
I have the code in while loop which search for the content on line by line.
In the 'IF' condition below "IF_Check", is not satisfied then i need to propagte the message to out1 terminal immeditely and never execute loop again and generate failure report "errorcode" and finally put message to MQ output node,
if all condition are ok as per "IF_Check" then message successfully passed from out node and then finally to output node.
WHILE(some condition)
BEGIN
IF (IF_Check) THEN
some processing;
Continue processing for next line;
ELSE
PROPAGATE to terminal 'out1';
END IF;
END WHILE
In case of failure i.e. "IF_Check" fails then
propagate statement as mentioned causes two copies of message one in output node with failed report "errorcode" and other to failure queue attached to the CATCH terminal of the input node (I know this come becuase of empty message tree)
But
How do i get rid of messge in the failure queue attached to the CATCH terminal of the input queue, as I need only the message to the output queue with the failure report when IF_Check" fails .
Regards |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Jul 28, 2007 6:56 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
else
propagate
return false
end if _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
joe.l3 |
Posted: Sat Jul 28, 2007 8:05 am Post subject: |
|
|
Novice
Joined: 24 Jul 2007 Posts: 20 Location: ITALY
|
I have used PROPAGATE statment to propagate two separated message to the next node of my workflow. Take a look to the following code. You can adjust it for you need.
CREATE COMPUTE MODULE MyComputeNode
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE MsgQuantity INTEGER 2;
DECLARE MsgOutput INTEGER 1;
WHILE MsgOutput <= MsgQuantity DO
IF MsgOutput=1 THEN
CALL CopyMessageHeaders();
SET OutputRoot.XML.msg1='out1';
SET MsgOutput = MsgOutput+1;
PROPAGATE; -- the first message is propagated to the next node
END IF;
IF MsgOutput=2 THEN
CALL CopyMessageHeaders();
SET OutputRoot.XML.msg2='out2';
SET MsgOutput = MsgOutput+1; -- the second message is propagated to the next node
PROPAGATE;
END IF;
END WHILE;
RETURN FALSE;
END;
CREATE PROCEDURE CopyMessageHeaders()
BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
END MODULE; |
|
Back to top |
|
 |
datspats |
Posted: Sat Jul 28, 2007 8:27 am Post subject: |
|
|
Voyager
Joined: 12 Apr 2007 Posts: 80 Location: Mumbai
|
Thanks for the both replies,
Regards |
|
Back to top |
|
 |
mrgate |
Posted: Mon Jul 30, 2007 12:56 am Post subject: |
|
|
 Centurion
Joined: 28 Feb 2007 Posts: 141 Location: India
|
Hey Joe.13,
what you have done is perfect and its not wrong. To decrease space complexity i.e. coding, instead of calling headers twice, copy only once and in the first if condition, instead of using only propagate, use propagate delete none so that headers are not removed. |
|
Back to top |
|
 |
joe.l3 |
Posted: Thu Aug 02, 2007 5:08 am Post subject: |
|
|
Novice
Joined: 24 Jul 2007 Posts: 20 Location: ITALY
|
Thanks mrgate for your comment, but I don't understand about "...use propagate delete none...". Can you tell me some details?
(I have a WBI Toolkit 5.0 version) |
|
Back to top |
|
 |
Vitor |
Posted: Thu Aug 02, 2007 5:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
"Delete None" is an option of the Propogate command. It's in the manual description. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Aug 02, 2007 6:00 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Vitor wrote: |
"Delete None" is an option of the Propogate command. It's in the manual description. |
But I believe it's new to v6... and so not available to a v5 Toolkit or Broker... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Aug 02, 2007 6:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jefflowrey wrote: |
Vitor wrote: |
"Delete None" is an option of the Propogate command. It's in the manual description. |
But I believe it's new to v6... and so not available to a v5 Toolkit or Broker... |
Doh!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
joe.l3 |
Posted: Thu Aug 02, 2007 6:19 am Post subject: |
|
|
Novice
Joined: 24 Jul 2007 Posts: 20 Location: ITALY
|
In the ESQL 5.0 manual there is not a "DELETE NONE" option for "PROPAGATE" so I think that it's new for 6.0 PROPAGATE. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Aug 02, 2007 6:32 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
joe.l3 wrote: |
In the ESQL 5.0 manual there is not a "DELETE NONE" option for "PROPAGATE" so I think that it's new for 6.0 PROPAGATE. |
I think you're right. As jefflowrey correctly points out!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|