Select to view content in your preferred language

Configure Path based on Extended Property field

1016
4
02-21-2023 08:09 AM
CSander
Emerging Contributor

I am trying to create path logic using an arcade expression to take a specific answer from an extended property table.

I have tried:

 jobExtendedProperty($job,'report_qc_revision','qcpassfail')=="True"

jobExtendedProperty($job,'report_qc_revision','qcpassfail')=='0'

jobExtendedProperty($job,'report_qc_revision','qcpassfail')==0

where the qcpassfail field is a Boolean. They all end up with "No paths match return code". I want to avoid a "Question" step as there are multiple fields for the qc step prior to moving to next step.

The other path logic I require that is failing is where there are 3 options (possibly more in future) that split the workflow. I have tried using a domain and using the same path logic as above, trying to use both the domain code (an integer) and the text value of the domain. 

Where am I going wrong?!

 

0 Kudos
4 Replies
bbaker_tngeo
Regular Contributor

I tried to reproduce your issue and could not get a boolean question to work. I tried "True", 'True' and True, as well as "0", '0' and 0 but none worked.

Instead, I created an Extended Property attribute with a domain of user1 and user2 (but you could use a field with Pass and Fail as the values). I tried a branching logic based on the usernames using the following and it routed along the correct path based on the user selection:

Proceed to Step A : jobExtendedProperty($job, 'attributes', 'assignment') == 'user1'

Proceed to Step B: jobExtendedProperty($job, 'attributes', 'assignment') == 'user2'

 

bbaker_tngeo_0-1677084385809.png

 

0 Kudos
CSander
Emerging Contributor

I am still getting "No Paths Match Return Code"

Here are some screen shots of my process:

CSander_2-1677093396969.png

 

The path configuration to move to the next step is:

jobExtendedProperty($job,'report_qc_revision','qcpassfail')=='Pass'

(A fail would move to a different step not pictured above)

CSander_3-1677093527818.png

The branch split to the various reports can be an AND/OR situation - and may not happen at the same time. 

The process would move on and meet up from the report branches after they are loaded.

I feel like I am missing something really small and really annoying . . . 

 

 

0 Kudos
bbaker_tngeo
Regular Contributor

The only thing I can see potentially is that the code for your domain is not the same (e.g. 'yes' vs. 'Yes'). I ran through a test with the following setup:

bbaker_tngeo_0-1677158230016.png

Then I have an Update Job Properties to select Yes or No for the 2 reports and then configured the paths with the expressions below:

bbaker_tngeo_1-1677158319253.png

That is successfully routing to either Report 1 Step or Report 2 Step based on selecting Yes for the corresponding job property.

bbaker_tngeo_2-1677158410848.png

It even works if both are updated to 'Yes':

bbaker_tngeo_3-1677158459746.png

I hope that helps. Beyond that, I'm at a loss as to what to try next.

 

 

 

0 Kudos
StefanDieters
Occasional Contributor

We had a very similar problem in directing path logic. I tryed many of the same things as you have, with a similar lack of success.It was a problem with how == >= is interpreted. see rest.

This is my answer to a similar problem see: https://community.esri.com/t5/arcgis-workflow-manager-questions/quot-send-web-request-quot-step-erro...

Here is the explanation from our (esri.australia technical rep Razi Mosadeghi). I have verified that the suggested fixes work

Please find below the explanation they have provided on why Boolean(jobExtendedProperty($job, 'switchtable', 'nerrors')== 0) Does not work:

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:

  1. Use Number(jobExtendedProperty($job, 'tablenew', 'arcade')) == 0 when using an integer value
  2. Or, use jobExtendedProperty($job, 'tablenew', 'arcade')) == '0' if you are ok with using a string representation of the value

This is my answer to a similar problem

0 Kudos