Author |
Message
|
superstar |
Posted: Mon Jul 31, 2006 4:39 pm Post subject: Failure in Exception Handling |
|
|
Apprentice
Joined: 12 May 2004 Posts: 31
|
I have created and an Exception handling subflow and attached it to my main flow as follows.
Happy Path:
InputNode --> ExceptionHandling1 (Try)--> Compute (Split and Propagate) --> ExceptionHandling2 (Try)--> OutputNode
The compute node receives a big message which it needs to split into multiple CWF messages and propagate. We insreted a 2'nd Exceptionhandling subflow to ensure that if while split and propagate and error occurs, the flow shpuld not stop and needs to continue the split and put.
In a particular case while creating the small CWF message a parser error occured and a malformed CWF message is built and PROPAGATE'd. An error occured and the messages comes out of the error-sub-flow's catch terminal where I try to build an error XML. As a part of building the XML I need to copy the original message into the error XML too.
As the input is CWF message I tried to reset the content to BLOB and use ASBITSTREAM to pass the input body into a variable, then CAST it into a string and put it in my Error XML.
An exception occurs at the reset content descriptor saying that the input message is invalid (invalid wire format). How do I save the incorrect message that was built?
My data flow again:
BigXML --> Split into Multiple CWF's --> put.
Thanks,
Superstar |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jul 31, 2006 5:55 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to set an xml CDATA format for your serialized string (BLOB). Otherwise truely your XML might be invalid.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jul 31, 2006 6:01 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You actually need to do something more to make sure that your BLOB data does not include things like <, >, [[, ]], and etc. to make sure that your CDATA section does not invalidate your XML.
base64 encoding is a reasonable idea. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
superstar |
Posted: Tue Aug 01, 2006 11:44 am Post subject: |
|
|
Apprentice
Joined: 12 May 2004 Posts: 31
|
I am trying to capture the MRM (CWF) data into a BLOB and store it in XML. And the MRM was not formatted correctly. Hence ... the code fails right at the point where I try to conver it into BLOB or bitstream ...
Am I clear? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 01, 2006 12:00 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If a subsegment of the input message is badly formed, how did you parse it in the first place? I mean how do you split it if the whole document is invalid becuase one piece is invalid. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
superstar |
Posted: Wed Aug 02, 2006 3:08 pm Post subject: |
|
|
Apprentice
Joined: 12 May 2004 Posts: 31
|
I have a big input XML (good one) coming in, I need to split it a create multiple CWF's out of it. As the incoming is XML it has no data constraints. But when we try to copy some thing to output and create CWF one of the field is more than the allowed length and the output message is malformed and errors out. We try to catch the error at that part. Hence for the exception subflow the backe out input message is the malformed CWF message and not the incoming good XML. ... am I clear...? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 02, 2006 3:19 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yes, that makes more sense. I though you were splitting a big CWF. And you did say your input was a CWF message
So if the CWF parser fails, I think the ASBITSTREAM throws an exception which takes you out of the node, right? If so, you can do this.
ComputeNode (splits XML and propagates) -> Try/Catch node -(try)> ComputeNode (converts to CWF) -> ... other processing
Try/Catch node-(catch)> ComputeNode(handles and reports error) -> output node or nothing to end this execution
Each propagate will hit the Try/Catch node as an individual piece, and they will run in serial. The try/catch will prevent the exception from going back to the propagate Compute node and interrupting that flow - so all pieces will be processed individually.
Depending on your requirements for handling the errors, you can either use an xxxOutput node to put the data somewhere, or you can have nothing connected which will cause that piece of data to be discarded. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
superstar |
Posted: Wed Aug 02, 2006 4:22 pm Post subject: |
|
|
Apprentice
Joined: 12 May 2004 Posts: 31
|
Jeff,
I am doing the same way. But my concern is, I am loosing that small chunk of malformed data right. Is there no way that I can save it any where? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Aug 02, 2006 4:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Send an xsd to your XML partner which you can create from an mxsd. You need of course to have restricted the string to the max value allowed by your CWF format. This way your partner should not send data that is too long...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 02, 2006 6:14 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
superstar wrote: |
Jeff,
I am doing the same way. But my concern is, I am loosing that small chunk of malformed data right. Is there no way that I can save it any where? |
Yes, that's why I said you can use an xxxOutput node on the Catch flow. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
superstar |
Posted: Tue Aug 08, 2006 11:36 am Post subject: |
|
|
Apprentice
Joined: 12 May 2004 Posts: 31
|
But Jeff ... if the message is malformed it cannot be written on output queue right. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 08, 2006 11:55 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No.
You have valid chunks of XML Input data that can't be transformed into valid chunks of CWF Output data. So you can send the valid XML to the xxxOutput node - and really this is the data that is wrong anyway, because it can't be turned into valid CWF data. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|