org.camunda.bpm.engine.impl.persistence.entity
Class TaskEntity

java.lang.Object
  extended by org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
      extended by org.camunda.bpm.engine.impl.persistence.entity.TaskEntity
All Implemented Interfaces:
Serializable, BpmnModelExecutionContext, DelegateTask, ProcessEngineServicesAware, VariableScope, VariableEventDispatcher, VariableStore.VariablesProvider<VariableInstanceEntity>, DbEntity, HasDbRevision, CommandContextListener, Task

public class TaskEntity
extends AbstractVariableScope
implements Task, DelegateTask, Serializable, DbEntity, HasDbRevision, CommandContextListener, VariableStore.VariablesProvider<VariableInstanceEntity>

Author:
Tom Baeyens, Joram Barrez, Falko Menge, Deivarayan Azhagappan
See Also:
Serialized Form

Field Summary
protected  String assignee
           
static String ASSIGNEE
           
static String CASE_INSTANCE_ID
           
protected  String caseDefinitionId
           
protected  CaseExecutionEntity caseExecution
           
protected  String caseExecutionId
           
protected  String caseInstanceId
           
protected  Date createTime
           
static String DELEGATION
           
protected  DelegationState delegationState
           
static String DELETE
           
static String DELETE_REASON_COMPLETED
           
static String DELETE_REASON_DELETED
           
protected  String deleteReason
           
protected  String description
           
static String DESCRIPTION
           
static String DUE_DATE
           
protected  Date dueDate
           
protected  String eventName
           
protected  ExecutionEntity execution
           
protected  String executionId
           
static String FOLLOW_UP_DATE
           
protected  Date followUpDate
           
protected  String formKey
           
protected  String id
           
protected  List<PropertyChange> identityLinkChanges
           
protected  boolean isDeleted
           
protected  boolean isFormKeyInitialized
           
protected  boolean isIdentityLinksInitialized
           
protected static EnginePersistenceLogger LOG
           
protected  String name
           
static String NAME
           
protected  String owner
           
static String OWNER
           
static String PARENT_TASK
           
protected  TaskEntity parentTask
           
protected  String parentTaskId
           
protected  int priority
           
static String PRIORITY
           
protected  String processDefinitionId
           
protected  ExecutionEntity processInstance
           
protected  String processInstanceId
           
protected  Map<String,PropertyChange> propertyChanges
          contains all changed properties of this entity
protected  int revision
           
protected  boolean skipCustomListeners
           
protected  int suspensionState
           
protected  TaskDefinition taskDefinition
           
protected  String taskDefinitionKey
           
protected  List<IdentityLinkEntity> taskIdentityLinkEntities
           
protected  String tenantId
           
protected  VariableStore<VariableInstanceEntity> variableStore
           
 
Fields inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
cachedElContext
 
Fields inherited from interface org.camunda.bpm.engine.task.Task
PRIORITY_MAXIMUM, PRIORITY_MINIUM, PRIORITY_NORMAL
 
Constructor Summary
TaskEntity()
           
TaskEntity(String taskId)
           
 
Method Summary
 void addCandidateGroup(String groupId)
          Adds the given group as candidate group to this task
 void addCandidateGroups(Collection<String> candidateGroups)
          Adds multiple groups as candidate group to this task.
 void addCandidateUser(String userId)
          Adds the given user as a candidate user to this task.
 void addCandidateUsers(Collection<String> candidateUsers)
          Adds multiple users as candidate user to this task.
 void addGroupIdentityLink(String groupId, String identityLinkType)
          Involves a group with group task.
 IdentityLinkEntity addIdentityLink(String userId, String groupId, String type)
           
 void addIdentityLinkChanges(String type, String oldProperty, String newProperty)
           
 void addUserIdentityLink(String userId, String identityLinkType)
          Involves a user with a task.
 void caseExecutionCompleted()
           
 void complete()
          set status to complete.
static TaskEntity create()
          new task.
static TaskEntity createAndInsert(VariableScope execution)
          creates and initializes a new persistent task.
 void createHistoricTaskDetails(String operation)
           
 void delegate(String userId)
          delegates this task to the given user and sets the delegationState to DelegationState.PENDING.
 void delete(String deleteReason, boolean cascade)
           
 void delete(String deleteReason, boolean cascade, boolean skipCustomListeners)
           
protected  void deleteAuthorizations(AuthorizationEntity[] authorizations)
           
 void deleteCandidateGroup(String groupId)
          Convenience shorthand for #deleteGroupIdentityLink(String, String, String); with type IdentityLinkType.CANDIDATE
 void deleteCandidateUser(String userId)
          Convenience shorthand for DelegateTask.deleteUserIdentityLink(String, String); with type IdentityLinkType.CANDIDATE
 void deleteGroupIdentityLink(String groupId, String identityLinkType)
          Removes the association between a group and a task for the given identityLinkType.
 void deleteIdentityLink(String userId, String groupId, String type)
           
 void deleteIdentityLinks(boolean withHistory)
           
 void deleteUserIdentityLink(String userId, String identityLinkType)
          Removes the association between a user and a task for the given identityLinkType.
 void dispatchEvent(VariableEvent variableEvent)
           
