cancel
Showing results for 
Search instead for 
Did you mean: 

XI message mapping clarifications

Former Member
0 Kudos

Dear All

I would like to know if XI message mapping(graphical mapping) can be

used for mapping based on the order of elements given in the XML source

message.

For example I have a source message as below

Source XML:

<Source>

<givenname>Ramesh</givenname>

<givenname>Kumar</givenname>

<givenname>Ganapathy</givenname>

</Source>

semantic is first instance of <givenname> needs to be mapped <firstname> in target,

Second occurance of <givenname> needs to be mapped <secondname>,

Third occurance of <givenname> needs to be mapped <familyname>

Target XML

<Target>

<firstname>Ramesh</firstname>

<secondname>Kumar</secondname>

<familyname>Ganapathy</familyname>

</Target>

As I understand graphical mapping editor works based on Xpath

expressions, Is it possible to achieve such mapping schematics with

graphical mapping and UDF in XI.

Please note I cannot use Java, ABAP or XSLT mapping programme.

Can you provide me some hints on how to do this.

Thanks

Satish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Satish,

This functionality can be achived using simple CopyValue function.

- Map <i>givenname</i> to CopyValue with the function property set to 0. This should be mapped to <i>firstname</i>

- Map <i>givenname</i> to CopyValue with the function property set to 1. This should be mapped to <i>secondname</i>

- Map <i>givenname</i> to CopyValue with the function property set to 2. This should be mapped to <i>familyname</i>

Regards,

Keerti Nayak

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Satish,

This functionality can be achived using simple CopyValue function.

- Map <i>givenname</i> to CopyValue with the function property set to 0. This should be mapped to <i>firstname</i>

- Map <i>givenname</i> to CopyValue with the function property set to 1. This should be mapped to <i>secondname</i>

- Map <i>givenname</i> to CopyValue with the function property set to 2. This should be mapped to <i>familyname</i>

Regards,

Keerti Nayak

Former Member
0 Kudos

Hi,

You can write User defined function for this.With the help of for lop one can achieve this.

Regards

Madhu

Former Member
0 Kudos

Hi,

You can achieve this by UDF in message mapping.

see for example:

Type of UDF is queue. use three diff UDfs

input givenname -- UDF --- firstname

result.addValue(givenname(1));

input givenname -- UDF --- secondname

result.addValue(givenname(2));

input givenname -- UDF --- thirdname

result.addValue(givenname(3));

Regards

Chilla

Former Member
0 Kudos

Hi Chilla

This is how I am currently handling it. But my problem is

The number of UDF's keeps increasing if I have a fourth, fifth element to handle. I have to create new UDF for every new level added.

Is there a way I can do this with single UDF.

result.addValue(givenname(X));

X- will be the position and I can pass values as an argument to the UDF.

Again the problem here is when I have second argument to specify which value of input to pick up say for example givenname(1) or givenname(2)

The second argument expects an String[] array as argument and not string(when i assign a constant its a string).

So I cannot attach a constant to the second argument and pass the input.

Is there any functions that can return a String[] array as an output taking sting value as input.

Thanks

Satish

Former Member
0 Kudos

Hi,

Yes we have one function that is index usein that you can assign the X.

result.addValue(givenname(X));

The Second , good way , maitain the global variable as int x = 0;

so in your UDF,

result.addValue(givenname(x));

x = x + 1;

Regards

Chilla