on 07-09-2014 6:07 PM
Hi Experts,
My requirement is I will get queue of values for two source fields (Var1, Var2), when ever both are equal those many times third source field should send to target.
Attached is the image of my mapping (which is i am getting (wrong))
I tried below UDF's with execution type "All values of queue" , Please check and correct the UDF based on my below expected mapping.
UDF1: (Not working as expected)
int len = var1.length;
int key =0;
String[] finalval = new String[len];
while(key<len)
{
for(int i=0;i<var2.length;i++)
{
if(var1[key].equals(var2[i]))
result.addValue(var3[i]);
}
key++;
}
UDF2: (Not expected as expecting)
int a=var1.length;
int b= var2.length;
for(int i=0;i<a;i++)
{
for(int j=0;j<b;j++)
{
if(var2[j].equals(var1i )) ("i" is under square brackets)
{
result.addValue(var3[j]);
}
}
}
Attached is the image of my mapping (which is i am expecting (If i pass same values two times i am getting this, But expected source values are different))
Thanks & Regards,
A.Neelima.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amol,
Thanks for your reply.
Its not working, I am getting same output.
As shown in your disply list: Pass the below values and see the output.
My requirement is : (I am comparing both in0 and in1 and when ever those are equal i am passing the in2 value to result, in below example its two times equal (3 and 4)).
in0:
3
4
in1:
1
2
3
4
in2:
GL
COST
GL
COST
Now you will get output as below by using all the UDF's mentioned in chain.
out:
GL
COST.
But i am expecting output as below : (I am comparing both in0 and in1 and when ever those are equal i am passing the in2 value to result, in our example its two times equal (3 and 4)).
out:
GL
COST
GL
COST
Thanks & Regards,
A.Neelima.
>>>But i am expecting output as below : (I am comparing both in0 and in1 and when ever those are equal i am passing the in2 value to result, in our example its two times equal (3 and 4)).
Your requirement is a bit unclear. What do you mean by passing in2 value to result when they are equal?
If there is a match then you want to return all the values of in2?
for the below input, what is the expected output and what basis?
in0:
3
4
in1:
1
2
3
4
in2:
a
b
c
d
I will explain my requirement again.
Source structure:
ST
--->GenericLineItem
--> AccountNumber
-->LineItemRefNum
-->Value
--->AllocationLineDetails
--->AccountNumber
Target Structure
TT
---> ZORDETAIL
-->Cost
My mapping logic for target node Cost is , it will compare AccounNumber under AllocationLineDetails and GenericLineItem if its equal value under LineItemRefNum will be passed. If its single value means my UDF is working, I will get multiple contexts from source (Duplicate sub trees) here i am facing problem. Hope its clear now Thanks & Regards,A.Neelima.User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.