on 10-14-2013 4:50 AM
Hi,
I am finding difficulty in making a logic.
The problem is I need a logic when the source field( Field A) is coming null or the source field is not coming, i want to send the dummy value "XXXXXXXXXX" to the target field B.
Thanks in advance.
Sherwin
Try this UDF:
Execution Type: All values of queue
for(int i =0;i<var1.length;i++)
{
if(var1[i] == null || var1[i].equals(ResultList.SUPPRESS) || var1[i].equals(""))
result.addValue("XXXXXXXXXX");
else
result.addValue(var1[i]);
}
Simply map the source field to this as input & output of this UDF is mapped to target.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
THank you for thr reply. I will try to use the udf. BUt My question is, If I do the end to end testing, it does not give the dummy value but if i pick the same payload and test in ESR TEST, it gives the dummy value. what is causing this..?
I have checked all the objects, config.. everything is fine..
Thanks
Sherwin
Hi,
Could you check if the Interface Determination is using this operation mapping only? You might try removing the operation mapping in Interface Determination & reselecting it & then activate the Interface Determination. Also check if there is any cache issue. Test it in operation mapping & if it works there, the only issue could be with Cache.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sherwin,
Could you please try this UDF?
public String defaultVal(String a, Container container) throws StreamTransformationException{
if(a==null || a.length()==0 || a.equals(""))
{
return "XXXXXXXXXX" ;
}
return a;
}
Connected_pole_[N]_number(source field) ------>UDF----->Connected_pole_[N]_number(Target field).
Regards
Anupam
HI,
The logic given by you guys is working when I am doing unit testing. But when I am doing End to end testing, the results are same. Target value is empty.Suppose if there are 3 fields and if value in the 1st field is not coming so i guess the value of the second field is going to 1st field and so on. please suggest.
Thanks,
Sherwin
Thank you Ambrish and Praveen. It worked.
Amit, Thanks to you to for your help. MWD was not working as it is a file scenario and sometimes out of 10 fields only 5 fields were coming, so i needed a logic when the field is not coming, I should send dummy value to the target.
Thanks,
Sherwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sherwin,
Use if then else and the logic below:
Check if Source -> MWD EQ Null, map to XXXXXX else map to Source.
This should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Use "MapWithDeafult" function.
Source -> MWD (XXXXXX) -> Target
Thanks
Amit Srivastava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.