Skip to content

Mapper Example Reference

User Guide: Object Services > Mapper Example Reference

Mapper Example Reference

This section provides a library of mapper examples. Select a link from the following list to view:

Attribute To Object Mapping

This is an example of attribute to object mapping.

Input

{
"WorkOrder": [
{
"WorkOrderId": "1",
"AddressId": "101"
},
{
"WorkOrderId": "2",
"AddressId": "202"
}
]
}

Output

{
"WorkOrder": [
{
"WorkOrderId": "1",
"Address": [
{
"WorkOrderId": "1",
"AddressId": "101",
"AddressType": "ORD"
}
]
},
{
"WorkOrderId": "2",
"Address": [
{
"WorkOrderId": "2",
"AddressId": "202",
"AddressType": "ORD"
}
]
}
]
}

Mapping

<?xml version\="1.0" encoding\="UTF-8" standalone\="yes"?>
<mapper
    xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath\="WorkOrder" inputpath\="WorkOrder">
< outputpath\="WorkOrderId" inputpath\="WorkOrderId" />
<map outputpath\="Address" inputpath\="">
< outputpath\="WorkOrderId" inputpath\="WorkOrderId" />
< outputpath\="AddressId" inputpath\="AddressId" />
< outputpath\="AddressType" input\="ORD" />
</map>
</map>
</mapper>

Attribute To Object With Empty Fields

This is an example of mapping an attribute to an object with empty fields.

Input

{"WorkOrder": [

{

"WorkOrderId": "1",

"AddressId": "101"

},

{

"WorkOrderId": "2",

"AddressId": "202"

}

{

"WorkOrderId": "3",

}
]

}

Output

