> #### 6.2.1 Assigning Java Actions

> Java Actions can be assigned to either the process definition as a whole or to individual nodes (except for the Start and EXIT nodes). For this reason, you can access an Action Set tab from either the Process Definition Properties dialog or the properties dialogs of the individual nodes.

> NOTE: The dialogs displayed in this section are for Activity nodes. Activity nodes were used in these examples because there are three different types of actions that can be associated with it. Other node types are more limited in the types of actions that can be associated with them. For example, the Complex Condition Node can only have Prologue Actions associated with it. A DB Custom Node can only have database actions associated with it. However, the functionality used to deal with Actions is the same.

> These groupings of Actions are called Action Sets because they execute as a single unit. All Business Actions within a set operate within a single transaction. This means they all complete (as far as the database is concerned), or none complete. If any of the actions fails by throwing an exception, the database will be rolled back to the state it was when the set started executing. If you are using XA transactions, then all of the resources participating in the transaction will be rolled back. Of course, if the Actions access resources that are not guarded by the transaction, such as an SMTP email server, then those effects can not be rolled back. In practice this means that if you have an action manipulating variables followed by an action that throws an exception, it will appear as if the earlier action was not working. If you wish to make actions run in separate transactions, then simply move them to different sets, in different nodes, and make sure that the "commit transaction" flag is on for that node.

> ###### To assign a Java Action:

> 1. Display the process definition.

> 2. Add the data items you will need for your Java Action to the process definition. See Define the set of user-defined process attributes for instructions.

> Note: If you do not add the correct data items to your process definition, your Java Action may work unpredictably. For example in Generic Java Actions, the method that you want to use in your Java Action may be unavailable. A method will be available only if all the data items that it uses are defined as user-defined attributes.

> Also in Generic Java Actions, only methods that use non-primitive data types (String, Integer, Float, etc.) will appear in the Method Name drop-down list. The only exception to this is the use of the IflowEnactmentContextIntf object. For more information on methods that include this class, see Chapter 5, the "JavaActions" section of the Interstage BPM Developer's Guide.

> 3. For an activity action set, right-click a node and select Action Set from the popup menu. For a process-level action set, click the Properties button in the Target Area.

> A pane like the following appears*:

> Figure 54: The Action Set pane

> 4. Click the Add button corresponding to the position where you want to add the Java Action.

> The Action List dialog box appears:

> Figure 55: The Action List Dialog Box

> 5. Select one of the actions available in the Action Type List dialog box, then click the Create button.

> The action editor for the selected action type appears. In the example, Generic JavaAction was selected, and the Generic Java Action Editor would appear. Instructions for all the various Java Actions are provided in the sections below.

Business Process Manager Help-Fujitsu Computer Systems Corporation Interstage Website Voice: (888) 248-9273 Interstage BPM Information