Within the Advanced Workflow tool you have the ability to build a Process Definition. Process Definitions define the steps of an automated business process and control the flow of work that is allocated during running processes in Sugar. The Process Definitions consist of a network of activities, criteria to start and end the process and information about the individual activities.
A process might need at some point, dependent on the evaluated conditions, different possible outcomes and actions. This can be achieved by incorporating gateways into the Process Definition. There are four Gateways that can be used within the Process Definition: Exclusive, Inclusive, Parallel and Event-Based.
- Exclusive Gateways will evaluate several conditions but only direct the flow to or from a single path.
- Inclusive Gateways will direct a flow along all paths that accomplish their criteria, this could result in a single or multiple parallel flows.
- Parallel Gateways simply tell the process that two or more flows are all to happen at the same time.
- Event-Based gateways are similar to Exclusive gateways in the way that the process will only go forward with the flow that first accomplishes its criteria. Event-Based Gateways, however, evaluate which event has occurred first rather than which condition has been met first.
Shown below is an example of a Process Definition using an Event-Based gateway:
An example Process Definition where you may want to use an Event-Based gateway could be: When the Lead status changes to ‘In Process’, the process continues and changes the description field on the Lead record to show that the Lead is being worked with. However, if the lead status does not change for 2 days, then create a task for the assigned user to follow up. There are no configuration settings for Event-Based Gateways as they will follow the flow of the first event that takes place.
To achieve the first scenario, you can use the intermediate event ‘Receive Message’. If the gateway receives the message from the system that the status has changed to ‘In Process’ within 2 days, then the process will follow the top flow, changes the description field and ends as shown below:
However, it would not be ideal to have to wait for an unlimited amount of time for the Lead status to change without reminding the user to follow-up. Use a ‘Wait’ event and set the parameters to 2 days. The Event-Based Gateway will then evaluate which event happens first. If the Lead status does not change and the 2-day ‘Wait’ event is completed, then the process will follow the bottom flow and creates a Task for the assigned user of the Lead, reminding them to take action.
Event-Based Gateways are extremely useful when configuring a Process Definition with outcomes depending on occurring events.