Package org.camunda.bpm.engine.delegate
Interface DelegateTask
- All Superinterfaces:
BpmnModelExecutionContext
,ProcessEngineServicesAware
,VariableScope
- All Known Implementing Classes:
TaskEntity
public interface DelegateTask
extends VariableScope, BpmnModelExecutionContext, ProcessEngineServicesAware
- Author:
- Joram Barrez, Daniel Meyer, Sebastian Menski
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
addGroupIdentityLink
(String groupId, String identityLinkType) Involves a group with group task.void
addUserIdentityLink
(String userId, String identityLinkType) Involves a user with a task.void
complete()
set status to complete.void
deleteCandidateGroup
(String groupId) Convenience shorthand for#deleteGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.CANDIDATE
void
deleteCandidateUser
(String userId) Convenience shorthand fordeleteUserIdentityLink(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
deleteUserIdentityLink
(String userId, String identityLinkType) Removes the association between a user and a task for the given identityLinkType.The {@link User.getId() userId} of the person to which this task is delegated.Provides access to the currentUserTask
Element from the Bpmn Model.Retrieves the candidate users and groups associated with the task.Reference to the case definition or null if it is not related to a case.Returns the case execution currently at the task.Reference to the case execution or null if it is not related to a case instance.Reference to the case instance or null if it is not related to a case instance.The date/time when this task was createdGet delete reason of the task.Free text description of the task.Due date of the task.Returns the event name which triggered the task listener to fire for this task.Returns the execution currently at the task.Reference to the path of execution or null if it is not related to a process instance.Follow-up date of the task.getId()
DB id of the task.The date/time when this task was last updated.getName()
Name or title of the task.getOwner()
The {@link User.getId() userId} of the person responsible for this task.int
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] highestReference to the process definition or null if it is not related to a process.Reference to the process instance or null if it is not related to a process instance.The id of the activity in the process defining this task or null if this is not related to a processReturn the id of the tenant this task belongs to.void
setAssignee
(String assignee) The {@link User.getId() userId} of the person to which this task is delegated.void
setDescription
(String description) Change the description of the taskvoid
setDueDate
(Date dueDate) Change due date of the task.void
setFollowUpDate
(Date followUpDate) Change follow-up date of the task.void
Change the name of the task.void
The {@link User.getId() userId} of the person responsible for this task.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] highestMethods inherited from interface org.camunda.bpm.engine.delegate.BpmnModelExecutionContext
getBpmnModelInstance
Methods inherited from interface org.camunda.bpm.engine.delegate.ProcessEngineServicesAware
getProcessEngine, getProcessEngineServices
Methods inherited from interface org.camunda.bpm.engine.delegate.VariableScope
getVariable, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariableScopeKey, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setVariable, setVariableLocal, setVariables, setVariablesLocal
-
Method Details
-
getId
String getId()DB id of the task. -
getName
String getName()Name or title of the task. -
setName
Change the name of the task. -
getDescription
String getDescription()Free text description of the task. -
setDescription
Change the description of the task -
getPriority
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 -
setPriority
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 -
getProcessInstanceId
String getProcessInstanceId()Reference to the process instance or null if it is not related to a process instance. -
getExecutionId
String getExecutionId()Reference to the path of execution or null if it is not related to a process instance. -
getProcessDefinitionId
String getProcessDefinitionId()Reference to the process definition or null if it is not related to a process. -
getCaseInstanceId
String getCaseInstanceId()Reference to the case instance or null if it is not related to a case instance. -
getCaseExecutionId
String getCaseExecutionId()Reference to the case execution or null if it is not related to a case instance. -
getCaseDefinitionId
String getCaseDefinitionId()Reference to the case definition or null if it is not related to a case. -
getCreateTime
Date getCreateTime()The date/time when this task was created -
getLastUpdated
Date getLastUpdated()The date/time when this task was last updated. All operations that fireTaskListener.EVENTNAME_UPDATE
count as an update to the task. Returns null if the task was never updated before (i.e. it was only created). -
getTaskDefinitionKey
String getTaskDefinitionKey()The id of the activity in the process defining this task or null if this is not related to a process -
getExecution
DelegateExecution getExecution()Returns the execution currently at the task. -
getCaseExecution
DelegateCaseExecution getCaseExecution()Returns the case execution currently at the task. -
getEventName
String getEventName()Returns the event name which triggered the task listener to fire for this task. -
addCandidateUser
Adds the given user as a candidate user to this task. -
addCandidateUsers
Adds multiple users as candidate user to this task. -
addCandidateGroup
Adds the given group as candidate group to this task -
addCandidateGroups
Adds multiple groups as candidate group to this task. -
getOwner
String getOwner()The {@link User.getId() userId} of the person responsible for this task. -
setOwner
The {@link User.getId() userId} of the person responsible for this task. -
getAssignee
String getAssignee()The {@link User.getId() userId} of the person to which this task is delegated. -
setAssignee
The {@link User.getId() userId} of the person to which this task is delegated. -
getDueDate
Date getDueDate()Due date of the task. -
setDueDate
Change due date of the task. -
getDeleteReason
String getDeleteReason()Get delete reason of the task. -
addUserIdentityLink
Involves a user with a task. The type of identity link is defined by the given identityLinkType.- Parameters:
userId
- id of the user involve, cannot be null.identityLinkType
- type of identityLink, cannot be null (@seeIdentityLinkType
).- Throws:
ProcessEngineException
- when the task or user doesn't exist.
-
addGroupIdentityLink
Involves a group with group task. The type of identityLink is defined by the given identityLink.- Parameters:
groupId
- id of the group to involve, cannot be null.identityLinkType
- type of identity, cannot be null (@seeIdentityLinkType
).- Throws:
ProcessEngineException
- when the task or group doesn't exist.
-
deleteCandidateUser
Convenience shorthand fordeleteUserIdentityLink(String, String)
; with typeIdentityLinkType.CANDIDATE
- Parameters:
userId
- id of the user to use as candidate, cannot be null.- Throws:
ProcessEngineException
- when the task or user doesn't exist.
-
deleteCandidateGroup
Convenience shorthand for#deleteGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.CANDIDATE
- Parameters:
groupId
- id of the group to use as candidate, cannot be null.- Throws:
ProcessEngineException
- when the task or group doesn't exist.
-
deleteUserIdentityLink
Removes the association between a user and a task for the given identityLinkType.- Parameters:
userId
- id of the user involve, cannot be null.identityLinkType
- type of identityLink, cannot be null (@seeIdentityLinkType
).- Throws:
ProcessEngineException
- when the task or user doesn't exist.
-
deleteGroupIdentityLink
Removes the association between a group and a task for the given identityLinkType.- Parameters:
groupId
- id of the group to involve, cannot be null.identityLinkType
- type of identity, cannot be null (@seeIdentityLinkType
).- Throws:
ProcessEngineException
- when the task or group doesn't exist.
-
getCandidates
Set<IdentityLink> getCandidates()Retrieves the candidate users and groups associated with the task.- Returns:
- set of
IdentityLink
s of typeIdentityLinkType.CANDIDATE
.
-
getBpmnModelElementInstance
UserTask getBpmnModelElementInstance()Provides access to the currentUserTask
Element from the Bpmn Model.- Specified by:
getBpmnModelElementInstance
in interfaceBpmnModelExecutionContext
- Returns:
- the current
UserTask
Element from the Bpmn Model.
-
getTenantId
String getTenantId()Return the id of the tenant this task belongs to. Can benull
if the task belongs to no single tenant. -
getFollowUpDate
Date getFollowUpDate()Follow-up date of the task. -
setFollowUpDate
Change follow-up date of the task. -
complete
void complete()set status to complete.- Throws:
IllegalStateException
- if performed on completion or deletion
-