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 » Issue in Defining DFDL Parser for a scenario

Post new topic  Reply to topic Goto page 1, 2  Next
 Issue in Defining DFDL Parser for a scenario « View previous topic :: View next topic » 
Author Message
DP1234
PostPosted: Wed Oct 15, 2014 9:36 am    Post subject: Issue in Defining DFDL Parser for a scenario Reply with quote

Apprentice

Joined: 25 May 2014
Posts: 40

Hi All
Am trying to create a parser for the below scenario

HeaderASampleTrailer
HeaderBSampleXTrailer
HeaderCSampTrailer

First 6 character are related to Header
After 6 character
if Starts with "A" next 6 character is payload and beyond that is trailer
if Starts with "B" next 7 character is payload and beyond that is trailer
if Starts with "C" next 4 character is payload and beyond that is trailer

(These are just random numbers which am using to explain scenario)

My question is

Which is efficient way to create a parser for above scenario.?
Is it possible to create a DFDL parser for this scenario.?

Am trying to create DFDL parser for same...in Length option am using "XPATH Expression Builder" to define certain function
to implement above logic...is it possible to create using this process?

Searched in IBM website aswell forum regarding "XPATH Expression Builder" didn't find one...
can anybdy help in defining 'IF ELSE' logic in expression builder

Please Help, Thanks
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Oct 15, 2014 9:41 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

In MRM this would be tagged-fixed length data, with each of the A,B,C being in a choice.

structurally something like
Code:
Message
sequence
    Header - fixed length 6
    sequence
         choice
              ARecord - tag 'A'
                   sequence
                         ....
              BRecord - tag 'B'
                   sequence
                        ....
....


In DFLD these are initiators, not tags.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 15, 2014 9:46 am    Post subject: Re: Issue in Defining DFDL Parser for a scenario Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

DP1234 wrote:
can anybdy help in defining 'IF ELSE' logic in expression builder


Why do you need this? To me, your model (using your posted example and accepting this simply illustrates the issue) looks like:

Item - fixed length 6 character header

Item - Identity A, fixed length 6 character field, field until end of data
Item - Identity B, fixed length 7 character field, field until end of data
Item - Identity C, fixed length 4 character field, field until end of data

So all you need is 3 descriptions in DFDL for the 3 possible item types, and a way to identify which is which (A,B or C) and a description of your header.

Sorted. Even if A,B & C have significantly more complex structures.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
DP1234
PostPosted: Wed Oct 15, 2014 10:43 am    Post subject: Re: Issue in Defining DFDL Parser for a scenario Reply with quote

Apprentice

Joined: 25 May 2014
Posts: 40

Vitor wrote:
DP1234 wrote:
can anybdy help in defining 'IF ELSE' logic in expression builder


Why do you need this? To me, your model (using your posted example and accepting this simply illustrates the issue) looks like:

Item - fixed length 6 character header

Item - Identity A, fixed length 6 character field, field until end of data
Item - Identity B, fixed length 7 character field, field until end of data
Item - Identity C, fixed length 4 character field, field until end of data

So all you need is 3 descriptions in DFDL for the 3 possible item types, and a way to identify which is which (A,B or C) and a description of your header.

Sorted. Even if A,B & C have significantly more complex structures.


Bolded Part is wat am not able to achieve as am working on DFDL for first time.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 15, 2014 10:50 am    Post subject: Re: Issue in Defining DFDL Parser for a scenario Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

DP1234 wrote:
Bolded Part is wat am not able to achieve as am working on DFDL for first time.


Start here
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Oct 16, 2014 4:05 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

No time to reply in detail now, but there are two posts that discuss this. Search for 'DFDL body trailer discriminator' and you should find them.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
DP1234
PostPosted: Thu Oct 16, 2014 11:32 pm    Post subject: Reply with quote

Apprentice

Joined: 25 May 2014
Posts: 40

I've achieved most of the part in developing DFDL parser for above scenario...thanks for the link vitor

Now am stuck in looping over all payload elements
DFDL parser looks like

Header
Payload
sequence
A
B
Trailer

Ideally Payload has to occur only once under which all c1,E3 should appear though declared in any order

am not able loop over properly

say data is in format Header,Adata,Bdata,Adata,Adata,Adata,Bdata,Trailer

If i make payload as unbounded
i get structure like

Header
payload
A
B
payload
A
A
A
B
Trailer

if payload max occurs is 1 (ideally t has to be 1)

Header
payload
A
B
Trailer

am facing issue here in looping over

