Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jbpm.graph.exe
Class Token

    java.lang.Object
      org.jbpm.graph.exe.Token

All Implemented Interfaces:
  java.io.Serializable

    public class Token

extends java.lang.Object
implements java.io.Serializable

represents one path of execution and maintains a pointer to a node in the `ProcessDefinition`. Most common way to get a hold of the token objects is with `ProcessInstance.getRootToken()` or `ProcessInstance.findToken(String)`.

See Also:
  Serialized Form

Field Summary
`protected java.util.Map` | `children`
`protected java.util.List` | `comments`
`protected java.util.Date` | `end`
`protected java.lang.String` | `name`
`protected int` | `nextLogIndex`
`protected Node` | `node`
`protected java.util.Date` | `nodeEnter`
`protected Token` | `parent`
`protected ProcessInstance` | `processInstance`
`protected java.util.Date` | `start`
`protected ProcessInstance` | `subProcessInstance`

Constructor Summary
`Token()`
`Token(ProcessInstance processInstance)` creates a root token.
`Token(Token parent, java.lang.String name)` creates a child token.

Method Summary
`void` | `addComment(Comment comment)`
`void` | `addComment(java.lang.String message)`
`void` | `addLog(ProcessLog processLog)` convenience method for adding a process log.
`void` | `checkImplicitTermination()`
`void` | `collectChildrenRecursively(java.util.List tokens)`
`ProcessInstance` | `createSubProcessInstance(ProcessDefinition subProcessDefinition)`
`void` | `end()` ends this token and all of its children (if any). this is the last active (=not-ended) child of a parent token, the parent token will be ended as well and that verification will continue to propagate.
`void` | `end(boolean verifyParentTermination)` ends this token with optional parent ending verification.
`void` | `endCompositeLog()` convenience method for ending a composite log.
`boolean` | `equals(java.lang.Object o)`
`Token` | `findToken(java.lang.String relativeTokenPath)`
`java.util.Map` | `getActiveChildren()`
`java.util.Set` | `getAvailableTransitions()` a set of all the leaving transitions on the current node for which the condition expression resolves to true.
`Token` | `getChild(java.lang.String name)`
`java.util.Map` | `getChildren()`
`java.util.List` | `getChildrenAtNode(Node aNode)`
`java.util.List` | `getComments()`
`java.util.Date` | `getEnd()`
`java.lang.String` | `getFullName()`
`long` | `getId()`
`java.lang.String` | `getName()`
`Node` | `getNode()`
`java.util.Date` | `getNodeEnter()`
`Token` | `getParent()`
`ProcessInstance` | `getProcessInstance()`
`java.util.Date` | `getStart()`
`ProcessInstance` | `getSubProcessInstance()`
`boolean` | `hasActiveChildren()` tells if this token has child tokens that have not yet ended.
`boolean` | `hasChild(java.lang.String name)`
`boolean` | `hasEnded()`
`boolean` | `hasParent()`
`boolean` | `isAbleToReactivateParent()`
`boolean` | `isLocked()`
`boolean` | `isRoot()`
`boolean` | `isSuspended()`
`boolean` | `isTerminatedImplicitly()`
`boolean` | `isTerminationImplicit()`
`void` | `lock(java.lang.String lockOwnerId)` locks a process instance for further execution.
`int` | `nextLogIndex()`
`void` | `resume()` resumes a process execution.
`void` | `setAbleToReactivateParent(boolean isAbleToReactivateParent)`
`void` | `setNode(Node node)`
`void` | `setNodeEnter(java.util.Date nodeEnter)`
`void` | `setParent(Token parent)`
`void` | `setProcessInstance(ProcessInstance processInstance)`
`void` | `setSubProcessInstance(ProcessInstance subProcessInstance)`
`void` | `setTerminationImplicit(boolean isTerminationImplicit)`
`void` | `signal()` provides a signal to the token. this method activates this token and leaves the current state over the default transition.
`void` | `signal(java.lang.String transitionName)` provides a signal to the token. this leave the current state over the given transition name.
`void` | `signal(Transition transition)` provides a signal to the token. this leave the current state over the given transition name.
`void` | `startCompositeLog(CompositeLog compositeLog)` convenience method for starting a composite log.
`void` | `suspend()` suspends a process execution.
`java.lang.String` | `toString()`
`void` | `unlock(java.lang.String lockOwnerId)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### name

    protected java.lang.String name

### start

    protected java.util.Date start

### end

    protected java.util.Date end

### node

    protected Node node

### nodeEnter

    protected java.util.Date nodeEnter

### processInstance

    protected ProcessInstance processInstance

### parent

    protected Token parent

### children

    protected java.util.Map children

### comments

    protected java.util.List comments

### subProcessInstance

    protected ProcessInstance subProcessInstance

### nextLogIndex

    protected int nextLogIndex

Constructor Detail

### Token

    public Token()

### Token

    public Token(ProcessInstance processInstance)

  creates a root token.

### Token

    public Token(Token parent,
                 java.lang.String name)

  creates a child token.

Method Detail

### signal

    public void signal()

  provides a signal to the token. this method activates this token and leaves the current state over the default transition.

### signal

    public void signal(java.lang.String transitionName)

  provides a signal to the token. this leave the current state over the given transition name.

### signal

    public void signal(Transition transition)

  provides a signal to the token. this leave the current state over the given transition name.

### getAvailableTransitions

    public java.util.Set getAvailableTransitions()

  a set of all the leaving transitions on the current node for which the condition expression resolves to true.

### end

    public void end()

  ends this token and all of its children (if any). this is the last active (=not-ended) child of a parent token, the parent token will be ended as well and that verification will continue to propagate.

### end

    public void end(boolean verifyParentTermination)

  ends this token with optional parent ending verification.

  Parameters:
    `verifyParentTermination` - specifies if the parent token should be checked for termination. if verifyParentTermination is set to true and this is the last non-ended child of a parent token, the parent token will be ended as well and the verification will continue to propagate.

### addComment

    public void addComment(java.lang.String message)

### addComment

    public void addComment(Comment comment)

### getComments

    public java.util.List getComments()

### hasActiveChildren

    public boolean hasActiveChildren()

  tells if this token has child tokens that have not yet ended.

### addLog

    public void addLog(ProcessLog processLog)

  convenience method for adding a process log.

### startCompositeLog

    public void startCompositeLog(CompositeLog compositeLog)

  convenience method for starting a composite log. When you add composite logs, make sure you put the `endCompositeLog()` in a finally block.

### endCompositeLog

    public void endCompositeLog()

  convenience method for ending a composite log. Make sure you put this in a finally block.

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### hasEnded

    public boolean hasEnded()

### isRoot

    public boolean isRoot()

### hasParent

    public boolean hasParent()

### hasChild

    public boolean hasChild(java.lang.String name)

### getChild

    public Token getChild(java.lang.String name)

### getFullName

    public java.lang.String getFullName()

### getChildrenAtNode

    public java.util.List getChildrenAtNode(Node aNode)

### collectChildrenRecursively

    public void collectChildrenRecursively(java.util.List tokens)

### findToken

    public Token findToken(java.lang.String relativeTokenPath)

### getActiveChildren

    public java.util.Map getActiveChildren()

### checkImplicitTermination

    public void checkImplicitTermination()

### isTerminatedImplicitly

    public boolean isTerminatedImplicitly()

### nextLogIndex

    public int nextLogIndex()

### suspend

    public void suspend()

  suspends a process execution.

### resume

    public void resume()

  resumes a process execution.

### equals

    public boolean equals(java.lang.Object o)

  Overrides:
    `equals` in class `java.lang.Object`

### createSubProcessInstance

    public ProcessInstance createSubProcessInstance(ProcessDefinition subProcessDefinition)

### lock

    public void lock(java.lang.String lockOwnerId)

  locks a process instance for further execution. A locked token cannot continue execution. This is a non-persistent operation. This is used to prevent tokens being propagated during the execution of actions.

  See Also:
    `unlock(String)`

### unlock

    public void unlock(java.lang.String lockOwnerId)

  See Also:
    `lock(String)`

### isLocked

    public boolean isLocked()

### getId

    public long getId()

### getStart

    public java.util.Date getStart()

### getEnd

    public java.util.Date getEnd()

### getName

    public java.lang.String getName()

### getProcessInstance

    public ProcessInstance getProcessInstance()

### getChildren

    public java.util.Map getChildren()

### getNode

    public Node getNode()

### setNode

    public void setNode(Node node)

### getParent

    public Token getParent()

### setParent

    public void setParent(Token parent)

### setProcessInstance

    public void setProcessInstance(ProcessInstance processInstance)

### getSubProcessInstance

    public ProcessInstance getSubProcessInstance()

### getNodeEnter

    public java.util.Date getNodeEnter()

### setNodeEnter

    public void setNodeEnter(java.util.Date nodeEnter)

### isAbleToReactivateParent

    public boolean isAbleToReactivateParent()

### setAbleToReactivateParent

    public void setAbleToReactivateParent(boolean isAbleToReactivateParent)

### isTerminationImplicit

    public boolean isTerminationImplicit()

### setTerminationImplicit

    public void setTerminationImplicit(boolean isTerminationImplicit)

### isSuspended

    public boolean isSuspended()

### setSubProcessInstance

    public void setSubProcessInstance(ProcessInstance subProcessInstance)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD