EDI Templates

When I create a transaction set template (in this case the x12 210), If the transaction contains an N9 segment in the Header and then again in Detail inside the LX loop, would I expect to see both header and detail N9 segments in the template? When I run wm.b2b.edi.templateMgr:getTemplate, the template in the pipeline does not contain a N9 segment following the LX segment, it only shows it in the header section. I have a problem with a MAP function not working properly for a subsequent segment (L1), and I wonder if it might be because webMethods thinks the N9, (which is coming in the LX loop) starts another header section. Any help?

I ran into this myself in a previous project. Thankfully, we never had to address this as the “nested” segment wasn’t used. I had done some testing and the presence/absence of LX/LS didn’t seem to matter. However, I really, really, really, want to know how this scenario is supported. Perhaps someone from wM can chime in a shed some light?

Jon, have you posted this in Advantage? Get any response?

Rob,

I posted on advantage, but no response there. After discussing the matter with support, when dropping into the L1 loop, the L1 segment was still represented as a record list in the pipeline. This is why the mapping didn't take place. The suggestion was that the schema I was using in convertToValues didn't match the input data. I can't see how this is the case. Then I thought perhaps my flow processing is flawed (being my first attempt at mapping an EDI transaction in IS, this is a logical assumption). However, I am unable to correct it after various attempts. I have a mapping for the N9 segment also inside the LX loop which is done the same way, It works fine. (further puzzling me) The work around for now was to "hardcode" the schema in the input pipeline with a record instead of a record list for the L1 segment and all maps well. I have to live with this for now to make a date. The logic is a s follows: 

Loop over ST/LX
Loop over ST/LX/N9
MAP
Loop over ST/LX/L1
Map

Both N9 and L1 have multiple occurances in the data and are represented as record lists in the schema, the N9 map works, the L1 map does not because the L1 in the pipeine is still represented as a record list rather than a record. Am I missing something? Any suggestions?

I too have run into this situation in the past and cant help and smile when my fellow co-workers are baffled by we things are not working correctly. I have not found any reason as to why this occurs but when the problem is encountered I extract the list from the document, process the list, put list back into document.

So in your case I would

Loop over ST/LX
Loop over ST/LX/N9
MAP
After ST/LX/N9 loop is completed:
Map –> Extract L1 record list from the current LX record to a L1 record list in the pipeline out
Loop over L1
Map –> Perform whatever needs to be done to the L1 record list
After L1 Loop
Map –> Put L1 record list back into the current LX record