cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Issue - Multiple Occurrences not pulling correctly

0 Kudos

Hello,

I have an issue where when a particular node occurs for multiple times, only the first instance is correctly mapping a value.  I think I need to resolve issue with context or other node functions.  I have been trying to read more about these, but I can't figure this out. Here is the detail:

Source node (<Operation> is 1...unbounded)

<Operation>

     <OpID>10</OpID>

     <Site type="PlannedLocation">

          <ID>DHV</ID>

     </Site>

     <Site type="PlannedDepartment">

          <ID>ELECFAB</ID>

     </Site>

</Operation>

<Operation>

     <OpID>20</OpID>

     <Site type="PlannedLocation">

          <ID>DHV</ID>

     </Site>

     <Site type="PlannedDepartment">

          <ID>MECHFAB</ID>

     </Site>

</Operation>




How I need destination (<access> is 1...unbounded)


<access>

     <OrgCode>DHV</OrgCode>

     <DEPARTMENT_CODE>ELECFAB</DEPARTMENT_CODE>

</access>

<access>

     <OrgCode>DHV</OrgCode>

     <DEPARTMENT_CODE>MECHFAB</DEPARTMENT_CODE>

<access>


Here is how I am mapping DEPARTMENT_CODE.  This works when only 1 Operation exists.  It fails when there is another occurence of Operation. With error of "Values missing in queue context."


Where am I going wrong?

Accepted Solutions (1)

Accepted Solutions (1)

GauravKant
Contributor
0 Kudos

Hi Adam,

Change the type context to root node and try.

Regards,

Gaurav

0 Kudos

Gaurav,

Thank you for reply.  I tried changing both @type and <ID> to context Root node, and still getting the same error.

Also to mention, I am mapping <Operation> to <access>.

GauravKant
Contributor
0 Kudos

Adam,

Pls try below approach. IfWithoutelse will throw error if condition will fail so to handle this use if-else like below.

Regards,

Gaurav

GauravKant
Contributor
0 Kudos

In addition to above, If receiver side OrgCode is required field then you can you mapwithdefault after if-else to avoid any failure in response.

Regards,

Gaurav

0 Kudos

I tried the if-then-else, and while it is not generating an error any longer in the mapping test, it is putting in null values for DEPARTMENT_CODE instead of the value I need.

former_member182412
Active Contributor
0 Kudos

Hi Adam,

Use attached mapping.

Regards,

Praveen.

0 Kudos

Praveen,

Thank you very much, sir.  This worked.  I wouldn't have thought about moving the <access> element into the same functional mapping like that.  I am going to study this a bit to gain further understanding.

Thank you again,

Adam

Answers (0)