Author |
Message
|
cklink |
Posted: Thu Nov 18, 2004 7:46 pm Post subject: Capturing original message following schema validation |
|
|
Newbie
Joined: 08 Sep 2004 Posts: 3
|
Hi all,
I'm currently developing some message flows using WBIMB 5.0.3. I have a requirement to perform schema validation of the message placed on a queue, and if there is a validation failure to append some additional error information to the original message and place it on a separate queue.
I have successfully created the message definition in the MRM domain, and am able to perform the schema validation by setting the MQInput node properties. I then can capture the ExceptionList constructed, but I can't find any way to capture the contents of the original message (presumably because the invalid content could not be parsed successfully).
Does anyone have any suggestions as to how I can capture both the original message and the ExceptionList, so that I can construct a modified version of the original message with appended information regarding the validation failure?
Many thanks. |
|
Back to top |
|
 |
JT |
Posted: Thu Nov 18, 2004 8:45 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Just thinking out loud:
- Set the message domain of the MQInput node to BLOB.
- Connect the out terminal of the MQInput node to a ResetContentDescriptor node.
- Convert the message domain from BLOB to MRM.
- Connect the failure terminal of the RCD node to a Compute node.
- When a parsing exception occurs, that Compute node now has the input message (as a BLOB) and a Parser ExceptionList.
- Cast the input message into a string and append the desired elements from the ExceptionList tree.
An alternative is to replace steps 2, 3 & 4 with the following:- Connect the out terminal of the MQInput node to a Compute node.
- Convert the message domain from BLOB to MRM using the CREATE LASTCHILD statement with the PARSER parameter.
- Connect the failure terminal of the Compute node to another Compute node.
....or maybe some derivative of the above. |
|
Back to top |
|
 |
cklink |
Posted: Thu Nov 18, 2004 9:14 pm Post subject: |
|
|
Newbie
Joined: 08 Sep 2004 Posts: 3
|
Thanks for the response JT.
I have tried to use the ResetContentDescriptor node, but I haven't been able to configure this such that it constructs an ExceptionList and throws an exception when it observes a schema validation error.
If you can advise how to do this, then I'd be happy to try this out.
Thanks. |
|
Back to top |
|
 |
kirani |
Posted: Thu Nov 18, 2004 11:45 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
You cannot use RCD node to do this. It will not validate your message against schema. It only rests your domain/wireformat.
Follow the second suggestion from JT. Please make sure that you set Validation option in your compute node. _________________ 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 |
|
 |
Ramphart |
Posted: Wed Nov 24, 2004 3:14 am Post subject: |
|
|
 Disciple
Joined: 21 Jul 2004 Posts: 150 Location: South Africa, JHB
|
|
Back to top |
|
 |
cklink |
Posted: Mon Jan 10, 2005 9:26 pm Post subject: |
|
|
Newbie
Joined: 08 Sep 2004 Posts: 3
|
Because of bugs with the version I am currently required to use, I couldn't use the CREATE LASTCHILD with PARSE parameter as suggested - although I suspect this is the best approach if it works in your environment.
In the end, I got this to work by:
(a) Disabling validation on the MQInput node
(b) Storing the incoming message in Environment
(c) Defining a compute node with validation specified
(d) Writing the output message from the compute node to an MQOutput node to force the validation to occur
(e) Expiring the output message to avoid any resource issue
This isn't as elegant a solution as I would have liked, but it does at least work!
Thanks for the pointers. |
|
Back to top |
|
 |
|