Triggers are automatic actions that react to any change in data and run immediately after that, when a condition is met, to activate a process or execute an expression.
The following section illustrates an example regarding a trigger that launches a process.
For more information about this feature refer to Triggers.
Consider a scenario in a company where after a successful purchase of a considerable amount of money, a poll is given to the supplier to evaluate the relationship with them. To launch the poll a trigger will be set. For this example the following data model has been defined:
When the purchase order is marked as Complete, a new Poll supplier case is started. To create the trigger go to the entity that is evaluated, in this case, Purchase orders entity. Expand it and right-click the Triggers node, then select New trigger.
In the configuration window set a display name and when the trigger will be launched.
In this case, it will be launched when an instance of Purchase orders is modified (when it is marked as Complete).
Select or create the condition rule. This condition will be the one that determines if the trigger is executed or not.
In this case we want the trigger to be executed only when the purchase value exceeds an amount defined and the purchase is marked as successful.
As a good practice, we manage the minimum purchase value as a vocabulary definition.
We will now define the process or the expression to execute.
In this case we want a new Poll as soon as the condition above is met.
Select the Launch a new case for the following process option and then click the drop-down list to select the Poll process.
Once created, select Ok to save your changes.
Now you can see the trigger on the list when selecting the Triggers node.
And now every time a new purchase exceeds the value specified, the trigger will start the Poll process.
When the process is started, Bizagi will inject in the Process entity the record that triggered. Thus, in order to inject such record, the Process entity must have a foreign key to the entity that triggers.
In this case (see data model above), the Supplier poll entity DOES NOT have a related entity to the Purchase order entity, that is the one that triggers. Thus, no data will be injected.