Triggers are used to define a set of event criteria. When the event criteria specified in the trigger is met, the event is published and an action containing a payload is kicked off.
Note: Triggers are not referenced in a process definition.
The basic properties of a trigger are:
| Property | Description |
|---|---|
| Trigger name | Required. The name of the trigger. Must be in lowercase and between 1 and 26 characters in length. Alphanumeric characters and hyphens are allowed, however the name must begin with a letter and end alphanumerically, for exampleemail-trigger |
| Trigger description | Optional. A description of what the trigger should be used for, for exampleStarts a process when an order request email is received. |
To create a trigger:
Sign into the Modeling Application and open a project.
Click theNEW dropdown.
Select how to create the trigger:
Create > Trigger creates a new, empty trigger.
Upload > Trigger allows for uploading an existing trigger.json file into the Modeling Application.
Alternatively use the+ orUpload buttons next toTriggers in the left-hand menu.
Enter a name and optional description.
Trigger events include specificBPMN states occurring in a process such as a timer being fired, a form being saved or events related toconnectors such as an email being received or a webhook REST request.
The events that can be created for a trigger are:
Note: The events handled in triggers follow theCloud Events specification. All the information described there and the specific information of the event is contained inside thedata field.
BPMN engine events are events generated as part of the life cycle of processes. They include events such as when BPMN activity is started, saved, submitted or completed. These events can be monitored by a trigger and an event published when specific criteria are met, for example when a timer with a certain ID is fired.
BPMN engine events are mostly configured using theelementId which is theID of theBPMN element within a process definition.
The saving and submission of aform can be monitored as a trigger event. The specific form and the process definition it is attached to are used to create the trigger event.
Acustom end-user action of typeEvent can be set on the Digital Workspace user interface. When a user clicks the action in the Ditial Workspace an event is fired that can be linked to a trigger action.
The input parameters for a user interface action are:
| Parameter | Description |
|---|---|
| uIName | Required. The name of the user interface that contains the action, for examplecontent. |
| Name | Required. The name of the action of typeEvent to monitor, for exampleshare-with-accounts. |
Content connector events that can be monitored as trigger events include creating, updating and moving files, folders and content types. Content types are read from anycontent models attached to the project.
Theemail service contains anEMAIL_RECEIVED event. This event allows for inbound emails to be monitored and an event published when specific criteria are met.
The input parameters for receiving an email are:
| Parameter | Description |
|---|---|
| condition | Optional. An expression created using theCondition Builder that when true triggers an action. The event content described by its model can be used in the expression. |
| pattern | Required. A regular expression that selects which emails trigger an action. Java catching group syntax can be used to create groups from the pattern as variables, for exampleOrder Number (?<orderNumber>.+). The variables can then be used inecho andechoError, for example${orderNumber}. |
| echo | Optional. An email sent to the original sender of the email that is matched, for exampleYour reference number is ${orderNumber}. |
| echoError | Optional. An email sent to the original sender if an error occurs when publishing the event, for exampleThere was a problem publishing that event. |
The output parameters that can be used as values within the trigger action for receiving an email are:
| Parameter | Type | Description |
|---|---|---|
| matchGroups | JSON | Optional. Any matching groups found using the regular expression inpattern. |
| emailSubject | String | Optional. The subject line of the matched email. |
| emailTo | String | Optional. The recipient of the matched email. |
| emailFrom | String | Optional. The sender of the matched email. |
| emailBody | String | Optional. The message body of the matched email. |
Note: Groups found in
matchGroupscan be used within a trigger action variable using the syntax${matchGroups.group}, for example${matchGroups.orderNumber}.
Important: Theconfiguration parameters for the email service contain some parameters that are specific to configuring a trigger.
TheTwilio connector contains anSMS_RECEIVED event. This event allows for inbound SMS messages to be monitored and an event published when specific criteria are met.
The input parameters for receiving an SMS are:
| Parameter | Description |
|---|---|
| condition | Optional. An expression created using theCondition Builder that when true triggers an action. The event content described by its model can be used in the expression. |
| pattern | Required. A regular expression that selects which messages trigger an action. Java catching group syntax can be used to create groups from the pattern as variables, for exampleOrder Number (?<orderNumber>.+). The variables can then be used inecho andechoError, for example${orderNumber}. |
| echo | Optional. A message sent to the original sender of the text that is matched, for exampleYour reference number is ${orderNumber}. |
| echoError | Optional. A message sent to the original sender if an error occurs when publishing the event, for exampleThere was a problem publishing that event. |
The output parameters that can be used as values within the trigger action for receiving an SMS are:
| Parameter | Type | Description |
|---|---|---|
| matchGroups | JSON | Optional. Any matching groups found using the regular expression inpattern. |
| originalMessage | String | Optional. The contents of the SMS message. |
| to | String | Optional. The recipient of the matched message. |
| from | String | Optional. The sender of the matched message. |
Note: Groups found in
matchGroupscan be used within a trigger action variable using the syntax${matchGroups.group}, for example${matchGroups.orderNumber}.
TheSlack connector contains aMESSAGE_RECEIVED event. This event allows for Slack messages to be monitored and an event published when specific criteria are met.
Note: Make sure the Slack connectorevent subscription has been configured to receive notifications from the Slack API.
The input parameters for a received Slack message are:
| Parameter | Description |
|---|---|
| condition | Optional. An expression created using theCondition Builder that when true triggers an action. The event content described by its model can be used in the expression. |
| pattern | Required. A regular expression that selects which messages trigger an action. Java catching group syntax can be used to create groups from the pattern as variables, for exampleOrder Number (?<orderNumber>.+). The variables can then be used inecho andechoError, for example${orderNumber}. |
| echo | Optional. A message sent to the user of the message that is matched, for exampleYour reference number is ${orderNumber}. |
| echoError | Optional. A message sent to the user of the message that is matched if an error occurs when publishing the event, for exampleThere was a problem publishing that event. |
| channelTypes | Optional. The channel types to be monitored in Slack, for exampledirect-message,public-channel ormention. |
The output parameters that can be used as values within the trigger action for a received Slack message are:
| Parameter | Type | Description |
|---|---|---|
| matchGroups | JSON | Optional. Any matching groups found using the regular expression inpattern. |
| originalMessage | String | Optional. The contents of the Slack message. |
| slackChannelId | String | Optional. The channel the matched message was sent in. |
| slackUserId | String | Optional. The Slack user that sent the matched message. |
Note: Groups found in
matchGroupscan be used within a trigger action variable using the syntax${matchGroups.group}, for example${matchGroups.orderNumber}.
TheREST connector can be used to publish an endpoint that external systems such as GitHub can consume as part of a trigger. The trigger then monitors this webhook and will publish any events that match the specific criteria as part of a project.
The input parameters for theINCOMING_WEBHOOK event is:
| Parameter | Description |
|---|---|
| condition | Optional. An expression created using theCondition Builder that when true triggers an action. The event content described by its model can be used in the expression. |
| path | Required. The webhook path to monitor. The format beginshttps://<environment>.com/<project-name>/<connector-name>/events/ followed by a custom value, for examplehttps://alfresco.com/finance-project/rest-connector-1/events/github. |
| method | Optional. A list of HTTP methods that can trigger an action. |
| condition | Optional. The condition that must evaluate to true to trigger an action. |
| status | Optional. The status code to return to the external service. |
| headers | Optional. The key value pairs that must match in order to publish the event. Use the+ symbol to add more pairs. |
| params | Optional. The request parameter key value pairs that must match in order to publish the event. Use the+ symbol to add more pairs. |
| body | Optional. The JSON body to send to the external service. |
The output parameters that can be used as values within the trigger action for a webhook are:
| Parameter | Type | Description |
|---|---|---|
| method | String | Optional. The HTTP method of the request. |
| path | String | Optional. The relative path of the request URL. |
| params | JSON | Optional. The query string or form parameters of the request. |
| headers | JSON | Optional. The headers of the request. |
| body | JSON | Optional. The body of the HTTP request. |
Important: Theconfiguration parameter for the REST connector is used for sending a response to the external system from the webhook.
Trigger actions include starting a process instance, sending a BPMN signal or anyconnector action. An action contains a payload that is sent from the trigger to the action being started.
The values for action payloads can be set in different ways depending on the action being sent and the source event type that generated the action. For example, if the SlackMESSAGE_RECEIVED event is used, then the value of an action can use the value of theslackChannelId the message was received from or an expression based on the event model.
The ways in which an action can be set are as:
Variables are variables from the source event, for example using a BPMN engine activity as an event will allow the variables such as theprocessDefinitionKey as a value.
Expressions: can be entered using a JSON editor to create more complex mappings from JSON objects, such as${temperature.celsius} will use the value for the objectcelsius.
Values are static values that can be entered when the trigger action is modeled.
The actions that can be set on a trigger are:
The action to start a process will begin a process instance when the event criteria are met. The payload for the start process action is:
| Property | Description |
|---|---|
| processDefinitionKey | Required. The process definition the action will use to create a process instance with. The process definition must be in the same project as the trigger. |
| name | Required. The name that will be given to the process instance, for exampleslackUserId. |
| payloadType | Required. The type of payload. This is set toStartProcessPayload and cannot be changed. |
| businessKey | Optional. A business key ID for the process instance. |
| variables | Optional. Values from the trigger event can be mapped toprocess variables in the process definition. If the trigger event was a connector, this includes output parameters in the connector event. |
The action to send a signal will send a named signal of global scope when an event criteria are met. The signal can be caught by the catching signal eventssignal start events,signal intermediate catch events andsignal boundary events. The payload for the send signal action is:
| Property | Description |
|---|---|
| name | Required. The name of the signal to emit, for exampleSignal_0n91cib. |
| payloadType | Required. The type of payload. This is set toSignalPayload and cannot be changed. |
| variables | Optional. Values from the trigger event can be mapped toprocess variables in the process definition. If the trigger event was a connector, this includes output parameters in the connector event. |
The action to receive a message will send a named message when an event criteria are met. The message can be caught by the message catching eventsmessage intermediate catch events andmessage boundary events. The payload for the receive message action is:
| Property | Description |
|---|---|
| name | Required. The name of the message to send, for exampleMessage_077epax. |
| correlationKey | Required. Acorrelation key must be provided when sending a message from a trigger, for example014-245. |
| payloadType | Required. The type of payload. This is set toReceiveMessagePayload and cannot be changed. |
| variables | Optional. Values from the trigger event can be sent as part of the message payload. |
The action to send a start message will send a named message when an event criteria are met. The message can be caught by amessage start event to start a process instance. The payload for the start message action is:
| Property | Description |
|---|---|
| name | Required. The name of the message to send, for exampleMessage_077epax. |
| payloadType | Required. The type of payload. This is set toStartMessagePayload and cannot be changed. |
| businessKey | Optional. A business key ID for the process instance. |
| variables | Optional. Values from the trigger event can be sent as part of the message payload. |
The action to execute a script will execute a namedscript when an event criteria are met. The script must exist in the same project as the trigger.
| Property | Description |
|---|---|
| scriptName | Required. The name of the script to execute. This is set by selecting a script to execute, for exampleupdate-orders-script. |
| scriptId | Required. The ID of the script to execute. This is set by selecting a script to execute, for example19ced673-e701-4e6c-ace6-f8aaee5455eb. |
| variables | Optional. Values from the trigger event can be mapped to script variables to be used as part of the execution. |
Thecontent connector is used to execute actions against the Content Services repository. The actions available involve creating, selecting, updating and managing content.
All of the actions that the content connector can execute as part of a service task can also be used as trigger actions. The properties are the same as they are when the action is attached to a service task.
Connectors are used to handle interactions with external systems. This includes actions such as sending emails and utilizing services such as AWS Textract, Rekognition and Lambda functions.
All of the actions that connectors can execute as part of a service task can also be used as trigger actions. The properties are the same as they are when the action is attached to a service task.
Note: Connector actions as part of a trigger are also tied to the connector instance. If different configuration is required to a connector used within a process then create a new connector instance for the trigger.