Author |
Message
|
pfaulkner |
Posted: Thu Oct 17, 2002 7:35 am Post subject: PARSING Question |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
I have Message Flow that parses an C message using MRM CWF but on occaison some messages are not the full length and therefore I get parsing errors because the msg does not meet to expected length I have defined in my message set. Is it possible to tell the parser to pad the message set with spaces or zeroes depending on the data type if the message is not long enough?
I also have an XML message Set which could have the same issue. |
|
Back to top |
|
 |
pfaulkner |
Posted: Thu Oct 17, 2002 8:12 am Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
I set the Connection min occurs in the message set to ZERO but I also need to reference the fields that may or may not be there. When I do this I get a parsing error because the fields are not there. |
|
Back to top |
|
 |
mverh |
Posted: Thu Oct 17, 2002 9:31 am Post subject: |
|
|
Voyager
Joined: 06 Mar 2002 Posts: 97
|
Could you possibly:
1. define two (or more) messages in the mrm
2. specify BLOB as the domain on input
3. Check the length of the BLOB to determine the message type
4. RCD to the appropriate message |
|
Back to top |
|
 |
pfaulkner |
Posted: Thu Oct 17, 2002 9:41 am Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
Can't do it exactly that way because my message consists of 2 parts. A variable length header followed by variable length msg data. So checking the BLOB length wouldn't tell me anything. But my msg header does contain a length field which I need to extract. Having that I can still use the single message set and use the length to know what fields I can and cannot access..
FYI. I have another Question open trying to figure out how to CAST part of my BLOB to an integer to access this length field... |
|
Back to top |
|
 |
lung |
Posted: Thu Oct 17, 2002 5:44 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Paul,
MRM-CWF is supposed to be 'fixed-length'. You may want to ask the sending application to fix the length of each field in the message to a certain length.
To cast blob to an integer, first u need to calculate where the length field is located and the length of it. For example, if the length field is starts from the 60th byte in the message and its length is 4 bytes, then...
Code: |
SET A = CAST(SUBSTRING(InputBody.BLOB FROM 60 FOR 4) AS INT) |
Hope this helps!  _________________ lung |
|
Back to top |
|
 |
|