cancel
Showing results for 
Search instead for 
Did you mean: 

PI mapping issue

former_member235717
Participant
0 Kudos

Hi All,

I'm doing a mapping where the source structure has three elements phone (Home ,Work, mobile) each having occurrence 0..1

I have created the target structure as an attribute Phone with occurrence 0- unbounded.

Please let me know the best way to map this three fields to the attribute. So based upon the input the attribute phone will repeat.

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

Hi Swetha - I don't think you can create attribute as 0..unbounded. Attribute always have two parameters(optional/mandatory).

Please share the target structure.

If you have created an element, just right click on the target element and click on duplicate subtree option then map all your 3 fields directly..

if this is not what you are looking for then please provide your mapping rules..

former_member235717
Participant
0 Kudos

Sorry for the confusion, Phone is the element for which I have created an attribute as "type".(Type will have the values "Home" , "Work" , "Mobile" based upon the input given )

Here is my source and target structure:

Source:

Phone

type="Home"

Number

Phone

type= "Work"

Number

Phone

type= "Cell"

Number

Target :

<Phone type="Home">

<Number></Number>

</Phone>

<Phone type= "Work">

<Number></Number>

</Phone>

<Phone type= "Cell">

<Number></Number>

</Phone> 

I can duplicate the tree in Data type and can map with all the three elements. But I'm looking for the target Phone to get duplicated at run time based upon the input.

For eg: If I input only Home number. target structure should appear only once. If I input Home and Cell,Target should appear twice with type 'Home" also with type "Cell".

Hope it clears!!

former_member184720
Active Contributor
0 Kudos

do not duplicate in the data type..

Duplicate the subtree in the mapping.. it'll display only once if your input is once..

Harish
Active Contributor
0 Kudos

Hi Swetha,

your target (having occurence 0..1 or 0.. unbounded) will only populated (created) when your source is populated or have data.

Hope this clear your doubt.

regards,

Harish

former_member184720
Active Contributor
0 Kudos
former_member235717
Participant
0 Kudos

It helps !! Thank you

Answers (1)

Answers (1)

Harish
Active Contributor
0 Kudos

Hi Swetha,

you can duplicate the target attribute Phone three times and map the source elements phone (Home ,Work, mobile) to each target attribute.

regards,

Harish

former_member235717
Participant
0 Kudos

But I would like to make the target element as reusable. This is the reason I have set the occurence to 0.. unbounded and declared once.

Isn't it possible to duplicate the target at run time based upon the input selection? Using mapping

former_member184720
Active Contributor
0 Kudos

How does it matter.. design time /run time??

If you want to create your own strcture dynamically then you have to go for Java mapping which is not at all required here..