Author |
Message
|
KMcKean |
Posted: Thu Jul 24, 2003 2:31 am Post subject: Message Validation Query? |
|
|
Newbie
Joined: 24 Jul 2003 Posts: 6
|
Hi,
I am trying to use validation within a compute node to validate an input message. Because compute nodes can only be used to validate output messages the compute node is set to use the same input and output message and to copy the entire message. It should then be able to validate the output message which is an exact copy of the input message. However, it doesn't appear to work! I have set the validation tab to 'ContentandValue' and 'Exception'. The MQInput Node cannot be used to do the validation because of the routing set up so we need to be able to do it through the compute node.
This issue stems from putting an input message with a missing mandatory tag (specified in the message set using Min/Max Occurs) and the message parsing without any errors.
Any ideas how we can get around this problem?
Thanks,
Karen |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jul 24, 2003 5:00 am Post subject: Re: Message Validation Query? |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
KMcKean wrote: |
Hi,
I am trying to use validation within a compute node to validate an input message. |
You are aware that the MQInputNode has validation options as well? |
|
Back to top |
|
 |
KMcKean |
Posted: Thu Jul 24, 2003 5:09 am Post subject: |
|
|
Newbie
Joined: 24 Jul 2003 Posts: 6
|
Yes!.... As stated in my original query:
'The MQInput Node cannot be used to do the validation because of the routing set up so we need to be able to do it through the compute node. '
Thanks,
Karen |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jul 24, 2003 5:18 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
KMcKean wrote: |
Yes!.... As stated in my original query:
'The MQInput Node cannot be used to do the validation because of the routing set up so we need to be able to do it through the compute node. '
Thanks,
Karen |
Oops. Missed that, sorry.
Can you be more explicit about your model? Are you doing MRM-XML, CWF, TDS? What is the type composition and type content? Are you modelling fixed length records, or variable length? etc... |
|
Back to top |
|
 |
KMcKean |
Posted: Thu Jul 24, 2003 6:04 am Post subject: |
|
|
Newbie
Joined: 24 Jul 2003 Posts: 6
|
I'm trying to validate SWIFT messages which use the TDS format of third party built message sets. I can now get it to validate the message if it's immediately written to a queue after compute node, however I want it to validate the input message. I could do this on the MQ input node except the domain is set to BLOB. It's only later in the flow that the message type is recognised and I need to validate it. Is this possible? Documentation states that it will only validate the message when it's written to a bitstream. Is there a way to force the writing to a bitstream without writing to a queue?" |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jul 29, 2003 5:07 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
In case it helps...
Validation is actually performed when the mesage is parsed, which may be before it is written to a bitstream. MRM parsers do not parse a message until something (ESQL, for example) accesses an element within it. Even then, parsing will stop at the element which was accessed, and will not be completed until something (e.g. the need to write the message to a bitstream) requires the entire message to be parsed.
If you know what the final element in the message is, you could add a line of ESQL which accesses it - that would cause the entire message to be parsed.
You should also try inserting a Trace node before the Compute node. This will show you whether the message is being parsed in the way that you expect.
regards,
Tim Kimber
MRM Development Team |
|
Back to top |
|
 |
Craig B |
Posted: Tue Jul 29, 2003 6:01 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
You can drive both Parsing and rendering from ESQL in WMQI V2.1 CSD03 and above. This can be done with the CREATE statement using the PARSE clause, and with the ASBITSTREAM function. The PARSE clause and ASBITSTREAM functions take a 7th parameter which is for the validation options that you require, and constants are provided that match the validation options you see in the pull down menus on the Validation tab. This gives you the option to parse your BLOB message with validation on in the compute node, or take an existing tree, and produce a BLOB with validation on, or use the CREATE with PARSE to build an output tree and then rely on Compute node validation to validate the message tree. The choice is yours.
Although this functionality was introduced in CSD03, these options were not documented until CSD04, and these were documented in the readme. _________________ Regards
Craig |
|
Back to top |
|
 |