protected  void ensureCaseExecutionInitialized()
           
protected  void ensureParentTaskActive()
           
protected  void ensureTaskActive()
           
protected  void ensureTenantIdNotChanged()
           
 boolean equals(Object obj)
           
 void executeMetrics(String metricsName)
           
protected  void fireAddIdentityLinkAuthorizationProvider(String type, String userId, String groupId)
           
protected  void fireAssigneeAuthorizationProvider(String oldAssignee, String newAssignee)
           
 void fireAuthorizationProvider()
           
protected  void fireAuthorizationProvider(String property, String oldValue, String newValue)
           
protected  void fireDeleteIdentityLinkAuthorizationProvider(String type, String userId, String groupId)
           
 void fireEvent(String taskEventName)
           
 void fireEvents()
           
 void fireHistoricIdentityLinks()
           
 void fireIdentityLinkHistoryEvents(String userId, String groupId, String type, HistoryEventTypes historyEventType)
           
protected  void fireOwnerAuthorizationProvider(String oldOwner, String newOwner)
           
 Map<String,Object> getActivityInstanceVariables()
           
 String getAssignee()
          The userId of the person to which this task is assigned or delegated.
 org.camunda.bpm.model.bpmn.instance.UserTask getBpmnModelElementInstance()
          Provides access to the current UserTask Element from the Bpmn Model.
 org.camunda.bpm.model.bpmn.BpmnModelInstance getBpmnModelInstance()
          Returns the BpmnModelInstance for the currently executed Bpmn Model
 Set<IdentityLink> getCandidates()
          Retrieves the candidate users and groups associated with the task.
 CaseDefinitionEntity getCaseDefinition()
           
 String getCaseDefinitionId()
          Reference to the case definition or null if it is not related to a case.
 CaseExecutionEntity getCaseExecution()
          Returns the case execution currently at the task.
 String getCaseExecutionId()
          Reference to the path of case execution or null if it is not related to a case instance.
 String getCaseInstanceId()
          Reference to the case instance or null if it is not related to a case instance.
 Date getCreateTime()
          The date/time when this task was created
 DelegationState getDelegationState()
          The current DelegationState for this task.
 String getDelegationStateString()
           
 String getDeleteReason()
          Get delete reason of the task.
 String getDescription()
          Free text description of the task.
 Date getDueDate()
          Due date of the task.
 String getEventName()
          Returns the event name which triggered the task listener to fire for this task.
 ExecutionEntity getExecution()
          Returns the execution currently at the task.
 String getExecutionId()
          Reference to the path of execution or null if it is not related to a process instance.
 Date getFollowUpDate()
          Follow-up date of the task.
 String getFormKey()
          Provides the form key for the task.
 String getId()
          DB id of the task.
 List<IdentityLinkEntity> getIdentityLinks()
           
protected  List<TaskListener> getListenersForEvent(String event)
           
 String getName()
          Name or title of the task.
 String getOwner()
          The userId of the person that is responsible for this task.
 TaskEntity getParentTask()
           
 String getParentTaskId()
          the parent task for which this task is a subtask
 AbstractVariableScope getParentVariableScope()
           
 Object getPersistentState()
          Returns a representation of the object, as would be stored in the database.
 int getPriority()
          indication of how important/urgent this task is with a number between 0 and 100 where higher values mean a higher priority and lower values mean lower priority: [0..19] lowest, [20..39] low, [40..59] normal, [60..79] high [80..100] highest
 ProcessDefinitionEntity getProcessDefinition()
           
 String getProcessDefinitionId()
          Reference to the process definition or null if it is not related to a process.
 ProcessEngineServices getProcessEngineServices()
          Returns the ProcessEngineServices providing access to the public API of the process engine.
 ExecutionEntity getProcessInstance()
           
 String getProcessInstanceId()
          Reference to the process instance or null if it is not related to a process instance.
 Map<String,PropertyChange> getPropertyChanges()
           
protected  ResourceAuthorizationProvider getResourceAuthorizationProvider()
           
 int getRevision()
           
 int getRevisionNext()
           
 int getSuspensionState()
           
 TaskDefinition getTaskDefinition()
           
 String getTaskDefinitionKey()
          The id of the activity in the process defining this task or null if this is not related to a process
 String getTenantId()
          Returns the task's tenant id or null in case this task does not belong to a tenant.
protected  VariableInstanceFactory<CoreVariableInstance> getVariableInstanceFactory()
           
protected  List<VariableInstanceLifecycleListener<CoreVariableInstance>> getVariableInstanceLifecycleListeners()
           
 String getVariableScopeKey()
           
 Collection<VariableInstanceEntity> getVariablesInternal()
           
protected  VariableStore<CoreVariableInstance> getVariableStore()
           
 int hashCode()
           
 void initializeFormKey()
           
 void insert(ExecutionEntity execution)
           
