org.jbpm.taskmgmt.exe
Class TaskInstance

java.lang.Object
  extended by org.jbpm.context.exe.VariableContainer
      extended by org.jbpm.taskmgmt.exe.TaskInstance
All Implemented Interfaces:
java.io.Serializable, Identifiable, Assignable

public class TaskInstance
extends VariableContainer
implements Identifiable, Assignable

is one task instance that can be assigned to an actor (read: put in someone's task list) and that can trigger the continuation of execution of the token upon completion.

See Also:
Serialized Form

Field Summary
protected  java.lang.String actorId
           
protected  java.util.List comments
           
protected  java.util.Date create
           
protected  java.lang.String description
           
protected  java.util.Date dueDate
           
protected  java.util.Date end
           
protected  boolean isBlocking
           
protected  boolean isCancelled
           
protected  boolean isOpen
           
protected  boolean isSignalling
           
protected  boolean isSuspended
           
protected  java.lang.String name
           
protected  java.util.Set pooledActors
           
protected  java.lang.String previousActorId
           
protected  int priority
           
protected  ProcessInstance processInstance
           
protected  java.util.Date start
           
protected  SwimlaneInstance swimlaneInstance
           
protected  Task task
           
protected  TaskMgmtInstance taskMgmtInstance
           
protected  Token token
           
 
Fields inherited from class org.jbpm.context.exe.VariableContainer
variableInstances
 
Constructor Summary
TaskInstance()
           
TaskInstance(java.lang.String taskName)
           
TaskInstance(java.lang.String taskName, java.lang.String actorId)
           
 
Method Summary
 void addComment(Comment comment)
           
 void addComment(java.lang.String message)
           
 void assign(ExecutionContext executionContext)
           
 void cancel()
          cancels this task.
 void cancel(java.lang.String transitionName)
          cancels this task, takes the specified transition.
 void cancel(Transition transition)
          cancels this task, takes the specified transition.
 void copySwimlaneInstanceAssignment(SwimlaneInstance swimlaneInstance)
          copies the assignment (that includes both the swimlaneActorId and the set of pooledActors) of the given swimlane into this taskInstance.
 void create()
           
 void create(ExecutionContext executionContext)
           
 void end()
          marks this task as done.
 void end(java.lang.String transitionName)
          marks this task as done and specifies the name of a transition leaving the task-node for the case that the completion of this task instances triggers a signal on the token.
 void end(Transition transition)
          marks this task as done and specifies a transition leaving the task-node for the case that the completion of this task instances triggers a signal on the token.
 boolean equals(java.lang.Object o)
           
 java.lang.String getActorId()
           
 java.util.List getAvailableTransitions()
          is the list of transitions that can be used in the end method and it is null in case this is not the last task instance.
 java.util.List getComments()
           
 java.util.Date getCreate()
           
 java.lang.String getDescription()
           
 java.util.Date getDueDate()
           
 java.util.Date getEnd()
           
 long getId()
           
 java.lang.String getName()
           
protected  VariableContainer getParentVariableContainer()
           
 java.util.Set getPooledActors()
          gets the pool of actors for this task instance.
 java.lang.String getPreviousActorId()
           
 int getPriority()
           
 ProcessInstance getProcessInstance()
           
 java.util.Date getStart()
           
 SwimlaneInstance getSwimlaneInstance()
           
 Task getTask()
           
 TaskMgmtInstance getTaskMgmtInstance()
           
 Token getToken()
           
 boolean hasEnded()
           
 boolean isBlocking()
           
 boolean isCancelled()
           
 boolean isLast()
           
 boolean isOpen()
           
 boolean isSignalling()
           
 boolean isStartTaskInstance()
           
 boolean isSuspended()
           
 void resume()
          resumes a process execution.
 void setActorId(java.lang.String actorId)
          (re)assign this task to the given actor.
 void setActorId(java.lang.String actorId, boolean overwriteSwimlane)
          (re)assign this task to the given actor.
 void setBlocking(boolean isBlocking)
           
 void setCreate(java.util.Date create)
           
 void setDescription(java.lang.String description)
           
 void setDueDate(java.util.Date dueDate)
           
 void setEnd(java.util.Date end)
           
 void setId(long id)
           
 void setName(java.lang.String name)
           
 void setPooledActors(java.util.Set pooledActors)
          takes a set of PooledActors
 void setPooledActors(java.lang.String[] actorIds)
          takes a set of String's as the actorIds
 void setPriority(int priority)
           
 void setProcessInstance(ProcessInstance processInstance)
           
 void setSignalling(boolean isSignalling)
           
 void setStart(java.util.Date date)
          overwrite start date
 void setSwimlaneInstance(SwimlaneInstance swimlaneInstance)
           
 void setTask(Task task)
           
 void setTaskMgmtInstance(TaskMgmtInstance taskMgmtInstance)
           
 void setToken(Token token)
           
 void start()
          can optionally be used to indicate that the actor is starting to work on this task instance.
 void start(java.lang.String actorId)
          convenience method that combines a setActorId(String) and a start().
 void start(java.lang.String actorId, boolean overwriteSwimlane)
          convenience method that combines a setActorId(String,boolean) and a start().
 void suspend()
          suspends a process execution.
 java.lang.String toString()
           
 
Methods inherited from class org.jbpm.context.exe.VariableContainer
addVariableInstance, addVariables, deleteVariable, deleteVariableInstance, deleteVariableLocally, getContextInstance, getUpdatedVariableContainers, getVariable, getVariableInstance, getVariableInstances, getVariableLocally, getVariables, getVariablesLocally, hasVariable, hasVariableLocally, setVariable, setVariableLocally, setVariables
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

description

protected java.lang.String description

actorId

protected java.lang.String actorId

create

protected java.util.Date create

start

protected java.util.Date start

end

protected java.util.Date end

dueDate

protected java.util.Date dueDate

priority

protected int priority

isCancelled

protected boolean isCancelled

isSuspended

protected boolean isSuspended

isOpen

protected boolean isOpen

isSignalling

protected boolean isSignalling

isBlocking

protected boolean isBlocking

task

protected Task task

token

protected Token token

swimlaneInstance

protected SwimlaneInstance swimlaneInstance

taskMgmtInstance

protected TaskMgmtInstance taskMgmtInstance

processInstance

protected ProcessInstance processInstance

pooledActors

protected java.util.Set pooledActors

comments

protected java.util.List comments

previousActorId

protected java.lang.String previousActorId
Constructor Detail

TaskInstance

public TaskInstance()

TaskInstance

public TaskInstance(java.lang.String taskName)

TaskInstance

public TaskInstance(java.lang.String taskName,
                    java.lang.String actorId)
Method Detail

setTask

public void setTask(Task task)

create

public void create()

create

public void create(ExecutionContext executionContext)

assign

public void assign(ExecutionContext executionContext)

isStartTaskInstance

public boolean isStartTaskInstance()

copySwimlaneInstanceAssignment

public void copySwimlaneInstanceAssignment(SwimlaneInstance swimlaneInstance)
copies the assignment (that includes both the swimlaneActorId and the set of pooledActors) of the given swimlane into this taskInstance.


getPooledActors

public java.util.Set getPooledActors()
gets the pool of actors for this task instance. If this task has a simlaneInstance and no pooled actors, the pooled actors of the swimlane instance are returned.


setActorId

public void setActorId(java.lang.String actorId)
(re)assign this task to the given actor. If this task is related to a swimlane instance, that swimlane instance will be updated as well.

Specified by:
setActorId in interface Assignable

setActorId

public void setActorId(java.lang.String actorId,
                       boolean overwriteSwimlane)
(re)assign this task to the given actor.

Parameters:
actorId - is reference to the person that is assigned to this task.
overwriteSwimlane - specifies if the related swimlane should be overwritten with the given swimlaneActorId.

setPooledActors

public void setPooledActors(java.lang.String[] actorIds)
takes a set of String's as the actorIds

Specified by:
setPooledActors in interface Assignable

start

public void start()
can optionally be used to indicate that the actor is starting to work on this task instance.


start

public void start(java.lang.String actorId)
convenience method that combines a setActorId(String) and a start().


start

public void start(java.lang.String actorId,
                  boolean overwriteSwimlane)
convenience method that combines a setActorId(String,boolean) and a start().


setStart

public void setStart(java.util.Date date)
overwrite start date


cancel

public void cancel()
cancels this task. This task instance will be marked as cancelled and as ended. But cancellation doesn't influence signalling and continuation of process execution.


cancel

public void cancel(Transition transition)
cancels this task, takes the specified transition. This task intance will be marked as cancelled and as ended. But cancellation doesn't influence singalling and continuation of process execution.


cancel

public void cancel(java.lang.String transitionName)
cancels this task, takes the specified transition. This task intance will be marked as cancelled and as ended. But cancellation doesn't influence singalling and continuation of process execution.


end

public void end()
marks this task as done. If this task is related to a task node this might trigger a signal on the token.

See Also:
end(Transition)

end

public void end(java.lang.String transitionName)
marks this task as done and specifies the name of a transition leaving the task-node for the case that the completion of this task instances triggers a signal on the token. If this task leads to a signal on the token, the given transition name will be used in the signal. If this task completion does not trigger execution to move on, the transitionName is ignored.


end

public void end(Transition transition)
marks this task as done and specifies a transition leaving the task-node for the case that the completion of this task instances triggers a signal on the token. If this task leads to a signal on the token, the given transition name will be used in the signal. If this task completion does not trigger execution to move on, the transition is ignored.


hasEnded

public boolean hasEnded()

suspend

public void suspend()
suspends a process execution.


resume

public void resume()
resumes a process execution.


addComment

public void addComment(java.lang.String message)

addComment

public void addComment(Comment comment)

getComments

public java.util.List getComments()

isLast

public boolean isLast()

getAvailableTransitions

public java.util.List getAvailableTransitions()
is the list of transitions that can be used in the end method and it is null in case this is not the last task instance.


equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setPooledActors

public void setPooledActors(java.util.Set pooledActors)
takes a set of PooledActors


getParentVariableContainer

protected VariableContainer getParentVariableContainer()
Specified by:
getParentVariableContainer in class VariableContainer

getActorId

public java.lang.String getActorId()

getDueDate

public java.util.Date getDueDate()

setDueDate

public void setDueDate(java.util.Date dueDate)

getEnd

public java.util.Date getEnd()

setEnd

public void setEnd(java.util.Date end)

setCreate

public void setCreate(java.util.Date create)

getId

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

setId

public void setId(long id)

getStart

public java.util.Date getStart()

getTaskMgmtInstance

public TaskMgmtInstance getTaskMgmtInstance()

setTaskMgmtInstance

public void setTaskMgmtInstance(TaskMgmtInstance taskMgmtInstance)

getToken

public Token getToken()
Specified by:
getToken in class VariableContainer

setToken

public void setToken(Token token)

setSignalling

public void setSignalling(boolean isSignalling)

isSignalling

public boolean isSignalling()

isCancelled

public boolean isCancelled()

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

isBlocking

public boolean isBlocking()

setBlocking

public void setBlocking(boolean isBlocking)

getCreate

public java.util.Date getCreate()

getTask

public Task getTask()

getSwimlaneInstance

public SwimlaneInstance getSwimlaneInstance()

setSwimlaneInstance

public void setSwimlaneInstance(SwimlaneInstance swimlaneInstance)

getPreviousActorId

public java.lang.String getPreviousActorId()

getPriority

public int getPriority()

setPriority

public void setPriority(int priority)

isOpen

public boolean isOpen()

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

isSuspended

public boolean isSuspended()

getProcessInstance

public ProcessInstance getProcessInstance()

setProcessInstance

public void setProcessInstance(ProcessInstance processInstance)


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