Skip to Content
0
Former Member
Oct 19, 2011 at 08:49 PM

Complex mapping with deep structure

10 Views

Hi all,

I need to create a complex mapping as follows:

Source message:

CreateOrder (0..1)

-sell-order (0..1)

--items-sell-order (0..1)

---items-sell-request (0..unbounded)

-


sell-discount (0..1)

-


sell-discount (0..unbounded)

-


discount-id (0..1)

-


discount-quantity (0..1)

-


description (0..1)

Target message:

MT_xxxx

-ORDER_V3 (0..1)

--TDESC (0..1)

---item (0..unbounded)

-


ITEM_NUMBER (0..1)

-


discount (0..unbounded)

-


REASON (0..1)

-


VALUE (0..1)

-


DESCRIPTION (0..1)

--TPLUGIN (0..1)

---item (0..unbounded)

-


ITEM_NUMBER (0..1)

-


discount (0..unbounded)

-


ID (0..1)

-


QUANTITY (0..1)

The mapping has some rules:

If sell-order - items-sell-order - items-sell-request - sell-discount - sell-discount - discount-id .length > 0 then the structure TPLUGIN must be filled

else

the structure TDESC must be filled

The problem is: the field ITEM_NUMBER is an index that is unique and must increment each record of node items-sell-request, and it is not mandatory an item to have discounts.

When I test with n items and all items with discount node, it works perfect. However, if I put for example 10 items in the source array, and for example the records 5 and 6 doesn't have discounts, the association item x discount makes the mapping get lost and mess all the target nodes.

Could anyone help me?

Thanks in advance.

Ricardo.