cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping Design Question

Former Member
0 Kudos

Hi All,

I have a Java mapping requrement for which I would like some suggestions.

I have 3 variables:

     1) price

     2) price factor

     3) pricing condition

There is already quite a bit of logic determining these.

The new requirement is that if the price has a precision greater than 2 (eg 1.234 but not 1.23) then:

     1) set price = price * 10

     2) set price factor = 10

     3) set pricing condition = "ZMPE"

Since it is unclear to me that there is an easy way to modify the current logic, I would rather try to take the current output for these 3 variables and override their values in the way described above. (I did try modifying the current logic but I have found it gave me problems.)

So is there a simple way that I can take the current values and override them in the way described. For instance can I do this with a single User Defined Function.

Thanks in advance.

Cheers

Gerard

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

I think, u can do it.

BTW, i believe u are using graphical mapping? right?

So what u can do is, create a UDF having 3 inputs (Price, Price Factor and PricingConditions) and 3 outputs (3 Results) and inside ur udf evaluate conditions.

For instance if the number of digits after decimal is greater than 2 then output ur new values otherwise (in the else block) pass the input (which is nothing but your current output) as the output of ur UDF.

Just to add, the input to ur UDF will be ur current output.

Thanks

Amit Srivastava

Former Member
0 Kudos


Hi Amit,

Thanks for your answer.

I think I can see how you could have a User Defined Function with 3 inputs but how do you have 3 outputs? That is my problem. It seems that the output of a UDF is always a single String.

Cheers

Gerard

former_member184720
Active Contributor
0 Kudos

Hi Gerard - Please check the below screenshot.. (just change the type to result so that it'll be your output parameter.)

edited : removed "remove context"

Former Member
0 Kudos

Hello,

As already suggested above, add 3 ResultList type variables - one for each output.

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit,

I think your answer solves my problem. (Sorry I am new to UDFs).

(I am also new to this forum. So I hope my marking your answer as correct is the correct procedure.)

Thanks

Gerard

Former Member
0 Kudos

Hi Hareesh,

Thanks for all the detail you have put into this.

Cheers

Gerard

Answers (0)