Creating operation state

About this task

An operation state is a state in a transaction flow that is bound to an operation. To navigate from an operation state to another state, add events to the operation state.

The procedure in this topic describes how to create an operation state by dragging the Operation state icon The Operation state icon. from the Palette pane to the Transaction editor. However, if the operation that you want to use has already been created, you can drag the operation file from the Project Explorer pane to the Transaction editor as shown in Figure 1. All the properties and events of the operation file are copied to the Operation state, and the name of the operation file is displayed on the label of the Operation state.
Figure 1. Creating an Operation state by dragging an operation file to the Transaction editor

Procedure

To create an operation state, do the following steps:

  1. In the Project Explorer pane, double-click the transaction file that you want to edit.
  2. In the Transaction editor, click the Flow tab.
  3. In the Palette pane, click Operation.
  4. In the Flow tab of the Transaction editor, click the area on which you want to place the Operation state icon The Operation state icon.. If you want to change the location of the Operation state icon in the Flow tab, drag and drop the Operation state icon to the desired location.
  5. Bind an operation file to the Operation state.
    1. Click the operation state icon in the Flow tab.
    2. In the Properties tab of the Operation state, click the General tab.
    3. In the Operation field of the General tab, click the Browse icon The Browse icon. The Select Operation window opens.
    4. In the Select Operation window, select an operation for the Operation state, and then click OK.
  6. In the Events panel of the General tab, click the Add icon The Add icon. to add events to the operation.
  7. Edit the related Java file. Shown below is an example of sample code from a .java file:
    Note: In the image above, "ok" and "error" are the names of the events that are defined in the Operation state