cancel
Showing results for 
Search instead for 
Did you mean: 

Disabling a node using Condition

Former Member
0 Kudos

Hi,

Is it possible to disable a specific node in the target using a condition and User defined function?

Sample scenario:

My target structure is this:

Header

Header fields

Line_items

Line_item fields

my source is a file with a structure of multiple lines.

My condition is... if the source file is empty... the header will be the only one that will print out not the line item. So i need to disable the LINE_ITEM node when the file is empty.

Accepted Solutions (1)

Accepted Solutions (1)

sunil_singh13
Active Contributor
0 Kudos

Hi Vincent,

Just to add to Malini's Solution.

Instead of using if then you have to use IfWithoutElse (A standard function available in Boolean).

and set the Property(right click on IfWithouelse) Keeps = true.

It will pass the SUPPRESS node when the condition is false and the Target node will not be created.

srclineitem-->exists-|if WithoutElse(Keeps=true) | -


>tgt_lineitem

Thanks

Sunil Singh

Former Member
0 Kudos

Thanks! It solved the problem! But "exist" actually checks the node itself. I just used some comparison operators to check the value of the field if it's null or not...

Answers (3)

Answers (3)

Former Member
0 Kudos

Use exists node function


srclineitem---->exists---|if     --------->tgt_lineitem
          srclineitem-------|then

This ll nt generate the targetline item when src file is empty.

Former Member
0 Kudos

under the LINE_ITEM are sub-fields. It will still go through all the subfields... some of the fields have constant values. I need to disable all the LINE_ITEM including the sub-fields. I can do that by manually configuring every field. but if there is an easier way...

Former Member
0 Kudos

Ofcourse it is possible inside UDF. You just need to use the funtion resultlist.supress();

Your condition here is that if the file is empty, If I understand it correctly, then you dont even need this UDF. If the Line item field is not present in the source at all, it will not populate the target too.

Former Member
0 Kudos

have the occurrence for the line item nodes as 0...1 and map the line item to the source line item. so when source line item doesnot exist ur target node is not created