KMcKean |
Posted: Tue Aug 12, 2003 7:18 am Post subject: |
|
|
Newbie
Joined: 24 Jul 2003 Posts: 6
|
Craig B wrote: |
The PARSE clause and ASBITSTREAM functions take a 7th parameter which is for the validation options that you require, and constants are provided that match the validation options you see in the pull down menus on the Validation tab. Although this functionality was introduced in CSD03, these options were not documented until CSD04, and these were documented in the readme. |
Thanks for your response Craig but I don't seem to be able to locate where this is documented. Please could you provide me with a link to the documentation or perhaps some sample syntax to help me?
Thanks in advance. |
|
Back to top |
|
 |
Craig B |
Posted: Wed Aug 13, 2003 6:35 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
The use of Validation options in the CREATE with PARSE and ASBITSTREAM ESQL are documented in Point 100 in the CSD04 (and onward) readme.txt file. This starts with 'The new ASBITSTREAM function and the corresponding changes to CREATE FIELD' ...
An example of its use in ESQL is as follows :
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN('MRM')
PARSE(XMLMsg,
InputRoot.MQMD.Encoding,
InputRoot.MQMD.CodedCharSetId,
'DRRGI8K0AO001','PaymentXMLMessage','XML',
BITOR( ValidateValue, ValidateContent, ValidateException, ValidateComplete, ValidateFullConstraints ));
|
The final parameter contains the validation option that are being used on this parse.
Hope this helps. _________________ Regards
Craig |
|
Back to top |
|
 |
aks |
Posted: Mon Oct 20, 2003 1:05 am Post subject: |
|
|
Voyager
Joined: 19 Jul 2002 Posts: 84
|
I can't get the above esql to work in V5. The toolkit gives a syntax error.
Also, what is the type of the XMLMsg variable? Is it a BLOB of the Input MRM XML message?
Alan |
|
Back to top |
|
 |
JLRowe |
Posted: Mon Oct 20, 2003 1:52 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
I also had a validation problem, in that I wanted to log the validation error via the catch terminal of the input node. Unfortunately, validation errors are propagated directly to the failure node.
What I do is set validation to defferred, and then walk through the message tree using a recursive procedure:
Code: |
CREATE COMPUTE MODULE Walktree
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputLocalEnvironment = InputLocalEnvironment;
CALL WalkValidate(InputBody);
RETURN TRUE;
END;
CREATE PROCEDURE WalkValidate(IN Input REFERENCE) BEGIN
DECLARE Ref REFERENCE TO Input;
-- Get the value of this field first
IF FIELDVALUE(Ref) IS NULL THEN
END IF;
-- Walk through the first child
MOVE Ref FIRSTCHILD;
IF LASTMOVE(Ref) THEN
CALL WalkValidate(Ref);
END IF;
-- Walk through the next sibling
MOVE Input TO Ref;
MOVE Ref NEXTSIBLING;
IF LASTMOVE(Ref) THEN
CALL WalkValidate(Ref);
END IF;
END;
END MODULE;
|
This attempts to get the FIELDVALUE of every element in the message tree, and forces MRM to parse each element. |
|
Back to top |
|
 |
aks |
Posted: Mon Oct 20, 2003 2:03 am Post subject: |
|
|
Voyager
Joined: 19 Jul 2002 Posts: 84
|
I can't have validation turned on the MQInput node, as it has to accept different XML messages, so I was trying to get validation to work in a compute node further into the flow (after I've determined what DTD the message is associated with). Will your code work in this situation?
Thanks
Alan |
|
Back to top |
|
 |
JLRowe |
Posted: Mon Oct 20, 2003 5:50 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
It will work if you do a Reset Content Descriptor first (after determining the message type), or you can use CREATE FIELD ... PARSE with the validation option turned on.
Whichever suits your requirements best. |
|
Back to top |
|
 |
aks |
Posted: Wed Oct 22, 2003 1:34 pm Post subject: |
|
|
Voyager
Joined: 19 Jul 2002 Posts: 84
|
From IBM:
'There is currently a defect where the PARSE clause will only
accept 6 arguments and not the full 7 as it should do.
There is a second defect where the keyword form of the PARSE verb
(use of OPTIONS, CCSID,
SET etc) is also not accepted. These defects will be fixed in
FP02 for WBI-B V5. "
CSD2 has a target date of 31.10.03.
It is recommended that you wait for csd2 and then apply this as there are
many known syntax problems
being addressed in this fix. |
|
Back to top |
|
 |
|