protected  boolean isAuthorizationEnabled()
           
 boolean isDeleted()
           
 boolean isSuspended()
          Indicated whether this task is suspended or not.
 IdentityLinkEntity newIdentityLink(String userId, String groupId, String type)
           
 void onCommandContextClose(CommandContext commandContext)
           
 void onCommandFailed(CommandContext commandContext, Throwable t)
           
protected  void propagateExecutionTenantId(ExecutionEntity execution)
           
protected  void propagateParentTaskTenantId()
           
protected  void propertyChanged(String propertyName, Object orgValue, Object newValue)
          Tracks a property change.
 Collection<VariableInstanceEntity> provideVariables()
           
protected  void registerCommandContextCloseListener()
           
 void resolve()
           
protected  void saveAuthorizations(AuthorizationEntity[] authorizations)
           
 void setAssignee(String assignee)
          The userId of the person to which this task is assigned or delegated.
 void setAssigneeWithoutCascade(String assignee)
           
 void setCaseDefinitionId(String caseDefinitionId)
           
 void setCaseExecution(DelegateCaseExecution caseExecution)
           
 void setCaseExecutionId(String caseExecutionId)
           
 void setCaseInstanceId(String caseInstanceId)
          The case instance id for which this task is associated for.
 void setCaseInstanceIdWithoutCascade(String caseInstanceId)
           
 void setCreateTime(Date createTime)
           
 void setDelegationState(DelegationState delegationState)
          The current DelegationState for this task.
 void setDelegationStateString(String delegationState)
          Setter for mybatis mapper.
 void setDelegationStateWithoutCascade(DelegationState delegationState)
           
 void setDeleted(boolean isDeleted)
           
 void setDescription(String description)
          Change the description of the task
 void setDescriptionWithoutCascade(String description)
           
 void setDueDate(Date dueDate)
          Change due date of the task.
 void setDueDateWithoutCascade(Date dueDate)
           
 void setEventName(String eventName)
           
 void setExecution(PvmExecutionImpl execution)
           
 void setExecutionId(String executionId)
           
 void setExecutionVariables(Map<String,Object> parameters)
           
 void setFollowUpDate(Date followUpDate)
          Change follow-up date of the task.
 void setFollowUpDateWithoutCascade(Date followUpDate)
           
 void setId(String id)
           
 void setName(String taskName)
          Name or title of the task.
 void setNameWithoutCascade(String taskName)
           
 void setOwner(String owner)
          The userId of the person that is responsible for this task.
 void setOwnerWithoutCascade(String owner)
           
 void setParentTaskId(String parentTaskId)
          the parent task for which this task is a subtask
 void setParentTaskIdWithoutCascade(String parentTaskId)
           
 void setPriority(int priority)
          indication of how important/urgent this task is with a number between 0 and 100 where higher values mean a higher priority and lower values mean lower priority: [0..19] lowest, [20..39] low, [40..59] normal, [60..79] high [80..100] highest
 void setPriorityWithoutCascade(int priority)
           
 void setProcessDefinitionId(String processDefinitionId)
           
 void setProcessInstance(ExecutionEntity processInstance)
           
 void setProcessInstanceId(String processInstanceId)
           
 void setRevision(int revision)
           
 void setSuspensionState(int suspensionState)
           
 void setTaskDefinition(TaskDefinition taskDefinition)
           
 void setTaskDefinitionKey(String taskDefinitionKey)
           
 void setTaskDefinitionKeyWithoutCascade(String taskDefinitionKey)
           
 void setTenantId(String tenantId)
          Sets the tenant id for this task.
 void setVariablesLocal(Map<String,?> variables)
           
protected  boolean tenantIdIsSame(TaskEntity otherTask)
           
 String toString()
           
 void update()
           
 
Methods inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
collectVariableNames, collectVariables, getCachedElContext, getSourceActivityVariableScope, getValueFromVariableInstance, getVariable, getVariable, getVariableInstance, getVariableInstanceLocal, getVariableInstancesLocal, getVariableLocal, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, invokeVariableLifecycleListenersCreate, invokeVariableLifecycleListenersCreate, invokeVariableLifecycleListenersDelete, invokeVariableLifecycleListenersDelete, invokeVariableLifecycleListenersUpdate, invokeVariableLifecycleListenersUpdate, removeVariable, removeVariable, removeVariableLocal, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setCachedElContext, setVariable, setVariable, setVariableLocal, setVariableLocal, setVariableLocalTransient, setVariables
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.camunda.bpm.engine.delegate.VariableScope
getVariable, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setVariable, setVariableLocal, setVariables
 

Field Detail

LOG

protected static final EnginePersistenceLogger LOG

DELETE_REASON_COMPLETED

public static final String DELETE_REASON_COMPLETED
See Also:
Constant Field Values

DELETE_REASON_DELETED

public static final String DELETE_REASON_DELETED
See Also:
Constant Field Values

id

protected String id

revision

protected int revision

owner

protected String owner

assignee

