Package org.flowable.cmmn.engine.impl
Class CmmnTaskServiceImpl
java.lang.Object
org.flowable.common.engine.impl.service.CommonServiceImpl<C>
org.flowable.common.engine.impl.service.CommonEngineServiceImpl<CmmnEngineConfiguration>
org.flowable.cmmn.engine.impl.CmmnTaskServiceImpl
- All Implemented Interfaces:
CmmnTaskService
public class CmmnTaskServiceImpl
extends CommonEngineServiceImpl<CmmnEngineConfiguration>
implements CmmnTaskService
- Author:
- Joram Barrez
-
Field Summary
Fields inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
commandExecutorFields inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
configuration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateTask(String taskId, String userId) Activates the task.voidaddGroupIdentityLink(String taskId, String groupId, String identityLinkType) Involves a group with a task.voidaddUserIdentityLink(String taskId, String userId, String identityLinkType) Involves a user with a task.voidbulkSaveTasks(Collection<Task> taskList) voidClaim responsibility for a task: the given user is made assignee for the task.voidvoidvoidvoidcomplete(String taskId, String userId, Map<String, Object> variables, Map<String, Object> transientVariables) voidvoidvoidcompleteTaskWithForm(String taskId, String formDefinitionId, String outcome, String userId, Map<String, Object> variables) voidcompleteTaskWithForm(String taskId, String formDefinitionId, String outcome, String userId, Map<String, Object> variables, boolean localScope) voidcompleteTaskWithForm(String taskId, String formDefinitionId, String outcome, String userId, Map<String, Object> variables, Map<String, Object> transientVariables) voidcompleteTaskWithForm(String taskId, String formDefinitionId, String outcome, Map<String, Object> variables) voidcompleteTaskWithForm(String taskId, String formDefinitionId, String outcome, Map<String, Object> variables, boolean localScope) voidcompleteTaskWithForm(String taskId, String formDefinitionId, String outcome, Map<String, Object> variables, Map<String, Object> transientVariables) Create a builder for the taskCreate a completion builder for the taskvoiddelegateTask(String taskId, String userId) Delegates the task to another user.voiddeleteGroupIdentityLink(String taskId, String groupId, String identityLinkType) Removes the association between a group and a task for the given identityLinkType.voiddeleteTask(String taskId) Deletes the given task, not deleting historic information that is related to this task.voiddeleteTask(String taskId, boolean cascade) Deletes the given task.voiddeleteTask(String taskId, String deleteReason) Deletes the given task, not deleting historic information that is related to this task..voiddeleteTasks(Collection<String> taskIds) Deletes all tasks of the given collection, not deleting historic information that is related to these tasks.voiddeleteTasks(Collection<String> taskIds, boolean cascade) Deletes all tasks of the given collection.voiddeleteTasks(Collection<String> taskIds, String deleteReason) Deletes all tasks of the given collection, not deleting historic information that is related to these tasks.voiddeleteUserIdentityLink(String taskId, String userId, String identityLinkType) Removes the association between a user and a task for the given identityLinkType.getIdentityLinksForTask(String taskId) Retrieves theIdentityLinks associated with the given task.getSubTasks(String parentTaskId) The list of subtasks for this parent taskgetTaskFormModel(String taskId) getTaskFormModel(String taskId, boolean ignoreVariables) getVariable(String taskId, String variableName) get a variables and search in the task scope and if available also the execution scopes.<T> TgetVariable(String taskId, String variableName, Class<T> variableClass) get a variables and search in the task scope and if available also the execution scopes.getVariableInstance(String taskId, String variableName) The variable.getVariableInstanceLocal(String taskId, String variableName) The variable for a task.getVariableInstances(String taskId) All variables visible from the given task scope (including parent scopes).getVariableInstances(String taskId, Collection<String> variableNames) The variable values for all given variableNames, takes all variables into account which are visible from the given task scope (including parent scopes).getVariableInstancesLocal(String taskId) All variable values that are defined in the task scope, without taking outer scopes into account.getVariableInstancesLocal(String taskId, Collection<String> variableNames) The variable values for all given variableNames that are defined in the given task's scope.getVariableInstancesLocalByTaskIds(Set<String> taskIds) get all variables and search only in the task scope.getVariableLocal(String taskId, String variableName) checks whether or not the task has a variable defined with the given name.<T> TgetVariableLocal(String taskId, String variableName, Class<T> variableClass) checks whether or not the task has a variable defined with the given name.getVariables(String taskId) get all variables and search in the task scope and if available also the execution scopes.getVariables(String taskId, Collection<String> variableNames) get values for all given variableNames and search only in the task scope.getVariablesLocal(String taskId) get all variables and search only in the task scope.getVariablesLocal(String taskId, Collection<String> variableNames) get a variable on a taskbooleanhasVariable(String taskId, String variableName) checks whether or not the task has a variable defined with the given name, in the task scope and if available also the execution scopes.booleanhasVariableLocal(String taskId, String variableName) checks whether or not the task has a variable defined with the given name, local task scope only.newTask()voidremoveVariable(String taskId, String variableName) Removes the variable from the task.voidremoveVariableLocal(String taskId, String variableName) Removes the variable from the task (not considering parent scopes).voidremoveVariables(String taskId, Collection<String> variableNames) Removes all variables in the given collection from the task.voidremoveVariablesLocal(String taskId, Collection<String> variableNames) Removes all variables in the given collection from the task (not considering parent scopes).voidresolveTask(String taskId) Marks that the assignee is done with this task and that it can be send back to the owner.voidresolveTask(String taskId, Map<String, Object> variables) Marks that the assignee is done with this task providing the required variables and that it can be sent back to the owner.voidSimilar toCmmnTaskService.resolveTask(String, Map), but allows to set transient variables too.voidvoidsetAssignee(String taskId, String userId) Changes the assignee of the given task to the given userId.voidsetDueDate(String taskId, Date dueDate) Changes the due date of the taskvoidTransfers ownership of this task to another user.voidsetPriority(String taskId, int priority) Changes the priority of the task.voidsetVariable(String taskId, String variableName, Object value) set variable on a task.voidsetVariableLocal(String taskId, String variableName, Object value) set variable on a task.voidsetVariables(String taskId, Map<String, ? extends Object> variables) set variables on a task.voidsetVariablesLocal(String taskId, Map<String, ? extends Object> variables) set variables on a task.voidstartProgress(String taskId, String userId) Starts the progress on the task.voidsuspendTask(String taskId, String userId) Suspends the task.voidA shortcut toCmmnTaskService.claim(java.lang.String, java.lang.String)with null user in order to unclaim the taskMethods inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
getCommandExecutor, setCommandExecutorMethods inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
getConfiguration
-
Constructor Details
-
CmmnTaskServiceImpl
-
-
Method Details
-
newTask
- Specified by:
newTaskin interfaceCmmnTaskService
-
newTask
- Specified by:
newTaskin interfaceCmmnTaskService
-
saveTask
- Specified by:
saveTaskin interfaceCmmnTaskService
-
bulkSaveTasks
- Specified by:
bulkSaveTasksin interfaceCmmnTaskService
-
claim
Description copied from interface:CmmnTaskServiceClaim responsibility for a task: the given user is made assignee for the task. The difference withCmmnTaskService.setAssignee(String, String)is that here a check is done if the task already has a user assigned to it. No check is done whether the user is known by the identity component.- Specified by:
claimin interfaceCmmnTaskService- Parameters:
taskId- task to claim, cannot be null.userId- user that claims the task. When userId is null the task is unclaimed, assigned to no one.
-
unclaim
Description copied from interface:CmmnTaskServiceA shortcut toCmmnTaskService.claim(java.lang.String, java.lang.String)with null user in order to unclaim the task- Specified by:
unclaimin interfaceCmmnTaskService- Parameters:
taskId- task to unclaim, cannot be null.
-
startProgress
Description copied from interface:CmmnTaskServiceStarts the progress on the task.- Specified by:
startProgressin interfaceCmmnTaskService- Parameters:
taskId- task to start progress, cannot be null.userId- user that starts progress for the task.
-
suspendTask
Description copied from interface:CmmnTaskServiceSuspends the task. No check is done whether the user is known by the identity component.- Specified by:
suspendTaskin interfaceCmmnTaskService- Parameters:
taskId- task to suspend, cannot be null.userId- user that suspends the task.
-
activateTask
Description copied from interface:CmmnTaskServiceActivates the task. No check is done whether the user is known by the identity component.- Specified by:
activateTaskin interfaceCmmnTaskService- Parameters:
taskId- task to activate, cannot be null.userId- user that activates the task.
-
complete
- Specified by:
completein interfaceCmmnTaskService
-
complete
- Specified by:
completein interfaceCmmnTaskService
-
complete
- Specified by:
completein interfaceCmmnTaskService
-
complete
- Specified by:
completein interfaceCmmnTaskService
-
complete
public void complete(String taskId, Map<String, Object> variables, Map<String, Object> transientVariables) - Specified by:
completein interfaceCmmnTaskService
-
complete
public void complete(String taskId, String userId, Map<String, Object> variables, Map<String, Object> transientVariables) - Specified by:
completein interfaceCmmnTaskService
-
completeTaskWithForm
public void completeTaskWithForm(String taskId, String formDefinitionId, String outcome, Map<String, Object> variables) - Specified by:
completeTaskWithFormin interfaceCmmnTaskService
-
completeTaskWithForm
public void completeTaskWithForm(String taskId, String formDefinitionId, String outcome, String userId, Map<String, Object> variables) - Specified by:
completeTaskWithFormin interfaceCmmnTaskService
-
completeTaskWithForm
public void completeTaskWithForm(String taskId, String formDefinitionId, String outcome, Map<String, Object> variables, Map<String, Object> transientVariables) - Specified by:
completeTaskWithFormin interfaceCmmnTaskService
-
completeTaskWithForm
public void completeTaskWithForm(String taskId, String formDefinitionId, String outcome, String userId, Map<String, Object> variables, Map<String, Object> transientVariables) - Specified by:
completeTaskWithFormin interfaceCmmnTaskService
-
completeTaskWithForm
public void completeTaskWithForm(String taskId, String formDefinitionId, String outcome, Map<String, Object> variables, boolean localScope) - Specified by:
completeTaskWithFormin interfaceCmmnTaskService
-
completeTaskWithForm
public void completeTaskWithForm(String taskId, String formDefinitionId, String outcome, String userId, Map<String, Object> variables, boolean localScope) - Specified by:
completeTaskWithFormin interfaceCmmnTaskService
-
createTaskCompletionBuilder
Description copied from interface:CmmnTaskServiceCreate a completion builder for the task- Specified by:
createTaskCompletionBuilderin interfaceCmmnTaskService- Returns:
- task completion builder
-
delegateTask
Description copied from interface:CmmnTaskServiceDelegates the task to another user. This means that the assignee is set and the delegation state is set toDelegationState.PENDING. If no owner is set on the task, the owner is set to the current assignee of the task.- Specified by:
delegateTaskin interfaceCmmnTaskService- Parameters:
taskId- The id of the task that will be delegated.userId- The id of the user that will be set as assignee.
-
resolveTask
Description copied from interface:CmmnTaskServiceMarks that the assignee is done with this task and that it can be send back to the owner. Can only be called when this task isDelegationState.PENDINGdelegation. After this method returns, thedelegationStateis set toDelegationState.RESOLVED.- Specified by:
resolveTaskin interfaceCmmnTaskService- Parameters:
taskId- the id of the task to resolve, cannot be null.
-
resolveTask
Description copied from interface:CmmnTaskServiceMarks that the assignee is done with this task providing the required variables and that it can be sent back to the owner. Can only be called when this task isDelegationState.PENDINGdelegation. After this method returns, thedelegationStateis set toDelegationState.RESOLVED.- Specified by:
resolveTaskin interfaceCmmnTaskServicevariables- When no task exists with the given id.
-
resolveTask
public void resolveTask(String taskId, Map<String, Object> variables, Map<String, Object> transientVariables) Description copied from interface:CmmnTaskServiceSimilar toCmmnTaskService.resolveTask(String, Map), but allows to set transient variables too.- Specified by:
resolveTaskin interfaceCmmnTaskService
-
deleteTask
Description copied from interface:CmmnTaskServiceDeletes the given task, not deleting historic information that is related to this task.- Specified by:
deleteTaskin interfaceCmmnTaskService- Parameters:
taskId- The id of the task that will be deleted, cannot be null. If no task exists with the given taskId, the operation is ignored.
-
deleteTasks
Description copied from interface:CmmnTaskServiceDeletes all tasks of the given collection, not deleting historic information that is related to these tasks.- Specified by:
deleteTasksin interfaceCmmnTaskService- Parameters:
taskIds- The id's of the tasks that will be deleted, cannot be null. All id's in the list that don't have an existing task will be ignored.
-
deleteTask
Description copied from interface:CmmnTaskServiceDeletes the given task.- Specified by:
deleteTaskin interfaceCmmnTaskService- Parameters:
taskId- The id of the task that will be deleted, cannot be null. If no task exists with the given taskId, the operation is ignored.cascade- If cascade is true, also the historic information related to this task is deleted.
-
deleteTasks
Description copied from interface:CmmnTaskServiceDeletes all tasks of the given collection.- Specified by:
deleteTasksin interfaceCmmnTaskService- Parameters:
taskIds- The id's of the tasks that will be deleted, cannot be null. All id's in the list that don't have an existing task will be ignored.cascade- If cascade is true, also the historic information related to this task is deleted.
-
deleteTask
Description copied from interface:CmmnTaskServiceDeletes the given task, not deleting historic information that is related to this task..- Specified by:
deleteTaskin interfaceCmmnTaskService- Parameters:
taskId- The id of the task that will be deleted, cannot be null. If no task exists with the given taskId, the operation is ignored.deleteReason- reason the task is deleted. Is recorded in history, if enabled.
-
deleteTasks
Description copied from interface:CmmnTaskServiceDeletes all tasks of the given collection, not deleting historic information that is related to these tasks.- Specified by:
deleteTasksin interfaceCmmnTaskService- Parameters:
taskIds- The id's of the tasks that will be deleted, cannot be null. All id's in the list that don't have an existing task will be ignored.deleteReason- reason the task is deleted. Is recorded in history, if enabled.
-
getTaskFormModel
- Specified by:
getTaskFormModelin interfaceCmmnTaskService
-
getTaskFormModel
- Specified by:
getTaskFormModelin interfaceCmmnTaskService
-
setPriority
Description copied from interface:CmmnTaskServiceChanges the priority of the task. Authorization: actual owner / business admin- Specified by:
setPriorityin interfaceCmmnTaskService- Parameters:
taskId- id of the task, cannot be null.priority- the new priority for the task.
-
setDueDate
Description copied from interface:CmmnTaskServiceChanges the due date of the task- Specified by:
setDueDatein interfaceCmmnTaskService- Parameters:
taskId- id of the task, cannot be null.dueDate- the new due date for the task
-
createTaskQuery
- Specified by:
createTaskQueryin interfaceCmmnTaskService
-
getSubTasks
Description copied from interface:CmmnTaskServiceThe list of subtasks for this parent task- Specified by:
getSubTasksin interfaceCmmnTaskService
-
getVariables
Description copied from interface:CmmnTaskServiceget all variables and search in the task scope and if available also the execution scopes. If you have many variables and you only need a few, consider usingCmmnTaskService.getVariables(String, Collection)for better performance.- Specified by:
getVariablesin interfaceCmmnTaskService
-
getVariablesLocal
Description copied from interface:CmmnTaskServiceget all variables and search only in the task scope. If you have many task local variables and you only need a few, consider usingCmmnTaskService.getVariablesLocal(String, Collection)for better performance.- Specified by:
getVariablesLocalin interfaceCmmnTaskService
-
getVariables
Description copied from interface:CmmnTaskServiceget values for all given variableNames and search only in the task scope.- Specified by:
getVariablesin interfaceCmmnTaskService
-
getVariablesLocal
Description copied from interface:CmmnTaskServiceget a variable on a task- Specified by:
getVariablesLocalin interfaceCmmnTaskService
-
getVariable
Description copied from interface:CmmnTaskServiceget a variables and search in the task scope and if available also the execution scopes.- Specified by:
getVariablein interfaceCmmnTaskService
-
getVariable
Description copied from interface:CmmnTaskServiceget a variables and search in the task scope and if available also the execution scopes.- Specified by:
getVariablein interfaceCmmnTaskService
-
hasVariable
Description copied from interface:CmmnTaskServicechecks whether or not the task has a variable defined with the given name, in the task scope and if available also the execution scopes.- Specified by:
hasVariablein interfaceCmmnTaskService
-
getVariableLocal
Description copied from interface:CmmnTaskServicechecks whether or not the task has a variable defined with the given name.- Specified by:
getVariableLocalin interfaceCmmnTaskService
-
getVariableLocal
Description copied from interface:CmmnTaskServicechecks whether or not the task has a variable defined with the given name.- Specified by:
getVariableLocalin interfaceCmmnTaskService
-
getVariableInstancesLocalByTaskIds
Description copied from interface:CmmnTaskServiceget all variables and search only in the task scope.- Specified by:
getVariableInstancesLocalByTaskIdsin interfaceCmmnTaskService
-
hasVariableLocal
Description copied from interface:CmmnTaskServicechecks whether or not the task has a variable defined with the given name, local task scope only.- Specified by:
hasVariableLocalin interfaceCmmnTaskService
-
setVariable
Description copied from interface:CmmnTaskServiceset variable on a task. If the variable is not already existing, it will be created in the most outer scope. This means the process instance in case this task is related to an execution.- Specified by:
setVariablein interfaceCmmnTaskService
-
setVariableLocal
Description copied from interface:CmmnTaskServiceset variable on a task. If the variable is not already existing, it will be created in the task.- Specified by:
setVariableLocalin interfaceCmmnTaskService
-
setVariables
Description copied from interface:CmmnTaskServiceset variables on a task. If the variable is not already existing, it will be created in the most outer scope. This means the process instance in case this task is related to an execution.- Specified by:
setVariablesin interfaceCmmnTaskService
-
setVariablesLocal
Description copied from interface:CmmnTaskServiceset variables on a task. If the variable is not already existing, it will be created in the task.- Specified by:
setVariablesLocalin interfaceCmmnTaskService
-
removeVariable
Description copied from interface:CmmnTaskServiceRemoves the variable from the task. When the variable does not exist, nothing happens.- Specified by:
removeVariablein interfaceCmmnTaskService
-
removeVariableLocal
Description copied from interface:CmmnTaskServiceRemoves the variable from the task (not considering parent scopes). When the variable does not exist, nothing happens.- Specified by:
removeVariableLocalin interfaceCmmnTaskService
-
removeVariables
Description copied from interface:CmmnTaskServiceRemoves all variables in the given collection from the task. Non existing variable names are simply ignored.- Specified by:
removeVariablesin interfaceCmmnTaskService
-
removeVariablesLocal
Description copied from interface:CmmnTaskServiceRemoves all variables in the given collection from the task (not considering parent scopes). Non existing variable names are simply ignored.- Specified by:
removeVariablesLocalin interfaceCmmnTaskService
-
getVariableInstance
Description copied from interface:CmmnTaskServiceThe variable. Searching for the variable is done in all scopes that are visible to the given task (including parent scopes). Returns null when no variable value is found with the given name.- Specified by:
getVariableInstancein interfaceCmmnTaskService- Parameters:
taskId- id of task, cannot be null.variableName- name of variable, cannot be null.- Returns:
- the variable or null if the variable is undefined.
-
getVariableInstanceLocal
Description copied from interface:CmmnTaskServiceThe variable for a task. Returns the variable when it is set for the task (and not searching parent scopes). Returns null when no variable is found with the given name.- Specified by:
getVariableInstanceLocalin interfaceCmmnTaskService- Parameters:
taskId- id of task, cannot be null.variableName- name of variable, cannot be null.- Returns:
- the variable or null if the variable is undefined.
-
getVariableInstances
Description copied from interface:CmmnTaskServiceAll variables visible from the given task scope (including parent scopes).- Specified by:
getVariableInstancesin interfaceCmmnTaskService- Parameters:
taskId- id of task, cannot be null.- Returns:
- the variable instances or an empty map if no such variables are found.
-
getVariableInstances
public Map<String,VariableInstance> getVariableInstances(String taskId, Collection<String> variableNames) Description copied from interface:CmmnTaskServiceThe variable values for all given variableNames, takes all variables into account which are visible from the given task scope (including parent scopes).- Specified by:
getVariableInstancesin interfaceCmmnTaskService- Parameters:
taskId- id of taskId, cannot be null.variableNames- the collection of variable names that should be retrieved.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariableInstancesLocal
Description copied from interface:CmmnTaskServiceAll variable values that are defined in the task scope, without taking outer scopes into account. If you have many task local variables and you only need a few, consider usingCmmnTaskService.getVariableInstancesLocal(String, Collection)for better performance.- Specified by:
getVariableInstancesLocalin interfaceCmmnTaskService- Parameters:
taskId- id of task, cannot be null.- Returns:
- the variables or an empty map if no such variables are found.
-
getVariableInstancesLocal
public Map<String,VariableInstance> getVariableInstancesLocal(String taskId, Collection<String> variableNames) Description copied from interface:CmmnTaskServiceThe variable values for all given variableNames that are defined in the given task's scope. (Does not searching parent scopes).- Specified by:
getVariableInstancesLocalin interfaceCmmnTaskService- Parameters:
taskId- id of taskId, cannot be null.variableNames- the collection of variable names that should be retrieved.- Returns:
- the variables or an empty map if no such variables are found.
-
setAssignee
Description copied from interface:CmmnTaskServiceChanges the assignee of the given task to the given userId. No check is done whether the user is known by the identity component.- Specified by:
setAssigneein interfaceCmmnTaskService- Parameters:
taskId- id of the task, cannot be null.userId- id of the user to use as assignee.
-
setOwner
Description copied from interface:CmmnTaskServiceTransfers ownership of this task to another user. No check is done whether the user is known by the identity component.- Specified by:
setOwnerin interfaceCmmnTaskService- Parameters:
taskId- id of the task, cannot be null.userId- of the person that is receiving ownership.
-
addUserIdentityLink
Description copied from interface:CmmnTaskServiceInvolves a user with a task. The type of identity link is defined by the given identityLinkType.- Specified by:
addUserIdentityLinkin interfaceCmmnTaskService- Parameters:
taskId- id of the task, cannot be null.userId- id of the user involve, cannot be null.identityLinkType- type of identityLink, cannot be null.
-
addGroupIdentityLink
Description copied from interface:CmmnTaskServiceInvolves a group with a task. The type of identityLink is defined by the given identityLink.- Specified by:
addGroupIdentityLinkin interfaceCmmnTaskService- Parameters:
taskId- id of the task, cannot be null.groupId- id of the group to involve, cannot be null.identityLinkType- type of identity, cannot be null.
-
deleteGroupIdentityLink
Description copied from interface:CmmnTaskServiceRemoves the association between a group and a task for the given identityLinkType.- Specified by:
deleteGroupIdentityLinkin interfaceCmmnTaskService- Parameters:
taskId- id of the task, cannot be null.groupId- id of the group to involve, cannot be null.identityLinkType- type of identity, cannot be null.
-
deleteUserIdentityLink
Description copied from interface:CmmnTaskServiceRemoves the association between a user and a task for the given identityLinkType.- Specified by:
deleteUserIdentityLinkin interfaceCmmnTaskService- Parameters:
taskId- id of the task, cannot be null.userId- id of the user involve, cannot be null.identityLinkType- type of identityLink, cannot be null.
-
getIdentityLinksForTask
Description copied from interface:CmmnTaskServiceRetrieves theIdentityLinks associated with the given task. Such anIdentityLinkinforms how a certain identity (eg. group or user) is associated with a certain task (eg. as candidate, assignee, etc.)- Specified by:
getIdentityLinksForTaskin interfaceCmmnTaskService
-
createTaskBuilder
Description copied from interface:CmmnTaskServiceCreate a builder for the task- Specified by:
createTaskBuilderin interfaceCmmnTaskService- Returns:
- task builder
-