Creating actions
Actions are services that allow your app to interact with server-level capabilities, or assets from other offerings. You can configure an action for a view. For example, a user can click a button to launch a workflow service that opens a mortgage application. Actions might be contributed in a toolkit by an other offering, or authored by a technical user in an app project of a toolkit.
Actions are created within the Advanced view mode of App Designer. You can add actions to your app, and nest actions within actions.
- Ensure that your view mode is set to Advanced under your user preferences. If you are set to Basic view mode, you must switch to Advanced, go back to Studio, and then return to App Designer.
- From the left navigation menu in App Designer, click the plus icon next to Action, then name your action.
- In the Diagram view, create your action by dragging artifacts in the palette like services, gateways, and events to the canvas and wiring them.
- To assign a pre-execution and post-execution script to an activity in the action, select the activity node in the action diagram, click Pre & Post in the properties view, and then enter or paste the appropriate JavaScript code in the Pre-Execution Script section or the Post-Execution Script section. The JavaScript code that you add runs immediately before or after the activity runs.
- To call another action from your action, add a Nested action to your diagram. In the Implementation tab, click Select. There might be a custom configuration dialog for the Action. If one exists, you can launch it. Or, click New and complete the wizard to create the action that you want to call.
- If you need to branch the path that your action takes at run time, add an exclusive gateway to the action diagram, and define JavaScript conditions in the implementation properties of the gateway to determine the path that the flow follows.
Action editor palette
The action editor is an easy-to-use graphical development environment for developing actions. By dragging objects from the palette to the canvas, you compose the structure of your action.
Tool | Description |
---|---|
Server-side script | Runs JavaScript code on the server to access and manipulate data. The script language is JavaScript. |
Nested action | A nested action calls out to another action. When the nested action is triggered at run time, the linked action is run. After the linked action is completed, the parent action resumes execution. |
Event handler | Adds a subflow that is triggered by an event. An error event is the only available trigger event at this time. |
Exclusive gateway | Use a gateway to determine a change in the path of the action. An exclusive gateway follows only one of several paths, depending on a condition; that is, it is mutually exclusive. |
Error boundry event | An error intermediate event catches errors. When you attach the event to the boundary of an activity, the error boundary event catches errors that occur when the activity to which it is attached runs. The error boundary event catches all the runtime and business errors. Each error boundary event must have an outgoing link. When you use the event as a stand-alone error event, it catches all the errors that are not caught by boundary event handlers. |
End event | Use an end event to end the action. The following end event types are available:
|
Note | Use a note to add textual information to an action diagram. You can add notes that explain parts of your action, development notes, or information that is relevant to a specified step in the action. |