Action nodes

An action node (often called simply an action) represents a step in a collaboration. It is the basic building block of collaboration logic. The breakdown of the collaboration's logic into action nodes is completely up to you. You can write many lines of complex code in a single action or divide the logic into numerous individual actions. Breaking a collaboration's logic into action nodes is analogous to developing program code. You can write a program with a short main routine that invokes a series of subroutines or method calls to carry out the program function. Or, you can write a longer main routine that includes all program logic inline.

Adding an action to a diagram

To add an action node to an activity diagram:

  1. In the Symbols toolbar, click the Action button.
  2. Click in the workspace to place the Action symbol.

Note:
An action node can make a service call if you attach the Service Call symbol to the action. For information on service calls, refer to "Service calls".

Defining action node properties

After the action node appears in the activity diagram, use the Action Properties dialog box to define any of the following properties for the node:

Open the Action Properties dialog box by doing one of the following:

The Action Properties dialog displays with the name of the action node at the top of the dialog. This name has the following format:

Action_UID
 

where UID specifies the unique identifier for the action node. Figure 28 shows the Action Properties dialog box.

Figure 28. Action Properties dialog


Adding code fragments to an action node

Action nodes contain code fragments. Code fragments (also called activity definitions) consist of calls to the collaboration API or other Java code, and can contain operations such as the following:

Code fragments are added to action nodes with Activity Editor. The Graphical view of the Activity Editor enables you to specify the action node's logic without having to write Java code. Instead, you can drag and drop function blocks onto the workspace to represent the flow of the activity definition.

The basic steps for adding business logic to an action node are as follows:

  1. Right-click the action node to display its context menu.
  2. From the context menu, click Properties. The Action Properties dialog box is displayed.
  3. Click Edit to open the Activity Editor.
  4. Add the activity definition.
  5. Close the Activity Editor. The Action Properties dialog box is still open, and it now displays the code fragment associated with the activity definition.
  6. Click Apply to save your changes.

For detailed information on using Activity Editor to create business logic code fragments, see Using Activity Editor.

Copyright IBM Corp. 2003, 2004