Author |
Message
|
maven |
Posted: Thu Jun 12, 2008 12:18 am Post subject: Propogate + exception |
|
|
Novice
Joined: 03 Jun 2007 Posts: 15
|
hi all,
we have a scenario where in compute node a message is split into multiple messages based on an ID and propogated to the output terminal. The output terminal property for Validation is set for 'Content and Value'.
The issue we are facing is that if one input message is split into 3 messages(inside the compute node) and if the 2nd message is not correctly formed, then an exception is generated at the MQOutput node when propogated. In this case, the 3rd message will never be propogated to the MQOutput node.
We have 2 alternative..
first one is to validate in compute node every mandatory element for the target system (which wont be efficient for a lenghty code) and
second is to propogate all the messages to a temp queue w/o validation, from where another message flow will pick up and validate the message one by one and put on the destination queue. (which changes the architect)
Can anyone suggest me on how to catch the excetion within the compute node till all correct messages are propogate and then throw the exception. or any other suggestions.. |
|
Back to top |
|
 |
AkankshA |
Posted: Thu Jun 12, 2008 12:48 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
use try node... before putting the message in MQOutput....
using catch terminal u can deal with that exception and your 3rd message would still be generated as the entre flow would not be rolled back.... _________________ Cheers |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 12, 2008 6:24 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
validate in compute node every mandatory element for the target system (which wont be efficient for a lenghty code) |
Why do the validation in the Compute node? If your input format is XML, then schema validation using XMLNSC in v6.1 is very lightweight. If non-XML or pre-v6.1, you could use MRM validation. |
|
Back to top |
|
 |
maven |
Posted: Thu Jun 19, 2008 7:54 pm Post subject: |
|
|
Novice
Joined: 03 Jun 2007 Posts: 15
|
hi all,
we require validation on the MQOutput node, so the the message for content and valuse is as per the what the target app wants.
nwayz we have foung an alternative by using 'Declare Handler' statement. But we are facing an issue, whenever an excePtion is throwN at the MQOutput node and the flows enters the 'Declare Handler' statement, we dont see the exception list being populated. We need to log the exception but without the exception list we can't.
We have set the MQOutput ppts for validation to ontent and value.
Please let us know if we are missing anything. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jun 20, 2008 12:16 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You could put a Catch node between the Compute node and the MQOutput node. Then you could delete your ESQL handler logic and put your exception processing logic on the catch terminal of the Catch node. I think that would be the standard solution. |
|
Back to top |
|
 |
chrisc |
Posted: Sun Jun 22, 2008 6:36 pm Post subject: |
|
|
Voyager
Joined: 19 Mar 2006 Posts: 77
|
I'm not sure whether the above replies have addressed your problem of the propagation stopping at the exception.
It's definitely a problem that you can't put "try/catch" in your ESQL like you can in Java, because the only way to continue the loop is to handle the exception from the Catch terminal, then link the output of that back to the input of your Compute node.
HOWEVER - this can be very dangerous, because you might end up with an infinite loop unless you're very careful! If you know what you're doing you can track your iterations using Environment (which doesn't disappear after each propagate) and have a check at the beginning of the Compute node code that behaves differently according to what it finds in the Environment. |
|
Back to top |
|
 |
|