cancel
Showing results for 
Search instead for 
Did you mean: 

I want to skip/disable target mandatory(1:1) element if source element(0:1) it doesn't contain data

former_member197830
Participant
0 Kudos

Hi All,

I want to skip/disable target mandatory(1:1) element if source element(0:1) it doesn't contain data.

Can any help me how to achieve above functionality.

Thank you,

Narasaiah T

Accepted Solutions (1)

Accepted Solutions (1)

former_member190293
Active Contributor
0 Kudos

Hi Narsaiah!

I think the right way is to ask your vendor to change WSDL if element is not obligatory. In other case you can get errors if any schema validation is performed on target side. Or at least you can fill this element with empty value but not to remove it.

Regards, Evgeniy.

Answers (2)

Answers (2)

GauravKant
Contributor
0 Kudos

Hi Narsaiah,

As per my understanding, If target element you want to skip or disable in absence of data from sender then you can change occurrence to 0:1 as you are not considering it as mandatory field.

And it is of no use keeping it 1:1 and using some logic to skip.

Regards,

Gaurav

former_member197830
Participant
0 Kudos

Hi Gaurav,

We can't change target element occurrence 1:1 to 0:1  because that is coming from vendor WSDL.

is there any way to disable dynamically target mandatory element if source element contain empty data.

Thank you,

Narasaiah T

GauravKant
Contributor
0 Kudos

Hi Narsaiah,

You can use mapwithdeafult function from node function to avoid any failure in run time for mandatory field.

Regards,

Gaurav

manoj_khavatkopp
Active Contributor
0 Kudos

Narsaiah,

So if you want to dynamically create the target field depending on source filed check below links :

Check Praveen's Reply in this thread:

Br,

Manoj

manoj_khavatkopp
Active Contributor
0 Kudos

Check below one:

Message Mapping:

When source Filed is present :

When source isn't present :

UDF :

Execution Type :Single Value


LeafStructureNode node = ((LeafStructureNode)container.getParameter("STRUCTURE_NODE"));

if(var1.length()>0)

{

node.setQName("F1");

return var1;

}

else

{

node.setOccurences(0, 0);

return "";

}

Br,