protected String assignee

delegationState

protected DelegationState delegationState

parentTaskId

protected String parentTaskId

parentTask

protected transient TaskEntity parentTask

name

protected String name

description

protected String description

priority

protected int priority

createTime

protected Date createTime

dueDate

protected Date dueDate

followUpDate

protected Date followUpDate

suspensionState

protected int suspensionState

tenantId

protected String tenantId

isIdentityLinksInitialized

protected boolean isIdentityLinksInitialized

taskIdentityLinkEntities

protected transient List<IdentityLinkEntity> taskIdentityLinkEntities

executionId

protected String executionId

execution

protected transient ExecutionEntity execution

processInstanceId

protected String processInstanceId

processInstance

protected transient ExecutionEntity processInstance

processDefinitionId

protected String processDefinitionId

caseExecutionId

protected String caseExecutionId

caseExecution

protected transient CaseExecutionEntity caseExecution

caseInstanceId

protected String caseInstanceId

caseDefinitionId

protected String caseDefinitionId

taskDefinition

protected transient TaskDefinition taskDefinition

taskDefinitionKey

protected String taskDefinitionKey

isDeleted

protected boolean isDeleted

deleteReason

protected String deleteReason

eventName

protected String eventName

isFormKeyInitialized

protected boolean isFormKeyInitialized

formKey

protected String formKey

variableStore

protected transient VariableStore<VariableInstanceEntity> variableStore

skipCustomListeners

protected transient boolean skipCustomListeners

propertyChanges

protected transient Map<String,PropertyChange> propertyChanges
contains all changed properties of this entity


identityLinkChanges

protected transient List<PropertyChange> identityLinkChanges

ASSIGNEE

public static final String ASSIGNEE
See Also:
Constant Field Values

DELEGATION

public static final String DELEGATION
See Also:
Constant Field Values

DELETE

public static final String DELETE
See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
See Also:
Constant Field Values

DUE_DATE

public static final String DUE_DATE
See Also:
Constant Field Values

FOLLOW_UP_DATE

public static final String FOLLOW_UP_DATE
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

OWNER

public static final String OWNER
See Also:
Constant Field Values

PARENT_TASK

public static final String PARENT_TASK
See Also:
Constant Field Values

PRIORITY

public static final String PRIORITY
See Also:
Constant Field Values

CASE_INSTANCE_ID

public static final String CASE_INSTANCE_ID
See Also:
Constant Field Values
Constructor Detail

TaskEntity

public TaskEntity()

TaskEntity

public TaskEntity(String taskId)
Method Detail

createAndInsert

public static TaskEntity createAndInsert(VariableScope execution)
creates and initializes a new persistent task.


insert

public void insert(ExecutionEntity execution)

propagateExecutionTenantId

protected void propagateExecutionTenantId(ExecutionEntity execution)

propagateParentTaskTenantId

protected void propagateParentTaskTenantId()

update

public void update()

ensureTenantIdNotChanged

protected void ensureTenantIdNotChanged()

tenantIdIsSame

protected boolean tenantIdIsSame(TaskEntity otherTask)

create

public static TaskEntity create()
new task. Embedded state and create time will be initialized. But this task still will have to be persisted with TransactionContext .getCurrent() .getPersistenceSession() .insert(task);


complete

public void complete()
Description copied from interface: DelegateTask
set status to complete.

Specified by:
complete in interface DelegateTask

caseExecutionCompleted

public void caseExecutionCompleted()

delete

public void delete(String deleteReason,
                   boolean cascade)

delete

public void delete(String deleteReason,
                   boolean cascade,
                   boolean skipCustomListeners)

delegate

public void delegate(String userId)
Description copied from interface: Task
delegates this task to the given user and sets the delegationState to DelegationState.PENDING. If no owner is set on the task, the owner is set to the current assignee of the task.

Specified by:
delegate in interface Task

resolve

public void resolve()

getPersistentState

public Object getPersistentState()
Description copied from interface: DbEntity
Returns a representation of the object, as would be stored in the database. Used when deciding if updates have occurred to the object or not since it was last loaded.

Specified by:
getPersistentState in interface DbEntity

getRevisionNext

public int getRevisionNext()
Specified by:
getRevisionNext in interface HasDbRevision

ensureParentTaskActive

protected void ensureParentTaskActive()

ensureTaskActive

protected void ensureTaskActive()

getBpmnModelElementInstance

public org.camunda.bpm.model.bpmn.instance.UserTask getBpmnModelElementInstance()
Description copied from interface: DelegateTask
Provides access to the current UserTask Element from the Bpmn Model.

Specified by:
getBpmnModelElementInstance in interface BpmnModelExecutionContext
Specified by:
getBpmnModelElementInstance in interface DelegateTask
Returns:
the current UserTask Element from the Bpmn Model.

getBpmnModelInstance

public org.camunda.bpm.model.bpmn.BpmnModelInstance getBpmnModelInstance()
Description copied from interface: BpmnModelExecutionContext
Returns the BpmnModelInstance for the currently executed Bpmn Model

