Action Chain Properties
An action chain has two properties: the set of variables it can use, and the root action.
Action chains are defined under the 'chains' property of the page model. An action chain always has a root action. This root action will always be called when the action chain is invoked.
This action chain will call the 'myAction' action:
"chains": { "myActionChain": { "root": "myAction", "actions": { "myAction": { "label": "My action!", "module": "vb/action/builtin/someAction", "parameters": { "key": "value" } } } } }
Each action has an outcome. Usually, an action supports the "success" or "error" outcomes. Some actions may also support other outcomes. Actions can be chained by connecting an additional action to a previous action's outcome.
To perform another action if the previous action succeeds, and handle error cases if it does not succeed, you could do the following:
"myActionChain": { "root": "myAction", "actions": { "myAction": { "module": "vb/action/builtin/someAction", "parameters": { "key": "value" }, "outcomes": { "success": "mySuccessAction", "error": "myErrorAction" } }, "mySuccessAction": { "module": "vb/action/builtin/someAction" }, "myErrorAction": { "module": "vb/action/builtin/someAction" } } }