cancel
Showing results for 
Search instead for 
Did you mean: 

Help Message Mapping

Former Member
0 Kudos

Hi for all, i have the message 1 and parameter input of type integer named p_index

The Message 1 have following structure:

<Message>

<item>

<key>A</key>

<value>Auto</value>

</item>

<item>

<key>M</key>

<value>Manual</value>

</item>

</Message>

The objective is use the parameter p_index for retrieve the value of the field key of the node item with position p_index. For example: p_index is equal to 1 the key value is M or p_index is equal to 0 the key value is A.

Thanks for the help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

not sure if i understood ur Q correctly or not??

but i guess u r passing parameter (under signature tab) and based upon that parameter value u want to fetch the "Key" filed value from the source payload...

if yes then u can use CopValue function (under constants)..

Key----CopyValue( click on the drop down and select ur parameter) -


target

Former Member
0 Kudos

Hello, the problem is that the function copyValue receives only parameters of type String and the parameter that I have defined in the Signature Tab is integer. There is another solution?

anjaneya_bhardwaj2
Contributor
0 Kudos

Not sure if we have a standard function there if not write a user defined function and use the toString function of java to convert it to string ...

Former Member
0 Kudos

Hi, for all, my solution is create the following UDF:

public void getValueByPosition(String[] var, int index, ResultList result, Container container) throws StreamTransformationException{
    result.addValue(var[index]);
}

And message mapping is:

key (Source) --> removeContexts --> getValueByPosition (with parameter p_index of the signature tab) --> key (Target)

Thanks.