org.jbpm.api.model
Interface Activity


public interface Activity

a activity in a OpenProcessDefinition graph.

The activity supports both graph based process models as well as block structured (tree based) process models. First we describe tranisions that can be used to formResourceName graph based process structures and then we'll describe activity composition to formResourceName block structured process models. Both models can be combined as well.

Activities have incoming and outgoing transitions. These are lists of transitions.

Optionally, transitions can have names. In that case the transition names are associated to activity's outgoing transitions. The map of outgoing transitions provides easy access to the named transitions.

One of the outgoing transitions can optionally be marked as the default transition.

Block structured process languages have composite activities that can be modeled with the parent-child relation.

Author:
Tom Baeyens

Method Summary
 Activity findActivity(java.lang.String activityName)
          searches for the given activity in this element recursively, including this activity and all child activities.
 Transition findOutgoingTransition(java.lang.String transitionName)
          searches for the given transitionName in this activity and then up the parent chain.
 java.util.List<? extends Activity> getActivities()
          the list of direct composite activities.
 java.util.Map<java.lang.String,? extends Activity> getActivitiesMap()
          the composite activities, keyed by activity name.
 Activity getActivity(java.lang.String activityName)
          the first composite activity with the given name or null of no such activity exists.
 Transition getDefaultOutgoingTransition()
          the default outgoing transition.
 java.util.List<? extends Transition> getIncomingTransitions()
          the list of arriving transitions.
 java.lang.String getName()
          the short display name given to this element.
 Transition getOutgoingTransition(java.lang.String transitionName)
          the first leaving transition with the given name or null of no such leaving transition exists.
 java.util.List<? extends Transition> getOutgoingTransitions()
          the list of outgoing transitions.
 java.util.Map<java.lang.String,? extends Transition> getOutgoingTransitionsMap()
          the leaving transitions, keyed by transition name.
 Activity getParentActivity()
          retrieve the parent activity in the composite activity structure.
 java.lang.String getType()
          the type of this activity which corresponds to the xml tag
 boolean hasActivities()
          indicates if this processDefinition has activities.
 boolean hasActivity(java.lang.String activityName)
          indicates if an activity with the given name exists directly in this element.
 boolean hasIncomingTransitions()
          indicates if this activity has arriving transitions
 boolean hasOutgoingTransition(java.lang.String transitionName)
          indicates if a leaving transition with the given transitionName exists.
 boolean hasOutgoingTransitions()
          indicates if this activity has leaving transitions
 

Method Detail

getName

java.lang.String getName()
the short display name given to this element.


getOutgoingTransitions

java.util.List<? extends Transition> getOutgoingTransitions()
the list of outgoing transitions. Caution: the actual member is returned. No copy is made.


getDefaultOutgoingTransition

Transition getDefaultOutgoingTransition()
the default outgoing transition.


getOutgoingTransition

Transition getOutgoingTransition(java.lang.String transitionName)
the first leaving transition with the given name or null of no such leaving transition exists. If the multiple transitions have the given transition name, the first (in order of getOutgoingTransitions()) will be returned.

Parameters:
transitionName - is the name of the transition to take. A null value will match the first unnamed transition.

hasOutgoingTransition

boolean hasOutgoingTransition(java.lang.String transitionName)
indicates if a leaving transition with the given transitionName exists. A null value matches an unnamed transition.


hasOutgoingTransitions

boolean hasOutgoingTransitions()
indicates if this activity has leaving transitions


getOutgoingTransitionsMap

java.util.Map<java.lang.String,? extends Transition> getOutgoingTransitionsMap()
the leaving transitions, keyed by transition name. If a transition with the same name occurs mutltiple times, the first one is returned. Leaving transitions with a null value for their name are not included in the map. Beware: the actual member is returned. No copy is made. In fact, the returned map is maintained as a cache. So updates to the map will influence subsequent retrievals of outgoing transitions by name.


findOutgoingTransition

Transition findOutgoingTransition(java.lang.String transitionName)
searches for the given transitionName in this activity and then up the parent chain. Returns null if no such transition is found.


getIncomingTransitions

java.util.List<? extends Transition> getIncomingTransitions()
the list of arriving transitions. Beware: the actual member is returned. No copy is made.


hasIncomingTransitions

boolean hasIncomingTransitions()
indicates if this activity has arriving transitions


getParentActivity

Activity getParentActivity()
retrieve the parent activity in the composite activity structure. This is different from ObservableElement#getParent() in that it is restricted to the parent activities. It doesn't take into account the process definition.


hasActivities

boolean hasActivities()
indicates if this processDefinition has activities.


getActivities

java.util.List<? extends Activity> getActivities()
the list of direct composite activities. Recursively contained activities are not included in the list. Beware: the actual member is returned. No copy is made.


hasActivity

boolean hasActivity(java.lang.String activityName)
indicates if an activity with the given name exists directly in this element. Only the direct contained activities are searched. No recursive search is made.


getActivity

Activity getActivity(java.lang.String activityName)
the first composite activity with the given name or null of no such activity exists. Only the direct contained activities are searched. No recursive search is made.


findActivity

Activity findActivity(java.lang.String activityName)
searches for the given activity in this element recursively, including this activity and all child activities. The search is done depth-first. A null value for activityName matches a activity without a name.


getActivitiesMap

java.util.Map<java.lang.String,? extends Activity> getActivitiesMap()
the composite activities, keyed by activity name. If an activity with the same name occurs mutltiple times, the first in the list is included in the map. Activities with a null value for their name are not included in the map. Beware: the actual member is returned. No copy is made. In fact, the returned map is maintained as a cache. So updates to the map will influence subsequent retrievals of activities by name.


getType

java.lang.String getType()
the type of this activity which corresponds to the xml tag



Copyright © 2010 JBoss Community. All Rights Reserved.