Specified by:
getBpmnModelInstance in interface BpmnModelExecutionContext
Returns:
the current BpmnModelInstance

getVariableStore

protected VariableStore<CoreVariableInstance> getVariableStore()
Specified by:
getVariableStore in class AbstractVariableScope

getVariableInstanceFactory

protected VariableInstanceFactory<CoreVariableInstance> getVariableInstanceFactory()
Specified by:
getVariableInstanceFactory in class AbstractVariableScope

getVariableInstanceLifecycleListeners

protected List<VariableInstanceLifecycleListener<CoreVariableInstance>> getVariableInstanceLifecycleListeners()
Specified by:
getVariableInstanceLifecycleListeners in class AbstractVariableScope

dispatchEvent

public void dispatchEvent(VariableEvent variableEvent)
Specified by:
dispatchEvent in interface VariableEventDispatcher
Overrides:
dispatchEvent in class AbstractVariableScope

provideVariables

public Collection<VariableInstanceEntity> provideVariables()
Specified by:
provideVariables in interface VariableStore.VariablesProvider<VariableInstanceEntity>

getParentVariableScope

public AbstractVariableScope getParentVariableScope()
Specified by:
getParentVariableScope in class AbstractVariableScope

getVariableScopeKey

public String getVariableScopeKey()
Specified by:
getVariableScopeKey in interface VariableScope
Overrides:
getVariableScopeKey in class AbstractVariableScope

getParentTask

public TaskEntity getParentTask()

getExecution

public ExecutionEntity getExecution()
Description copied from interface: DelegateTask
Returns the execution currently at the task.

Specified by:
getExecution in interface DelegateTask

setExecution

public void setExecution(PvmExecutionImpl execution)

getCaseExecution

public CaseExecutionEntity getCaseExecution()
Description copied from interface: DelegateTask
Returns the case execution currently at the task.

Specified by:
getCaseExecution in interface DelegateTask

ensureCaseExecutionInitialized

protected void ensureCaseExecutionInitialized()

setCaseExecution

public void setCaseExecution(DelegateCaseExecution caseExecution)

getCaseExecutionId

public String getCaseExecutionId()
Description copied from interface: Task
Reference to the path of case execution or null if it is not related to a case instance.

Specified by:
getCaseExecutionId in interface DelegateTask
Specified by:
getCaseExecutionId in interface Task

setCaseExecutionId

public void setCaseExecutionId(String caseExecutionId)

getCaseInstanceId

public String getCaseInstanceId()
Description copied from interface: Task
Reference to the case instance or null if it is not related to a case instance.

Specified by:
getCaseInstanceId in interface DelegateTask
Specified by:
getCaseInstanceId in interface Task

setCaseInstanceId

public void setCaseInstanceId(String caseInstanceId)
Description copied from interface: Task
The case instance id for which this task is associated for.

Specified by:
setCaseInstanceId in interface Task

setCaseInstanceIdWithoutCascade

public void setCaseInstanceIdWithoutCascade(String caseInstanceId)

getCaseDefinition

public CaseDefinitionEntity getCaseDefinition()

getCaseDefinitionId

public String getCaseDefinitionId()
Description copied from interface: Task
Reference to the case definition or null if it is not related to a case.

Specified by:
getCaseDefinitionId in interface DelegateTask
Specified by:
getCaseDefinitionId in interface Task

setCaseDefinitionId

public void setCaseDefinitionId(String caseDefinitionId)

addIdentityLink

public IdentityLinkEntity addIdentityLink(String userId,
                                          String groupId,
                                          String type)

fireIdentityLinkHistoryEvents

public void fireIdentityLinkHistoryEvents(String userId,
                                          String groupId,
                                          String type,
                                          HistoryEventTypes historyEventType)

newIdentityLink

public IdentityLinkEntity newIdentityLink(String userId,
                                          String groupId,
                                          String type)

deleteIdentityLink

public void deleteIdentityLink(String userId,
                               String groupId,
                               String type)

deleteIdentityLinks

public void deleteIdentityLinks(boolean withHistory)

getCandidates

public Set<IdentityLink> getCandidates()
Description copied from interface: DelegateTask
Retrieves the candidate users and groups associated with the task.

Specified by:
getCandidates in interface DelegateTask
Returns:
set of IdentityLinks of type IdentityLinkType.CANDIDATE.

addCandidateUser

public void addCandidateUser(String userId)
Description copied from interface: DelegateTask
Adds the given user as a candidate user to this task.

Specified by:
addCandidateUser in interface DelegateTask

addCandidateUsers

public void addCandidateUsers(Collection<String> candidateUsers)
Description copied from interface: DelegateTask
Adds multiple users as candidate user to this task.

Specified by:
addCandidateUsers in interface DelegateTask

addCandidateGroup

public void addCandidateGroup(String groupId)
Description copied from interface: DelegateTask
Adds the given group as candidate group to this task

Specified by:
addCandidateGroup in interface DelegateTask

addCandidateGroups

