Author |
Message
|
mqjeff |
Posted: Tue Oct 27, 2015 10:14 am Post subject: |
|
|
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 |
|
 |
bdaoust |
Posted: Tue Oct 27, 2015 10:53 am Post subject: |
|
|
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 |
|
 |
timber |
Posted: Tue Oct 27, 2015 11:17 am Post subject: |
|
|
 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 |
|
 |
bdaoust |
Posted: Tue Oct 27, 2015 11:24 am Post subject: |
|
|
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 |
|
 |
bdaoust |
Posted: Tue Oct 27, 2015 11:39 am Post subject: |
|
|
Centurion
Joined: 23 Sep 2010 Posts: 130
|
Sorry timber, I missed your reply.
The output should look like :
not what I'm getting which is;
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 |
|
 |
timber |
Posted: Tue Oct 27, 2015 2:23 pm Post subject: |
|
|
 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 |
|
 |
bdaoust |
Posted: Thu Oct 29, 2015 2:30 pm Post subject: |
|
|
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 |
|
 |
|