I am trying to branch in my workflow based upon the output value 'errorsIdentified' of the EvaluateDataQuality step. This is for the server version using Enterprise 10.9.1 and Pro 2.9.
I have tried setting the Path Logic using Expressions with the expression :
Path 1 out of Evaluate Data Quality
jobOutputValue($job, 'e876f36d-2683-e499-ae54-f44430d04daa', 'errorsIdentified') >0
Path 2 out of Evaluate Data Quality
jobOutputValue($job, 'e876f36d-2683-e499-ae54-f44430d04daa', 'errorsIdentified') = 0
The workflow fails after the Evaluate Data Quality step with a message "No paths match return code"
If have tried first branching on the return code from Evaluate Data Quality, placing a manual step on the "success output" and then again using the above expression. Same result.
Any ideas ?
Solved! Go to Solution.
Hello all.
I have managed to get this to work. Here is a close up of the diagram
I have used the an extended properties table (switchtable with field nerrors) to hold the output value identifiedErrors from the EvaluateDataQuality. I have left the output as visible. This lets me change the stored value containing the number of identified errors. There are 3 paths out of the Update Job Properties step. The leftmost is triggered when the Update Job properties fails.
The rightmost leading back to the editor for when there are errors has the expression:
Boolean(jobExtendedProperty($job, 'switchtable', 'nerrors') > 0)
The middle path leading on to a Reconcile and Post step when there are No Errors has the expression:
Boolean(!jobExtendedProperty($job, 'switchtable', 'nerrors') > 0)
i.e. the NOT of the other expression.
This works but
Boolean(jobExtendedProperty($job, 'switchtable', 'nerrors') == 0)
does not with a message saying there is no path.
Hope this help some-one else
I don't see anything inherently wrong with your Arcade expressions, assuming that step ID value is correct.
It would be good to know what the output value is that is being returned when the step runs. Can you check the jobProgress table in the hosted layer for your Workflow Item and see if the value being returned for errorsIdentified is equal to or greater than 0?
Jonathan
Instead of using joboutputvalue I put errorsIdentified into extended property table and use jobExtendedProperty($job, '<table_name>', '<field_name>'. With the table visible I am sure of the value going into the branching.
I have made some progress.If I use the expression :
Boolean(jobExtendedProperty($job, 'switchtable', 'nerrors') > 0) on the path back to the editor, that works. However the path errorsIdentified (nerrors in table switchtable) = 0 is never executed.
OK, I tested this and realized your expression was not actually correct. Sorry about that.
You need to use the double equal signs for this to work:
jobOutputValue($job, '5e8cd37e-fa09-494c-a8c6-c972824a7be2', 'errorsIdentified') == 0
This worked fine for me.
Jonathan
Thanks for checking. I later realized that error and updated the expression. Did not work either.
Hello all.
I have managed to get this to work. Here is a close up of the diagram
I have used the an extended properties table (switchtable with field nerrors) to hold the output value identifiedErrors from the EvaluateDataQuality. I have left the output as visible. This lets me change the stored value containing the number of identified errors. There are 3 paths out of the Update Job Properties step. The leftmost is triggered when the Update Job properties fails.
The rightmost leading back to the editor for when there are errors has the expression:
Boolean(jobExtendedProperty($job, 'switchtable', 'nerrors') > 0)
The middle path leading on to a Reconcile and Post step when there are No Errors has the expression:
Boolean(!jobExtendedProperty($job, 'switchtable', 'nerrors') > 0)
i.e. the NOT of the other expression.
This works but
Boolean(jobExtendedProperty($job, 'switchtable', 'nerrors') == 0)
does not with a message saying there is no path.
Hope this help some-one else
Last piece of puzzle: Thanks Razi of Australian esri support.
It appears == 0 returns the string representation of the value here and not the actual value (an integer).
In addition, core Arcade logic is playing a role here as well. In Arcade, the > and < operations will first try to evaluate the result as a string value. If that fails (because you aren't using a string), it will then try to evaluate the result as a integer, which is what we are using here. The == function doesn't have that same logic. It tries to compare a string to a string and then will fail if it can't.
So, if you would like to use == 0 logic, we would need to do either one of the following: