on 09-18-2013 5:32 PM
I have a source with a node and sub node under it and mapped as follows :
Here for all the source fields I have chnaged the context to 'Test_source_msg'.
But when Iam not getting results as expected.
I want 'tg_fld1' to have value 'A'.
If you see in the first instance I don't have subnode present, I can have cases where sub node can not be present entirely. I think this is causing the issue when I debug.
I'm not comfortable with Java, I want to do this with mapping instead on UDF.
Thanks in advance.
Hi,
no sure i got your question.
try below one if it works for you.
Pass some dummy value like"NA" when sub_src_fld is not coming.
create two udfs. udf is for tg_fld1. udf1 is for tg_fld2.
pass two values to udf.
src_fld-->var1
sub_src_fld-->var2
change the execution type as All values of Queue.
use below code for udfs.
code for UDF.
for(int i = 0; i<var1.length;i++)
{
if(var1[i].equals("A"))
{
if (var2[i].equals("NA"))
result.addValue("");
else
result.addValue(var2[i]);
}
}
Code for UDF1
for(int i = 0; i<var1.length;i++)
{
if(var1[i].equals("Z"))
{
if (var2[i].equals("NA"))
result.addValue("");
else
result.addValue(var2[i]);
}
}
mapping test results.
Regards,
Muniyappan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.