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 » Defining a TDS format i WMB that has "variable" le

Post new topic  Reply to topic
 Defining a TDS format i WMB that has "variable" le « View previous topic :: View next topic » 
Author Message
eskil
PostPosted: Tue Nov 25, 2008 4:44 am    Post subject: Defining a TDS format i WMB that has "variable" le Reply with quote

Novice

Joined: 25 Nov 2008
Posts: 14

Hi.

I have an incoming message in TDS format that I want to convert to XML. The problem I'm having is that the message can be sent in two formats. The latter is an extended version (i.e has some additional fields) of the "original" one.

My approach was to create a message definition for all the common fields (min/max occurs = 1/1) for the two versions, and then add a sequence (min/max occurs = 0/1) at the end where the rest of the fields (min/max occurs = 1/1) are added.

I've tried to visualize it below:
Code:
commonfield1 (min/max occurs = 1/1)
commonfield2 (min/max occurs = 1/1)
commonfield3 (min/max occurs = 1/1)
sequence (min/max occurs = 0/1)
--extrafield1 (min/max occurs = 1/1)
--extrafield2 (min/max occurs = 1/1)


Doing this I managed to parse messages of the extended version, but not of the original (subset) version. Is this even doable, or do I have to solve this with code inside my flow? (I.e get the message as a BLOB and then parse the message to the specific format based on the message length)
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Nov 25, 2008 6:01 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
The problem I'm having is that the message can be sent in two formats. The latter is an extended version (i.e has some additional fields) of the "original" one.
Please provide at least one example of each input format. The answers to your questions depend on that information.
Back to top
View user's profile Send private message
eskil
PostPosted: Tue Nov 25, 2008 7:12 am    Post subject: Reply with quote

Novice

Joined: 25 Nov 2008
Posts: 14

Hi.

Clarification: The input data is in a fixed length format.

Example:
Original: AAABBBCCC
Extended: AAABBBCCCDDEEFF

Field: "AAABBBCCC" is the common part, that exists in both versions.
Field: "DDEEFF" is considered as the "extended" part and these fields will always exist together. Basically the message only have two different lengths.

/Emil
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Nov 25, 2008 8:22 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Doing this I managed to parse messages of the extended version, but not of the original (subset) version
I expect you were told that the bitstream was too short. In a fixed-length message, optional fields ( minOccurs=0) are treated as though they are mandatory ( minOccurs=1).

You have two solutions available:
a) Set the input domain to BLOB. In a Compute node, test the length of InputRoot.BLOB.BLOB, and then reparse using either CREATE...PARSE or RCD nodes
b) Use data patterns to distinguish between the two message types.
The message structure would have to be something like this:
Code:
Message  Composition='Choice' DataElementSeparation='Use Data Pattern'
    Group DataElementSeparation='Fixed Length' Data Pattern='.*[15]'
        elementAAA
        elementBBB
        elementCCC
        elementDDD
        elementEEE
        elementFFF
    Group DataElementSeparation='Fixed Length' Data Pattern='.*[9]'
        elementAAA
        elementBBB
        elementCCC

Note that the longer group must come first in the choice, otherwise the shorter one will match first.
Back to top
View user's profile Send private message
eskil
PostPosted: Wed Nov 26, 2008 2:10 am    Post subject: Reply with quote

Novice

Joined: 25 Nov 2008
Posts: 14

I eventually got it to work. I had to use date patterns with curly brackets instead of square brackets.

Code:
Message Composition='Choice' DataElementSeparation='Use Data Pattern'
    Group DataElementSeparation='Fixed Length' Data Pattern='.{15}'
        elementAAA
        elementBBB
        elementCCC
        elementDDD
        elementEEE
        elementFFF
    Group DataElementSeparation='Fixed Length' Data Pattern='.{9}'
        elementAAA
        elementBBB
        elementCCC


Thank you for your help!
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 » Defining a TDS format i WMB that has "variable" le
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.