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 » For Each / Else If - Map controlling sequence of output

Post new topic  Reply to topic Goto page Previous  1, 2
 For Each / Else If - Map controlling sequence of output « View previous topic :: View next topic » 
Author Message
mqjeff
PostPosted: Tue Oct 27, 2015 10:14 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It looks like you are mapping to a repeating structure...
Code:
(0x01000000:Name):HeaderForPremiumValidation =
    (0x01000000:Name):HeaderForPremiumValidation = (
      (0x03000000:NameValue):COLARiderAnnualPremium = 'COLA3' (CHARACTER)
    )
    (0x01000000:Name):HeaderForPremiumValidation = (
      (0x03000000:NameValue):FIORiderAnnualPremium = 'FIO' (CHARACTER)
    )


That's more than one instance of HeaderForPremiumValidation.

If you need only one of those, then you need to adjust the target of your for loop.

As long as your output is a repeating structure, then the map node will assign the output repeats in the order that your input message has them. So if your input message has "FIO" occurring directly before "COLA3", then the for loop will assign FIO to the first repeat and COLA3 to the next repeat.

[/i]
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
bdaoust
PostPosted: Tue Oct 27, 2015 10:53 am    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Ok, my bad on that

This doesn't seem to change the output behavior and again the order looks to be determined by the For/Each Loop.
Back to top
View user's profile Send private message
timber
PostPosted: Tue Oct 27, 2015 11:17 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

The output message depends on two things:
1. The structure and content of OutputRoot.DFDL
2. The structure and content of the DFDL schema
Therefore, it makes zero difference whether you create OutputRoot.DFDL using the mapping node or using ESQL. It's the structure of OutputRoot.DFDL that matters. But first you need to explain properly what your output message needs to look like...
Quote:
I know that the delimiter is not set I striped down my example to make it easy.
You are making an invalid assumption. When a delimiter is defined, a bunch of other DFDL properties come into play to control whether missing delimiters get output. Please tell us *exactly* what output you want, including all delimiters. And this time, please enclose the output in code tags too (otherwise spaces and other delimiters can be hard to spot).
Back to top
View user's profile Send private message
bdaoust
PostPosted: Tue Oct 27, 2015 11:24 am    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Probably not a best practice, but I got the sequence fixed.

All I did was create another map against the same schema and did auto map.

*ducking as you all throw things at me*
Back to top
View user's profile Send private message
bdaoust
PostPosted: Tue Oct 27, 2015 11:39 am    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Sorry timber, I missed your reply.

The output should look like :

Code:
FIO,COLA


not what I'm getting which is;

Code:
COLA,FIO


The reason COLA is preceding FIO is because in the For/Next, the COLA condition is satisfied first because in the input COLA is first in the repeating structure not FIO.
Back to top
View user's profile Send private message
timber
PostPosted: Tue Oct 27, 2015 2:23 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

I'm not clear on whether you have solved the entire problem, or just one part of it.

If you need further help then you will need to provide new information on the tree structure, DFDL model and desired output.

btw, your DFDL xsd does not contain the string 'maxOccurs' anywhere. Should I be worried about that?
Back to top
View user's profile Send private message
bdaoust
PostPosted: Thu Oct 29, 2015 2:30 pm    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Sorry for the late reply.

Seems like the root cause if the For/Each and the map.

I need FIO to come before COLA and if the XML that I do the For/Each on, the COLA comes first and thus the message tree is built in that order.

I could fix the order after the fact, but again I was hoping that :

    1) The tree would get built in the order of the IF/ELSEIF. Not the case. But I guess that makes sense since the For Each does the loop - then goes to submap and goes through all the conditions - finds condition of COLA matching, so that is the first built in the tree. Exits submap, then loops - hit FIO - builds FIO.
    2) Given the above behavior, I was hoping the output schema order would trump how the message tree was built.



Unfortunately, I couldn't play around with it any longer since I need to get a deliverable done. So I'm writing ESQL and not using a graphical map.

I am going to circle back when I don't have people hounding me "is it done yet" - so please continue to offer suggestions or words of encouragement.

Thanks for everyone's input.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » For Each / Else If - Map controlling sequence of output
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.