cancel
Showing results for 
Search instead for 
Did you mean: 

Suggestion for Mapping logic needed

Former Member
0 Kudos

Hi

I have a condition were in if a field value is A1 i should pass it as 01 to target and if its A2 i should pass it as 02 to target side..

We can do it using fixed valued fn..But if the field value is anything othet than A1 or A2 what ever comes it has to be passed over unchanged..

How to get it..Do we need a UDF or standrd fns can do it?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

In addition to the above suggestions. Chk this also:

if(var.equals("a1"))

{

return "01";

}

else if (var.equals("a2"))

{

return "02";

}

else

{

return var;

}

Thanks

Amit

Former Member
0 Kudos

Hi Amit and Prabhas,

I think its best to go with Fix value as its a very simple and ideal case for Fix value.

Also, lets say in future you get a requirement to add one more mapping then you will to change the java code again (not advisable and needed).

Former Member
0 Kudos

Hi Puneet,

Thats why i have mentioned in the first line : " In addition to the above suggestion"

And its always good to go for standard functionalities ...i have just mentioned an extra solution to avail...

Thanks

Amit

Former Member
0 Kudos

Hi,

Its one of the common requirement in mapping.

Use Fixed value and to handle the requirement of anything other than A1 or A2: Failure Behavior in FIX values (in the top part of fix value window) just select the option "Use key"..it will take care

stefan_grube
Active Contributor
0 Kudos

In "fixed value" you can set default value to source field.

Former Member
0 Kudos

Sorry frnds i didtn get it.. i see a Deafult tab at the top of function.. What should i fill in there.?

Former Member
0 Kudos

right below the default value there are 3 radio buttons for Failure Behavior ..just check the "Use key" one..

Actually thats where we ask PI mapping how to react if none of the mappings in the fix value satisfies the condtion.

We will have 3 option then:

1. Default value: which we can provide there

2. Use key: pass whatever is coming in the source

3. Throw exception.

Edited by: Puneet Singhal on Mar 7, 2011 11:47 AM

Former Member
0 Kudos

Hi Puneet,

I am working on 7.0 i dont see any check buttons?

under default

i can see Key Value

Key1 Value1

Edited by: prabhas465 on Mar 7, 2011 12:10 PM

Former Member
0 Kudos

Hi Prabhas,

If you select the FixValues function from Convesion and double click on it, the following options should be visible:

1.Default Value: (not required in your scenario)

2.Behaviour if Lookup Fails: (Options in round check button are)

a) Use Key - - - select this option

b) Use Default Value (picks value from point 1) - - - not required in your scenario

c) Throw Exception - - - not required in your scenario

3. Value to be entered with + addition and - deletion button for entries

key value

A1 01

A2 02

Hope this helps.

Regards,

Souvik