cancel
Showing results for 
Search instead for 
Did you mean: 

HCI : Duplicate Target Nodes

former_member192561
Participant
0 Kudos

Hi ,

I'm looking for solution to duplicate the target nodes in HCI mapping. I have a single source node which is mapped to target node which has cardinality 1...n . This target node should be created multiple times with different values as described below:

Current Mapping:

E1KNVPM  is mapped to node PartnerFunction.   Based on the occurrences of  E1KNVPM , node PartnerFunction is created. my requirement is that when the source node appears once, I need target node PartnerFunction to appear 15 times.  for the value in the Source code , I could use the value mapping as below.

Required Mapping:

My Source:

<E1KNVPM>

<PARVW>YES</PARVW>

<E1KNVPM/>

Target:

<PartnerFunction>

<CategoryCode>RE</CategoryCode>

<Partner>

</PartnerFunction>

<PartnerFunction>

<CategoryCode>WE</CategoryCode>

</PartnerFunction>

<PartnerFunction>

<CategoryCode>PY</CategoryCode>

</PartnerFunction>

.

.

.

.

.

..

.

<PartnerFunction>

<CategoryCode>SH</CategoryCode>

</PartnerFunction>

Value Mapping in HCI:

Source  : 1

target   : RE

Source : 2

target : WE

.

.

.

.

.

.

Source : 15

target :SH

Regards,

Amber Badam

Accepted Solutions (1)

Accepted Solutions (1)

apu_das2
Active Contributor
0 Kudos

Hi,

You can easily achieve this by writing an UDF. Please find the sample UDF -

int b=Integer.parseInt(a[0]);

for (int i=0;i<b;i++)

{

String s=String.valueOf(i);

result.addValue(s);

r1.addValue(arr[i]);

r2.addValue(arr2[i]);

}

Thanks,

Apu

former_member192561
Participant
0 Kudos

Hi Apu,

Thank you. To my knolwedge we cannot use UDF in HCI.

I think you mean to write a UDF in PI and import it to HCI. Do you know, how to import the UDF from PI to HCI ?

Regards,

Amber Badam

apu_das2
Active Contributor
0 Kudos

Hi,

You need to change the UDF as per your requirement.

Do it like that-

E1KNVPM-> Count=>UDF => PartnerFunction

                     => Split By value => CategoryCode

Your UDF will have two result List

result - For PartnerFunction generation

r1 - For CategoryCode generation

UDF-

String arr[] = new String[15];

arr[0] = "RE";

arr[1] = "WE";

.

.

.

arr[14] = "PY";

int b=Integer.parseInt(a[0]);

if (b == 1)

{

for (int i=0;i<15;i++)

{

String s=String.valueOf(i);

result.addValue(s);

r1.addValue(arr[i]);

}

}

Thanks,

Apu

former_member192561
Participant
0 Kudos

Thank you. it worked.

Answers (0)