cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Default value in receiving element

glenn_karlsson2
Participant
0 Likes
636

Hi all,

I have a need to map to a structure which have a "tagname" inside the element.

I map for example a phone number to an element and the receiving value should be "TelephoneNumber = 0345335454"

My first thought was to create a phone number datatype with two sub elements, like Tag and Value and in the data type definition somehow default the Tag value to "TelephoneNumber = " so that i didn´t have to map it at all in the message mapping.

Is that even possible?

Or are there any other ways to do it? I would like to be able to not have the need for mapping a value in message mapping (not even a constant), but use a default from the datatype.

kind regards,

Glenn

View Entire Topic
glenn_karlsson2
Participant
0 Likes

Hi all,

Apparently I have a problem stating my needs

I want to be able to create a target data strucure that when I map a value to a element I will include a "prefix" to the value, without the need to map the prefix.

I could of course do a concat in the graphical mapping so that I concat "TelephoneNumber = " and the source value "1234567" to create target value "TelephoneNumber = 1234567".

But the way I want it is to just map the actual phone number and get the prefix "for free". To clarify, the "TelephoneNumber = " -part is not the element name, but part of the element value.

Like this: <TelephoneNumber>TelephoneNumber = 1234567</TelephoneNumber>. Is that possible? I would like to be able to create the single elements as their own data type for reuse purposes.

kind regards,

Glenn

anupam_ghosh2
Active Contributor
0 Likes

Hi Glenn,

I don't think this can be achieved without concatenating individually the field names along with their values. The method you have already explained yourself. In case you need for all fields respective field names to be concatenated with their field values in a generic manner then this is possible using java mapping. The java mapping would traverse the entire source xml and add the required prefix for each of the field.Thus you get everything in target XML as per your requirement. For this you need a mapping.

regards

Anupam

Former Member
0 Likes

Hi,

In graphics mapping it can be handled easily, Still you donot want to do it.

make java mapping based on the element name. use it in interface mapping.

Regards,

N.Gunaseelan