Conditionally starting a process
Create applications that flexibly adjust to dynamically changing scenarios by configuring conditions to start specific sets of actions. When processes in your case type start under specified conditions, you save time and resources because you can create one case type that is relevant in various situations, instead of providing and maintaining multiple case types.
Additionally, you can focus your application development on a goal that you want to achieve rather than on fixed paths that might be difficult to predict.Consider a case type with the goal of hiring a new candidate. The case type includes an Interview stage during which a manager interviews a job candidate. Additionally, if the candidate applies for a manager role, the company requires a background check. You can create a Background check process, and then define conditions to run the process only for candidates for manager roles. As a result, you create only one case type instead of creating two very similar case types.
You can define conditions to start a process both in App Studio and Dev Studio. In App Studio, you can reuse existing conditions or create new ones by using a condition builder, while in Dev Studio you can use a When rule or an expression to define when the process starts.
- Open the process that you want to configure:
- To configure the process in App Studio, in the navigation pane of App Studio, click Case types, and then click the case type that you want to open.
- To configure the process in Dev Studio, in the navigation pane of Dev Studio, click Case types, and then click the case type that you want to open.
- In the Case life cycle section, click the process that you want to configure.
- In the Process pane, on the General
tab, define conditions to start the process:
Choices Actions Always start a process In the Start process (otherwise skip) list, select Always. Define a new condition in App Studio - In the Start process (otherwise skip) list, select Custom condition, and then click the Configure conditions icon.
- In the Configure condition window,
define a condition by selecting a property, comparator, and
value to evaluate against the property at run time.
For example: To start a process only when a job candidate applies for a manager role, select Position type equals to "Manager". As a property, you can select a field or a when condition. For more information about building conditions, see Defining conditions in the condition builder. - Optional: To define more conditions, click Add a row, and then repeat step 3.b.
- If you have multiple conditions, specify whether all or any
conditions need to evaluate to true at run time by selecting
either and or
or between the conditions.
For example: The following figure shows the conditions to set if you want a process to start when a job candidate applies for a manager role or when the work experience of the candidate is less than three years: Conditions for starting a process - Click Submit.
Use an existing condition in App Studio - In the Start process (otherwise skip) list, select Existing condition.
- In the list of conditions, select a condition that you want
to evaluate, and then decide whether the condition needs to
evaluate to true or false to start the process.
For example: The following figure shows the condition that starts a process if a user starts your application on a mobile device: Reusing an existing condition
Use a When rule in Dev Studio - In the Start Process list, select When Rule.
- In the text field, press the Down arrow key, and then
select the When rule that you want to use.
Tip: You can also create a new When rule by clicking the Open icon. For more information, see Creating a When rule.
Use an expression in Dev Studio - In the Start Process list, select Expression.
- In the text field, press the Down arrow key, and then
select the expression that you want to use.
Tip: You can also create a new expression by clicking the Build an expression icon.
- Click Save.
Previous topic Defining conditions for starting a process Next topic Removing a process from a stage