public void addCandidateGroups(Collection<String> candidateGroups)
Description copied from interface: DelegateTask
Adds multiple groups as candidate group to this task.

Specified by:
addCandidateGroups in interface DelegateTask

addGroupIdentityLink

public void addGroupIdentityLink(String groupId,
                                 String identityLinkType)
Description copied from interface: DelegateTask
Involves a group with group task. The type of identityLink is defined by the given identityLink.

Specified by:
addGroupIdentityLink in interface DelegateTask
Parameters:
groupId - id of the group to involve, cannot be null.
identityLinkType - type of identity, cannot be null (@see IdentityLinkType).

addUserIdentityLink

public void addUserIdentityLink(String userId,
                                String identityLinkType)
Description copied from interface: DelegateTask
Involves a user with a task. The type of identity link is defined by the given identityLinkType.

Specified by:
addUserIdentityLink in interface DelegateTask
Parameters:
userId - id of the user involve, cannot be null.
identityLinkType - type of identityLink, cannot be null (@see IdentityLinkType).

deleteCandidateGroup

public void deleteCandidateGroup(String groupId)
Description copied from interface: DelegateTask
Convenience shorthand for #deleteGroupIdentityLink(String, String, String); with type IdentityLinkType.CANDIDATE

Specified by:
deleteCandidateGroup in interface DelegateTask
Parameters:
groupId - id of the group to use as candidate, cannot be null.

deleteCandidateUser

public void deleteCandidateUser(String userId)
Description copied from interface: DelegateTask
Convenience shorthand for DelegateTask.deleteUserIdentityLink(String, String); with type IdentityLinkType.CANDIDATE

Specified by:
deleteCandidateUser in interface DelegateTask
Parameters:
userId - id of the user to use as candidate, cannot be null.

deleteGroupIdentityLink

public void deleteGroupIdentityLink(String groupId,
                                    String identityLinkType)
Description copied from interface: DelegateTask
Removes the association between a group and a task for the given identityLinkType.

Specified by:
deleteGroupIdentityLink in interface DelegateTask
Parameters:
groupId - id of the group to involve, cannot be null.
identityLinkType - type of identity, cannot be null (@see IdentityLinkType).

deleteUserIdentityLink

public void deleteUserIdentityLink(String userId,
                                   String identityLinkType)
Description copied from interface: DelegateTask
Removes the association between a user and a task for the given identityLinkType.

Specified by:
deleteUserIdentityLink in interface DelegateTask
Parameters:
userId - id of the user involve, cannot be null.
identityLinkType - type of identityLink, cannot be null (@see IdentityLinkType).

getIdentityLinks

public List<IdentityLinkEntity> getIdentityLinks()

getActivityInstanceVariables

public Map<String,Object> getActivityInstanceVariables()

setExecutionVariables

public void setExecutionVariables(Map<String,Object> parameters)

toString

public String toString()
Overrides:
toString in class Object

setName

public void setName(String taskName)
Description copied from interface: Task
Name or title of the task.

Specified by:
setName in interface DelegateTask
Specified by:
setName in interface Task

setNameWithoutCascade

public void setNameWithoutCascade(String taskName)

setDescription

public void setDescription(String description)
Description copied from interface: Task
Change the description of the task

Specified by:
setDescription in interface DelegateTask
Specified by:
setDescription in interface Task

setDescriptionWithoutCascade

public void setDescriptionWithoutCascade(String description)

setAssignee

public void setAssignee(String assignee)
Description copied from interface: Task
The userId of the person to which this task is assigned or delegated.

Specified by:
setAssignee in interface DelegateTask
Specified by:
setAssignee in interface Task

setAssigneeWithoutCascade

public void setAssigneeWithoutCascade(String assignee)

setOwner

public void setOwner(String owner)
Description copied from interface: Task
The userId of the person that is responsible for this task. This is used when a task is delegated.

Specified by:
setOwner in interface DelegateTask
Specified by:
setOwner in interface Task

setOwnerWithoutCascade

public void setOwnerWithoutCascade(String owner)

setDueDate

public void setDueDate(Date dueDate)
Description copied from interface: Task
Change due date of the task.

Specified by:
setDueDate in interface DelegateTask
Specified by:
setDueDate in interface Task

setDueDateWithoutCascade

public void setDueDateWithoutCascade(Date dueDate)

setPriority

public void setPriority(int priority)
Description copied from interface: Task
indication of how important/urgent this task is with a number between 0 and 100 where higher values mean a higher priority and lower values mean lower priority: [0..19] lowest, [20..39] low, [40..59] normal, [60..79] high [80..100] highest

Specified by:
setPriority in interface DelegateTask
Specified by:
setPriority in interface Task

setPriorityWithoutCascade

public void setPriorityWithoutCascade(int priority)

setParentTaskId

public void setParentTaskId(String parentTaskId)
Description copied from interface: Task
the parent task for which this task is a subtask

Specified by:
setParentTaskId in interface Task

setParentTaskIdWithoutCascade

