I have an action node named 'CW', after that I placed a Decision Node to check if 'CW' returns error or not.... how should I write the predicate?
I tried:
${ wf:errorCode('CW') eq '' }
then go to Y
${ wf:errorCode('CW') != '' }
then go to N
Although it return empty string (no error), but it always goes to N
. Any advise? Thanks!!
Try
${not empty wf:errorCode('CW')}
to detect failures
This is the only method for checking an empty string that worked for me.
<decision name='decision-action'>
<switch>
<case to='success-action'>${firstNotNull(wf:lastErrorNode(), 'no error') eq 'no error'}</case>
<default to='failed-action' />
</switch>
</decision>
So, to relate this answer directly to the question, this conditional
${firstNotNull(wf:errorCode('CW'), 'no error') eq 'no error}
should map to Y.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With