cancel
Showing results for 
Search instead for 
Did you mean: 

Need a Logic

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member184789
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

former_member184789
Active Contributor
0 Kudos

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.

Muniyappan
Active Contributor
0 Kudos

Hi,

adding to Adarsh points

you can also test the scenario in ID using Test Configuration to check if the mapping is working fine.

Regards,

Muniyappan.

Former Member
0 Kudos

Hi,

I am using Integrated configuration. when I am doing Test Configuration, It is showing error in reciever agreement. Do Test configurations works in ICU?

Thanks,

Sherwin

former_member184789
Active Contributor
0 Kudos

Hi,

If you are using an ICO you won't be able to test it in ID by Test Tools as it would give error for Receiver Agreement not found. You should run it end to end & before doing that, you might reselect your operation mapping in the ICO & activate it.

Answers (5)

Answers (5)

Former Member
0 Kudos

HI,

When I am doing End to end testing, The result is not satisfactory. I am still getting no values at the target side. The value in the market filed is still null. Please suggest.

gagandeep_batra
Active Contributor
0 Kudos

Hi Sherwin,

did you check with blank value also

means

if Source is null or source=""(blank value),

then send XXXXXX

else map to Source.

Regads

gAgan

Former Member
0 Kudos

yes, Plz see the logic below.

gagandeep_batra
Active Contributor
0 Kudos

Hi Sherwin

plz check below:

Regards

gAgan

Muniyappan
Active Contributor
0 Kudos

Hi,

are you looking for like this?

Regards,

Muniyappan.

anupam_ghosh2
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

gagandeep_batra
Active Contributor
0 Kudos

Hi Sherwin

Can you post your screen shot for refrenace?

Regards

gAgan

Former Member
0 Kudos

Hi,

Use SplitByValue before mapping to the target field.

Regards,

Veerendra.

Former Member
0 Kudos

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

praveen_sutra
Active Contributor
0 Kudos

hi Sherwin,

Hope this helps,

thanks and regards,

Praveen T

ambrish_mishra
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hello,

Use "MapWithDeafult" function.

Source -> MWD (XXXXXX) -> Target

Thanks

Amit Srivastava

Former Member
0 Kudos

HI Amit,

Thanks for the reply. It is not working as the MWD will work if the filed is null. When field is not coming, it is giving null value. I tried to use MWD as u suggested but it is not giving the desired result. Please note that the fields are mandatory(1,1 occurrence).

Thanks,

Sherwin

Former Member
0 Kudos

Hello,

>>When field is not coming, it is giving null value

Is it possible for u to paste ur mapping screenshot with display queue output?

Thanks

Amit Srivastava

PeterJonker
Active Contributor
0 Kudos

That is strange it should work also when tag is not coming (null or not exist). I use it many times like that and it works (otherwise the mapping will go in error if it would not work)

I think something else must be wrong and NOT the MWD function.

Former Member
0 Kudos

Hi Sherwin,

MWD does not work if context is raised to higher hierarchy, Share screenshot of Display queue on the MWD function.

Regards,

Pranav

ambrish_mishra
Active Contributor
0 Kudos

Adding to what Ram mentioned, keep the context to a lower level and then use remove context if need be...

Ambrish