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 IndexWebSphere Message Broker SupportComplicated Bank Message set

Post new topicReply to topic
Complicated Bank Message set View previous topic :: View next topic
Author Message
jaymnr7
PostPosted: Mon Apr 16, 2018 5:19 am Post subject: Complicated Bank Message set Reply with quote

Newbie

Joined: 16 Apr 2018
Posts: 1



I am creating a message set that has comma separated values, but the case is that based on a field in the message the further message structure changes.

For eg:
16,409,000000000002500,V,060316,,,,RETURNED CHEQUE / -- Here when there is V as the fourth comma seperated element, we are expecting two values after that V and the RETURNED CHEQUE.

16,409,000000000090000,S,060316,,,,,RTN-UNKNOWN / -- Here when there is S as the fourth comma separated element, we are expecting three values after that S and the RTN CHEQUE.


And like these (V and S) we can have many more values and the structure changes according to that. Also these V and S are choices means only one of these values can come in the message.

Can you please give a hint on how to design this.


Thanks in advance.
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Apr 16, 2018 5:24 am Post subject: Re: Complicated Bank Message set Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24908
Location: Ohio, USA

jaymnr7 wrote:
Can you please give a hint on how to design this.


With DFDL.

Seriously.

You clearly need a model which describes a CSV (like the IBM supplied one), augmented with the choice you mention. As described, it doesn't sound hard. Time consuming and lengthy possibly (given the actual number of choices) but not hard.

What have you tried? What about that didn't work? What did you discover about the problem from the DFDL trace? How did you try to resolve it and why wasn't that a good answer?

Better information, better advice.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
timber
PostPosted: Mon Apr 16, 2018 12:33 pm Post subject: Reply with quote

Shaman

Joined: 25 Aug 2015
Posts: 745

When you say 'message set' I think 'MRM parser'. But I think you mean 'DFDL model'. Please tell me that you're not trying to use the old MRM TDS parser to deal with this format!

The DFDL model structure that you need looks something like this:
Code:
element name='message'
  record maxOccurs=unbounded terminator=%NL;
    element name='firstThree fields'
      sequence delimiter=','
        element name='field1'
        element name='field2'
        element name='field3'
      choice initiatedContent=yes
        element name='returnedCheque'  'initiator='V,'
          sequence delimiter=', 
            element name='dummy1'
            element name='dummy2'
            element name='dummy3'
            element name='returnedCheque'
        element name='rtnUnknown'  'initiator='S,'
          sequence  delimiter=', 
            element name='dummy' minOccurs=4 maxOccurs=4
            element name='rtnUnknown'


Note a couple of modelling tricks that I've used here
- I've modelled the choice using initiatedContent='yes'. This is much faster than using a discriminator to handle the variability. If you use a discriminator, the DFDL parser will try each branch of the choice in turn until it finds one that matches. But if you set initiatedContent='yes' then it will read the initiator and jump directly to the correct branch
- In the first element, I used 3 elements to model the unwanted fields, but the in the second I used an array. An array within a delimited record will always require N delimiters, where N=maxOccurs. Unless you change the delimiterSuppressionPolicy (but don't, unless you really know what you're doing).

Vitor is 100% correct in advising you to use the DFDL Test perspective and the DFDL Trace view when debugging your model. Feel free to try the above structure, but don't expect further help without some evidence that you have looked at the DFDL Trace.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportComplicated Bank Message set
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.