Example: Defining states and transitions

The first thing to do is add a state named cstWorkInProgress. To add a state, click the Add State action in the menu at the top of the State Transitions panel. The State Transitions panel now looks like the following figure.
Figure 1. State Transitions panel with second state
The image is explained in the text.

The new state has no name. When new states are added, they automatically become the selected state. The form to edit the new state's properties appears in the left side of the panel. Set the name of the new state to cstWorkInProgress.

The next thing to do is to add a state transition action from the null state to the cstWorkInProgress state. To add this transition, first click the null state. Then click the Add Transition action in the left panel. Nothing happens right after you click the action. Then click the cstWorkInProgress state. After clicking the cstWorkInProgress state, a blank state transition action symbol appears from the null state to the cstWorkInProgress state. The State Transitions panel now looks like the following figure.
Figure 2. Work in Progress state and transition
The image is explained in the text.
Specify the properties of a state transition action with the following fields:
Action

This is the name of the state transition action that will trigger this transition. The state transition action's name is used to identify the action from workflows.

Actions of the same name will trigger the same event. If you want the same labeled action to trigger different asynchronous workflows, use a different Action name in this field.

Use the naming conventions in "Naming conventions".

Label

This is the text that will be used to identify the state transition action in a menu that a user sees and in life cycle diagrams.

State transition action labels containing two or more words will not wrap/break between the words if the browser window is resized smaller. Instead, the wrap/break occurs between different labels.

Class or Ejb Name
This field is used to integrate a state transition action with a piece of the internal logic in the IBM TRIRIGA Application Platform. You should not put a value in this field unless specifically told to do so in the documentation or by your IBM® TRIRIGA® team.
Method Name
This field is used to integrate a state transition action with a piece of the internal logic in the IBM TRIRIGA Application Platform. You should not put a value in this field unless specifically told to do so in the documentation or by your IBM TRIRIGA team.
Default Display

The state transition family is part of the definition of a business object. When you define a form to edit records created from the business object, one of the things to specify is whether the state transition action to trigger this state transition will appear in the form's action buttons by default. As described in "Sub actions", a sub action can override this with its Inclusion Exclusion section.

The value of the Default Display property in the corresponding form overrides the value in the business object. See the discussion in "State-based actions". If you change the Default Display value in the business object after a form already exists, the Default Display property in the form still controls whether or not the state transition action displays to the user.

Read Only

When a state transition action is triggered, the record is read only if the state it is transitioning to is read only. To make a state read only, all of the state transition actions coming out of that state must have this check box checked.

At runtime, a state will be read only if all of the state transition actions visible on the form have the Read Only property checked.

Close Window
If this check box is checked, the window containing the record on which the state transition action appears closes when a user clicks the action button.
Secondary Action
If this check box is checked, the action is automatically put into the More menu for that form. If the check box is not checked, the action appears as a button on the form's menu bar. See "State-based actions" for more details on the effect of this property.
Fill in the fields shown in the previous figure, setting the Action field to cstCreate and the Label field to Create. Click the Apply action above Transition Properties. The name Create appears in the state transition action symbol. Click the cstWorkInProgress state. The life cycle diagram now looks like the following figure.
Figure 3. Life cycle diagram with new state added
The image is explained in the text.
Continue adding the rest of the states and state transition actions. Click the Add State action. This adds a new state. Set the name of the state to cstAbandoned. Then create a state transition action from the cstWorkInProgress state to the cstAbandoned state. Label this new state transition action Abandon and have it trigger an action named cstAbandon. At this point, the life cycle diagram looks like the following figure.
Figure 4. Life cycle diagram with abandoned state added
The image is explained in the text.

Build the rest of the state transition family. The completed life cycle diagram looks like the figure in "Life cycle diagrams".

When you are finished entering the states and state transition actions, click Save to save the diagram. Click Cancel to close the state transition diagram.

The following reviews the remaining actions in the upper right corner:
Print
This action allows you to print the contents of the state transition diagram.
Autosort
Prior to IBM TRIRIGA Application Platform 3.0, whenever you saved a state transition diagram, a built in algorithm rearranged the states for you. Unfortunately this algorithm did not let you use your own judgment in how to best place the states for optimal readability. Starting in IBM TRIRIGA Application Platform 3.0, the states retain their ordering when you click Save, and the previous algorithm is tied to the Autosort action. Note that the Autosort action does not commit to the database, so if you click Autosort and do not like the outcome, you can simply Cancel and reopen the diagram to restore the original ordering.
Import
This is described in "State transition family reuse". Note that, unlike Autosort, the system saves the results of this action to the database.