Configure a dynamic executor in the process
In this topic, we will configure a dynamic executor for the process activities.
As an example, we will use the purchase request process created in the Create a process topic.
With the process on edit mode, access the flowchart.
Then, double-click on the second lane "Approval".
On the data screen, go to Configuration > Execution, check Consider dynamic executor and keep the "Formula" option selected.
In the Formula field that will load, click on the button.
In the formula, we will create an urgency-based rule.
If it is urgent, the executor will be the starter leader.
Otherwise, it will be the "Purchase manager" functional role.
To this end, we will start by creating an X variable that receives the "Urgency" value, which is an attribute of the list type that contains these values: "High", "Medium" and "Low".
On the formula data screen, type the "x =" variable in the formula.
Click on the lower arrow in the Process tab to open the options and select "Attribute value".
On the screen that will open, search for the "Urgency" attribute and click on .
Now, we will set the condition:
x = ATTRIBUTEVALUE('Urgency')
IF(x = 'High')
RETURN DEFINE_EXECUTOR('Starter leader';";")
ELSE
RETURN DEFINE_EXECUTOR('Functional role';'Purchase Manager';'')
END
If (x = ‘High’), return the "define executor" function.
Write this in the formula: “IF (x = ‘High’) RETURN ”.
Then, click on Process > Define executor.
On the parameters screen, select the Starter leader option for the executor type and click on the button.
Afterwards, we will write the standard clause.
To do so, type "ELSE RETURN" and click on Process > Define executor.
On the screen that will open, select the "Purchase manager" functional role and click on the button.
To finish the formula, type "END" after the "IF/Else" condition and click on the button.
Done. The activity has been successfully configured as dynamic executor via formula!