{

"WorkOrder": [

{

"WorkOrderId": "1",

"Address": [

{

"WorkOrderId": "1",

"AddressId": "101",

"AddressType": "ORD"

}
]

},

{

"WorkOrderId": "2",

"Address": [

{

"WorkOrderId": "2",

"AddressId": "202",

"AddressType": "ORD"

}
]

},

{

"WorkOrderId": "3",

"Address": [

{

"WorkOrderId": "3",

"AddressType": "ORD"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="WorkOrder" inputpath="WorkOrder">
< outputpath="WorkOrderId" inputpath="WorkOrderId" />
<map outputpath="Address" inputpath="">
< outputpath="WorkOrderId" inputpath="WorkOrderId" />
< outputpath="AddressId" inputpath="AddressId" />
< outputpath="AddressType" input="ORD" />
</map>
</map>
</mapper>

Attribute To Object With Missing Fields

This is an example of mapping an attribute to an object with missing fields.

Input

{

"WorkOrder": [

{

"WorkOrderId": "1",

"AddressId": "101"

},

{

"WorkOrderId": "2",

"AddressId": "202"

}

{

"WorkOrderId": "3",

}
]

}

Output

{

"WorkOrder": [

{

"WorkOrderId": "1",

"Address": [

{

"WorkOrderId": "1",

"AddressId": "101",

"AddressType": "ORD"

}
]

},

{

"WorkOrderId": "2",

"Address": [

{

"WorkOrderId": "2",

"AddressId": "202",

"AddressType": "ORD"

}
]

},

{

"WorkOrderId": "3",

"Address": [

{

"WorkOrderId": "3",

"AddressType": "ORD"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="WorkOrder" inputpath="WorkOrder">
< outputpath="WorkOrderId" inputpath="WorkOrderId" />
<map outputpath="Address" inputpath="">
< outputpath="WorkOrderId" inputpath="WorkOrderId" />
< outputpath="AddressId" inputpath="AddressId" />
< outputpath="AddressType" input="ORD" />
</map>
</map>
</mapper>

Attribute To Object With Null Field Value

This is an example of mapping an attribute to an object with a null field value.

Input

{

"WorkOrder": [

{

"WorkOrderId": "1",

"AddressId": "101"

},

{

"WorkOrderId": "2",

"AddressId": "202"

}

{

"WorkOrderId": "3",

"AddressId": null

}
]

}

Output

{

"WorkOrder": [

{

"WorkOrderId": "1",

"Address": [

{

"WorkOrderId": "1",

"AddressId": "101",

"AddressType": "ORD"

}
]

},

{

"WorkOrderId": "2",

"Address": [

{

"WorkOrderId": "2",

"AddressId": "202",

"AddressType": "ORD"

}
]

},

{

"WorkOrderId": "3",

"Address": [

{

"WorkOrderId": "3",

"AddressType": "ORD"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="A" inputpath="A">
< outputpath="Q1" inputpath="P1" />
< outputpath="Q2" inputpath="P2" />
</map>
</mapper>

Concatenation From Child

This is an example of concatenation mapping from a child.

Input

{

"Customers": [

{

"Id": "101",

"Address": {

"FirstName": "First1",

"LastName": "Last1"

}

},

{

"Id": "102",

"Address": {

"FirstName": "First2",

"LastName": "Last2"

}

},

{

"Id": "103",

"Address": {

"FirstName": "First3",

"LastName": "Last3"

}

}
]

}

Output

{

"Customers": [

{

"Id": "101",

"Name": "First1 Last1"

},

{

"Id": "102",

"Name": "First2 Last2"

},

{

"Id": "103",

"Name": "First3 Last3"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Customers" inputpath="Customers">
< outputpath="Id" inputpath="Id" />
<map outputpath="" inputpath="Address">
<exec-function name="voltmx.string:concat" outputpath="concatname output="$vars">
<set-arg name="FirstName" inputpath="FirstName"/>
<set-arg name="Separator" input=" " />
<set-arg name="LastName" inputpath="LastName"/<
</exec-function>
<set-param outputpath="Name" inputpath="$vars/concatname" />
</map>
</map>
</mapper>

Concatenation Mapping

This is an example of concatenation mapping.

Input

{

"A": [

{

"P1": "value1",

"P2": "value2"

}
]

}

Output

{

"A": [

{

"Q1": "value1-value2",

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="A" inputpath="A">
<exec-function name="voltmx.string:concat" outputpath="P1P2Concat" output="$vars">
<set-arg name="P1" inputpath="P1"/>
<set-arg name="Separator" input="-" />
<set-arg name="P2" inputpath="P2"/>
</exec-function>
< outputpath="Q1" inputpath="$vars/P1P2Concat" />
</map>
</mapper>

Concatenation With Child Attribute

This is an example of mapping concatenation with a child attribute.

Input

{

"EAM_WO_HDR": [

{

"EAM_WO_Address": [

{

"P1": "value1",

"P2": "value2"

}
]

}
]

}

Output

{

"Address": [

{

"Q1": "value1-value2"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Address" inputpath="EAM_WO_HDR">
<exec-function name="voltmx.string:concat" outputpath="P1P2Concat" output="$vars">
<set-arg name="P1" inputpath="EAM_WO_Address/P1"/>
<set-arg name="Separator" input="-" />
<set-arg name="P2" inputpath="P2"/>
</exec-function>
< outputpath="Q1" inputpath="$vars/P1P2Concat" />
</map>
</mapper>

Concatenation With Dollar Mapping

This is an example of concatenation with dollar mapping.

Input

{

"A": [

{

"P1": "value1",

"P2": "value2"

}
]

}

Output

{

"A": [

{

"Q1": "value1$value2"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="A" inputpath="A">
<exec-function name="voltmx.string:concat" outputpath="P1P2Concat" output="$vars">
<set-arg name="P1" inputpath="P1"/>
<set-arg name="Separator" input="\\$" />
<set-arg name="P2" inputpath="P2"/>
</exec-function>
< outputpath="Q1" inputpath= "$vars/P1P2Concat" />
</map>
</mapper>

Conditional Mapping

This is an example of conditional mapping.

Input

{

"Customers": [

{

"Id": "101",

"NotStarted": "",

"Started": "X",

"InProgress": "",

"Completed": "",

},

{

"Id": "102",

"NotStarted": "",

"Started": "",

"InProgress": "",

"Completed": "X",

},

{

"Id": "103",

"NotStarted": "",

"Started": "",

"InProgress": "X",

"Completed": "",

}
]

}

Output

{

"Customers": [

{

"Id": "101",

"Status": "Started"

},

{

"Id": "102",

"Status": "Completed"

},

{

"Id": "103",

"Status": "InProgress"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Customers" inputpath="Customers">
< outputpath="Id" inputpath="Id" />
<exec-function name="voltmx.logical:equal" outputpath="NotStartedCond" output="$vars">
<set-arg name="NotStarted" inputpath="NotStarted" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="StartedCond" output="$vars">
<set-arg name="Started" inputpath="Started" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="InProgressCond" output="$vars">
<set-arg name="InProgress" inputpath="InProgress" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="CompletedCond" output="$vars">
<set-arg name="Completed" inputpath="Completed" />
<set-arg name="X" input="X" />
</exec-function>
<choose>
<when test="$vars/NotStartedCond">
< outputpath="Status" input="NotStarted" />
</when>
<when test="$vars/StartedCond">
< outputpath="Status" input="Started" />
</when>
<when test="$vars/InProgressCond">
< outputpath="Status" input="InProgress" />
</when>
<when test="$vars/CompletedCond">
< outputpath="Status" input="Completed" />
</when>
</choose>
</map>
</mapper>

Conditional Mapping With Choose-When-Otherwise

This is an example of conditional mapping that uses a choose-when-otherwise block.

Input

{

"Customers": [

{

"Id": "101",

"NotStarted": "",

"Started": "X",

"InProgress": "",

"Completed": "",

},

{

"Id": "102",

"NotStarted": "",

"Started": "",

"InProgress": "",

"Completed": "X",

},

{

"Id": "103",

"NotStarted": "",

"Started": "",

"InProgress": "X",

"Completed": "",

},

{

"Id": "104",

"NotStarted": "",

"Started": "",

"InProgress": "",

"Completed": "",

}
]

}

Output

{

"Customers": [

{

"Id": "101",

"Status": "Started",

},

{

"Id": "102",

"Status": "Completed",

},

{

"Id": "103",

"Status": "InProgress",

},

{

"Id": "104",

"Status": "Unknown",

},

]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Customers" inputpath="Customers">
< outputpath="Id" inputpath="Id" />
<exec-function name="voltmx.logical:equal" outputpath="NotStartedCond" output="$vars">
<set-arg name="NotStarted" inputpath="NotStarted" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="StartedCond" output="$vars">
<set-arg name="Started" inputpath="Started" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="InProgressCond" output="$vars">
<set-arg name="InProgress" inputpath="InProgress" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="CompletedCond" output="$vars">
<set-arg name="Completed" inputpath="Completed" />
<set-arg name="X" input="X" />
</exec-function>
<choose>
<when test="$vars/NotStartedCond">
< outputpath="Status" input="NotStarted" />
</when>
<when test="$vars/StartedCond">
< outputpath="Status" input="Started" />
</when>
<when test="$vars/InProgressCond">
< outputpath="Status" input="InProgress" />
</when>
<when test="$vars/CompletedCond">
< outputpath="Status" input="Completed" />
</when>
<otherwise>
< outputpath="Status" input="Unknown" />
</otherwise>
</choose>
</map>
</mapper>

Field Mapping

This is an example of field mapping.

Input

{

"A": [

{

"P1": "A-row1-p1",

"P2": "A-row1-p2"

},

{

"P1": "A-row2-p1",

"P2": "A-row2-p2"

}
]

}

Output

{

"M": [

{

"Q1": "A-row1-p1",

"Q2": "A-row1-p2"

},

{

"Q1": "A-row2-p1",

"Q2": "A-row2-p2"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map name="field-mapping">
<exec-function name="field-mapping">
</exec-function>
</map>
</mapper>

Functions

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<functions xmlns="http://www.voltmx.com/ns/mapper">
<function name="field-mapping">
< outputpath="Q1" inputpath="P1" />
< outputpath="Q2" inputpath="P2" />
</function>
</function>

Global Mapper Output Mapping

This is an example of global mapper output mapping.

Input

{

"Customers": [

{

"Id": "101",

"NotStarted": "",

"Started": "X",

"InProgress": "",

"Completed": "",

},

{

"Id": "102",

"NotStarted": "",

"Started": "",

"InProgress": "",

"Completed": "X",

},

{

"Id": "103",

"NotStarted": "",

"Started": "",

"InProgress": "X",

"Completed": "",

},

{

"Id": "104",

"NotStarted": "",

"Started": "",

"InProgress": "",

"Completed": "",

}
]

}

Output

{

"Error-Message": "Unknown element.",

"Customers": [

{

"Id": "101",

"Status": "Started",

},

{

"Id": "102",

"Status": "Completed",

},

{

"Id": "103",

"Status": "InProgress",

},

{

"Id": "104",

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Customers" inputpath="Customers">
< outputpath="Id" inputpath="Id" />
<exec-function name="voltmx.logical:equal" outputpath="NotStartedCond" output="$vars">
<set-arg name="NotStarted" inputpath="NotStarted" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="StartedCond" output="$vars">
<set-arg name="Started" inputpath="Started" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="InProgressCond" output="$vars">
<set-arg name="InProgress" inputpath="InProgress" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="CompletedCond" output="$vars">
<set-arg name="Completed" inputpath="Completed" />
<set-arg name="X" input="X" />
</exec-function>
<choose>
<when test="$vars/NotStartedCond">
< outputpath="Status" input="NotStarted" />
</when>
<when test="$vars/StartedCond">
< outputpath="Status" input="Started" />
</when>
<when test="$vars/InProgressCond">
< outputpath="Status" input="InProgress" />
</when>
<when test="$vars/CompletedCond">
< outputpath="Status" input="Completed" />
</when>
<otherwise>
< outputpath="Error-Message" input="Unknown element." output="$mapper-output"/>
</otherwise>
</choose>
</map>
</mapper>

Global Mapper Output Second Mapping

This is an example of mapping a second global mapper output.

Input

{

"Customers": [

{

"Id": "101",

"NotStarted": "",

"Started": "X",

"InProgress": "",

"Completed": "",

},

{

"Id": "102",

"NotStarted": "",

"Started": "",

"InProgress": "",

"Completed": "X",

},

{

"Id": "103",

"NotStarted": "",

"Started": "",

"InProgress": "X",

"Completed": "",

},

{

"Id": "104",

"NotStarted": "",

"Started": "",

"InProgress": "",

"Completed": "",

}
]

}

Output

{

"Error-Message": "Unknown element.",

"Customers": [

{

"Id": "101",

"Status": "Started",

},

{

"Id": "102",

"Status": "Completed",

},

{

"Id": "103",

"Status": "InProgress",

},

{

"Id": "104",

},

{}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Customers" inputpath="Customers">
< outputpath="Id" inputpath="Id" />
<exec-function name="voltmx.logical:equal" outputpath="NotStartedCond" output="$vars">
<set-arg name="NotStarted" inputpath="NotStarted" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="StartedCond" output="$vars">
<set-arg name="Started" inputpath="Started" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="InProgressCond" output="$vars">
<set-arg name="InProgress" inputpath="InProgress" />
<set-arg name="X" input="X" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="CompletedCond" output="$vars">
<set-arg name="Completed" inputpath="Completed" />
<set-arg name="X" input="X" />
</exec-function>
<choose>
<when test="$vars/NotStartedCond">
< outputpath="Id" inputpath="Id" />
< outputpath="Status" input="NotStarted" />
</when>
<when test="$vars/StartedCond">
< outputpath="Status" input="Started" />
</when>
<when test="$vars/InProgressCond">
< outputpath="Id" inputpath="Id" />
< outputpath="Status" input="InProgress" />
</when>
<when test="$vars/CompletedCond">
< outputpath="Id" inputpath="Id" />
< outputpath="Status" input="Completed" />
</when>
<otherwise>
< outputpath="Error-Message" input="Unknown element." output="$mapper-output"/>
</otherwise>
</choose>
</map>
</mapper>

Independent Object Structure Mapping

This is an example of mapping an independent object structure.

Input

{

"WorkOrder": [

{

"Address": [

{

"CustomerId": "1",

"AddressId": "101",

"PrimaryContactId": "12345",

"SecondaryContactId": "123456"

},

{

"CustomerId": "2",

"AddressId": "102",

"PrimaryContactId": "12346",

"SecondaryContactId": "123457"

}
]

},

{

"workOrderContacts": [

{

"CustomerId": "3",

"AddressId": "103",

"PrimaryContactId": "123459",

"SecondaryContactId": "1234567"

},

{

"CustomerId": "4",

"AddressId": "104",

"PrimaryContactId": "123458",

"SecondaryContactId": "1234568"

}
]

]

}
]

}

Output

{

"WorkOrderContacts": [

{

"Contacts": [

{

"PrimaryContactId": "12345",

"SecondaryContactId": "123456"

},

{

"PrimaryContactId": "12346",

"SecondaryContactId": "1234567"

}
]

},

{

"Contacts": [

{

"PrimaryContactId": "123459",

"SecondaryContactId": "1234567"

},

{

"PrimaryContactId": "123458",

"SecondaryContactId": "1234568"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="WorkOrder" inputpath="WorkOrder">
<map outputpath="Address" inputpath="Address">
< outputpath="CustomerId" inputpath="CustomerId" />
< outputpath="AddressId" inputpath="AddressId" />
</map>
</map>
<map outputpath="workOrderContacts" inputpath="WorkOrder">
<map outputpath="Contacts" inputpath="Address">
< outputpath="PrimaryContactId" inputpath="PrimaryContactId" />
< outputpath="SecondaryContactId" inputpath="SecondaryContactId" />
</map>
</map>
</mapper>

Looping Filter

This is an example of mapping a looping filter.

Input

{

"Persons": [

{

"Id": "101",

"Type": "EMP",

"Name": "Employee1",

},

{

"Id": "102",

"Type": "EMP",

"Name": "Customer1",

},

{

"Id": "103",

"Type": "EMP",

"Name": "Employee2",

},

{

"Id": "104",

"Type": "EMP",

"Name": "Customer2",

}
]

}

Output

{

"Employee": [

{

"Id": "101",

"Name": "Employee1",

},

{

"Id": "103",

"Name": "Employee2",

},

{

"Customer": [

{

"Id": "102",

"Name": "Customer1",

},

{

"Id": "104",

"Name": "Customer2",

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="" inputpath="Persons">
<exec-function name="voltmx.logical:equal" outputpath="EMPCondition" output="$vars">
<set-arg name="Type" inputpath="Type" />
<set-arg name="EMP" input="EMP" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="CUSTCondition" output="$vars">
<set-arg name="Type" inputpath="Type" />
<set-arg name="CUST" input="CUST" />
</exec-function>
<choose>
<when test="$vars/EMPCondition">
<map outputpath="Employee" inputpath="">
< outputpath="Id" inputpath="Id" />
<set-param outputpath="Name" inputpath="Name" />
</map>
</when>
<when test="$vars/CUSTCondition">
<map outputpath="Customer" inputpath="">
< outputpath="Id" inputpath="Id" />
<set-param outputpath="Name" inputpath="Name" />
</map>
</when>
</choose>
</map>
</mapper>

One To N Split Mapping

This is an example of one to N split mapping.

Input

{

"WorkOrder": [

{

"WorkOrderId": "1",

"AddressId": "101"

"CustomerId": "201",

"Contacts": [

{

"Id": "301"

},

{

"Id": "401"

}
]

},

{

"WorkOrderId": "3",

"AddressId": ""

"CustomerId": "601",

"Contacts": [

{

"Id": "701"

},

{

"Id": "801"

},

]

},

}{

"WorkOrderId": "2",

"AddressId": "102"

"CustomerId": "202",

"Contacts": [

{

"Id": "302"

},

{

"Id": "402"

}
]

}
]

}

Output

{

"WorkOrder": [

{

"WorkOrderId": "1",

"Address": [

{

"AddressId": "101",

"AddressType": "ADDRESS"

},

{

"AddressId": "201",

"AddressType": "CUSTOMER"

},

{

"AddressId": "301",

"AddressType": "CONTACT"

},

{

"AddressId": "401",

"AddressType": "CONTACT"

},

]

},

{

"WorkOrderId": "3",

"Address": [

{

"AddressId": "601",

"AddressType": "CUSTOMER"

},

{

"AddressId": "201",

"AddressType": "CONTACT"

},

{

"AddressId": "301",

"AddressType": "CONTACT"

}
]

},

{

"WorkOrderId": "1",

"Address": [

{

"AddressId": "102",

"AddressType": "ADDRESS"

},

{

"AddressId": "202",

"AddressType": "CUSTOMER"

},

{

"AddressId": "302",

"AddressType": "CONTACT"

},

{

"AddressId": "402",

"AddressType": "CONTACT"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="WorkOrder" inputpath="WorkOrder">
< outputpath="WorkOrderId" inputpath="WorkOrderId" />
<exec-function name="voltmx.logical:equal" outputpath="EmptyCondition" output="$vars">
<set-arg name="AddressId" inputpath="AddressId" />
<set-arg name="Empty" input="" />
</exec-function>
<choose>
<when test="$vars/EmptyCondition">
</when>
<otherwise>
<map outputpath="Address" inputpath="">
< outputpath="AddressId" inputpath="AddressId" />
< outputpath="AddressType" input="Address" />
</map>
</otherwise>
</choose>
<map outputpath="Address" inputpath="">
< outputpath="AddressId" inputpath="CustomerId" />
< outputpath="AddressType" input="Customer" />
</map>
<map outputpath="Address" inputpath="Contacts">
< outputpath="AddressId" inputpath="Id" />
< outputpath="AddressType" input="Contact" />
</map>
</map>
</mapper>

Optional Input Path

This is an example of mapping an optional input path .

Input

{

"WorkOrder": [

{

"Address": [

{

"CustomerId": "1",

"AddressId": "101",

"PrimaryContactId": "12345",

"SecondaryContactId": "123457"

},

{

"CustomerId": "2",

"AddressId": "102",

"PrimaryContactId": "12346",

"SecondaryContactId": "123457"

}
]

},

{

"Address": [

{

"CustomerId": "3",

"AddressId": "103",

"PrimaryContactId": "123459",

"SecondaryContactId": "1234567"

},

{

"CustomerId": "4",

"AddressId": "104",

"PrimaryContactId": "123458",

"SecondaryContactId": "1234568"

}
]

}
]

}

Output

{

"Address": [

{

"CustomerId": "1",

"AddressId": "101",

"Contact": [

{

"PrimaryContactId": "12345",

"SecondaryContactId": "123456"

}
]

},

{

"CustomerId": "2",

"AddressId": "102",

"Contact": [

{

"PrimaryContactId": "12346",

"SecondaryContactId": "123457"

}
]

},

{

"CustomerId": "3",

"AddressId": "103",

"Contact": [

{

"PrimaryContactId": "123459",

"SecondaryContactId": "1234567"

}
]

},

{

"CustomerId": "4",

"AddressId": "104",

"Contact": [

{

"PrimaryContactId": "123458",

"SecondaryContactId": "1234568"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Address" inputpath="WorkOrder/Address">
< outputpath="CustomerId" inputpath="CustomerId" />
< outputpath="AddressId" inputpath="AddressId" />
<map outputpath="Contact" inputpath="">
< outputpath="PrimaryContactId" inputpath="PrimaryContactId" />
< outputpath="SecondaryContactId" inputpath="SecondaryContactId" />
</map>
</map>
</mapper>

Optional Output Path

This is an example of mapping an optional output path.

Input

{

"WorkOrder": [

{

"CustomerId": "1",

"Address": [

{

"AddressId": "101",

"PrimaryContactId": "12345",

"SecondaryContactId": "123456"

},

{

"AddressId": "102",

"PrimaryContactId": "12346",

"SecondaryContactId": "123457"

}
]

},

{

"CustomerId": "3",

"Address": [

{

"AddressId": "103",

"PrimaryContactId": "123459",

"SecondaryContactId": "1234567"

},

{

"AddressId": "104",

"PrimaryContactId": "123458",

"SecondaryContactId": "1234568"

}
]

}
]

}

Output

{

"Address": [

{

"CustomerId": "1",

"AddressId": "102",

"PrimaryContactId": "12346",

"SecondaryContactId": "123457"

},

{

"CustomerId": "3",

"AddressId": "104",

"PrimaryContactId": "123458",

"SecondaryContactId": "1234568"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Address" inputpath="WorkOrder">
< outputpath="CustomerId" inputpath="CustomerId" />
< outputpath="AddressId" inputpath="AddressId" />
<map outputpath="Contact" inputpath="">
< outputpath="PrimaryContactId" inputpath="PrimaryContactId" />
< outputpath="SecondaryContactId" inputpath="SecondaryContactId" />
</map>
</map>
</mapper>

Parent Attributes To Different Child Objects

This is an example of mapping parent attributes to different child objects.

Input

{

"EAM_CONTACTS": [

{

"ContactNo": "101",

"EAM_CONT_ADDRESS": [

{

"Name1": "xyz"

}
],

"EAM_CONT_MISC": [

{

"PREFERENCES": "PrefOne"

}
]

},

{

"ContactNo": "102",

"EAM_CONT_ADDRESS": [

{

"Name1": "abc"

}
],

"EAM_CONT_MISC": [

{

"PREFERENCES": "PrefTwo"

}
]

}
]

}

Output

{

"Contact": [

{

"CONTACT_NO": "101",

"FirstName": "xyz",

"Preferences": "PrefOne"

},

{

"CONTACT_NO": "102",

"FirstName": "abc",

"Preferences": "PrefTwo"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Contact" inputpath="EAM_CONTACTS">
< outputpath="CONTACT_NO" inputpath="ContactNo" />
< outputpath="FirstName" inputpath="EAM_CONT_ADDRESS/Name1" />
< outputpath="Preferences" inputpath="EAM_CONT_MISC/PREFERENCES" />
</map>
</mapper>

Primary To Secondary Mapping

This is an example of primary to secondary mapping.

Input

{

"WorkOrder": [

{

"Address": [

{

"CustomerId": "1",

"AddressId": "101",

"PrimaryContactId": "12345",

"SecondaryContactId": "123456"

},

{

"CustomerId": "2",

"AddressId": "102",

"PrimaryContactId": "12346",

"SecondaryContactId": "123457"

}
]

},

{

"Address": [

{

"CustomerId": "3",

"AddressId": "103",

"PrimaryContactId": "123459",

"SecondaryContactId": "1234567"

},

{

"CustomerId": "4",

"AddressId": "104",

"PrimaryContactId": "123458",

"SecondaryContactId": "1234568"

}
]

}
]

}

Output

{

"Address": [

{

"CustomerId": "1",

"AddressId": "101",

"WorkOrderContacts": [

{

"PrimaryContactId": "12345",

"SecondaryContactId": "123456"

}
]

},

{

"CustomerId": "2",

"AddressId": "102",

"WorkOrderContacts": [

{

"PrimaryContactId": "12346",

"SecondaryContactId": "123457"

}
]

},

{

"CustomerId": "3",

"AddressId": "103",

"WorkOrderContacts": [

{

"PrimaryContactId": "123459",

"SecondaryContactId": "1234567"

}
]

},

{

"CustomerId": "4",

"AddressId": "104",

"WorkOrderContacts": [

{

"PrimaryContactId": "123458",

"SecondaryContactId": "1234568"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="WorkOrder" inputpath="WorkOrder/Address">
< outputpath="CustomerId" inputpath="CustomerId" />
< outputpath="AddressId" inputpath="AddressId" />
<map outputpath="workOrderContacts" inputpath="">
< outputpath="PrimaryContactId" inputpath="PrimaryContactId" />
< outputpath="SecondaryContactId" inputpath="SecondaryContactId" />
</map>
</map>
</mapper>

Random Mapping

This is an example of mapping using the random function.

Input

{

"A": [

{

"P1": "A-row1-p1"

},

{

"P1": "A-row2-p1"

}
]

}

Output

{

"M": [

{

"Q1": "A-row1-p1"

"Q2": ""

},

{

"Q1": "A-row2-p1"

"Q2": ""

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="M" inputpath="A">
<exec-function name="voltmx.util:random" outputpath="random" output="$vars">
</exec-function>
< outputpath="Q1" inputpath="P1" />
< outputpath="Q2" inputpath="$vars/random" />
</map>
</mapper>

Reference Only Child Object

This is an example of referencing only a child object.

Input

{

"WorkOrder": [

{

"Address": [

{

"CustomerId": "1",

"AddressId": "101",

"PrimaryContactId": "12345",

"SecondaryContactId": "123456"

},

{

"CustomerId": "2",

"AddressId": "102",

"PrimaryContactId": "12346",

"SecondaryContactId": "123457"

}
]

},

{

"Address": [

{

"CustomerId": "3",

"AddressId": "103",

"PrimaryContactId": "123459",

"SecondaryContactId": "1234567"

},

{

"CustomerId": "4",

"AddressId": "104",

"PrimaryContactId": "123458",

"SecondaryContactId": "1234568"

}
]

}
]

}

Output

{

"Address": [

{

"CustomerId": "1",

"AddressId": "101",

"PrimaryContactId": "12345",

"SecondaryContactId": "123456"

},

{

"CustomerId": "2",

"AddressId": "102",

"PrimaryContactId": "12346",

"SecondaryContactId": "123457"

},

{

"CustomerId": "3",

"AddressId": "103",

"PrimaryContactId": "123459",

"SecondaryContactId": "1234567"

},

{

"CustomerId": "4",

"AddressId": "104",

"PrimaryContactId": "123458",

"SecondaryContactId": "1234568"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Address" inputpath="WorkOrder/Address">
< outputpath="CustomerId" inputpath="CustomerId" />
< outputpath="AddressId" inputpath="AddressId" />
< outputpath="PrimaryContactId" inputpath="PrimaryContactId" />
< outputpath="SecondaryContactId" inputpath="SecondaryContactId" />
</map>
</mapper>

Reverse Parent Child

This is an example of reverse parent-child mapping.

Input

{

"WorkOrder": [

{

"WorkOrderId": "1",

"Name": "WorkOrder1",

"Tasks": [

{

"TaskId": "101",

"Name": "Task101"

},

{

"TaskId": "102",

"Name": "Task102"

}
]

},

{

"WorkOrderId": "2",

"Name": "WorkOrder2",

"Tasks": [

{

"TaskId": "103",

"Name": "Task103"

},

{

"TaskId": "104",

"Name": "Task104"

}
]

}
]

}

Output

{

"Tasks": [

{

"TaskId": "101",

"Name": "Task101",

"WorkOrder": [

{

"WorkOrderId": "1",

"Name": "WorkOrder1"

},

]

},

{

"TaskId": "102",

"Name": "Task102",

"WorkOrder": [

{

"WorkOrderId": "1",

"Name": "WorkOrder1"

},

]

},

{

"TaskId": "103",

"Name": "Task103",

"WorkOrder": [

{

"WorkOrderId": "2",

"Name": "WorkOrder2"

},

]

},

{

"TaskId": "104",

"Name": "Task104",

"WorkOrder": [

{

"WorkOrderId": "2",

"Name": "WorkOrder2"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Tasks" inputpath="WorkOrder/Tasks">
< outputpath="TaskId" inputpath="TaskId" />
<set-param outputpath="Name" inputpath="Name" />
<map outputpath="WorkOrder" inputpath="..">
< outputpath="WorkOrderId" inputpath="WorkOrderId" />
<set-param outputpath="Name" inputpath="Name" />
</map>
</map>
</mapper>

Simple Mapping List

This is an example of a simple mapping list.

Input

{

"A": [

{

"P1": "A-row1-p1",

"P2": "A-row1-p2"

},

{

"P1": "A-row2-p1",

"P2": "A-row2-p2"

}
]

}

Output

{

"M": [

{

"Q1": "A-row1-p1",

"Q2": "A-row1-p2"

},

{

"Q1": "A-row2-p1",

"Q2": "A-row2-p2"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="M" inputpath="A">
< outputpath="Q1" inputpath="P1" />
< outputpath="Q2" inputpath="P2" />
</map>
</mapper>

Simple Mapping List With One Row

This is an example of a simple mapping list with one row.

Input

{

"A": [

{

"P1": "A-row1-p1",

"P2": "A-row1-p2"

}
]

}

Output

{

"M": [

{

"Q1": "A-row1-p1",

"Q2": "A-row1-p2"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="M" inputpath="A">
< outputpath="Q1" inputpath="P1" />
< outputpath="Q2" inputpath="P2" />
</map>
</mapper>

Simple Split Mapping

This is an example of simple split mapping using the substringbefore and substringafter functions.

Input

{

"A": [

{

"Name": "First Last"

}
]

}

Output

{

"A": [

{

"FirstName": "First"

"LastName": "Last"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="A" inputpath="A">
<exec-function name="voltmx.string:substringBefore" outputpath="NameSplitBeforeExpr" output="$vars">
<set-arg name="Name" inputpath="Name"/>
<set-arg name="Separator" input=" " />
</exec-function>
<exec-function name="voltmx.string:substringAfter" outputpath="NameSplitAfterExpr" output="$vars">
<set-arg name="Name" inputpath="Name"/>
<set-arg name="Separator" input=" " />
</exec-function>
< outputpath="FirstName" inputpath="$vars/NameSplitBeforeExpr" />
< outputpath="LastName" inputpath="$vars/NameSplitAfterExpr" />
</map>
</mapper>

Split Table

This is an example of split table mapping.

Input

{

"Customer": [

{

"CustomerInfo": "Customer1",

"AddressID": "Address1"

},

{

"CustomerInfo": "Customer2",

"AddressID": "Address2"

}
]

}

Output

{

"Customer": [

{

"CustomerInfo": "Customer1"

},

{

"CustomerInfo": "Customer2"

}
],

"CustomerAddress": [

{

"AddressID": "Address1"

},

{

"AddressID": "Address2"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Customer" inputpath="Customer">
< outputpath="CustomerInfo" inputpath="CustomerInfo" />
</map>
<map outputpath="CustomerAddress" inputpath="Customer">
< outputpath="AddressID" inputpath="AddressId" />
</map>
</mapper>

Split Table Filter Mapping

This is an example of split table filter mapping.

Input

{

"WorkOrder": [

{

"Id": "1",

"WorkOrderData": [

{

"Id": "101",

"Type": "Customer",

"TypeId": "1001",

"Name": "Customer-1"

},

{

"Id": "101",

"Type": "Customer",

"TypeId": "1001",

"Name": "Customer-1"

},

{

"Id": "101",

"Type": "Customer",

"TypeId": "1001",

"Name": "Customer-1"

},

{

"Id": "101",

"Type": "Customer",

"TypeId": "1001",

"Name": "Customer-1"

},

]

},

{

"Id": "2",

"WorkOrderData": [

{

"Id": "201",

"Type": "Customer",

"TypeId": "2001",

"Name": "Customer-2"

},

{

"Id": "202",

"Type": "Address",

"TypeId": "2002",

"Name": "Address-2"

},

{

"Id": "203",

"Type": "Contact",

"TypeId": "2003",

"Name": "Contact-2-1"

},

{

"Id": "204",

"Type": "Contact",

"TypeId": "2004",

"Name": "Contact-2-2"

}
]

}
]

}

Output

{

"WorkOrder": [

{

"WorkOrderId": "1",

"CustomerId": "101",

"AddressId": "102",

"Contacts": [

{

"ContactId": "103",

"Name": "Contact-1-1"

},

{

"ContactId": "104",

"Name": "Contact-1-2"

}
]

},

{

"WorkOrderId": "2",

"CustomerId": "201",

"AddressId": "202",

"Contacts": [

{

"ContactId": "203",

"Name": "Contact-2-1"

},

{

"ContactId": "204",

"Name": "Contact-2-2"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="WorkOrder" inputpath="WorkOrder">
< outputpath="WorkOrderId" inputpath="Id" />
<map outputpath="" inputpath="WorkOrderData">
<exec-function name="voltmx.logical:equal" outputpath="CustomerCondition" output="$vars">
<set-arg name="Type" inputpath="Type" />
<set-arg name="Customer" input="Customer" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="AddressCondition" output="$vars">
<set-arg name="Type" inputpath="Type" />
<set-arg name="Address" input="Address" />
</exec-function>
<exec-function name="voltmx.logical:equal" outputpath="ContactCondition" output="$vars">
<set-arg name="Type" inputpath="Type" />
<set-arg name="Contact" input="Contact" />
</exec-function>
<choose>
<when test="$vars/CustomerCondition">
< outputpath="CustomerId" inputpath="Id" />
</when>
<when test="$vars/AddressCondition">
< outputpath="AddressId" inputpath="Id" />
</when>
<when test="$vars/ContactCondition">
<map outputpath="Contacts" inputpath="">
< outputpath="ContactId" inputpath="Id" />
<set-param outputpath="Name" inputpath="Name" />
</map>
</when>
</choose>
</map>
</map>
</mapper>

Static Lookup

This is an example of static lookup mapping.

Input

{

"WorkOrder": [

{

"Id": "101",

"Status": "Completed"

},

{

"Id": "102",

"Status": "InProgress"

}
]

}

Output

{

"WorkOrder": [

{

"Id": "101",

"Status": "DONE"

},

{

"Id": "102",

"Status": "INCOMPLETE"

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="WorkOrder" inputpath="WorkOrder">
<variables>
<variable name="statusmap" evalType="map" value="{"Completed":"DONE", "InProgress":"INCOMPLETE"}" />
</variables>
< outputpath="Id" inputpath="WorkOrder/Id" />
< outputpath="Status"
inputpath="$vars.statusmap.get($content.get('WorkOrder').getValue('Status').getValue())" />
</map>
</mapper>

Two Childs To Same Entity

This is an example of mapping two child objects to the same entity.

Input

{

"EAM_WO_OPERATION": [

{

"DUR_NOR_UNIT": "H",

"ROUTING_NUM": "1000000082",

"START_DATE_TIME": "20151004082847",

"DURATION_NORMAL": "4.0",

"CONF_END_TIME": "093218",

"STATUS_TXT": "CNF REL",

"BASIC_START_DAT": "20151004",

"QUANTITY": ".000",

"FORECAST_FIN_TIM": "000000",

"WORK_UNIT": "H",

"CONTROL_KEY": "SM01",

"USER_STATUS": "E0005",

"OPERATION_TXT": "Replace valve",

"PRICE": ".00",

"PLANT": "8000",

"FORCAST_FINISH": "00000000",

"WORK_ACTIVITY": "4.0",

"USERSTATUS_TXT": "FIN",

"CONF_END_DATE": "20151004",

"OBJ_ID_RESOURCE": "10000198",

"LOCATION": "000000002358",

"OPERATION": "0010",

"TIMESTAMP": "20151009135631",

"CONF_START_TIME": "082847",

"USR04": ".000",

"USR05": ".000",

"USR06": ".000",

"USR07": ".000",

"USR08": "00000000",

"USR09": "00000000",

"GENERAL_COUNTER": "1",

"STAT_PROF": "EAM_WOPE",

"INTERNAL_NUMBER": "000004000121",

"BASIC_START_TIM": "183000",

"ACTUAL_WORK": "1.1",

"ORDER_NUM": "000004000121",

"TIME_ZONE": "UTC",

"WORK_CENTER": "MAINT01",

"FORECAST_DAT_TIM": "00000000000000",

"HOURLY_RATE": ".000",

"CONF_START_DATE": "20151004",

"END_DATE_TIME": "20151004093218",

"USER_NAME": "EAM00000",

"ACTUAL_AMOUNT": ".000",

"CALC_KEY": "0",

"EAM_WO_MAT": {

"MATERIAL_NUM": "A100",

"RELATIONS_INTVAL": ".0",

"INTERNAL_COM_ITM": "20",

"SHORT_TXT_TASK": "A1 Grand Prix super sprint BMX Bike",

"RESERVE_QUAN": ".000",

"COMP_ITEM_NUM": "0000040001210020",

"BASE_UNIT": "EA",

"VSI_SIZE1": ".000",

"VSI_SIZE2": ".000",

"VSI_SIZE3": ".000",

"VSI_NO": ".000",

"LIST_PRICE": ".00",

"REQUIRE_QUAN": "6.000",

"ACTUAL_QUAN": ".000",

"MAT_TYPE_TEXT": "Finished Product",

"MATERIAL_TYPE": "FERT",

"ITEM_CATEGORY": "L",

"ORIGINAL_QUAN": ".000",

"ORDER_NUM": "000004000121",

"VSI_QTY": ".000",

"RESERVATION_NUM": "591",

"ITEM_NUMBER": "5",

"OPERATION": "0010",

"TIMESTAMP": "20151009135631",

"ACTUAL_AMOUNT": ".000",

"BOM_ITEM_NUM": "0020"

},

"EAM_WO_PRT": {

"MATERIAL_NUM": "HAMMER",

"ORDER_NUM": "000004000121",

"OPERATION": "0010",

"TOT_PLAN_QUAN": ".000",

"SHORT_TXT_TASK": "Hammer Tool",

"INTERNAL_COM_ITM": "10",

"TIMESTAMP": "20151005165617",

"PRT_CATEGORY": "R",

"COMP_ITEM_NUM": "00000400012100100010"

}

}
]

}

Output

{

"Task": [

{

"Location_id": "000000002358",

"Type_id": "SM01",

"Plant_id": "8000",

"Code": "000004000121",

"WorkOrderMaterial": [

{

"type": "M",

"Material": "A100",

"Order": "000004000121",

"Description": "A1 Grand Prix super sprint BMX Bike",

"ItemNumber": "0000040001210020",

"Item": "L"

},

{

"type": "P",

"Material": "HAMMER",

"Order": "000004000121",

"Description": "Hammer Tool",

"ItemNumber": "00000400012100100010",

"Item": "R"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Task" inputpath="EAM_WO_OPERATION">
< outputpath="Location_id" inputpath="LOCATION" />
< outputpath="Type_id" inputpath="CONTROL_KEY" />
< outputpath="Plant_id" inputpath="PLANT" />
< outputpath="Code" inputpath="INTERNAL_NUMBER" />
<map outputpath="WorkOrderMaterial" inputpath="EAM_WO_MAT">
< outputpath="type" input="M" />
< outputpath="Material" inputpath="MATERIAL_NUM" />
< outputpath="Order" inputpath="ORDER_NUM" />
< outputpath="Description" inputpath="SHORT_TXT_TASK" />
< outputpath="ItemNumber" inputpath="COMP_ITEM_NUM" />
< outputpath="Item" inputpath="ITEM_CATEGORY" />
</map>
<map outputpath="WorkOrderMaterial" inputpath="EAM_WO_PRT">
< outputpath="type" input="P" />
< outputpath="Material" inputpath="MATERIAL_NUM" />
< outputpath="Order" inputpath="ORDER_NUM" />
< outputpath="Description" inputpath="SHORT_TXT_TASK" />
< outputpath="ItemNumber" inputpath="COMP_ITEM_NUM" />
< outputpath="Item" inputpath="PRT_CATEGORY" />
</map>
</map>
</mapper>

EAM Notification Mapping

This is an example of enterprise asset management (EAM) notification mapping.

Input

{

"EAM_NOTIF": [

{

"NOTIF_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"NOTIF_TYPE": "S2",

"SHORT_TEXT": "new test notification",

"NOTIF_DATE": "20150812",

"NOTIF_TIME": "071728",

"FUNC_LOCATION": "1000-100-AA",

"FLOCN_DESC": "Engineering Workshop - Auto",

"EQUIP_NUM": "10000001",

"TECH_OBJ_DESC": "Toyota Hilux: Reg ABC-123",

"CATALOG_PROFILE": "000000001",

"PRIORITY": "4",

"INTERNAL_NUMBER": "000300000561",

"WRRNTY_START_DT": "00000000",

"WRRNTY_END_DT": "00000000",

"MANU_WRRNTY_STDT": "00000000",

"MANU_WRRNTY_ENDT": "00000000",

"WORK_CENTER": "MAINT01",

"WC_SHORT_DESC": "General Maintenance",

"SYS_STATUS": "OSNO",

"TIME_ZONE": "UTC",

"PLANPLANT": "8000",

"LOC_ACC": "000000003874",

"STRMLFNDATE": "00000000",

"ENDMLFNDATE": "00000000",

"STRMLFNTIME": "000000",

"ENDMLFNTIME": "000000",

"DOWNTIME": "0.000000000E+00",

"UNIT": "H",

"PLANGROUP": "010",

"CREATED_BY": "CPIC_VTI",

"CREATED_ON": "20150812",

"CHANGED_ON": "00000000",

"DESSTDATE": "20150814",

"DESSTTIME": "071728",

"DESENDDATE": "20150817",

"DESENDTM": "071728",

"CUST_NO": "6",

"OBJECT_NO": "00000000",

"COMPTIME": "000000",

"PRILANG": "E",

"REFDATE": "20150812",

"REFTIME": "071729",

"PURCH_DATE": "00000000",

"DIVISION": "10",

"SALES_ORG": "1000",

"DISTR_CHAN": "10",

"CHANGED_AT": "000000",

"CREATED_AT": "124729",

"PM_WKCTR": "10000000",

"NOTIFTMEZ": "INDIA",

"MAINTPLANT": "8000",

"BUS_AREA": "8000",

"CO_AREA": "9999",

"COMP_CODE": "8000",

"SALES_ORG_LOC": "1000",

"DIVISION_LOC": "10",

"DIST_CHAN_LOC": "10",

"ADDR_NO_LOC": "23380",

"TIMESTAMP": "20150812124739",

"EAM_NOTIFICATION_ADDRESS": [

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ADDR_TYPE": "AG",

"ADDR_TYPE_ID": "0000000006",

"PARTNER_TYPE": "KU",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

},

{

"DOC_NUM": "000010001370",

"ADDR_TYPE": "NTF",

"ADDR_TYPE_ID": "000010001370",

"ADDRESS_ID": "0000024160",

"TIMESTAMP": "20150401204100",

"EAM_ADDRESS": {

"ADDRNO": "0000024160",

"HOUSE_NUM": "35",

"STREET": "DUNLOP ROAD",

"CITY": "MULGRAVE",

"REGION": "VIC",

"POST_CODE": "3170",

"COUNTRY": "AU",

"LATITUDE": "37.200000000000",

"LONGITUDE": "49.400000000000",

"PHONE1": "545453577",

"PHONE2": "040323223232-124",

"MOBILE1": "967631273133",

"MOBILE2": "931313131124",

"FAX": "0401231312314",

"EMAIL": "CUSTOMER@voltmx.COM",

"TIMESTAMP": "20150708153054"

}

},

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ADDR_TYPE": "CON",

"ADDR_TYPE_ID": "0000000006",

"PARTNER_TYPE": "SA",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

},

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ADDR_TYPE": "CON",

"ADDR_TYPE_ID": "0000000006",

"PARTNER_TYPE": "RR",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

}
]

},

{

"NOTIF_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"NOTIF_TYPE": "S2",

"SHORT_TEXT": "new test notification",

"NOTIF_DATE": "20150812",

"NOTIF_TIME": "071728",

"FUNC_LOCATION": "1000-100-AA",

"FLOCN_DESC": "Engineering Workshop - Auto",

"EQUIP_NUM": "10000001",

"TECH_OBJ_DESC": "Toyota Hilux: Reg ABC-123",

"CATALOG_PROFILE": "000000001",

"PRIORITY": "4",

"INTERNAL_NUMBER": "000300000561",

"WRRNTY_START_DT": "00000000",

"WRRNTY_END_DT": "00000000",

"MANU_WRRNTY_STDT": "00000000",

"MANU_WRRNTY_ENDT": "00000000",

"WORK_CENTER": "MAINT01",

"WC_SHORT_DESC": "General Maintenance",

"SYS_STATUS": "OSNO",

"TIME_ZONE": "UTC",

"PLANPLANT": "8000",

"LOC_ACC": "000000003874",

"STRMLFNDATE": "00000000",

"ENDMLFNDATE": "00000000",

"STRMLFNTIME": "000000",

"ENDMLFNTIME": "000000",

"DOWNTIME": "0.000000000E+00",

"UNIT": "H",

"PLANGROUP": "010",

"CREATED_BY": "CPIC_VTI",

"CREATED_ON": "20150812",

"CHANGED_ON": "00000000",

"DESSTDATE": "20150814",

"DESSTTIME": "071728",

"DESENDDATE": "20150817",

"DESENDTM": "071728",

"CUST_NO": "6",

"OBJECT_NO": "00000000",

"COMPTIME": "000000",

"PRILANG": "E",

"REFDATE": "20150812",

"REFTIME": "071729",

"PURCH_DATE": "00000000",

"DIVISION": "10",

"SALES_ORG": "1000",

"DISTR_CHAN": "10",

"CHANGED_AT": "000000",

"CREATED_AT": "124729",

"PM_WKCTR": "10000000",

"NOTIFTMEZ": "INDIA",

"MAINTPLANT": "8000",

"BUS_AREA": "8000",

"CO_AREA": "9999",

"COMP_CODE": "8000",

"SALES_ORG_LOC": "1000",

"DIVISION_LOC": "10",

"DIST_CHAN_LOC": "10",

"ADDR_NO_LOC": "23380",

"TIMESTAMP": "20150812124739",

"EAM_NOTIFICATION_ADDRESS": [

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ADDR_TYPE": "AG",

"ADDR_TYPE_ID": "0000000007",

"PARTNER_TYPE": "KU",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

},

{

"DOC_NUM": "000010001370",

"ADDR_TYPE": "NTF",

"ADDR_TYPE_ID": "000010001371",

"ADDRESS_ID": "0000024160",

"TIMESTAMP": "20150401204100",

"EAM_ADDRESS": {

"ADDRNO": "0000024160",

"HOUSE_NUM": "35",

"STREET": "DUNLOP ROAD",

"CITY": "MULGRAVE",

"REGION": "VIC",

"POST_CODE": "3170",

"COUNTRY": "AU",

"LATITUDE": "37.200000000000",

"LONGITUDE": "49.400000000000",

"PHONE1": "545453577",

"PHONE2": "040323223232-124",

"MOBILE1": "967631273133",

"MOBILE2": "931313131124",

"FAX": "0401231312314",

"EMAIL": "CUSTOMER@voltmx.COM",

"TIMESTAMP": "20150708153054"

}

},

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ADDR_TYPE": "CON",

"ADDR_TYPE_ID": "0000000006",

"PARTNER_TYPE": "SA1",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

},

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ADDR_TYPE": "CON",

"ADDR_TYPE_ID": "0000000006",

"PARTNER_TYPE": "RR1",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

}
]

},

{

"NOTIF_NUM": "33A52D58AC4D94C5B935FE9D8CCC8ADC7",

"NOTIF_TYPE": "S2",

"SHORT_TEXT": "new test notification",

"NOTIF_DATE": "20150812",

"NOTIF_TIME": "071728",

"FUNC_LOCATION": "1000-100-AA",

"FLOCN_DESC": "Engineering Workshop - Auto",

"EQUIP_NUM": "10000001",

"TECH_OBJ_DESC": "Toyota Hilux: Reg ABC-123",

"CATALOG_PROFILE": "000000001",

"PRIORITY": "4",

"INTERNAL_NUMBER": "000300000561",

"WRRNTY_START_DT": "00000000",

"WRRNTY_END_DT": "00000000",

"MANU_WRRNTY_STDT": "00000000",

"MANU_WRRNTY_ENDT": "00000000",

"WORK_CENTER": "MAINT01",

"WC_SHORT_DESC": "General Maintenance",

"SYS_STATUS": "OSNO",

"TIME_ZONE": "UTC",

"PLANPLANT": "8000",

"LOC_ACC": "000000003874",

"STRMLFNDATE": "00000000",

"ENDMLFNDATE": "00000000",

"STRMLFNTIME": "000000",

"ENDMLFNTIME": "000000",

"DOWNTIME": "0.000000000E+00",

"UNIT": "H",

"PLANGROUP": "010",

"CREATED_BY": "CPIC_VTI",

"CREATED_ON": "20150812",

"CHANGED_ON": "00000000",

"DESSTDATE": "20150814",

"DESSTTIME": "071728",

"DESENDDATE": "20150817",

"DESENDTM": "071728",

"CUST_NO": "6",

"OBJECT_NO": "00000000",

"COMPTIME": "000000",

"PRILANG": "E",

"REFDATE": "20150812",

"REFTIME": "071729",

"PURCH_DATE": "00000000",

"DIVISION": "10",

"SALES_ORG": "1000",

"DISTR_CHAN": "10",

"CHANGED_AT": "000000",

"CREATED_AT": "124729",

"PM_WKCTR": "10000000",

"NOTIFTMEZ": "INDIA",

"MAINTPLANT": "8000",

"BUS_AREA": "8000",

"CO_AREA": "9999",

"COMP_CODE": "8000",

"SALES_ORG_LOC": "1000",

"DIVISION_LOC": "10",

"DIST_CHAN_LOC": "10",

"ADDR_NO_LOC": "23380",

"TIMESTAMP": "20150812124739",

"EAM_NOTIFICATION_ADDRESS": [

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ADDR_TYPE": "AG",

"ADDR_TYPE_ID": "0000000006",

"PARTNER_TYPE": "KU",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

},

{

"DOC_NUM": "000010001370",

"ADDR_TYPE": "NTF",

"ADDR_TYPE_ID": "000010001370",

"ADDRESS_ID": "0000024160",

"TIMESTAMP": "20150401204100",

"EAM_ADDRESS": {

"ADDRNO": "0000024160",

"HOUSE_NUM": "35",

"STREET": "DUNLOP ROAD",

"CITY": "MULGRAVE",

"REGION": "VIC",

"POST_CODE": "3170",

"COUNTRY": "AU",

"LATITUDE": "37.200000000000",

"LONGITUDE": "49.400000000000",

"PHONE1": "545453577",

"PHONE2": "040323223232-124",

"MOBILE1": "967631273133",

"MOBILE2": "931313131124",

"FAX": "0401231312314",

"EMAIL": "CUSTOMER@voltmx.COM",

"TIMESTAMP": "20150708153054"

}

},

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ADDR_TYPE": "CON",

"ADDR_TYPE_ID": "0000000006",

"PARTNER_TYPE": "SA",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

},

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ADDR_TYPE": "CON",

"ADDR_TYPE_ID": "0000000006",

"PARTNER_TYPE": "RR",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

}
]

},

{

"NOTIF_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"NOTIF_TYPE": "S2",

"SHORT_TEXT": "new test notification",

"NOTIF_DATE": "20150812",

"NOTIF_TIME": "071728",

"FUNC_LOCATION": "1000-100-AA",

"FLOCN_DESC": "Engineering Workshop - Auto",

"EQUIP_NUM": "10000001",

"TECH_OBJ_DESC": "Toyota Hilux: Reg ABC-123",

"CATALOG_PROFILE": "000000001",

"PRIORITY": "4",

"INTERNAL_NUMBER": "000300000561",

"WRRNTY_START_DT": "00000000",

"WRRNTY_END_DT": "00000000",

"MANU_WRRNTY_STDT": "00000000",

"MANU_WRRNTY_ENDT": "00000000",

"WORK_CENTER": "MAINT01",

"WC_SHORT_DESC": "General Maintenance",

"SYS_STATUS": "OSNO",

"TIME_ZONE": "UTC",

"PLANPLANT": "8000",

"LOC_ACC": "000000003874",

"STRMLFNDATE": "00000000",

"ENDMLFNDATE": "00000000",

"STRMLFNTIME": "000000",

"ENDMLFNTIME": "000000",

"DOWNTIME": "0.000000000E+00",

"UNIT": "H",

"PLANGROUP": "010",

"CREATED_BY": "CPIC_VTI",

"CREATED_ON": "20150812",

"CHANGED_ON": "00000000",

"DESSTDATE": "20150814",

"DESSTTIME": "071728",

"DESENDDATE": "20150817",

"DESENDTM": "071728",

"CUST_NO": "6",

"OBJECT_NO": "00000000",

"COMPTIME": "000000",

"PRILANG": "E",

"REFDATE": "20150812",

"REFTIME": "071729",

"PURCH_DATE": "00000000",

"DIVISION": "10",

"SALES_ORG": "1000",

"DISTR_CHAN": "10",

"CHANGED_AT": "000000",

"CREATED_AT": "124729",

"PM_WKCTR": "10000000",

"NOTIFTMEZ": "INDIA",

"MAINTPLANT": "8000",

"BUS_AREA": "8000",

"CO_AREA": "9999",

"COMP_CODE": "8000",

"SALES_ORG_LOC": "1000",

"DIVISION_LOC": "10",

"DIST_CHAN_LOC": "10",

"ADDR_NO_LOC": "23380",

"TIMESTAMP": "20150812124739",

"EAM_NOTIFICATION_ADDRESS": [

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ADDR_TYPE": "AG",

"ADDR_TYPE_ID": "0000000007",

"PARTNER_TYPE": "KU",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

},

{

"DOC_NUM": "000010001370",

"ADDR_TYPE": "NTF",

"ADDR_TYPE_ID": "000010001371",

"ADDRESS_ID": "0000024160",

"TIMESTAMP": "20150401204100",

"EAM_ADDRESS": {

"ADDRNO": "0000024160",

"HOUSE_NUM": "35",

"STREET": "DUNLOP ROAD",

"CITY": "MULGRAVE",

"REGION": "VIC",

"POST_CODE": "3170",

"COUNTRY": "AU",

"LATITUDE": "37.200000000000",

"LONGITUDE": "49.400000000000",

"PHONE1": "545453577",

"PHONE2": "040323223232-124",

"MOBILE1": "967631273133",

"MOBILE2": "931313131124",

"FAX": "0401231312314",

"EMAIL": "CUSTOMER@voltmx.COM",

"TIMESTAMP": "20150708153054"

}

},

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ADDR_TYPE": "CON",

"ADDR_TYPE_ID": "0000000006",

"PARTNER_TYPE": "SA",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

},

{

"DOC_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ADDR_TYPE": "CON",

"ADDR_TYPE_ID": "0000000006",

"PARTNER_TYPE": "RR1",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739",

"EAM_ADDRESS": {

"ADDRNO": "0000022490",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"CITY": "Clayton North",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}

}
]

},

Output

{

"Notification": [

{

"NOTIF_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"Type_id": "S2",

"Description": "new test notification",

"NOTIF_DATE": "20150812",

"NOTIF_TIME": "071728",

"FUNC_LOCATION": "1000-100-AA",

"FLOCN_DESC": "Engineering Workshop - Auto",

"EQUIP_NUM": "10000001",

"TECH_OBJ_DESC": "Toyota Hilux: Reg ABC-123",

"CATALOG_PROFILE": "000000001",

"PRIORITY": "4",

"INTERNAL_NUMBER": "000300000561",

"WRRNTY_START_DT": "00000000",

"WRRNTY_END_DT": "00000000",

"WORK_CENTER": "MAINT01",

"WC_SHORT_DESC": "General Maintenance",

"SYS_STATUS": "OSNO",

"TIME_ZONE": "UTC",

"PLANPLANT": "8000",

"LOC_ACC": "000000003874",

"STRMLFNDATE": "00000000",

"ENDMLFNDATE": "00000000",

"STRMLFNTIME": "000000",

"ENDMLFNTIME": "000000",

"DOWNTIME": "0.000000000E+00",

"UNIT": "H",

"PLANGROUP": "010",

"CREATED_BY": "CPIC_VTI",

"CREATED_ON": "20150812",

"CHANGED_ON": "00000000",

"DESSTDATE": "20150814",

"DESSTTIME": "071728",

"DESENDDATE": "20150817",

"DESENDTM": "071728",

"CUST_NO": "6",

"PRILANG": "E",

"REFDATE": "20150812",

"REFTIME": "071729",

"PURCH_DATE": "00000000",

"DIVISION": "10",

"SALES_ORG": "1000",

"DISTR_CHAN": "10",

"CHANGED_AT": "000000",

"CREATED_AT": "124729",

"NOTIFTMEZ": "INDIA",

"MAINTPLANT": "8000",

"BUS_AREA": "8000",

"CO_AREA": "9999",

"TIMESTAMP": "20150812124739",

"ADDR_NO_LOC": "23380",

"Address": [

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

},

{

"id": "0000024160",

"city": "MULGRAVE",

"STREET": "DUNLOP ROAD",

"POST_CODE": "3170",

"COUNTRY": "AU",

"PHONE1": "545453577",

"TIMESTAMP": "20150708153054"

},

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

},

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}
],

"Contacts": [

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ContactId": "0000000007",

"Partner": "KU",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

},

{

"NotificationId": "000010001370",

"ContactId": "000010001370",

"ADDRESS_ID": "0000024160",

"TIMESTAMP": "20150401204100"

},

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ContactId": "0000000006",

"Partner": "SA",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

},

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ContactId": "0000000006",

"Partner": "RR",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

}
]

},

{

"NOTIF_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"Type_id": "S2",

"Description": "new test notification",

"NOTIF_DATE": "20150812",

"NOTIF_TIME": "071728",

"FUNC_LOCATION": "1000-100-AA",

"FLOCN_DESC": "Engineering Workshop - Auto",

"EQUIP_NUM": "10000001",

"TECH_OBJ_DESC": "Toyota Hilux: Reg ABC-123",

"CATALOG_PROFILE": "000000001",

"PRIORITY": "4",

"INTERNAL_NUMBER": "000300000561",

"WRRNTY_START_DT": "00000000",

"WRRNTY_END_DT": "00000000",

"WORK_CENTER": "MAINT01",

"WC_SHORT_DESC": "General Maintenance",

"SYS_STATUS": "OSNO",

"TIME_ZONE": "UTC",

"PLANPLANT": "8000",

"LOC_ACC": "000000003874",

"STRMLFNDATE": "00000000",

"ENDMLFNDATE": "00000000",

"STRMLFNTIME": "000000",

"ENDMLFNTIME": "000000",

"DOWNTIME": "0.000000000E+00",

"UNIT": "H",

"PLANGROUP": "010",

"CREATED_BY": "CPIC_VTI",

"CREATED_ON": "20150812",

"CHANGED_ON": "00000000",

"DESSTDATE": "20150814",

"DESSTTIME": "071728",

"DESENDDATE": "20150817",

"DESENDTM": "071728",

"CUST_NO": "6",

"PRILANG": "E",

"REFDATE": "20150812",

"REFTIME": "071729",

"PURCH_DATE": "00000000",

"DIVISION": "10",

"SALES_ORG": "1000",

"DISTR_CHAN": "10",

"CHANGED_AT": "000000",

"CREATED_AT": "124729",

"NOTIFTMEZ": "INDIA",

"MAINTPLANT": "8000",

"BUS_AREA": "8000",

"CO_AREA": "9999",

"TIMESTAMP": "20150812124739",

"ADDR_NO_LOC": "23380",

"Address": [

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

},

{

"id": "0000024160",

"city": "MULGRAVE",

"STREET": "DUNLOP ROAD",

"POST_CODE": "3170",

"COUNTRY": "AU",

"PHONE1": "545453577",

"TIMESTAMP": "20150708153054"

},

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

},

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}
],

"Contacts": [

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ContactId": "0000000007",

"Partner": "KU",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

},

{

"NotificationId": "000010001370",

"ContactId": "000010001371",

"ADDRESS_ID": "0000024160",

"TIMESTAMP": "20150401204100"

},

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ContactId": "0000000006",

"Partner": "SA1",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

},

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ContactId": "0000000006",

"Partner": "RR1",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

}
]

},

{

"NOTIF_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"Type_id": "S2",

"Description": "new test notification",

"NOTIF_DATE": "20150812",

"NOTIF_TIME": "071728",

"FUNC_LOCATION": "1000-100-AA",

"FLOCN_DESC": "Engineering Workshop - Auto",

"EQUIP_NUM": "10000001",

"TECH_OBJ_DESC": "Toyota Hilux: Reg ABC-123",

"CATALOG_PROFILE": "000000001",

"PRIORITY": "4",

"INTERNAL_NUMBER": "000300000561",

"WRRNTY_START_DT": "00000000",

"WRRNTY_END_DT": "00000000",

"WORK_CENTER": "MAINT01",

"WC_SHORT_DESC": "General Maintenance",

"SYS_STATUS": "OSNO",

"TIME_ZONE": "UTC",

"PLANPLANT": "8000",

"LOC_ACC": "000000003874",

"STRMLFNDATE": "00000000",

"ENDMLFNDATE": "00000000",

"STRMLFNTIME": "000000",

"ENDMLFNTIME": "000000",

"DOWNTIME": "0.000000000E+00",

"UNIT": "H",

"PLANGROUP": "010",

"CREATED_BY": "CPIC_VTI",

"CREATED_ON": "20150812",

"CHANGED_ON": "00000000",

"DESSTDATE": "20150814",

"DESSTTIME": "071728",

"DESENDDATE": "20150817",

"DESENDTM": "071728",

"CUST_NO": "6",

"PRILANG": "E",

"REFDATE": "20150812",

"REFTIME": "071729",

"PURCH_DATE": "00000000",

"DIVISION": "10",

"SALES_ORG": "1000",

"DISTR_CHAN": "10",

"CHANGED_AT": "000000",

"CREATED_AT": "124729",

"NOTIFTMEZ": "INDIA",

"MAINTPLANT": "8000",

"BUS_AREA": "8000",

"CO_AREA": "9999",

"TIMESTAMP": "20150812124739",

"ADDR_NO_LOC": "23380",

"Address": [

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

},

{

"id": "0000024160",

"city": "MULGRAVE",

"STREET": "DUNLOP ROAD",

"POST_CODE": "3170",

"COUNTRY": "AU",

"PHONE1": "545453577",

"TIMESTAMP": "20150708153054"

},

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

},

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}
],

"Contacts": [

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ContactId": "0000000006",

"Partner": "KU",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

},

{

"NotificationId": "000010001370",

"ContactId": "000010001371",

"ADDRESS_ID": "0000024160",

"TIMESTAMP": "20150401204100"

},

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ContactId": "0000000006",

"Partner": "SA1",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

},

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC7",

"ContactId": "0000000006",

"Partner": "RR",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

}
]

},

{

"NOTIF_NUM": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"Type_id": "S2",

"Description": "new test notification",

"NOTIF_DATE": "20150812",

"NOTIF_TIME": "071728",

"FUNC_LOCATION": "1000-100-AA",

"FLOCN_DESC": "Engineering Workshop - Auto",

"EQUIP_NUM": "10000001",

"TECH_OBJ_DESC": "Toyota Hilux: Reg ABC-123",

"CATALOG_PROFILE": "000000001",

"PRIORITY": "4",

"INTERNAL_NUMBER": "000300000561",

"WRRNTY_START_DT": "00000000",

"WRRNTY_END_DT": "00000000",

"WORK_CENTER": "MAINT01",

"WC_SHORT_DESC": "General Maintenance",

"SYS_STATUS": "OSNO",

"TIME_ZONE": "UTC",

"PLANPLANT": "8000",

"LOC_ACC": "000000003874",

"STRMLFNDATE": "00000000",

"ENDMLFNDATE": "00000000",

"STRMLFNTIME": "000000",

"ENDMLFNTIME": "000000",

"DOWNTIME": "0.000000000E+00",

"UNIT": "H",

"PLANGROUP": "010",

"CREATED_BY": "CPIC_VTI",

"CREATED_ON": "20150812",

"CHANGED_ON": "00000000",

"DESSTDATE": "20150814",

"DESSTTIME": "071728",

"DESENDDATE": "20150817",

"DESENDTM": "071728",

"CUST_NO": "6",

"PRILANG": "E",

"REFDATE": "20150812",

"REFTIME": "071729",

"PURCH_DATE": "00000000",

"DIVISION": "10",

"SALES_ORG": "1000",

"DISTR_CHAN": "10",

"CHANGED_AT": "000000",

"CREATED_AT": "124729",

"NOTIFTMEZ": "INDIA",

"MAINTPLANT": "8000",

"BUS_AREA": "8000",

"CO_AREA": "9999",

"TIMESTAMP": "20150812124739",

"ADDR_NO_LOC": "23380",

"Address": [

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

},

{

"id": "0000024160",

"city": "MULGRAVE",

"STREET": "DUNLOP ROAD",

"POST_CODE": "3170",

"COUNTRY": "AU",

"PHONE1": "545453577",

"TIMESTAMP": "20150708153054"

},

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

},

{

"id": "0000022490",

"city": "Clayton North",

"NAME1": "FLORIDA CANCER",

"STREET": "150 Blackburn Rd",

"POST_CODE": "3168",

"COUNTRY": "AU",

"PHONE1": "545453566",

"TIMESTAMP": "20150921112449"

}
],

"Contacts": [

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ContactId": "0000000007",

"Partner": "KU",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

},

{

"NotificationId": "000010001370",

"ContactId": "000010001371",

"ADDRESS_ID": "0000024160",

"TIMESTAMP": "20150401204100"

},

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ContactId": "0000000006",

"Partner": "SA1",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

},

{

"NotificationId": "3A52D58AC4D94C5B935FE9D8CCC8ADC8",

"ContactId": "0000000006",

"Partner": "RR1",

"ADDRESS_ID": "0000022490",

"TIMESTAMP": "20150812124739"

}
]

}
]

}

Mapping

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<map outputpath="Notification" inputpath="EAM_NOTIF">
< outputpath="NOTIF_NUM" inputpath="NOTIF_NUM" />
< outputpath="Type_id" inputpath="NOTIF_TYPE" />
< outputpath="Description" inputpath="SHORT_TEXT" />
< outputpath="NOTIF_DATE" inputpath="NOTIF_DATE" />
< outputpath="NOTIF_TIME" inputpath="NOTIF_TIME" />
< outputpath="FUNC_LOCATION" inputpath="FUNC_LOCATION" />
< outputpath="FLOCN_DESC" inputpath="FLOCN_DESC" />
< outputpath="EQUIP_NUM" inputpath="EQUIP_NUM" />
< outputpath="TECH_OBJ_DESC" inputpath="TECH_OBJ_DESC" />
< outputpath="CATALOG_PROFILE" inputpath="CATALOG_PROFILE" />
< outputpath="PRIORITY" inputpath="PRIORITY" />
< outputpath="INTERNAL_NUMBER" inputpath="INTERNAL_NUMBER" />
< outputpath="WRRNTY_START_DT" inputpath="WRRNTY_START_DT" />
< outputpath="WRRNTY_END_DT" inputpath="WRRNTY_END_DT" />
< outputpath="WORK_CENTER" inputpath="WORK_CENTER" />
< outputpath="WC_SHORT_DESC" inputpath="WC_SHORT_DESC" />
< outputpath="SYS_STATUS" inputpath="SYS_STATUS" />
< outputpath="TIME_ZONE" inputpath="TIME_ZONE" />
< outputpath="PLANPLANT" inputpath="PLANPLANT" />
< outputpath="LOC_ACC" inputpath="LOC_ACC" />
< outputpath="STRMLFNDATE" inputpath="STRMLFNDATE" />
< outputpath="ENDMLFNDATE" inputpath="ENDMLFNDATE" />
< outputpath="STRMLFNTIME" inputpath="STRMLFNTIME" />
< outputpath="ENDMLFNTIME" inputpath="ENDMLFNTIME" />
< outputpath="DOWNTIME" inputpath="DOWNTIME" />
< outputpath="UNIT" inputpath="UNIT" />
< outputpath="PLANGROUP" inputpath="PLANGROUP" />
< outputpath="CREATED_BY" inputpath="CREATED_BY" />
< outputpath="CREATED_ON" inputpath="CREATED_ON" />
< outputpath="CHANGED_ON" inputpath="CHANGED_ON" />
< outputpath="DESSTDATE" inputpath="DESSTDATE" />
< outputpath="DESSTTIME" inputpath="DESSTTIME" />
< outputpath="DESENDDATE" inputpath="DESENDDATE" />
< outputpath="DESENDTM" inputpath="DESENDTM" />
< outputpath="CUST_NO" inputpath="CUST_NO" />
< outputpath="PRILANG" inputpath="PRILANG" />
< outputpath="REFDATE" inputpath="REFDATE" />
< outputpath="REFTIME" inputpath="REFTIME" />
< outputpath="PURCH_DATE" inputpath="PURCH_DATE" />
< outputpath="DIVISION" inputpath="DIVISION" />
< outputpath="SALES_ORG" inputpath="SALES_ORG" />
< outputpath="DISTR_CHAN" inputpath="DISTR_CHAN" />
< outputpath="CHANGED_AT" inputpath="CHANGED_AT" />
< outputpath="CREATED_AT" inputpath="CREATED_AT" />
< outputpath="NOTIFTMEZ" inputpath="NOTIFTMEZ" />
< outputpath="MAINTPLANT" inputpath="MAINTPLANT" />
< outputpath="BUS_AREA" inputpath="BUS_AREA" />
< outputpath="CO_AREA" inputpath="CO_AREA" />
< outputpath="TIMESTAMP" inputpath="TIMESTAMP" />
< outputpath="ADDR_NO_LOC" inputpath="ADDR_NO_LOC" />
<map outputpath="" inputpath="EAM_NOTIFICATION_ADDRESS">
<map outputpath="Address" inputpath="">
< outputpath="id" inputpath="EAM_ADDRESS/ADDRNO" />
< outputpath="city" inputpath="EAM_ADDRESS/CITY" />
< outputpath="NAME1" inputpath="EAM_ADDRESS/NAME1" />
< outputpath="STREET" inputpath="EAM_ADDRESS/STREET" />
< outputpath="POST_CODE" inputpath="EAM_ADDRESS/POST_CODE" />
< outputpath="COUNTRY" inputpath="EAM_ADDRESS/COUNTRY" />
< outputpath="PHONE1" inputpath="EAM_ADDRESS/PHONE1" />
< outputpath="TIMESTAMP" inputpath="EAM_ADDRESS/TIMESTAMP" />
</map>
<map outputpath="Contacts" inputpath="">
< outputpath="NotificationId" inputpath="DOC_NUM" />
< outputpath="ContactId" inputpath="ADDR_TYPE_ID" />
< outputpath="Partner" inputpath="PARTNER_TYPE" />
< outputpath="ADDRESS_ID" inputpath="ADDRESS_ID" />
< outputpath="TIMESTAMP" inputpath="TIMESTAMP" />
</map>
</map>
</map>
</mapper>

Aggregation Support in Mapper

Aggregation support in Mapper allows you to iterate through a collection of objects and aggregate them based on a specific key.

Use case:

A user has multiple objects tracking daily employee hours and would like to combine them into a weekly summary of hours.

Input object

Time_Entry - Project_Task_id, Timesheet_Id, End_Time, Start_Time, Time_Type_Id, Activity_Description, Employee_Id, StatusId, Actual_Hours, Id, Project_Task_Type, Date

Output object

Timesheet - Employee_Id, Id, Start_Date, End_Date, Total_Hours

Example for Aggregation Support in Mapper

  • AggregationToFindMinMaxAndSum
Input
{
  "Time_Entry": [
    {
    "Project_Task_id" : "0000001202",
    "Timesheet_Id" : "MYTIME_V1_20161009",
    "End_Time" : "080000",
    "Start_Time" : "070000",
    "Time_Type_Id" : "0800",
    "Activity_Description" : "",
    "Employee_Id" : "1000001",
    "StatusId" : "2",
    "Actual_Hours" : "8.000",
    "Id" : "MYTIME_V1_1209_1",
    "Project_Task_Type" : "CC",
    "Date" : "20161012"
    }, 
    {
    "Project_Task_id" : "0000001202",
    "Timesheet_Id" : "MYTIME_V1_20161009",
    "End_Time" : "080000",
    "Start_Time" : "070000",
    "Time_Type_Id" : "0800",
    "Activity_Description" : "",
    "Employee_Id" : "1000001",
    "StatusId" : "2",
    "Actual_Hours" : "8Ti.000",
    "Id" : "MYTIME_V1_1209_1",
    "Project_Task_Type" : "CC",
    "Date" : "20161013"
    },
    {
        "Project_Task_id": "0000001202",
        "Timesheet_Id": "MYTIME_V1_20161009",
        "End_Time": "080000",
        "Start_Time": "070000",
        "Time_Type_Id": "0800",
        "Activity_Description": "",
        "Employee_Id": "1000001",
        "StatusId": "2",
        "Actual_Hours": "8.000",
        "Id": "MYTIME_V1_1209_1",
        "Project_Task_Type": "CC",
        "Date": "20161014"
        },
    {
        "Project_Task_id": "0000001202",
        "Timesheet_Id": "MYTIME_V1_20161009",
        "End_Time": "080000",
        "Start_Time": "070000",
        "Time_Type_Id": "0800",
        "Activity_Description": "",
        "Employee_Id": "1000001",
        "StatusId": "2",
        "Actual_Hours": "8.000",
        "Id": "MYTIME_V1_1209_1",
        "Project_Task_Type": "CC",
        "Date": "20161015"
    },
    {
        "Project_Task_id": "0000001202",
        "Timesheet_Id": "MYTIME_V1_20161016",
        "End_Time": "080000",
        "Start_Time": "070000",
        "Time_Type_Id": "0800",
        "Activity_Description": "",
        "Employee_Id": "1000001",
        "StatusId": "2",
        "Actual_Hours": "8.000",
        "Id": "MYTIME_V1_1209_1",
        "Project_Task_Type": "CC",
        "Date": "20161016"
    },
    {
        "Project_Task_id": "0000001202",
        "Timesheet_Id": "MYTIME_V1_20161016",
        "End_Time": "080000",
        "Start_Time": "070000",
        "Time_Type_Id": "0800",
        "Activity_Description": "",
        "Employee_Id": "1000001",
        "StatusId": "2",
        "Actual_Hours": "8.000",
        "Id": "MYTIME_V1_1209_1",
        "Project_Task_Type": "CC",
        "Date": "20161017"
    },
    {
        "Project_Task_id": "0000001202",
        "Timesheet_Id": "MYTIME_V1_20161016",
        "End_Time": "080000",
        "Start_Time": "070000",
        "Time_Type_Id": "0800",
        "Activity_Description": "",
        "Employee_Id": "1000001",
        "StatusId": "2",
        "Actual_Hours": "8.000",
        "Id": "MYTIME_V1_1209_1",
        "Project_Task_Type": "CC",
        "Date": "20161018"
    },
]
}
Output
{"Timesheet" : [
     {
        "Employee_Id": "1000001",
        "Id": " MYTIME_V1_1209_1",
        "Start_Date": "20161012",
        "End_Date": "20161015",
        "Total_Hours": "32.000"
    },
    {
        "Employee_Id": "1000001",
        "Id": " MYTIME_V1_1209_1",
        "Start_Date": "20161016",
        "End_Date": "20161018",
        "Total_Hours": "24.000"
    }
]}
Mapping
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
    <create-group inputpath="Time_Entry" output="$vars" outputpath="TimeEntryGroup">                            
        <group-key inputpath="Timesheet_Id"/>                    
    </create-group>
    <map outputpath="Timesheets" input="$vars" inputpath="TimeEntryGroup">
        <set-param outputpath="Timesheet_Id" inputpath="Timesheet_Id"/>
        <set-param outputpath="Start_Date" input="99999999"/>
        <set-param outputpath="End_Date" input="-1"/>
        <map outputpath="" inputpath="rows">
            <set-param outputpath="Employee_Id" inputpath="Employee_Id"/>
            <set-param outputpath="Id" inputpath="Id" />
            <exec-function name="voltmx.logical:min" outputpath="Start_Date">
                <set-arg name="arg1" inputpath="Date" />
                <set-arg name="arg2" inputpath="Start_Date" input="$current-output"/>
            </exec-function>
            <exec-function name="voltmx.logical:max" outputpath="End_Date">
                <set-arg name="arg1" inputpath="Date" />
                <set-arg name="arg2" inputpath="End_Date" input="$current-output"/>
            </exec-function>
            <exec-function name="voltmx.logical:sum" outputpath="Total_Hours">
                <set-arg name="arg1" inputpath="Actual_Hours" />
                <set-arg name="arg2" inputpath="Total_Hours" input="$current-output"/>
            </exec-function>
        </map>
    </map>

</mapper>

Look-up Support in Mapper

Look-up support in mapper helps you combine two parallel objects and generate a common object depending upon the key. For example, the user wants to combine two parallel objects Customers and Orders with one or more fields in common and to generate a common object depending upon the key.

  • Input object:
    • Customers – Id, Name, Phone
    • Orders – OrderId, CustomerId, ProductId, Quantity
      In above objects, the Id of Customers and the CustomerId of Orders are same.
  • Output object:
    • CustomerOrders – OrderId, CustomerName, Phone, ProductId, Quantity

Examples for Look-up Support in Mapper

  • LookupMappingWithMultiplePrimaryKey
Input
 {
    "Customers": [
        {
            "Id": "101",
            "Domain": "Finance",
            "Name": "Customer1",
            "Phone": "12345"
        },
        {
            "Id": "102",
            "Domain": "Healthcare",
            "Name": "Customer2",
            "Phone": "12346"
        }
    ],
    "Orders": [
        {
            "CustomerId": "101",
            "OrderDomain": "Finance",
            "OrderId": "111",
            "ProductId": "Product1",
            "Quantity": "5"
        },
        {
            "CustomerId": "102",
            "OrderDomain": "Healthcare",
            "OrderId": "222",
            "ProductId": "Product2",
            "Quantity": "6"
        }
    ]
}
Output
 {
    "CustomerOrders": [
        {
            "OrderId": "111",
            "CustomerName": "Customer1",
            "Phone": "12345",
            "ProductId": "Product1",
            "Quantity": "5"
        },
        {
            "OrderId": "222",
            "CustomerName": "Customer2",
            "Phone": "12346",
            "ProductId": "Product2",
            "Quantity": "6"
        }
    ]
}
Mapping
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<create-lookup>
<lookup-key inputpath="Id"/>
<lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
        <set-param outputpath="OrderId" inputpath="OrderId" />
        <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
            <lookup-key inputpath="CustomerId" />
            <lookup-key inputpath="OrderDomain" />
        </lookup>
        <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
        <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
        <set-param outputpath="ProductId" inputpath="ProductId" />
        <set-param outputpath="Quantity" inputpath="Quantity" />
</map>
</map>
</mapper>
  • LookupMappingWithOnePrimaryKey
Input
 {
    "Customers": [
        {
            "Id": "101",
            "Name": "Customer1",
            "Phone": "12345"
        },
        {
            "Id": "102",
            "Name": "Customer2",
            "Phone": "12346"
        }
    ],
    "Orders": [
        {
            "CustomerId": "101",
            "OrderId": "111",
            "ProductId": "Product1",
            "Quantity": "5"
        },
        {
            "CustomerId": "102",
            "OrderId": "222",
            "ProductId": "Product2",
            "Quantity": "6"
        }
    ]
}
Output
 {
    "CustomerOrders": [
        {
            "OrderId": "111",
            "CustomerName": "Customer1",
            "Phone": "12345",
            "ProductId": "Product1",
            "Quantity": "5"
        },
        {
            "OrderId": "222",
            "CustomerName": "Customer2",
            "Phone": "12346",
            "ProductId": "Product2",
            "Quantity": "6"
        }
    ]
}
Mapping
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<create-lookup>
<lookup-key inputpath="Id"/>
<lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
        <set-param outputpath="OrderId" inputpath="OrderId" />
        <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
            <lookup-key inputpath="CustomerId" />
            <lookup-key inputpath="OrderDomain" />
        </lookup>
        <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
        <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
        <set-param outputpath="ProductId" inputpath="ProductId" />
        <set-param outputpath="Quantity" inputpath="Quantity" />
</map>
</map>
</mapper>
  • LookupMappingWhenPrimaryKeyNotFoundInChild
Input
 {
    "Customers": [
        {
            "Id": "101",
            "Name": "Customer1",
            "Phone": "12345"
        },
        {
            "Id": "102",
            "Name": "Customer2",
            "Phone": "12346"
        },
        {
            "Id": "103",
            "Name": "Customer3",
            "Phone": "12347"
        }
    ],
    "Orders": [
        {
            "CustomerId": "101",
            "OrderId": "111",
            "ProductId": "Product1",
            "Quantity": "5"
        },
        {
            "CustomerId": "102",
            "OrderId": "222",
            "ProductId": "Product2",
            "Quantity": "6"
        }
    ]
}
Output
 {
    "CustomerOrders": [
        {
            "OrderId": "111",
            "CustomerName": "Customer1",
            "Phone": "12345",
            "ProductId": "Product1",
            "Quantity": "5"
        },
        {
            "OrderId": "222",
            "CustomerName": "Customer2",
            "Phone": "12346",
            "ProductId": "Product2",
            "Quantity": "6"
        }
    ]
}
Mapping
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<create-lookup>
<lookup-key inputpath="Id"/>
<lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
        <set-param outputpath="OrderId" inputpath="OrderId" />
        <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
            <lookup-key inputpath="CustomerId" />
            <lookup-key inputpath="OrderDomain" />
        </lookup>
        <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
        <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
        <set-param outputpath="ProductId" inputpath="ProductId" />
        <set-param outputpath="Quantity" inputpath="Quantity" />
</map>
</map>
</mapper>
  • LookupMappingWhenPrimaryKeyNotFoundInParent
Input
 {
    "Customers": [
        {
            "Id": "101",
            "Name": "Customer1",
            "Phone": "12345"
        },
        {
            "Id": "102",
            "Name": "Customer2",
            "Phone": "12346"
        }
    ],
    "Orders": [
        {
            "CustomerId": "101",
            "OrderId": "111",
            "ProductId": "Product1",
            "Quantity": "5"
        },
        {
            "CustomerId": "102",
            "OrderId": "222",
            "ProductId": "Product2",
            "Quantity": "6"
        },
        {
            "CustomerId": "103",
            "OrderId": "333",
            "ProductId": "Product3",
            "Quantity": "7"
        }
    ]
}
Output
 {
    "CustomerOrders": [
        {
            "OrderId": "111",
            "CustomerName": "Customer1",
            "Phone": "12345",
            "ProductId": "Product1",
            "Quantity": "5"
        },
        {
            "OrderId": "222",
            "CustomerName": "Customer2",
            "Phone": "12346",
            "ProductId": "Product2",
            "Quantity": "6"
        },
        {
            "OrderId": "333",
            "ProductId": "Product3",
            "Quantity": "7"
        }
    ]
}
Mapping
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
<create-lookup>
<lookup-key inputpath="Id"/>
<lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
        <set-param outputpath="OrderId" inputpath="OrderId" />
        <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
            <lookup-key inputpath="CustomerId" />
            <lookup-key inputpath="OrderDomain" />
        </lookup>
        <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
        <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
        <set-param outputpath="ProductId" inputpath="ProductId" />
        <set-param outputpath="Quantity" inputpath="Quantity" />
</map>
</map>
</mapper>

JavaScript Support in Mapper

JavaScript support in mapper helps you write JavaScript code to manipulate return values into the format that is expected from the app data model, or manipulate input values from the app data model into back-end LOB. You can use JavaScript support in mapper based on the following scenarios:

  • LOB returns data in one format (such as dates, currency, arrays) and an App Data model expects the data in another format.
  • Attributes returned from LOB either to be clubbed or split before assigning the attributes to an App Data model.

To enable JavaScript support in mapper, you need to write standalone JavaScript code snippets in mapper. Each standalone JavaScript snippet should be self-contained code and not dependent on other JavaScript files. JavaScript snippets can have multiple functions. A standalone JS snippet must be written HTML CDATA. ECMA 5.1 standard is supported JavaScript.

Important: In the Methods tab, Request Mapping tab, and Response Mapping tab, click the Validate button to validate whether the XML is proper. The action does not validate the JavaScript snippet code.

JavaScript Snippet Rules

  • The Function element can occur zero or more times as a child element to the mapper element.
  • The JavaScript element must occur one time only as a child element to the Function element.
  • Set-arg and Script elements can occur as child elements to the JavaScript element.
    • The Set-arg element is optional, and can occur zero or more times. The element is a parameter for JS snippet.

      For example:

      <set-arg name="firstName" inputpath="FirstName" />
      • inputpath - A field in LOB data
      • name - A JavaScript function argument that holds a field of LOB data.
  • The Script element is mandatory and must occur only once. The JavaScript snippet should be written in the CDATA section of the element.
  • The Exec-function element invokes the JavaScript function. The exec-function name and function name should match.

Sample JavaScript

Sample JavaScript Use Case

  • LOB data has the following attributes:
    • FirstName (for example, Bill)
    • MiddleName (for example, Tom)
    • LastName (for example, Sam)
  • App Model Object has the following attributes:
    • FirstName (for example, Bill)
    • MiddleName (for example, Tom)
    • LastName (for example, Sam)
    • FullName

      The FullName attribute is derived from FirstName, MiddleName and LastName - for example, FullName = FirstName + MiddlName + first letter of LastName + “. “


      The result: Bill Tom S.

Sample JavaScript mapping.xml

The following sample mapping.xml contains JavaScript code can be used as a reference. The following highlighted XML code shows how JavaScript code can be written and used to achieve the scenario.

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapper xmlns="http://www.voltmx.com/ns/mapper">
    <function name="NameConcat">
        <javascript outputpath="FullName">
            <set-arg name="firstName" inputpath="FirstName" />
            <set-arg name="middleName" inputpath="MiddleName" />
            <set-arg name="lastName" inputpath="LastName" />
            <script>
            <![CDATA[
              function concat(){
               var result = firstName+' '+ middleName + ' '+lastName.substring(0, 1).toUpperCase() + '. '
                return result;
                }
               concat();
             ]]>
            </script>
        </javascript>
    </function>
    <create-lookup>
<lookup-key inputpath="Id"/>
<lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
        <set-param outputpath="OrderId" inputpath="OrderId" />
        <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
            <lookup-key inputpath="CustomerId" />
            <lookup-key inputpath="OrderDomain" />
        </lookup>
        <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
        <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
        <set-param outputpath="ProductId" inputpath="ProductId" />
        <set-param outputpath="Quantity" inputpath="Quantity" />
</map>
</map>
</mapper>


Examples for JavaScript Support in Mapper

  • SimpleJSFunction
  • Input
     {
        "Person": [
            {
                "Id": "1021",
                "FirstName": "bill",
                "MiddleName": "tom",
                "LastName": "sam"
            }
        ]
    }
    Output
    {
        "PersonInfo": [
            {
                "Id": "1021",
                "FullName": "bill T. sam"
            }
        ]
    }
    Mapping
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <mapper xmlns="http://www.voltmx.com/ns/mapper">
        <function name="NameConcat">
            <javascript outputpath="FullName">
                <set-arg name="firstName" inputpath="FirstName" />
                <set-arg name="middleName" inputpath="MiddleName" />
                <set-arg name="lastName" inputpath="LastName" />
                <script>
                        <![CDATA[
                              function concat(){
                                 var result = firstName +' ' + middleName.substring(0, 1).toUpperCase() + '. ' + lastName
                                 return result;
                              }
                              concat();
                        ]]>
                </script>
            </javascript>
        </function>
    <create-lookup>
    <lookup-key inputpath="Id"/>
    <lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
    <set-param outputpath="OrderId" inputpath="OrderId" />
    <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
    <lookup-key inputpath="CustomerId" />
    <lookup-key inputpath="OrderDomain" />
    </lookup>
    <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
    <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
    <set-param outputpath="ProductId" inputpath="ProductId" />
    <set-param outputpath="Quantity" inputpath="Quantity" />
    </map>
    </map>
    </mapper>
  • MixedFunctions
  • Input
     {
        "A": [
            {
                "FirstName": "bill",
                "MiddleName": "tom",
                "LastName": "sam"
            }
        ]
    }
    Output
     {
        "A": [
            {
                "Q1": "bill-tom-sam",
                "NameInUpperCase": "BILL-TOM-SAM"
            }
        ]
    }
    Mapping
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <mapper xmlns="http://www.voltmx.com/ns/mapper">
        <function name="DisplayInUpperCase">
            <javascript outputpath="NameInUpperCase">
                <set-arg name="firstName" inputpath="FirstName" />
                <set-arg name="middleName" inputpath="MiddleName" />
                <set-arg name="lastName" inputpath="LastName" />
                <script>
                    <![CDATA[
                       function convertToUppercase(){
                          var result = firstName + '-'+ middleName +'-'+ lastName;
                          return result.toUpperCase();
                       }
                       convertToUppercase();
                    ]]>
                 </script>
            </javascript>
        </function>
    <create-lookup>
    <lookup-key inputpath="Id"/>
    <lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
    <set-param outputpath="OrderId" inputpath="OrderId" />
    <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
    <lookup-key inputpath="CustomerId" />
    <lookup-key inputpath="OrderDomain" />
    </lookup>
    <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
            <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
    <set-param outputpath="ProductId" inputpath="ProductId" />
    <set-param outputpath="Quantity" inputpath="Quantity" />
    </map>
    </map>
    </mapper>
  • JSFunctionWithZeroInputs
  • Input
     {
        "Person": [
            {
                "Id": "1021"
            }
        ]
    }
    Output
     {
        "PersonInfo": [
            {
                "Id": "1021",
                "Name": "Bill Tom Sam"
            }
        ]
    }
    Mapping
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <mapper xmlns="http://www.voltmx.com/ns/mapper">
        <function name="GiveSomeText">
            <javascript outputpath="Name">
                <script>
                   <![CDATA[
                     function concat(){
                        return 'Bill Tom Sam';
                     }
                     concat();
                   ]]>
              </script>
            </javascript>
        </function>
        <create-lookup>
    <lookup-key inputpath="Id"/>
    <lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
    <set-param outputpath="OrderId" inputpath="OrderId" />
    <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
    <lookup-key inputpath="CustomerId" />
    <lookup-key inputpath="OrderDomain" />
    </lookup>
    <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
    <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
    <set-param outputpath="ProductId" inputpath="ProductId" />
    <set-param outputpath="Quantity" inputpath="Quantity" />
    </map>
    </map>
    </mapper>
  • JSCodeNotAvailable
  • Input
     {
        "Person": [
            {
                "Id": "1021"
            }
        ]
    }
    Output
     {
        "PersonInfo": [
            {
                "Id": "1021",
                "Name": ""
            }
        ]
    }
    Mapping
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <mapper xmlns="http://www.voltmx.com/ns/mapper">
        <function name="someText">
            <javascript outputpath="Name">
            <script>
                   <![CDATA[
                          -
                        ]]>
            </script>
            </javascript>
        </function>
        <create-lookup>
    <lookup-key inputpath="Id"/>
    <lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
    <set-param outputpath="OrderId" inputpath="OrderId" />
    <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
    <lookup-key inputpath="CustomerId" />
    <lookup-key inputpath="OrderDomain" />
    </lookup>
    <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
            <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
    <set-param outputpath="ProductId" inputpath="ProductId" />
    <set-param outputpath="Quantity" inputpath="Quantity" />
    </map>
    </map>
    </mapper>
  • MapperExceptionWhenScriptTagMissedInJS
  • Input
     {
        "Person": [
            {
                "Id": "1021"
            }
        ]
    }
    Output null script
    Mapping
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <mapper xmlns="http://www.voltmx.com/ns/mapper">
        <function name="someText">
            <javascript>
               <![CDATA[
                 function concat(){
                    return NoElement.text;
                 }
                 concat();
               ]]>
            </javascript>
        </function>
        <create-lookup>
    <lookup-key inputpath="Id"/>
    <lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
    <set-param outputpath="OrderId" inputpath="OrderId" />
    <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
    <lookup-key inputpath="CustomerId" />
    <lookup-key inputpath="OrderDomain" />
    </lookup>
    <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
            <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
    <set-param outputpath="ProductId" inputpath="ProductId" />
    <set-param outputpath="Quantity" inputpath="Quantity" />
    </map>
    </map>
    </mapper>
  • MapperExceptionForErrorProneJS
  • Input
    {
        "Person": [
            {
                "Id": "1021"
            }
        ]
    }
    Output
    sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "NoElement" is not defined. (<Unknown source>#5) in <Unknown source> at line number 5
    Mapping
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <mapper xmlns="http://www.voltmx.com/ns/mapper">
        <function name="someText">
            <javascript>
            <script>
               <![CDATA[
                 function concat(){
                    return NoElement.text;
                 }
                 concat();
               ]]>
              </script>
            </javascript>
        </function>
        <create-lookup>
    <lookup-key inputpath="Id"/>
    <lookup-key inputpath="Domain"/>
    </create-lookup>
    <map inputpath="response_in" outputpath="response_out">
    <map outputpath="CustomerOrders" inputpath="Orders">
    <set-param outputpath="OrderId" inputpath="OrderId" />
    <lookup input="$vars" inputpath="customerMap" outputpath="customerRef" output="$vars">
    <lookup-key inputpath="CustomerId" />
    <lookup-key inputpath="OrderDomain" />
    </lookup>
    <set-param outputpath="CustomerName" inputpath="$vars/customerRef/Name" />
            <set-param outputpath="Phone" inputpath="$vars/customerRef/Phone" />
    <set-param outputpath="ProductId" inputpath="ProductId" />
    <set-param outputpath="Quantity" inputpath="Quantity" />
    </map>
    </map>
    </mapper>