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 37 shows the Action Properties dialog box.
Action nodes contain activity definitions. Activity definitions (also called code fragments) consist of calls to the collaboration API or other Java(TM) code, and can contain operations such as the following:
Activity definitions can contain any of the Java programming language constructs.
Activity definitions can be added to action nodes in two ways:
To add Java code directly to the Code Fragment window in the Action Properties dialog box, do the following:
To add an activity definition using Activity Editor, do the following:
You can use the Java operators in activity definitions, particularly the relational and conditional operators along with the arithmetic operators.
All Java classes inherit from the base Object class. As such, every class has an equals() method available to it. Its signature is as follows:
public boolean equals(Object obj);
The equals() method is concerned with value equality. It compares the object calling the method and the object referenced by obj for equality, returning true if they have the same value and false if they do not. Note that this differs from the equality operators == and !=. These two equality operators determine if two references refer to the same object, regardless of the value of the object. This is an important distinction.
Table 37 summarizes the available equality operators. Each equality or relational operator yields a boolean value result.
Note that results of boolean expressions can be joined with the conditional AND (&&) and the conditional OR (||) symbols.
Table 38 summarizes the arithmetic operators, including the increment and decrement operators.
If you want to include a Web service in a collaboration template's activity definition, you must first export the Web service from the Integration Component Library (ICL) project in System Manager. Each method in the Web service is exported as a function block to Activity Editor, where it can be placed in the activity definition. For more information, see Web services function blocks.
For more information on coding logic for an action node, refer to the following table:
Additional resources | Location |
---|---|
Detailed description of Activity Editor, including examples of using function blocks | Using Activity Editor |
Examples of code fragments | Coding tips and examples. |
Reference pages for individual function blocks | Business object function blocks through Utilities function blocks |
Reference pages for individual methods in the collaboration API | BaseCollaboration class through CollaborationException class. |