public void setParentTaskIdWithoutCascade(String parentTaskId)

setTaskDefinitionKeyWithoutCascade

public void setTaskDefinitionKeyWithoutCascade(String taskDefinitionKey)

fireEvent

public void fireEvent(String taskEventName)

getListenersForEvent

protected List<TaskListener> getListenersForEvent(String event)

propertyChanged

protected void propertyChanged(String propertyName,
                               Object orgValue,
                               Object newValue)
Tracks a property change. Therefore the original and new value are stored in a map. It tracks multiple changes and if a property finally is changed back to the original value, then the change is removed.

Parameters:
propertyName -
orgValue -
newValue -

fireAuthorizationProvider

public void fireAuthorizationProvider()

fireEvents

public void fireEvents()

fireAssigneeAuthorizationProvider

protected void fireAssigneeAuthorizationProvider(String oldAssignee,
                                                 String newAssignee)

fireOwnerAuthorizationProvider

protected void fireOwnerAuthorizationProvider(String oldOwner,
                                              String newOwner)

fireAuthorizationProvider

protected void fireAuthorizationProvider(String property,
                                         String oldValue,
                                         String newValue)

fireAddIdentityLinkAuthorizationProvider

protected void fireAddIdentityLinkAuthorizationProvider(String type,
                                                        String userId,
                                                        String groupId)

fireDeleteIdentityLinkAuthorizationProvider

protected void fireDeleteIdentityLinkAuthorizationProvider(String type,
                                                           String userId,
                                                           String groupId)

getResourceAuthorizationProvider

protected ResourceAuthorizationProvider getResourceAuthorizationProvider()

saveAuthorizations

protected void saveAuthorizations(AuthorizationEntity[] authorizations)

deleteAuthorizations

protected void deleteAuthorizations(AuthorizationEntity[] authorizations)

isAuthorizationEnabled

protected boolean isAuthorizationEnabled()

setTaskDefinition

public void setTaskDefinition(TaskDefinition taskDefinition)

getTaskDefinition

public TaskDefinition getTaskDefinition()

getId

public String getId()
Description copied from interface: Task
DB id of the task.

Specified by:
getId in interface DelegateTask
Specified by:
getId in interface DbEntity
Specified by:
getId in interface Task

setId

public void setId(String id)
Specified by:
setId in interface DbEntity

getRevision

public int getRevision()
Specified by:
getRevision in interface HasDbRevision

setRevision

public void setRevision(int revision)
Specified by:
setRevision in interface HasDbRevision

getName

public String getName()
Description copied from interface: Task
Name or title of the task.

Specified by:
getName in interface DelegateTask
Specified by:
getName in interface Task

getDescription

public String getDescription()
Description copied from interface: Task
Free text description of the task.

Specified by:
getDescription in interface DelegateTask
Specified by:
getDescription in interface Task

getDueDate

public Date getDueDate()
Description copied from interface: Task
Due date of the task.

Specified by:
getDueDate in interface DelegateTask
Specified by:
getDueDate in interface Task

getPriority

public int getPriority()
Description copied from interface: Task
indication of how important/urgent this task is with a number between 0 and 100 where higher values mean a higher priority and lower values mean lower priority: [0..19] lowest, [20..39] low, [40..59] normal, [60..79] high [80..100] highest

Specified by:
getPriority in interface DelegateTask
Specified by:
getPriority in interface Task

getCreateTime

public Date getCreateTime()
Description copied from interface: Task
The date/time when this task was created

Specified by:
getCreateTime in interface DelegateTask
Specified by:
getCreateTime in interface Task

setCreateTime

public void setCreateTime(Date createTime)

getExecutionId

public String getExecutionId()
Description copied from interface: Task
Reference to the path of execution or null if it is not related to a process instance.

Specified by:
getExecutionId in interface DelegateTask
Specified by:
getExecutionId in interface Task

getProcessInstanceId

public String getProcessInstanceId()
Description copied from interface: Task
Reference to the process instance or null if it is not related to a process instance.

Specified by:
getProcessInstanceId in interface DelegateTask
Specified by:
getProcessInstanceId in interface Task

getProcessDefinition

public ProcessDefinitionEntity getProcessDefinition()

getProcessDefinitionId

public String getProcessDefinitionId()
Description copied from interface: Task
Reference to the process definition or null if it is not related to a process.

Specified by:
getProcessDefinitionId in interface DelegateTask
Specified by:
getProcessDefinitionId in interface Task

initializeFormKey

public void initializeFormKey()

getFormKey

public String getFormKey()
Description copied from interface: Task
Provides the form key for the task.

NOTE: If the task instance us obtained through a query, this property is only populated in case the TaskQuery.initializeFormKeys() method is called. If this method is called without a prior call to TaskQuery.initializeFormKeys(), it will throw a BadUserRequestException.

Specified by:
getFormKey in interface Task
Returns:
the form key for this task

setProcessDefinitionId

public void setProcessDefinitionId(String processDefinitionId)

getAssignee

