org.jbpm.api.model
Interface Activity

All Superinterfaces:
CompositeElement, ObservableElement

public interface Activity
extends CompositeElement

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 form graph based process structures and then we'll describe activity composition to form 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
 Transition findOutgoingTransition(java.lang.String transitionName)
          searches for the given transitionName in this activity and then up the parent chain.
 Transition getDefaultOutgoingTransition()
          the default outgoing transition.
 java.util.List<Transition> getIncomingTransitions()
          the list of arriving transitions.
 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<Transition> getOutgoingTransitions()
          the list of outgoing transitions.
 java.util.Map<java.lang.String,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 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
 
Methods inherited from interface org.jbpm.api.model.CompositeElement
findActivity, getActivities, getActivitiesMap, getActivity, hasActivities, hasActivity
 
Methods inherited from interface org.jbpm.api.model.ObservableElement
getDbid, getName, getParent, getProcessDefinition, getProperty, getPropertyKeys, hasEvent
 

Method Detail

getOutgoingTransitions

java.util.List<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,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<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.


getType

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



Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.