Cloud Trigger Actions

 Cloud Trigger actions are the sequence of actions to execute when an event is triggered in Device Cloud.  

Device Cloud is an event-driven architecture that enables applications to notify each other of changes in state as they occur and trigger corresponding actions.

You need to add a trigger before adding the corresponding actions. For more information on adding a trigger, see Adding a New Trigger.  

Parameters for actions vary by the type of action. For all trigger actions, a Suggestions field appears and lists all trigger variables available to the action by the event and by the preceding trigger actions. The contents of this list vary depending on the event and trigger actions selected.

The event variables and action variables shown in the Suggestions field can be used as the parameters for the current and subsequent actions. For example, if a trigger action uses a thing key as a parameter (for example, the alarm.publish action requires a thing key parameter), and the trigger variable $(event.thing.key) is available (for example, from the property.change event), it can be used instead of a static thing key.
Note:

You can copy and paste a set of trigger actions while defining a trigger.

Global Variables

The following global variables can be used in any trigger action:

Variable

Description

Route

$(trigger.exec_time)

This shows the time the trigger executed.

Success and Failure

$(trigger.lastErrorMsg)

This shows the last failed trigger action error message and is overwritten by the next failed action.

Failure

$(trigger.lastErrorCode)

This shows the last failed trigger action error code and is overwritten by the next failed action.

Failure

Additional Trigger Actions

An comment action is a note that can be placed on the canvas. It takes no inputs and has no outputs. It is used to display a comment to future viewers of the trigger. For more information, see Comment.

The success and failure actions are used to indicate whether the trigger terminated successfully or unsuccessfully. Failure actions are optional. There must be at least one success action. Any branch that does not terminate at a success action is considered a failure. For more information, see Success and Failure.