The ClearBlade platform provides a trigger mechanism that lets you respond to specific platform events by executing a code service whenever such an event occurs. The events for which you can specify triggers are predefined by the platform and available through the API.
- Trigger: The platform defines and generates events. You create a trigger for responding to each event.
- Events: A platform defined internal action generates an event such as “User Created”, “Item Updated”, etc.
- Filter: A set of criteria to narrow and refine when a trigger is actually executed. For example, you could define a trigger to handle all “User Updated” events, or you could define a trigger to only handle “User Updated” events for user “Joe”.
When you define a trigger, you provide the following information:
- The event (described above)
- The code service to be executed
- Filters for the trigger
The process for firing triggers is very simple. When an event occurs in the system, the system passes the event information to the trigger processor. The trigger processor searches for triggers that match that event. When it finds such a trigger, its code service is invoked (in the background). The system uses trigger filters to perform the match.