org.jbpm.command
Class AbstractTokenBaseCommand

java.lang.Object
  extended by org.jbpm.command.AbstractTokenBaseCommand
All Implemented Interfaces:
Serializable, Command
Direct Known Subclasses:
BatchSignalCommand, ResumeTokenCommand, SuspendTokenCommand, UnlockTokenCommand

public abstract class AbstractTokenBaseCommand
extends Object
implements Command

Abstract base class for commands working on Tokens. The Token can either be specified by id or multiple ids. The alternative is to specify a ProcessDefinition name, a required node name and version. In this case all found Tokens are processed. If no version is specified, all versions are taken into account.

Author:
bernd.ruecker@camunda.com
See Also:
Serialized Form

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
AbstractTokenBaseCommand()
           
 
Method Summary
 Object execute(JbpmContext jbpmContext)
           
abstract  Object execute(Token token)
           
 String getAdditionalToStringInformation()
           
protected  JbpmContext getJbpmContext()
           
 String getProcessName()
           
 int getProcessVersion()
           
 String getStateName()
           
 long getTokenId()
          return the token id in case only one token id is set.
 long[] getTokenIds()
           
 AbstractTokenBaseCommand processName(String processName)
           
 AbstractTokenBaseCommand processVersion(int processVersion)
           
 void setProcessName(String processName)
           
 void setProcessVersion(int processVersion)
           
 void setStateName(String stateName)
           
 void setTokenId(long tokenId)
           
 void setTokenIds(long[] tokenIds)
           
 AbstractTokenBaseCommand stateName(String stateName)
           
 AbstractTokenBaseCommand tokenId(long tokenId)
           
 AbstractTokenBaseCommand tokenIds(long[] tokenIds)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

AbstractTokenBaseCommand

public AbstractTokenBaseCommand()
Method Detail

getJbpmContext

protected JbpmContext getJbpmContext()

execute

public Object execute(JbpmContext jbpmContext)
               throws Exception
Specified by:
execute in interface Command
Throws:
Exception

execute

public abstract Object execute(Token token)

setTokenIds

public void setTokenIds(long[] tokenIds)

setTokenId

public void setTokenId(long tokenId)

getAdditionalToStringInformation

public String getAdditionalToStringInformation()

getProcessName

public String getProcessName()

setProcessName

public void setProcessName(String processName)

getProcessVersion

public int getProcessVersion()

setProcessVersion

public void setProcessVersion(int processVersion)

getStateName

public String getStateName()

setStateName

public void setStateName(String stateName)

getTokenIds

public long[] getTokenIds()

getTokenId

public long getTokenId()
return the token id in case only one token id is set. Otherwise an IllegalStateException is thrown


toString

public String toString()
Overrides:
toString in class Object

tokenIds

public AbstractTokenBaseCommand tokenIds(long[] tokenIds)

tokenId

public AbstractTokenBaseCommand tokenId(long tokenId)

processName

public AbstractTokenBaseCommand processName(String processName)

processVersion

public AbstractTokenBaseCommand processVersion(int processVersion)

stateName

public AbstractTokenBaseCommand stateName(String stateName)


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