To cater for a wide variety of applications, CommonTime Infinity provides a range of actions which can be used in response to an event. These are available via the Toolbox and can be viewed using the menu icon at the top to change to the ‘Actions’ list.
For ease of navigation, the Actions are grouped into several sections, including Integration, Scripting, Navigation and Media. The search box at the top of the Toolbox can also be used to quickly find a specific actions.
In some cases, the action is used to call an item which has been configured via the App Config screen. For example, the details used by an API, function or variable are all set via the config, whereas actions are used to interact with them.
New actions can be added to an application simply by dragging them from Toolbox and dropping them to your chosen location. Where the action can be triggered by multiple events, it will be necessary to use the droplist at the top of the action to specify which event it should listen for.
Each action location includes a standard set of controls to duplicate, move and delete an action. These appear at the top of the Actionflow editor, whereas in the case of the ‘Actions’ tab and On-load style events, a separate set of controls are provided just above the list of items.
It is possible to create a more complex behaviour by adding multiple actions within an ‘Actions’ tab, Actionflow or On-Load Event. In each case, the actions are placed one after another and will be carried out in the order they are listed. If for any reason the flow of actions is stopped (e.g. an action fails) then no further actions in the flow will be executed.
Where the data from one action in a flow must be passed to the next action, an object called
$data is used. The usage of this object varies dependant on the type of actions used. Some actions (e.g. Call API) automatically assign values to this object, such as the result of the action, or a value (e.g. true/false) based on the action’s outcome or behaviour. Other actions (e.g. Show Notification) will simply pass the previous value for $data, whereas asynchronous functions require you to manually specify the value within the brackets of the $success call.
$data is a JSON object and can therefore hold a wide variety of values. To reference the contents of the object within the following action, simply type
$data. Where an $data is used to store an object, this reference can also include the object structure to reference particular values. e.g.
Within a flow, the $data value is designed to pass data from one action to the action which is located directly below. It can therefore not be assumed that a value set by the first action will be available for the third action to use, as the action in the middle may overwrite the value held in $data. If the data should be accessible for all actions, it is recommended that a variable is used instead as this will be available throughout the flow.
If an item provides multiple events, it is necessary to specify which should cause the action to be carried out. This is set on a per-action basis using a drop down list at the top of each action.
If this drop down list does not appear within an action, it is likely that it resides in a location which only has a single event type.
It is not possible to specify multiple events for the same action. If the same action should be triggered by multiple events, it will be necessary to duplicate the action and change the event in the drop down list.
Note that if the ‘Call Actionflow’ action is added to the ‘Actions’ tab of an item, a single event is used to trigger all actions in the Actionflow.