Class TaskEntity
- java.lang.Object
-
- org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
-
- org.camunda.bpm.engine.impl.persistence.entity.TaskEntity
-
- All Implemented Interfaces:
Serializable
,BpmnModelExecutionContext
,DelegateTask
,ProcessEngineServicesAware
,VariableScope
,VariableEventDispatcher
,VariableStore.VariablesProvider<VariableInstanceEntity>
,DbEntity
,HasDbReferences
,HasDbRevision
,CommandContextListener
,Task
public class TaskEntity extends AbstractVariableScope implements Task, DelegateTask, Serializable, DbEntity, HasDbRevision, HasDbReferences, CommandContextListener, VariableStore.VariablesProvider<VariableInstanceEntity>
- Author:
- Tom Baeyens, Joram Barrez, Falko Menge, Deivarayan Azhagappan
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TaskEntity.TaskState
-
Field Summary
-
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
Constructors Modifier Constructor Description TaskEntity()
Mybatis constructorTaskEntity(String id)
Standalone task constructorTaskEntity(CaseExecutionEntity caseExecution)
CMMN execution constructorTaskEntity(ExecutionEntity execution)
BPMN execution constructorprotected
TaskEntity(TaskEntity.TaskState initialState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCandidateGroup(String groupId)
Adds the given group as candidate group to this taskvoid
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
addCustomLifecycleListener(VariableInstanceLifecycleListener<VariableInstanceEntity> customLifecycleListener)
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
bpmnError(String errorCode, String errorMessage, Map<String,Object> variables)
void
caseExecutionCompleted()
void
complete()
set status to complete.void
delegate(String userId)
delegates this task to the given user and sets thedelegationState
toDelegationState.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 typeIdentityLinkType.CANDIDATE
void
deleteCandidateUser(String userId)
Convenience shorthand forDelegateTask.deleteUserIdentityLink(String, String)
; with typeIdentityLinkType.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()
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()
void
ensureParentTaskActive()
protected void
ensureTaskActive()
protected void
ensureTenantIdNotChanged()
boolean
equals(Object obj)
void
escalation(String escalationCode, Map<String,Object> variables)
void
executeMetrics(String metricsName, CommandContext commandContext)
protected void
fireAddIdentityLinkAuthorizationProvider(String type, String userId, String groupId)
protected void
fireAssigneeAuthorizationProvider(String oldAssignee, String newAssignee)
protected boolean
fireAssignmentEvent()
void
fireAuthorizationProvider()
protected void
fireAuthorizationProvider(String property, String oldValue, String newValue)
protected void
fireDeleteIdentityLinkAuthorizationProvider(String type, String userId, String groupId)
boolean
fireEvent(String taskEventName)
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()
UserTask
getBpmnModelElementInstance()
Provides access to the currentUserTask
Element from the Bpmn Model.BpmnModelInstance
getBpmnModelInstance()
Returns theBpmnModelInstance
for the currently executed Bpmn ModelCamundaFormRef
getCamundaFormRef()
Provides the form binding reference to the Camunda Form for the task.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 createdDelegationState
getDelegationState()
The currentDelegationState
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()
TheuserId
of the person that is responsible for this task.TaskEntity
getParentTask()
String
getParentTaskId()
the parent task for which this task is a subtaskAbstractVariableScope
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] highestProcessDefinitionEntity
getProcessDefinition()
String
getProcessDefinitionId()
Reference to the process definition or null if it is not related to a process.ProcessEngine
getProcessEngine()
Returns theProcessEngine
providing access to the public API of the process engine.ProcessEngineServices
getProcessEngineServices()
Returns theProcessEngineServices
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()
Map<String,Class>
getReferencedEntitiesIdAndClass()
Scope: IN-MEMORY referencesSet<String>
getReferencedEntityIds()
Scope: IN-MEMORY referencesprotected 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 processString
getTenantId()
Returns the task's tenant id or null in case this task does not belong to a tenant.protected TaskListener
getTimeoutListener(String timeoutId)
protected VariableInstanceFactory<CoreVariableInstance>
getVariableInstanceFactory()
protected List<VariableInstanceLifecycleListener<CoreVariableInstance>>
getVariableInstanceLifecycleListeners()
String
getVariableScopeKey()
Collection<VariableInstanceEntity>
getVariablesInternal()
protected VariableStore<CoreVariableInstance>
getVariableStore()
int
hashCode()
void
initializeFormKey()
void
insert()
protected boolean
invokeListener(String taskEventName, TaskListener taskListener)
protected boolean
invokeListener(CoreExecution currentExecution, String eventName, TaskListener taskListener)
protected boolean
isAuthorizationEnabled()
boolean
isDeleted()
boolean
isStandaloneTask()
boolean
isSuspended()
Indicated whether this task is suspended or not.void
logUserOperation(String operation)
IdentityLinkEntity
newIdentityLink(String userId, String groupId, String type)
void
onCommandContextClose(CommandContext commandContext)
void
onCommandFailed(CommandContext commandContext, Throwable t)
protected void
propagateExecutionTenantId(ExecutionEntity execution)
void
propagateParentTaskTenantId()
protected void
propertyChanged(String propertyName, Object orgValue, Object newValue)
Tracks a property change.Collection<VariableInstanceEntity>
provideVariables()
Collection<VariableInstanceEntity>
provideVariables(Collection<String> variableNames)
protected void
registerCommandContextCloseListener()
VariableInstanceLifecycleListener<VariableInstanceEntity>
removeCustomLifecycleListener(VariableInstanceLifecycleListener<VariableInstanceEntity> customLifecycleListener)
void
resolve()
protected void
saveAuthorizations(AuthorizationEntity[] authorizations)
void
setAssignee(String assignee)
void
setAssigneeWithoutCascade(String assignee)
void
setCaseDefinitionId(String caseDefinitionId)
void
setCaseExecution(CaseExecutionEntity 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 currentDelegationState
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 taskvoid
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)
TheuserId
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 subtaskvoid
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] highestvoid
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, boolean skipJavaSerializationFormatCheck)
protected boolean
tenantIdIsSame(TaskEntity otherTask)
String
toString()
boolean
transitionTo(TaskEntity.TaskState state)
boolean
triggerTimeoutEvent(String timeoutId)
boolean
triggerUpdateEvent()
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, getVariableInstancesLocal, getVariableLocal, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, initializeVariableStore, invokeVariableLifecycleListenersCreate, invokeVariableLifecycleListenersCreate, invokeVariableLifecycleListenersDelete, invokeVariableLifecycleListenersDelete, invokeVariableLifecycleListenersUpdate, invokeVariableLifecycleListenersUpdate, removeVariable, removeVariable, removeVariableLocal, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setCachedElContext, setVariable, setVariable, setVariable, setVariable, setVariableLocal, setVariableLocal, setVariableLocal, setVariables, setVariables, setVariablesLocal
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.camunda.bpm.engine.impl.db.HasDbReferences
getDependentEntities
-
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, setVariablesLocal
-
-
-
-
Field Detail
-
DEFAULT_VARIABLE_LIFECYCLE_LISTENERS
protected static final List<VariableInstanceLifecycleListener<CoreVariableInstance>> DEFAULT_VARIABLE_LIFECYCLE_LISTENERS
-
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
-
lifecycleState
protected TaskEntity.TaskState lifecycleState
-
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
-
camundaFormRef
protected CamundaFormRef camundaFormRef
-
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
-
customLifecycleListeners
protected List<VariableInstanceLifecycleListener<VariableInstanceEntity>> customLifecycleListeners
-
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()
Mybatis constructor
-
TaskEntity
public TaskEntity(String id)
Standalone task constructor
-
TaskEntity
protected TaskEntity(TaskEntity.TaskState initialState)
-
TaskEntity
public TaskEntity(ExecutionEntity execution)
BPMN execution constructor
-
TaskEntity
public TaskEntity(CaseExecutionEntity caseExecution)
CMMN execution constructor
-
-
Method Detail
-
insert
public void insert()
-
propagateExecutionTenantId
protected void propagateExecutionTenantId(ExecutionEntity execution)
-
propagateParentTaskTenantId
public void propagateParentTaskTenantId()
-
update
public void update()
-
ensureTenantIdNotChanged
protected void ensureTenantIdNotChanged()
-
tenantIdIsSame
protected boolean tenantIdIsSame(TaskEntity otherTask)
-
complete
public void complete()
Description copied from interface:DelegateTask
set status to complete.- Specified by:
complete
in interfaceDelegateTask
-
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 thedelegationState
toDelegationState.PENDING
. If no owner is set on the task, the owner is set to the current assignee of the 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 interfaceDbEntity
-
getRevisionNext
public int getRevisionNext()
- Specified by:
getRevisionNext
in interfaceHasDbRevision
-
ensureParentTaskActive
public void ensureParentTaskActive()
-
ensureTaskActive
protected void ensureTaskActive()
-
getBpmnModelElementInstance
public UserTask getBpmnModelElementInstance()
Description copied from interface:DelegateTask
Provides access to the currentUserTask
Element from the Bpmn Model.- Specified by:
getBpmnModelElementInstance
in interfaceBpmnModelExecutionContext
- Specified by:
getBpmnModelElementInstance
in interfaceDelegateTask
- Returns:
- the current
UserTask
Element from the Bpmn Model.
-
getBpmnModelInstance
public BpmnModelInstance getBpmnModelInstance()
Description copied from interface:BpmnModelExecutionContext
Returns theBpmnModelInstance
for the currently executed Bpmn Model- Specified by:
getBpmnModelInstance
in interfaceBpmnModelExecutionContext
- Returns:
- the current
BpmnModelInstance
-
getVariableStore
protected VariableStore<CoreVariableInstance> getVariableStore()
- Specified by:
getVariableStore
in classAbstractVariableScope
-
getVariableInstanceFactory
protected VariableInstanceFactory<CoreVariableInstance> getVariableInstanceFactory()
- Specified by:
getVariableInstanceFactory
in classAbstractVariableScope
-
getVariableInstanceLifecycleListeners
protected List<VariableInstanceLifecycleListener<CoreVariableInstance>> getVariableInstanceLifecycleListeners()
- Specified by:
getVariableInstanceLifecycleListeners
in classAbstractVariableScope
-
addCustomLifecycleListener
public void addCustomLifecycleListener(VariableInstanceLifecycleListener<VariableInstanceEntity> customLifecycleListener)
-
removeCustomLifecycleListener
public VariableInstanceLifecycleListener<VariableInstanceEntity> removeCustomLifecycleListener(VariableInstanceLifecycleListener<VariableInstanceEntity> customLifecycleListener)
-
dispatchEvent
public void dispatchEvent(VariableEvent variableEvent)
- Specified by:
dispatchEvent
in interfaceVariableEventDispatcher
- Overrides:
dispatchEvent
in classAbstractVariableScope
-
provideVariables
public Collection<VariableInstanceEntity> provideVariables()
- Specified by:
provideVariables
in interfaceVariableStore.VariablesProvider<VariableInstanceEntity>
-
provideVariables
public Collection<VariableInstanceEntity> provideVariables(Collection<String> variableNames)
- Specified by:
provideVariables
in interfaceVariableStore.VariablesProvider<VariableInstanceEntity>
-
getParentVariableScope
public AbstractVariableScope getParentVariableScope()
- Specified by:
getParentVariableScope
in classAbstractVariableScope
-
getVariableScopeKey
public String getVariableScopeKey()
- Specified by:
getVariableScopeKey
in interfaceVariableScope
- Overrides:
getVariableScopeKey
in classAbstractVariableScope
-
getParentTask
public TaskEntity getParentTask()
-
getExecution
public ExecutionEntity getExecution()
Description copied from interface:DelegateTask
Returns the execution currently at the task.- Specified by:
getExecution
in interfaceDelegateTask
-
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 interfaceDelegateTask
-
ensureCaseExecutionInitialized
protected void ensureCaseExecutionInitialized()
-
setCaseExecution
public void setCaseExecution(CaseExecutionEntity 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 interfaceDelegateTask
- Specified by:
getCaseExecutionId
in interfaceTask
-
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 interfaceDelegateTask
- Specified by:
getCaseInstanceId
in interfaceTask
-
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 interfaceTask
-
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 interfaceDelegateTask
- Specified by:
getCaseDefinitionId
in interfaceTask
-
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)
-
deleteIdentityLinks
public void deleteIdentityLinks()
-
getCandidates
public Set<IdentityLink> getCandidates()
Description copied from interface:DelegateTask
Retrieves the candidate users and groups associated with the task.- Specified by:
getCandidates
in interfaceDelegateTask
- Returns:
- set of
IdentityLink
s of typeIdentityLinkType.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 interfaceDelegateTask
-
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 interfaceDelegateTask
-
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 interfaceDelegateTask
-
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 interfaceDelegateTask
-
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 interfaceDelegateTask
- Parameters:
groupId
- id of the group to involve, cannot be null.identityLinkType
- type of identity, cannot be null (@seeIdentityLinkType
).
-
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 interfaceDelegateTask
- Parameters:
userId
- id of the user involve, cannot be null.identityLinkType
- type of identityLink, cannot be null (@seeIdentityLinkType
).
-
deleteCandidateGroup
public void deleteCandidateGroup(String groupId)
Description copied from interface:DelegateTask
Convenience shorthand for#deleteGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.CANDIDATE
- Specified by:
deleteCandidateGroup
in interfaceDelegateTask
- 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 forDelegateTask.deleteUserIdentityLink(String, String)
; with typeIdentityLinkType.CANDIDATE
- Specified by:
deleteCandidateUser
in interfaceDelegateTask
- 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 interfaceDelegateTask
- Parameters:
groupId
- id of the group to involve, cannot be null.identityLinkType
- type of identity, cannot be null (@seeIdentityLinkType
).
-
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 interfaceDelegateTask
- Parameters:
userId
- id of the user involve, cannot be null.identityLinkType
- type of identityLink, cannot be null (@seeIdentityLinkType
).
-
getIdentityLinks
public List<IdentityLinkEntity> getIdentityLinks()
-
setName
public void setName(String taskName)
Description copied from interface:Task
Name or title of the task.- Specified by:
setName
in interfaceDelegateTask
- Specified by:
setName
in interfaceTask
-
setDescription
public void setDescription(String description)
Description copied from interface:Task
Change the description of the task- Specified by:
setDescription
in interfaceDelegateTask
- Specified by:
setDescription
in interfaceTask
-
setAssignee
public void setAssignee(String assignee)
Description copied from interface:Task
- Specified by:
setAssignee
in interfaceDelegateTask
- Specified by:
setAssignee
in interfaceTask
-
setOwner
public void setOwner(String owner)
Description copied from interface:Task
TheuserId
of the person that is responsible for this task. This is used when a task isdelegated
.- Specified by:
setOwner
in interfaceDelegateTask
- Specified by:
setOwner
in interfaceTask
-
setDueDate
public void setDueDate(Date dueDate)
Description copied from interface:Task
Change due date of the task.- Specified by:
setDueDate
in interfaceDelegateTask
- Specified by:
setDueDate
in interfaceTask
-
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 interfaceDelegateTask
- Specified by:
setPriority
in interfaceTask
-
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 interfaceTask
-
setNameWithoutCascade
public void setNameWithoutCascade(String taskName)
-
setDescriptionWithoutCascade
public void setDescriptionWithoutCascade(String description)
-
setAssigneeWithoutCascade
public void setAssigneeWithoutCascade(String assignee)
-
setOwnerWithoutCascade
public void setOwnerWithoutCascade(String owner)
-
setDueDateWithoutCascade
public void setDueDateWithoutCascade(Date dueDate)
-
setPriorityWithoutCascade
public void setPriorityWithoutCascade(int priority)
-
setCaseInstanceIdWithoutCascade
public void setCaseInstanceIdWithoutCascade(String caseInstanceId)
-
setParentTaskIdWithoutCascade
public void setParentTaskIdWithoutCascade(String parentTaskId)
-
setTaskDefinitionKeyWithoutCascade
public void setTaskDefinitionKeyWithoutCascade(String taskDefinitionKey)
-
setDelegationStateWithoutCascade
public void setDelegationStateWithoutCascade(DelegationState delegationState)
-
setDelegationStateString
public void setDelegationStateString(String delegationState)
Setter for mybatis mapper.- Parameters:
delegationState
- the delegation state as string
-
setFollowUpDateWithoutCascade
public void setFollowUpDateWithoutCascade(Date followUpDate)
-
fireEvent
public boolean fireEvent(String taskEventName)
- Returns:
- true if invoking the listener was successful; if not successful, either false is returned (case: BPMN error propagation) or an exception is thrown
-
getListenersForEvent
protected List<TaskListener> getListenersForEvent(String event)
-
getTimeoutListener
protected TaskListener getTimeoutListener(String timeoutId)
-
invokeListener
protected boolean invokeListener(String taskEventName, TaskListener taskListener)
-
invokeListener
protected boolean invokeListener(CoreExecution currentExecution, String eventName, TaskListener taskListener) throws Exception
- Returns:
- true if the next listener can be invoked; false if not
- Throws:
Exception
-
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()
-
transitionTo
public boolean transitionTo(TaskEntity.TaskState state)
-
triggerUpdateEvent
public boolean triggerUpdateEvent()
-
triggerTimeoutEvent
public boolean triggerTimeoutEvent(String timeoutId)
- Returns:
- true if invoking the listener was successful; if not successful, either false is returned (case: BPMN error propagation) or an exception is thrown
-
fireAssignmentEvent
protected boolean fireAssignmentEvent()
-
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()
-
getRevision
public int getRevision()
- Specified by:
getRevision
in interfaceHasDbRevision
-
setRevision
public void setRevision(int revision)
- Specified by:
setRevision
in interfaceHasDbRevision
-
getName
public String getName()
Description copied from interface:Task
Name or title of the task.- Specified by:
getName
in interfaceDelegateTask
- Specified by:
getName
in interfaceTask
-
getDescription
public String getDescription()
Description copied from interface:Task
Free text description of the task.- Specified by:
getDescription
in interfaceDelegateTask
- Specified by:
getDescription
in interfaceTask
-
getDueDate
public Date getDueDate()
Description copied from interface:Task
Due date of the task.- Specified by:
getDueDate
in interfaceDelegateTask
- Specified by:
getDueDate
in interfaceTask
-
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 interfaceDelegateTask
- Specified by:
getPriority
in interfaceTask
-
getCreateTime
public Date getCreateTime()
Description copied from interface:Task
The date/time when this task was created- Specified by:
getCreateTime
in interfaceDelegateTask
- Specified by:
getCreateTime
in interfaceTask
-
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 interfaceDelegateTask
- Specified by:
getExecutionId
in interfaceTask
-
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 interfaceDelegateTask
- Specified by:
getProcessInstanceId
in interfaceTask
-
isStandaloneTask
public boolean isStandaloneTask()
-
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 interfaceDelegateTask
- Specified by:
getProcessDefinitionId
in interfaceTask
-
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 is 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 toTaskQuery.initializeFormKeys()
, it will throw aBadUserRequestException
.- Specified by:
getFormKey
in interfaceTask
- Returns:
- the form key for this task
-
getCamundaFormRef
public CamundaFormRef getCamundaFormRef()
Description copied from interface:Task
Provides the form binding reference to the Camunda Form for the task.NOTE: If the task instance is 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 toTaskQuery.initializeFormKeys()
, it will throw aBadUserRequestException
.- Specified by:
getCamundaFormRef
in interfaceTask
- Returns:
- the reference key, binding type and version (if type is
version
)
-
setProcessDefinitionId
public void setProcessDefinitionId(String processDefinitionId)
-
getAssignee
public String getAssignee()
Description copied from interface:Task
- Specified by:
getAssignee
in interfaceDelegateTask
- Specified by:
getAssignee
in interfaceTask
-
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 interfaceDelegateTask
- Specified by:
getTaskDefinitionKey
in interfaceTask
-
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 interfaceDelegateTask
-
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
TheuserId
of the person that is responsible for this task. This is used when a task isdelegated
.- Specified by:
getOwner
in interfaceDelegateTask
- Specified by:
getOwner
in interfaceTask
-
getDelegationState
public DelegationState getDelegationState()
Description copied from interface:Task
The currentDelegationState
for this task.- Specified by:
getDelegationState
in interfaceTask
-
setDelegationState
public void setDelegationState(DelegationState delegationState)
Description copied from interface:Task
The currentDelegationState
for this task.- Specified by:
setDelegationState
in interfaceTask
-
getDelegationStateString
public String getDelegationStateString()
-
isDeleted
public boolean isDeleted()
-
getDeleteReason
public String getDeleteReason()
Description copied from interface:DelegateTask
Get delete reason of the task.- Specified by:
getDeleteReason
in interfaceDelegateTask
-
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 interfaceTask
-
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 interfaceTask
-
getFollowUpDate
public Date getFollowUpDate()
Description copied from interface:Task
Follow-up date of the task.- Specified by:
getFollowUpDate
in interfaceDelegateTask
- Specified by:
getFollowUpDate
in interfaceTask
-
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 interfaceDelegateTask
- Specified by:
getTenantId
in interfaceTask
- 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 interfaceTask
- 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 interfaceDelegateTask
- Specified by:
setFollowUpDate
in interfaceTask
-
getVariablesInternal
public Collection<VariableInstanceEntity> getVariablesInternal()
-
onCommandContextClose
public void onCommandContextClose(CommandContext commandContext)
- Specified by:
onCommandContextClose
in interfaceCommandContextListener
-
onCommandFailed
public void onCommandFailed(CommandContext commandContext, Throwable t)
- Specified by:
onCommandFailed
in interfaceCommandContextListener
-
registerCommandContextCloseListener
protected void registerCommandContextCloseListener()
-
getPropertyChanges
public Map<String,PropertyChange> getPropertyChanges()
-
logUserOperation
public void logUserOperation(String operation)
-
fireHistoricIdentityLinks
public void fireHistoricIdentityLinks()
-
getProcessEngineServices
public ProcessEngineServices getProcessEngineServices()
Description copied from interface:ProcessEngineServicesAware
Returns theProcessEngineServices
providing access to the public API of the process engine.- Specified by:
getProcessEngineServices
in interfaceProcessEngineServicesAware
- Returns:
- the
ProcessEngineServices
.
-
getProcessEngine
public ProcessEngine getProcessEngine()
Description copied from interface:ProcessEngineServicesAware
Returns theProcessEngine
providing access to the public API of the process engine.- Specified by:
getProcessEngine
in interfaceProcessEngineServicesAware
- Returns:
- the
ProcessEngine
.
-
executeMetrics
public void executeMetrics(String metricsName, CommandContext commandContext)
-
addIdentityLinkChanges
public void addIdentityLinkChanges(String type, String oldProperty, String newProperty)
-
setVariablesLocal
public void setVariablesLocal(Map<String,?> variables, boolean skipJavaSerializationFormatCheck)
- Overrides:
setVariablesLocal
in classAbstractVariableScope
-
getReferencedEntityIds
public Set<String> getReferencedEntityIds()
Description copied from interface:HasDbReferences
Scope: IN-MEMORY references
- Specified by:
getReferencedEntityIds
in interfaceHasDbReferences
- Returns:
- the ids of the entities that this entity references. Should only return ids for entities of the same type
-
getReferencedEntitiesIdAndClass
public Map<String,Class> getReferencedEntitiesIdAndClass()
Description copied from interface:HasDbReferences
Scope: IN-MEMORY references
- Specified by:
getReferencedEntitiesIdAndClass
in interfaceHasDbReferences
- Returns:
- a map of the ids and the entities' classes that this entity references. It's used when trying to determine if there was an Optimistic Locking occurrence on an INSERT or UPDATE of an object of this type.
-
bpmnError
public void bpmnError(String errorCode, String errorMessage, Map<String,Object> variables)
-
-