Posted: Fri Oct 13, 2017 4:35 am Post subject: Write condition in mapping node
Newbie
Joined: 09 Aug 2017 Posts: 6
I am implementing a global cache using custom esql when mapping the two fields in the mapping node. I cannot add further condition in esql. My output field ->custom esql ->field in the mapping node. Now when the field from source if coming empty, the output is just namespace. I am trying to pass null value if the source is not sending value. I see there is condition tab. I am wondering what to put to pass the null value if source is empty.
I am trying to pass null value if the source is not sending value.
Take a read of Handling nulls in message maps
I assume your target (output) element is not defined as nillable, so when your Custom ESQL returns NULL, it is going to output an empty element.
Note the behavour of Mapping node is based on XML/XPath standards, hence it produces empty or nilled output elements if you map to them. (This is diffrent than an ESQL compute node, in which setting an output to ESQL NULL results in "deleting" / not outputting the element).
If you require a Map transform to not emit an output element then you must prevent the transform form being executed using a condition.
To prevent a Transform from being executed if the input source element is not present set the Condition on the transform. Lets say the input is an element "MyInputField" the condition would be
Code:
$MyInputField<n>
(Remember to use content assist (ctrl-space) to obtain the correct variable name.
If you have multiple transforms that should only be executed if a common parent input element is present embed them all in a If transform.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum