org.jbpm.graph.def
Class GraphElement

java.lang.Object
  extended by org.jbpm.graph.def.GraphElement
All Implemented Interfaces:
Serializable, Identifiable
Direct Known Subclasses:
Node, ProcessDefinition, Task, Transition

public abstract class GraphElement
extends Object
implements Identifiable, Serializable

See Also:
Serialized Form

Field Summary
protected  String description
           
protected  Map events
           
protected  List exceptionHandlers
           
protected  String name
           
protected  ProcessDefinition processDefinition
           
 
Constructor Summary
GraphElement()
           
GraphElement(String name)
           
 
Method Summary
 Event addEvent(Event event)
           
 ExceptionHandler addExceptionHandler(ExceptionHandler exceptionHandler)
           
protected  ExecuteActionJob createAsyncActionExecutionJob(Token token, Action action)
           
 boolean equals(Object o)
           
 void executeAction(Action action, ExecutionContext executionContext)
           
protected  ExceptionHandler findExceptionHandler(Throwable exception)
           
 void fireAndPropagateEvent(String eventType, ExecutionContext executionContext)
           
 void fireEvent(String eventType, ExecutionContext executionContext)
           
 String getDescription()
           
 Event getEvent(String eventType)
           
 Map getEvents()
          gets the events, keyed by eventType (java.lang.String).
 List getExceptionHandlers()
          is the list of exception handlers associated to this graph element.
 long getId()
           
 String getName()
           
 GraphElement getParent()
           
 List getParentChain()
           
 List getParents()
           
 ProcessDefinition getProcessDefinition()
           
abstract  String[] getSupportedEventTypes()
          indicative set of event types supported by this graph element.
 boolean hasEvent(String eventType)
           
 boolean hasEvents()
           
 int hashCode()
           
 void raiseException(Throwable exception, ExecutionContext executionContext)
          looks for an exception handler in this graph element and then recursively up the parent hierarchy.
 Event removeEvent(Event event)
           
 void removeExceptionHandler(ExceptionHandler exceptionHandler)
           
 void reorderExceptionHandler(int oldIndex, int newIndex)
           
 void setDescription(String description)
           
 void setName(String name)
           
 void setProcessDefinition(ProcessDefinition processDefinition)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected String name

description

protected String description

processDefinition

protected ProcessDefinition processDefinition

events

protected Map events

exceptionHandlers

protected List exceptionHandlers
Constructor Detail

GraphElement

public GraphElement()

GraphElement

public GraphElement(String name)
Method Detail

getSupportedEventTypes

public abstract String[] getSupportedEventTypes()
indicative set of event types supported by this graph element. this is currently only used by the process designer to know which event types to show on a given graph element. in process definitions and at runtime, there are no constraints on the event-types.


getEvents

public Map getEvents()
gets the events, keyed by eventType (java.lang.String).


hasEvents

public boolean hasEvents()

getEvent

public Event getEvent(String eventType)

hasEvent

public boolean hasEvent(String eventType)

addEvent

public Event addEvent(Event event)

removeEvent

public Event removeEvent(Event event)

getExceptionHandlers

public List getExceptionHandlers()
is the list of exception handlers associated to this graph element.


addExceptionHandler

public ExceptionHandler addExceptionHandler(ExceptionHandler exceptionHandler)

removeExceptionHandler

public void removeExceptionHandler(ExceptionHandler exceptionHandler)

reorderExceptionHandler

public void reorderExceptionHandler(int oldIndex,
                                    int newIndex)

fireEvent

public void fireEvent(String eventType,
                      ExecutionContext executionContext)

fireAndPropagateEvent

public void fireAndPropagateEvent(String eventType,
                                  ExecutionContext executionContext)

createAsyncActionExecutionJob

protected ExecuteActionJob createAsyncActionExecutionJob(Token token,
                                                         Action action)

executeAction

public void executeAction(Action action,
                          ExecutionContext executionContext)

raiseException

public void raiseException(Throwable exception,
                           ExecutionContext executionContext)
looks for an exception handler in this graph element and then recursively up the parent hierarchy. If an exception handler is found, it is applied. If the exception handler does not rethrow, the exception is considered handled. Otherwise the rethrown exception is propagated up the parent hierarchy.

Throws:
DelegationException - if no applicable exception handler is found

findExceptionHandler

protected ExceptionHandler findExceptionHandler(Throwable exception)

getParent

public GraphElement getParent()

getParents

public List getParents()
Returns:
the ancestors of this graph element ordered by depth.

getParentChain

public List getParentChain()
Returns:
this graph element plus the ancestors ordered by depth.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getId

public long getId()
Specified by:
getId in interface Identifiable

getName

public String getName()

setName

public void setName(String name)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getProcessDefinition

public ProcessDefinition getProcessDefinition()

setProcessDefinition

public void setProcessDefinition(ProcessDefinition processDefinition)


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