Retrieving Transition Information of a Process Definition

The ProcessDefinition class provides functionality to retrieve information on transitions in the process definition.

Retrieving all Transitions defined in the Process Definition

Use method getAllTransitions() to get all transitions defined for the process definition:

List<Transition> getAllTransitions();

The method returns a list of Transition objects.

Retrieving a List of all Transitions with a specific Target Activity

In case you like to get a list of all transitions having as target a specified activity, use:

List<Transition> getIncomingTransitions(Activity activity);

The method returns a list of Transition objects. This list can be empty if there are no incoming transitions to the specified activity.

Retrieving a List of all Transitions with a specific Source Activity

The following method returns a list of all transitions having as source the specified activity:

List<Transition> getOutgoingTransitions(Activity activity);

The method returns a list of Transition objects. This list can be empty if there are no incoming transitions from the specified activity.

Retrieving a specific Transition

To retrieve a specific transition, specified by the transition Id, use:

Transition getTransition(String transitionId);

The method returns the requested transition or null if there is no transition with the specified Id.

Retrieving the Source Activity for a specified Transition

If you like to retrieve the source activity of a specified transition, use the following method:

Activity getSourceActivity(Transition transition);

It returns an Activity object.

Retrieving the Target Activity for a specified Transition

To get the target activity for a specified transition, use:

Activity getTargetActivity(Transition transition);

The method returns an Activity object.