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.
To add an action node to an activity diagram:
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
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:
For detailed information on using Activity Editor to create business logic code fragments, see Using Activity Editor.