ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem with optional fields in output message

Post new topic  Reply to topic
 Problem with optional fields in output message « View previous topic :: View next topic » 
Author Message
PieterV
PostPosted: Mon Aug 07, 2006 1:48 am    Post subject: Problem with optional fields in output message Reply with quote

Disciple

Joined: 04 Jan 2006
Posts: 164
Location: Belgium

Hello.

We are trying to create a outputmessage with optional fields:

Code:

- Msg_IFTTOI
  |
  |- Record1 (mandatory: min: 1, max: 1)
     |
     |- Element1 (mandatory: min: 1, max: 1)
     |- Element2 (mandatory: min: 1, max: 1)
  |
  |- Record2 (optional: min: 0, max: 1)
     |
     |- Element1 (mandatory: min: 1, max: 1)
     |- Element2 (mandatory: min: 1, max: 1)
  |
  |- Record3 (optional: min: 0, max: 1)
     |
     |- Element1 (mandatory: min: 1, max: 1)
     |- Element2 (mandatory: min: 1, max: 1)


The flow exist out of an inputqueue with a message that is XML, then a mapping node and then an ouputnode that writes to a queue.

mapping node:
we map the MQMD from the inputmessage to the outputmessage
we map the properties from the inputmessage to the outputmessage, but change the following values:
* MessageSet => message setID of outputmessage
* MessageType => message type as found in the logical format
* MessageFormat => Custom Wire Format => CWF1

to map the data part we fill in fixed values (to test).
But we fill in only Record1 and Record3. Not Record2.
Note that Record2 and Record3 are optional (minimum occurence is 0).

The mapping goes fine.

After the mapping node the flow tries to write the message to an outputqueue, but this goes wrong. In the debug window it gives a CWF error.
In the trace on level debug we get:

Code:

ParserException  BIP5344E: CWF Output: Mismatch between logical definition and message tree. 
                                       Message         : 'msg_IFTTOI' 
                                       Element         : '89^Element1'
                                       The CWF writer has been given a message tree which does not match the logical message definition. 
                                       The elements may have been added to the message tree in the wrong order, or there may be elements missi
ng from the message tree. 
                                       The message type or message set may be incorrect.
                                       If the output message was assembled in a Compute node, check that the elements were added to the messag
e in the order specified in the logical message definition. 
                                       Check that the output message contains all the elements in the logical message definition (perhaps you
need to copy the entire input message to the output tree before modifying it) 
                                       Check that the output message has the correct message set and message type properties. 
                                       Check that the output message does not contain self-defining elements. 
                                       Check that any missing elements have default values defined.


It's on Element1 of Record3 that it gives the error.
If we read this error correct it's because of the "missing" Record2.
But we have defined this optional.

If we however fill in all the data in all Records (1, 2, 3) we don't get an error.

Why do we get this error and how can we solve it?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Aug 07, 2006 2:44 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

If you are using cobol make it an occurs depending clause. Then at the beginning of the message specify the depending values.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Mon Aug 07, 2006 3:32 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Why do we get this error and how can we solve it?
You get this error because you are trying to write a message which no application could ever parse. If you omit element2 then how will the next application know how to parse the message? You either need an 'OCCURS DEPENDING ON' for each optional field, or you MUST define default values for the optional elements ( as the error message says).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem with optional fields in output message
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.