cancel
Showing results for 
Search instead for 
Did you mean: 

How to map?

Former Member
0 Kudos

Hi all

I have my source and target xml like:

<Person>

<Gender>1</Gender>

<Surname>ABC</Surname>

</Person> </Passenger>

and target is

<Passenger>

<Title>Mr.</Title>

<Name>ABC</Name>

</Passenger>

How do i convert using Java Mapping in IR->Message mapping.

<b>If gender is 1 then Title will be Mr if it is 0 then Title will Mrs. How do i do represent the same graphically using Java Mapping</b>

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Ganesh,

I have a document that deals with this same exact scenario. Drop me a mail for the document on Java Mapping.

My mail id is in my business card.

Regards,

bhavesh

Former Member
0 Kudos

Hi Bhavesh!

Can you tell me one simple java mapping..any blog or pdf.

Thanks a lot

Former Member
0 Kudos

Hi

How to make use of that function in message mapping.

i mean how to map Gender, Title,Surname and name with our Java function.I want screenshots for developing the scenario, just you sent to me.

regards,

Ganesh

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Ganesh,

No of arguments passed in UDF is 1 i.e Gender.

Use following code in user defined function:

String Str = null;

if(Gender.equals(1))

{

Str = "Mr"

return Str;

}else

{

if(Gender.equals(0))

{

Str = "Mrs"

return Str;

}

}

Thanks,

Yaseen Mahammad

Message was edited by: Yaseen Mahammad

Message was edited by: Yaseen Mahammad

former_member187339
Active Contributor
0 Kudos

Hi,

If what you need is this

<b>

0 : Mr.

1 : Mrs.</b>

then no need for java mapping.... why are you going for that?

Instead try Constant-> FixValues in the graphical mapping. There give the above mentioned logic. And you will get the needed output.

Regards

Suraj

Former Member
0 Kudos

Thanks Suraj!

It was done, but my current requirement is i have to do with java mapping.

Thanks for a prompt reply!

Shabarish_Nair
Active Contributor
0 Kudos

try this

<gender>

constant (value is 1) use compare function in message mapping

the use a if then else and pass Mr or Mrs as required.

You can aviod any custom java func. itself

STALANKI
Active Contributor
0 Kudos

What is the need of java mapping for this?

use function fixvalue for doing thz kind of value mapping!