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 » Data mapping - grouping of records into one structure

Post new topic  Reply to topic
 Data mapping - grouping of records into one structure « View previous topic :: View next topic » 
Author Message
mk140589
PostPosted: Wed Oct 23, 2013 10:18 pm    Post subject: Data mapping - grouping of records into one structure Reply with quote

Novice

Joined: 17 Jun 2013
Posts: 20

Hi guys,

I'm creating a new transformation using the graphical data mapping.
In the incoming format I have the following records which relate to each other :
Code:
04 - Goods
05 - Just under the 04-records with the wagon number where the good was loaded on
06 - Wagon technical details


My outgoing structure is xml and the wagonsection looks as follows :
Code:
<Wagon>
      <Wagonnumber>
      <Technical Details>
      </Technical Details
      <Goods>
            <Good>
             </Good>
      </Goods>
</Wagon>


So, I would like to group the 05 and 06 records based on the wagonnumber and then get the 04 record that was above the 05 record.
Because of the fact that a 05-record can occur multiple times for one 06-record, the logic needs to be as follows :
Code:
Take the 06-record and get the wagon number
For each 05-record where the wagon number is equal to the 06 one
         Get the previous 04-record
         Create a Good-segment


Is this possible using the graphical data mapping?
If no, can I do this with just a Custom ESQL or Java and can you please give me a headstart?

Thanks very much,
Best regards,
Maarten
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Thu Oct 24, 2013 4:32 am    Post subject: Re: Data mapping - grouping of records into one structure Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

I do not think that you can do grouping with graphical mapping.

And especially I think that you can not do grouping in an efficient way with graphical mapping.

You should have a look at this and check if it can help with your scenario.

The example is a bit "generic" ("A", "B"), but comes from the same background (where trucks (instead of wagons) are loaded with goods).
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
mk140589
PostPosted: Thu Oct 24, 2013 4:35 am    Post subject: Reply with quote

Novice

Joined: 17 Jun 2013
Posts: 20

Thanks for the reply.

I solved it by modelling my DFDL differently.
Instead of creating separate records, I now have structures to do this grouping.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Oct 24, 2013 6:28 am    Post subject: Re: Data mapping - grouping of records into one structure Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

mqsiuser wrote:
I do not think that you can do grouping with graphical mapping.

I'm reasonably sure it's possible to do.

But mk140589's solution of changing the DFDL model to include additional structural elements is the better choice.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Oct 24, 2013 6:42 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

@mqsiuser: We have discussed this before. The Mapper most certainly can do grouping, and can handle complex joins and selects.

But I agree with mqjeff - changing the DFDL model was the best approach.
_________________
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
mk140589
PostPosted: Thu Oct 24, 2013 7:04 am    Post subject: Reply with quote

Novice

Joined: 17 Jun 2013
Posts: 20

I still needed to group the 06-record with the 04-record based on the 05-records which where under the 04-record.

My DFDL structure looked like this :
Code:

Goods element
     04-record
        Goodsdescription
     05-record
        Wagonnumber 1
     05-record
        Wagonnumber 2
Wagon element
     06-record
        Wagonnumber 2
Wagon element
     06-record
        Wagonnumber 1


My mapping looks like :
Code:

For each Wagon element (include the Goods element as supplementary connection)
      For each Goods element (include the Wagonnumber as supplementary connection)
           For each 05-record with the condition : 05-record/Wagonnumber = Wagonnumber
                Fill in the Goods
           End for
      End for
End for


I hope this helps people who face the same problem.

If you have any remarks or optimisations, please let me know.

Best regards,
Maarten
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 » Data mapping - grouping of records into one structure
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.