public String getAssignee()
Description copied from interface: Task
The userId of the person to which this task is assigned or delegated.

Specified by:
getAssignee in interface DelegateTask
Specified by:
getAssignee in interface Task

getTaskDefinitionKey

public String getTaskDefinitionKey()
Description copied from interface: Task
The id of the activity in the process defining this task or null if this is not related to a process

Specified by:
getTaskDefinitionKey in interface DelegateTask
Specified by:
getTaskDefinitionKey in interface Task

setTaskDefinitionKey

public void setTaskDefinitionKey(String taskDefinitionKey)

getEventName

public String getEventName()
Description copied from interface: DelegateTask
Returns the event name which triggered the task listener to fire for this task.

Specified by:
getEventName in interface DelegateTask

setEventName

public void setEventName(String eventName)

setExecutionId

public void setExecutionId(String executionId)

getProcessInstance

public ExecutionEntity getProcessInstance()

setProcessInstance

public void setProcessInstance(ExecutionEntity processInstance)

setProcessInstanceId

public void setProcessInstanceId(String processInstanceId)

getOwner

public String getOwner()
Description copied from interface: Task
The userId of the person that is responsible for this task. This is used when a task is delegated.

Specified by:
getOwner in interface DelegateTask
Specified by:
getOwner in interface Task

getDelegationState

public DelegationState getDelegationState()
Description copied from interface: Task
The current DelegationState for this task.

Specified by:
getDelegationState in interface Task

setDelegationState

public void setDelegationState(DelegationState delegationState)
Description copied from interface: Task
The current DelegationState for this task.

Specified by:
setDelegationState in interface Task

setDelegationStateWithoutCascade

public void setDelegationStateWithoutCascade(DelegationState delegationState)

getDelegationStateString

public String getDelegationStateString()

setDelegationStateString

public void setDelegationStateString(String delegationState)
Setter for mybatis mapper.

Parameters:
delegationState - the delegation state as string

isDeleted

public boolean isDeleted()

getDeleteReason

public String getDeleteReason()
Description copied from interface: DelegateTask
Get delete reason of the task.

Specified by:
getDeleteReason in interface DelegateTask

setDeleted

public void setDeleted(boolean isDeleted)

getParentTaskId

public String getParentTaskId()
Description copied from interface: Task
the parent task for which this task is a subtask

Specified by:
getParentTaskId in interface Task

getSuspensionState

public int getSuspensionState()

setSuspensionState

public void setSuspensionState(int suspensionState)

isSuspended

public boolean isSuspended()
Description copied from interface: Task
Indicated whether this task is suspended or not.

Specified by:
isSuspended in interface Task

getFollowUpDate

public Date getFollowUpDate()
Description copied from interface: Task
Follow-up date of the task.

Specified by:
getFollowUpDate in interface Task

getTenantId

public String getTenantId()
Description copied from interface: Task
Returns the task's tenant id or null in case this task does not belong to a tenant.

Specified by:
getTenantId in interface DelegateTask
Specified by:
getTenantId in interface Task
Returns:
the task's tenant id or null

setTenantId

public void setTenantId(String tenantId)
Description copied from interface: Task
Sets the tenant id for this task.

Specified by:
setTenantId in interface Task
Parameters:
tenantId - the tenant id to set

setFollowUpDate

public void setFollowUpDate(Date followUpDate)
Description copied from interface: Task
Change follow-up date of the task.

Specified by:
setFollowUpDate in interface Task

setFollowUpDateWithoutCascade

public void setFollowUpDateWithoutCascade(Date followUpDate)

getVariablesInternal

public Collection<VariableInstanceEntity> getVariablesInternal()

onCommandContextClose

public void onCommandContextClose(CommandContext commandContext)
Specified by:
onCommandContextClose in interface CommandContextListener

onCommandFailed

public void onCommandFailed(CommandContext commandContext,
                            Throwable t)
Specified by:
onCommandFailed in interface CommandContextListener

registerCommandContextCloseListener

protected void registerCommandContextCloseListener()

getPropertyChanges

public Map<String,PropertyChange> getPropertyChanges()

createHistoricTaskDetails

public void createHistoricTaskDetails(String operation)

fireHistoricIdentityLinks

public void fireHistoricIdentityLinks()

getProcessEngineServices

public ProcessEngineServices getProcessEngineServices()
Description copied from interface: ProcessEngineServicesAware
Returns the ProcessEngineServices providing access to the public API of the process engine.

Specified by:
getProcessEngineServices in interface ProcessEngineServicesAware
Returns:
the ProcessEngineServices.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

executeMetrics

public void executeMetrics(String metricsName)

addIdentityLinkChanges

public void addIdentityLinkChanges(String type,
                                   String oldProperty,
                                   String newProperty)

setVariablesLocal

public void setVariablesLocal(Map<String,?> variables)
Specified by:
setVariablesLocal in interface VariableScope
Overrides:
setVariablesLocal in class AbstractVariableScope


Copyright © 2017 camunda services GmbH. All rights reserved.