Can anybdy tell correct way to loop over and get all payload data in one tag
Back to top
View user's profile Send private message
DP1234
PostPosted: Fri Oct 17, 2014 4:03 am    Post subject: Reply with quote

Apprentice

Joined: 25 May 2014
Posts: 40

this is how need the data to appear

Header
payload
A
B
A
A
A
B
Trailer
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Oct 17, 2014 4:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

DP1234 wrote:
Can anybdy tell correct way to loop over and get all payload data in one tag


Why are you trying to loop through the model? Why not read the records as records, and assemble the data into the output as required.

It's probably possible to twist DFDL into doing this. It's almost certainly better to actually write some code to do this.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
DP1234
PostPosted: Fri Oct 17, 2014 5:10 am    Post subject: Reply with quote

Apprentice

Joined: 25 May 2014
Posts: 40

Vitor wrote:
DP1234 wrote:
Can anybdy tell correct way to loop over and get all payload data in one tag


Why are you trying to loop through the model? Why not read the records as records, and assemble the data into the output as required.

It's probably possible to twist DFDL into doing this. It's almost certainly better to actually write some code to do this.


Thanks for reply vitor

Is it really possible to get output like this by anyway

Header
payload
A
B
A
A
A
B
Trailer

Currently am getting like this

Header
payload
A
B
payload
A
A
A
B
Trailer
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Oct 17, 2014 5:22 am    Post subject: Reply with quote

Grand High Poobah

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

OK. So what you need to define is:
Header -- min 1 max 1
Payload --min 1 max 1
sequence -- min 1 max unbounded
A -- min 1 max 1
B -- min 0 max 1
Trailer -- min 1 max 1

Have fun with it
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Fri Oct 17, 2014 5:31 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Probably best if you do this:
1. Provide an example input message.
2. Provide an example message tree structure for the input message. Please use [c o d e] tags so that we can see the structure clearly.
3. Post your DFDL xsd, or else describe its structure clearly.

I can understand your requirements ( sort of ) but I don't want to give advice based on partial info.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
DP1234
PostPosted: Fri Oct 17, 2014 7:48 am    Post subject: Reply with quote

Apprentice

Joined: 25 May 2014
Posts: 40

fjb_saper wrote:
OK. So what you need to define is:
Header -- min 1 max 1
Payload --min 1 max 1
sequence -- min 1 max unbounded
A -- min 1 max 1
B -- min 0 max 1
Trailer -- min 1 max 1

Have fun with it


we Cant set sequence as unbounded...DFDL doesnt lets to do this i believe


Last edited by DP1234 on Fri Oct 17, 2014 8:33 am; edited 1 time in total
Back to top
View user's profile Send private message
DP1234
PostPosted: Fri Oct 17, 2014 8:04 am    Post subject: Reply with quote

Apprentice

Joined: 25 May 2014
Posts: 40

kimbert wrote:
Probably best if you do this:
1. Provide an example input message.
2. Provide an example message tree structure for the input message. Please use [c o d e] tags so that we can see the structure clearly.
3. Post your DFDL xsd, or else describe its structure clearly.

I can understand your requirements ( sort of ) but I don't want to give advice based on partial info.



Sample input message

Code:

EDDF4566855555555555A45896B5666A45896A45896B566600000
Here
Header: EDDF4566855555555555
A Data (Initiator A Length 5) : 45896
B Data (Initiator B Length 4) : 5666
Trailer: 00000


Data can appear any times any order


Currently i achieved to get tree structure like

Code:

Header
    EDDF4566855555555555
Record
    A
      45896
Record
    B
      5666
Record
    A
      45896
Record
    A
      45896
Record
    B
      5666
Trailer
   00000       



Which is the best tree structure can we create for this type of data structure
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Oct 17, 2014 12:55 pm    Post subject: Reply with quote

Grand High Poobah

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

DP1234 wrote:
fjb_saper wrote:
OK. So what you need to define is:
Header -- min 1 max 1
Payload --min 1 max 1
sequence -- min 1 max unbounded
A -- min 1 max 1
B -- min 0 max 1
Trailer -- min 1 max 1

Have fun with it


we Cant set sequence as unbounded...DFDL doesnt lets to do this i believe

So create a repetitive payloaditem complex type with the sequence.
Code:
Header
Payload
  PayloadItem (1 to n)
   sequence
     A min 1
     B min 0
Trailer

as long as your structure matches the data you're all good
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Issue in Defining DFDL Parser for a scenario
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.