Creating actions

Actions are services that allow your application 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 application project of a toolkit.

Note: If your action calls a process that is running on a workflow server, you must set the snapshot for that process application as the default. For more information, see Designating default snapshots.

Actions are created within the Advanced view mode when you are creating your business applications. You can add actions to your application, and nest actions within actions.

  1. 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, refresh your browser for the change to apply.
  2. From the left navigation menu, click the plus icon next to Action, then name your action.
  3. In the Diagram view, create your action by dragging artifacts in the palette like services, gateways, and events to the canvas and wiring them.
  4. 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.
  5. 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.
    Note: If you are leveraging the Business Automation Workflow toolkit and wanting to use the Start Process action, you might need to configure your connection definition after clicking the Configure... button. If you are prompted for the connection definition, you must use the port 443. Otherwise, you might encounter a connection error.
  6. To call an external service, add a Service Task to your diagram. In the Implementation tab, select the external service and operations that you want to call. If an external service does not exist, click New. For more information, see Calling external REST services.
  7. 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
Server-side script icon
Runs JavaScript code on the server to access and manipulate data. The script language is JavaScript.
Service task
Service task icon
A service task can call an external service from a local REST file or URL.
Nested action
Nested action icon
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
Event handler icon
Adds a subflow that is triggered by an event. An error event is the only available trigger event at this time.
Exclusive gateway
This icon indicates the Exclusive Gateway tool.
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
Error boundary event icon
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
End event icon
Use an end event to end the action. The following end event types are available:
None end event tool None
Ends the activities on a particular path.
Error end event tool Error
An error end event throws an error and ends the processing of the action. To throw a specific error, in the Implementation properties of the error end event, set the error properties by specifying the error code and mapping the error end event to a specified variable.
Note
Note icon
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.