xmlxsdaltovamap-force

Mapping XSD to X12 in Altova MapForce


Hi I'm trying to map from my XSD to X12 version 3040 and transaction set 846 - Inventory Inquiry/Advice.

I have a problem when trying to map the LIN segment from my XSD. My XSD has a single dimensional integer array(posOfRequests) which holds all LIN(Product/Service Id) values when I map this field to LIN segment it generates me multiple LIN segment, which look like below.

LIN*1*OA*2~
LIN*1*OA*3~
LIN*1*OA*1~

I want to achieve something that looks like the one below.

LIN*1*OA*2*OA*3*OA*1~

The mapping image looks like enter image description here posOfRequest has values [2,3,1] in it.


Solution

  • After trying lot of trail and errors, I found a method that can help me to generate the LIN segement as stated in question (LIN*1*OA*2*OA*3*OA*1), all I need to do is to look for the position on my response variable and map it using 'if-else' component. In this answer 'posOfRequest' and 'response' both holds the values I need to map, so I have used response object instead of posOfRequest, response is an object of user defined class which is declared within my main class, where 'dataSetNum' variable with in the response object has the same values that my posOfRequest has.

    enter image description here

    enter image description here