cancel
Showing results for 
Search instead for 
Did you mean: 

Need to Remove a Null Value from Context.

Former Member
0 Kudos

Hi,

I am getting a output of my udf as below:

But when I am running the Test tab I am getting the error:

Cannot create target element /ns0:MT_Output/NodeHeader[3]/DETAIL/OriginationControlNumbers. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one.

But as you see Third value is coming in the queue when i am running queue  display.

Plz Help

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Looks like it is the fourth iteration, add SplitByValue:each value just after the formatByExample output.

Regards,

Mark

Former Member
0 Kudos

Hello Mark,

Please find the input and output of UDF and code.

for(int i=0; i<var2.length;i++)

{

var2[i]=var1[0];

}

for(int i=0; i<var2.length;i++)

result.addValue(var2[i]);

I think Problem is somewhere in this code.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Hemant,

There is no null output in your UDF. The problem is that the target message mapping field expects 4 entries, whereas you are only passing 3 (2nd and 3rd values count as one).

e.g

/ns0:MT_Output/NodeHeader/DETAIL/OriginationControlNumbers = 01020315920002

/ns0:MT_Output/NodeHeader[1]/DETAIL/OriginationControlNumbers = 01020315920003

/ns0:MT_Output/NodeHeader[2]/DETAIL/OriginationControlNumbers = 01020315920004

/ns0:MT_Output/NodeHeader[3]/DETAIL/OriginationControlNumbers  = no value or null


That is why I asked you to place a splitByValue:eachValue just after the formatByExample.

If that should not be the output, please provide the sample input/output xmls:)

Regards,

Mark

Former Member
0 Kudos

Thanks Mark.

Its working.

praveen_sutra
Active Contributor
0 Kudos

Hi Hemant,

Would like to know what is the logic you are trying to achieve.

As per your current mapping and error it seems the target field is expected 4 values with 4 context change but u are passing 4 values with three context change.

either you add a context change in your UDF after inserting every value.

or use splitBYvalue.

this should solve the issue.

thanks and regards,

Praveen T

Former Member
0 Kudos

Thanks Praveen.

Error Solved. I used SplitByValue in the last.

Answers (0)