cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping problem

Former Member
0 Kudos

Hi PI Experts,

There are two different elements (1...unbounded) on the source side which have to be mapped to the same element (1...unbounded) on the receiver side. How do i achieve this in mapping ?

For example,

I want to achieve the following through mapping:

Source Message Structure is:

Detail1 (element 1... to unbounded)

Name (subelement 1)

Age (subelement 1)

Detail2 (element 1... to unbounded)

Name (subelement 1)

ID (subelement 1)

Target message Structure is:

Details (element 1... to unbounded)

Name (subelement 0..1)

Age (subelement 0..1)

ID (subelement 0..1)

How to do this mapping in PI ?

Regards, Gaurav.

Accepted Solutions (0)

Answers (2)

Answers (2)

rajasekhar_reddy14
Active Contributor
0 Kudos

Create target element once again,like right click on target elemebt select duplicate structure, that means now you have two same elements in target, juts map it.,

Regards,

raj

stefan_grube
Active Contributor
0 Kudos

> There are two different elements (1...unbounded) on the source side

Are the elements linked? Is the order the same?

Former Member
0 Kudos

Hi Stefan,

The elements are not linked. The order of the elements is one after the other i.e. they are successive elements.

Regards, Gaurav.

stefan_grube
Active Contributor
0 Kudos

What I mean is following:

Is your structure like this.

Detail1

Name = A

Age = 10

Detail1

Name = B

Age = 11

Detail2

Name = A

ID = 123

Detail2

Name = B

ID = 456

Or could detail 1 and detail2 come in different order?

Could it happen, that a value in detail1 is not in detail2 and vice versa?

Or is not ensured that detail1 an detail2 is in exact the same order and has the same Name elements?

Former Member
0 Kudos

Hi Stefan,

My main requirement is that lets say there are 2 Detail1 entry and 3 Detail2 entry. So, for this, i should get 5 Details entry in target side.

A value in detail1 may not be in detail2 and vice versa.

Also, Detail1 and Detail2 can have same/different values.

The values inside the Detail1 and Detail2 are irrelevant during mapping.

Regards, Gaurav.

stefan_grube
Active Contributor
0 Kudos

> My main requirement is that lets say there are 2 Detail1 entry and 3 Detail2 entry. So, for this, i should get 5 Details entry in target side.

I see. Just do what Raja proposed.

Former Member
0 Kudos

If Detail1 & Detail2 are are not coming in the successive orders in source structure, then you can use sortByKey function for mapping.

-Supriya.