on 11-10-2015 11:12 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Apu,
I get the following error in UDF.
Source text of object Message Mapping: MM | http://my302069.crm.ondemand.com has syntax errors: |
Mapping:
E1KNVPM =>UDF=> PartnerFunction
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
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.