Process trigger example

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Experience design > Advanced topics > Triggers >

Process trigger example

Overview

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.

 

Example

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:

 

triggers11

 

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.

 

triggers12

 

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).

 

triggers13

 

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.

 

triggers14

 

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.

 

triggers15

 

Once created, select Ok to save your changes.

 

triggers16

 

Now you can see the trigger on the list when selecting the Triggers node.

 

triggers17

 

And now every time a new purchase exceeds the value specified, the trigger will start the Poll process.

 

Mapped data

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.