Skip to main content

Task Expressions

Task Assignment Functions​

The following functions around assignment are available in a CMMN / BPMN execution context. If not otherwise mentioned the functions are also available in Flowable Cloud. The only difference is that in the Flowable Cloud you can only access a task which belongs to the same scope as the execution context (not in the hierarchy).

2025.1.01+
FunctionDescription
${task:getTask(<taskId>)}Returns the task (runtime or historical) with the provided id.
${task:getAssignee()}Get the assignee of the current task. Only applicable in a task listener
${task:getAssignee(<taskId>)}Get the assignee of the task with the given taskId
${task:removeAssignee()}Remove the assignee of the current task. Only applicable in a task listener
${task:removeAssignee(<taskId>)}Remove the assignee of the task with the given taskId
${task:setAssignee(<userId>)}Set the assignee of the current task to the user with the given userId. Only applicable in a task listener
${task:setAssignee(<taskId>, <userId>)}Set the assignee of the task with the given taskId to the user with the given userId
${task:getOwner()}Get the owner of the current task. Only applicable in a task listener
${task:getOwner(<taskId>)}Get the owner of the task with the given taskId
${task:removeOwner()}Remove the owner of the current task. Only applicable in a task listener
${task:removeOwner(<taskId>)}Remove the owner of the task with the given taskId
${task:setOwner(<userId>)}Set the owner of the current task to the user with the given userId. Only applicable in a task listener
${task:setOwner(<taskId>, <userId>)}Set the owner of the task with the given taskId to the user with the given userId
${task:addCandidateUser(<userId>)}Add the user with the given userId as a candidate user of the current task. Only applicable in a task listener
${task:addCandidateUser(<taskId>, <userId>)}Add the user with the given userId as a candidate user of the task with the given taskId
${task:removeCandidateUser(<userId>)}Remove the user with the given userId as a candidate user of the current task. Only applicable in a task listener
${task:removeCandidateUser(<taskId>, <userId>)}Remove the user with the given userId as a candidate user of the task with the given taskId
${task:addCandidateUsers(<userIds>)}Add the users with the given userIds as candidate users of the current task. Only applicable in a task listener
${task:addCandidateUsers(<taskId>, <userIds>)}Add the users with the given userIds as candidate users of the task with the given taskId
${task:removeCandidateUsers(<userIds>)}Remove the users with the given userIds as candidate users of the current task. Only applicable in a task listener
${task:removeCandidateUsers(<taskId>, <userIds>)}Remove the users with the given userIds as candidate users of the task with the given taskId
${task:addCandidateGroup(<groupKey>)}Add the group with the given groupKey as a candidate group of the current task. Only applicable in a task listener
${task:addCandidateGroup(<taskId>, <groupKey>)}Add the group with the given groupKey as a candidate group of the task with the given taskId
${task:removeCandidateGroup(<groupKey>)}Remove the group with the given groupKey as a candidate group of the current task. Only applicable in a task listener
${task:removeCandidateGroup(<taskId>, <groupKey>)}Remove the group with the given groupKey as a candidate group of the task with the given taskId
${task:addCandidateGroups(<groupKeys>)}Add the groups with the given groupKeys as candidate groups of the current task. Only applicable in a task listener
${task:addCandidateGroups(<taskId>, <groupKeys>)}Add the groups with the given groupKeys as candidate groups of the task with the given taskId
${task:removeCandidateGroups(<groupKeys>)}Remove the groups with the given groupKeys as candidate groups of the current task. Only applicable in a task listener
${task:removeCandidateGroups(<taskId>, <groupKeys>)}Remove the groups with the given groupKeys as candidate groups of the task with the given taskId
${task:addParticipantUser(<userId>)}Add the user with the given userId as a participant user of the current task. Only applicable in a task listener
${task:addParticipantUser(<taskId>, <userId>)}Add the user with the given userId as a participant user of the task with the given taskId
${task:removeParticipantUser(<userId>)}Remove the user with the given userId as a participant user of the current task. Only applicable in a task listener
${task:removeParticipantUser(<taskId>, <userId>)}Remove the user with the given userId as a participant user of the task with the given taskId
${task:addParticipantUsers(<userIds>)}Add the users with the given userIds as participant users of the current task. Only applicable in a task listener
${task:addParticipantUsers(<taskId>, <userIds>)}Add the users with the given userIds as participant users of the task with the given taskId
${task:removeParticipantUsers(<userIds>)}Remove the users with the given userIds as participant users of the current task. Only applicable in a task listener
${task:removeParticipantUsers(<taskId>, <userIds>)}Remove the users with the given userIds as participant users of the task with the given taskId
${task:addParticipantGroup(<groupKey>)}Add the group with the given groupKey as a participant group of the current task. Only applicable in a task listener
${task:addParticipantGroup(<taskId>, <groupKey>)}Add the group with the given groupKey as a participant group of the task with the given taskId
${task:removeParticipantGroup(<groupKey>)}Remove the group with the given groupKey as a participant group of the current task. Only applicable in a task listener
${task:removeParticipantGroup(<taskId>, <groupKey>)}Remove the group with the given groupKey as a participant group of the task with the given taskId
${task:addParticipantGroups(<groupKeys>)}Add the groups with the given groupKeys as participant groups of the current task. Only applicable in a task listener
${task:addParticipantGroups(<taskId>, <groupKeys>)}Add the groups with the given groupKeys as participant groups of the task with the given taskId
${task:removeParticipantGroups(<groupKeys>)}Remove the groups with the given groupKeys as participant groups of the current task. Only applicable in a task listener
${task:removeParticipantGroups(<taskId>, <groupKeys>)}Remove the groups with the given groupKeys as participant groups of the task with the given taskId
${task:addWatcherUser(<userId>)}Add the user with the given userId as a watcher user of the current task. Only applicable in a task listener
${task:addWatcherUser(<taskId>, <userId>)}Add the user with the given userId as a watcher user of the task with the given taskId
${task:removeWatcherUser(<userId>)}Remove the user with the given userId as a watcher user of the current task. Only applicable in a task listener
${task:removeWatcherUser(<taskId>, <userId>)}Remove the user with the given userId as a watcher user of the task with the given taskId
${task:addWatcherUsers(<userIds>)}Add the users with the given userIds as watcher users of the current task. Only applicable in a task listener
${task:addWatcherUsers(<taskId>, <userIds>)}Add the users with the given userIds as watcher users of the task with the given taskId
${task:removeWatcherUsers(<userIds>)}Remove the users with the given userIds as watcher users of the current task. Only applicable in a task listener
${task:removeWatcherUsers(<taskId>, <userIds>)}Remove the users with the given userIds as watcher users of the task with the given taskId
${task:addWatcherGroup(<groupKey>)}Add the group with the given groupKey as a watcher group of the current task. Only applicable in a task listener
${task:addWatcherGroup(<taskId>, <groupKey>)}Add the group with the given groupKey as a watcher group of the task with the given taskId
${task:removeWatcherGroup(<groupKey>)}Remove the group with the given groupKey as a watcher group of the current task. Only applicable in a task listener
${task:removeWatcherGroup(<taskId>, <groupKey>)}Remove the group with the given groupKey as a watcher group of the task with the given taskId
${task:addWatcherGroups(<groupKeys>)}Add the groups with the given groupKeys as watcher groups of the current task. Only applicable in a task listener
${task:addWatcherGroups(<taskId>, <groupKeys>)}Add the groups with the given groupKeys as watcher groups of the task with the given taskId
${task:removeWatcherGroups(<groupKeys>)}Remove the groups with the given groupKeys as watcher groups of the current task. Only applicable in a task listener
${task:removeWatcherGroups(<taskId>, <groupKeys>)}Remove the groups with the given groupKeys as watcher groups of the task with the given taskId

Task Service​

The task service can be used in expressions to programmatically interact with tasks

ExpressionDescription
${taskService.claim(taskId, userId)}Claims the task with the given id by the user with the provided user id.
${taskService.unclaim(taskId)}Unclaims the task after it was claimed.
${taskService.complete(taskId, userId, variables)}Completes the given task. The userId and variables (Map of String to Objects) are optional.
${taskService.setDueDate(taskId, userId)}Sets a due date for the task.
${taskService.setPriority(taskId, userId)}Sets a priority for the task.
${taskService.setAssignee(taskId, userId)}Sets the given userId as the assignee for the task.
${taskService.setOwner(taskId, userId)}Sets the given userId as the owner for the task.
${taskService.addCandidateUser(taskId, userId)}Adds the given userId as a candidate user for the task.
${taskService.addCandidateGroup(taskId, userId)}Adds the given groupId as a candidate group for the task.
${taskService.addUserIdentityLink(taskId, userId, identityLink)}Adds a user identity link to the given task.
${taskService.addGroupIdentityLink(taskId, groupId, identityLink)}Adds a group identity link to the given task.