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 » A complex MessageSet

Post new topic  Reply to topic
 A complex MessageSet « View previous topic :: View next topic » 
Author Message
drano
PostPosted: Wed May 28, 2008 6:24 am    Post subject: A complex MessageSet Reply with quote

Novice

Joined: 02 May 2002
Posts: 15
Location: Serv'N Data

Hi all,

I have a complex messageset to define. I am trying to use TDS.

The format:
LineRecord (Mandatory, and with tag in the 4 first characters)
Data (0 to 10 occurences, without a tag
LineRecord...

I have created a messageset for it with choice group and two elements in this group:
* LineRecord with a rule "Tag Fixed Length" with the tag name
* Data without a rule
My choice is unbounded (Max occurences -1)

This messageset is ok. But difficult to use mapping node to map in this format:
Record
LineRecord
Data
Data
Record
LineRecord
Data
...

Do you know how to change this messageset to keep the real tree structure ? Or maybe use it in the mapping node ? I think that I could create my own ESQL instead of Mapping. But for maintenance reasons, I'd rather to use Mapping node.

Thanks
Didier Rano
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Wed May 28, 2008 6:53 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Do you know how to change this messageset to keep the real tree structure ?
You just need to replace your groups with elements.
Elements in the message definition map to elements in the message tree. Groups map to nothing at all in the message tree, so their members appear as members of the nearest parent element ( in your case, the message itself! )
Back to top
View user's profile Send private message
drano
PostPosted: Wed May 28, 2008 7:11 am    Post subject: Reply with quote

Novice

Joined: 02 May 2002
Posts: 15
Location: Serv'N Data

Ok, I add Record instead of my choice group (In fact my choice group is inside the Record). This Record is unbounded (max occurences -1), and not for my choice group (max occurences 1).

Then, the result:
Record
Line
Record
Data
Record
Data
Record
Line
...

It it not easier to map in the XML destination:
Line
Data
Data
Line
...
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu May 29, 2008 3:56 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The shape of the message tree is determined by the shape ( the element structure ) of your message definition. You have chosen an unnatural shape for your message definition. I expect you did that because you could not make the message parse successfully any other way.

The obvious logical structure for your data would be
Code:
Message
    Line maxOccurs=-1
        LineRecord minOccurs=1, maxOccurs=1
        Data minOccurs=0, maxOccurs=-1
Please note the use of Code tags to preserve the indentation - makes it much easier to read doesn't it

Next problem is how to retain that logical structure and still parse your input message successfully. The trick is to detect the tag of LineRecord on the Line element, using a Data Pattern.

Assuming that your 4-character tag is 'ABCD', we need
Code:
Message
    complexType DataElementSeparation="Use Data Pattern"
        Line maxOccurs=-1, Data Pattern="([^A]|(A[^B])|(AB[^C])|(ABC[^D]))*"
            complexType DataElementSeparation="All Elements Delimited", Delimiter=<CR>, GroupTerminator=<CR>, Group Indicator='ABCD'
                LineRecord minOccurs=1, maxOccurs=1
                Data minOccurs=0, maxOccurs=-1, Repeating Element Delimiter=<CR>


- The data pattern is complex because it must match and select the entire Line element, up to ( but not including ) the next tag.
- We are consuming the tag on LineRecord using the Group Indicator on Line.

Warning : this is not tested. If it does not work first time, please take a user trace and read the entire text of all messages emitted from the TDS parser. If you need to ask further questions, please take time to supply all required information.
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 » A complex MessageSet
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.