Skip to main content

In an activity with multiple choice branches an activity may or may not be defined.

How do you check if an activity is defined with a script.

 

For example: 

You may have a choice of how you want to gather some data, and the results may come from one branch or the other.

To set a variable you need to determine which branch was used, a Try Catch block can’t be the want. 

 

Let me know if this isn’t clear.

Thanks.

Chris.

Typically you would update global variables while you are in the branch that is doing the work.  Then when all branches merge, you just need to read the global variable without needing to know which branch updated the variables.

However, if you do need a way to determine if an activity executed, then you can use a script like this to check

if (xpath:{/workflow/activity_1} != null)
{
      //activity has executed and contains outputs
}
else
{
      //activity did not execute
}

Regards

 


Typically you would update global variables while you are in the branch that is doing the work.  Then when all branches merge, you just need to read the global variable without needing to know which branch updated the variables.

However, if you do need a way to determine if an activity executed, then you can use a script like this to check

if (xpath:{/workflow/activity_1} != null)
{
      //activity has executed and contains outputs
}
else
{
      //activity did not execute
}

Regards

 

Thank you.