org.jbpm.pvm
Interface Node

All Superinterfaces:
CompositeElement, ObservableElement, ProcessElement, java.io.Serializable
All Known Implementing Classes:
NodeImpl, ProcessModificationsImpl.AddedNode

public interface Node
extends CompositeElement

a node in a ProcessDefinition graph.

The node 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 node composition to form block structured process models. Both models can be combined as well.

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

Optionally, transitions can have names. In that case the transition names are associated to node'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 nodes that can be modeled with the parent-child relation.

Author:
Tom Baeyens

Field Summary
static java.lang.String EVENT_NODE_ENTER
           
static java.lang.String EVENT_NODE_LEAVE
           
 
Method Summary
 Transition findOutgoingTransition(java.lang.String transitionName)
          searches for the given transitionName in this node and then up the parent chain.
 Transition getDefaultTransition()
          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.
 Node getParentNode()
          retrieve the parent node in the composite node structure.
 java.util.List<VariableDefinition> getVariableDefinitions()
          local variables declared on this node.
 boolean hasIncomingTransitions()
          indicates if this node has arriving transitions
 boolean hasOutgoingTransition(java.lang.String transitionName)
          indicates if a leaving transition with the given transitionName exists.
 boolean hasOutgoingTransitions()
          indicates if this node has leaving transitions
 boolean isExecutionAsync()
          indicates if this node should be executed asynchronously.
 boolean isLeaveAsync()
          indicates if execution should proceed asynchronously when this node is left over any of the outgoing transitions.
 boolean isPreviousNeeded()
          indicates if this node behaviour needs to know the previous node or previous transition.
 boolean isSignalAsync()
          indicates if signals should be processed asynchronously.
 
Methods inherited from interface org.jbpm.pvm.CompositeElement
findNode, getNode, getNodes, getNodesMap, hasNode, hasNodes
 
Methods inherited from interface org.jbpm.pvm.ObservableElement
getDescription, getEvent, getEvents, getName, getParent, hasEvent
 
Methods inherited from interface org.jbpm.pvm.ProcessElement
getDbid, getExceptionHandlers, getProcessDefinition, getProperty, getPropertyKeys
 

Field Detail

EVENT_NODE_LEAVE

static final java.lang.String EVENT_NODE_LEAVE
See Also:
Constant Field Values

EVENT_NODE_ENTER

static final java.lang.String EVENT_NODE_ENTER
See Also:
Constant Field Values
Method Detail

getOutgoingTransitions

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


getDefaultTransition

Transition getDefaultTransition()
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 node 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 node 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 node has arriving transitions


getParentNode

Node getParentNode()
retrieve the parent node in the composite node structure. This is different from ObservableElement.getParent() in that it is restricted to the parent nodes. It doesn't take into account the process definition.


isExecutionAsync

boolean isExecutionAsync()
indicates if this node should be executed asynchronously.


isSignalAsync

boolean isSignalAsync()
indicates if signals should be processed asynchronously.


isLeaveAsync

boolean isLeaveAsync()
indicates if execution should proceed asynchronously when this node is left over any of the outgoing transitions.


isPreviousNeeded

boolean isPreviousNeeded()
indicates if this node behaviour needs to know the previous node or previous transition. If this property is set to true, the properties Execution.getPreviousNode() and Execution.getPreviousTransition() will be available to the node behaviour when it is executed or signalled.


getVariableDefinitions

java.util.List<VariableDefinition> getVariableDefinitions()
local variables declared on this node. Beware: the actual member is returned. No copy is made.