Interface TaskQuery

All Superinterfaces:
Query<TaskQuery,Task>
All Known Implementing Classes:
TaskQueryImpl

public interface TaskQuery extends Query<TaskQuery,Task>
Allows programmatic querying of Tasks;
Author:
Joram Barrez, Falko Menge
  • Method Details Link icon

    • taskId Link icon

      TaskQuery taskId(String taskId)
      Only select tasks with the given task id (in practice, there will be maximum one of this kind)
    • taskIdIn Link icon

      TaskQuery taskIdIn(String... taskIds)
      Only select tasks with the given task ids.
    • taskName Link icon

      TaskQuery taskName(String name)
      Only select tasks with the given name. The query will match the names of tasks in a case-insensitive way.
    • taskNameNotEqual Link icon

      TaskQuery taskNameNotEqual(String name)
      Only select tasks with a name not matching the given name/ The query will match the names of tasks in a case-insensitive way.
    • taskNameLike Link icon

      TaskQuery taskNameLike(String nameLike)
      Only select tasks with a name matching the parameter. The syntax is that of SQL: for example usage: nameLike(%eximeebpms%). The query will match the names of tasks in a case-insensitive way.
    • taskNameNotLike Link icon

      TaskQuery taskNameNotLike(String nameNotLike)
      Only select tasks with a name not matching the parameter. The syntax is that of SQL: for example usage: nameNotLike(%eximeebpms%) The query will match the names of tasks in a case-insensitive way.
    • taskDescription Link icon

      TaskQuery taskDescription(String description)
      Only select tasks with the given description. The query will match the descriptions of tasks in a case-insensitive way.
    • taskDescriptionLike Link icon

      TaskQuery taskDescriptionLike(String descriptionLike)
      Only select tasks with a description matching the parameter . The syntax is that of SQL: for example usage: descriptionLike(%eximeebpms%) The query will match the descriptions of tasks in a case-insensitive way.
    • taskPriority Link icon

      TaskQuery taskPriority(Integer priority)
      Only select tasks with the given priority.
    • taskMinPriority Link icon

      TaskQuery taskMinPriority(Integer minPriority)
      Only select tasks with the given priority or higher.
    • taskMaxPriority Link icon

      TaskQuery taskMaxPriority(Integer maxPriority)
      Only select tasks with the given priority or lower.
    • taskAssignee Link icon

      TaskQuery taskAssignee(String assignee)
      Only select tasks which are assigned to the given user.
    • taskAssigneeExpression Link icon

      TaskQuery taskAssigneeExpression(String assigneeExpression)

      Only select tasks which are assigned to the user described by the given expression.

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • taskAssigneeLike Link icon

      TaskQuery taskAssigneeLike(String assignee)
      Only select tasks which are matching the given user. The syntax is that of SQL: for example usage: nameLike(%eximeebpms%)
    • taskAssigneeLikeExpression Link icon

      TaskQuery taskAssigneeLikeExpression(String assigneeLikeExpression)

      Only select tasks which are assigned to the user described by the given expression. The syntax is that of SQL: for example usage: taskAssigneeLikeExpression("${'%test%'}")

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • taskAssigneeIn Link icon

      TaskQuery taskAssigneeIn(String... assignees)
      Only select tasks which are assigned to one of the given users.
    • taskAssigneeNotIn Link icon

      TaskQuery taskAssigneeNotIn(String... assignees)
      Only select tasks which are not assigned to any of the given users.
    • taskOwner Link icon

      TaskQuery taskOwner(String owner)
      Only select tasks for which the given user is the owner.
    • taskOwnerExpression Link icon

      TaskQuery taskOwnerExpression(String ownerExpression)

      Only select tasks for which the described user by the given expression is the owner.

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • taskUnassigned Link icon

      TaskQuery taskUnassigned()
      Only select tasks which don't have an assignee.
    • taskUnnassigned Link icon

      @Deprecated TaskQuery taskUnnassigned()
      Deprecated.
      See Also:
    • taskAssigned Link icon

      TaskQuery taskAssigned()
      Only select tasks which have an assignee.
    • taskDelegationState Link icon

      TaskQuery taskDelegationState(DelegationState delegationState)
      Only select tasks with the given DelegationState.
    • taskCandidateUser Link icon

      TaskQuery taskCandidateUser(String candidateUser)
      Only select tasks for which the given user or one of his groups is a candidate.

      Per default it only selects tasks which are not already assigned to a user. To also include assigned task in the result specify includeAssignedTasks() in your query.

      Throws:
      ProcessEngineException -
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • taskCandidateUserExpression Link icon

      TaskQuery taskCandidateUserExpression(String candidateUserExpression)
      Only select tasks for which the described user by the given expression is a candidate.

      Per default it only selects tasks which are not already assigned to a user. To also include assigned task in the result specify includeAssignedTasks() in your query.

      Throws:
      ProcessEngineException -
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • taskInvolvedUser Link icon

      TaskQuery taskInvolvedUser(String involvedUser)
      Only select tasks for which there exist an IdentityLink with the given user
    • taskInvolvedUserExpression Link icon

      TaskQuery taskInvolvedUserExpression(String involvedUserExpression)

      Only select tasks for which there exist an IdentityLink with the described user by the given expression

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • withCandidateGroups Link icon

      TaskQuery withCandidateGroups()
      Only select tasks which have a candidate group
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • withoutCandidateGroups Link icon

      TaskQuery withoutCandidateGroups()
      Only select tasks which have no candidate group
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • withCandidateUsers Link icon

      TaskQuery withCandidateUsers()
      Only select tasks which have a candidate user
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • withoutCandidateUsers Link icon

      TaskQuery withoutCandidateUsers()
      Only select tasks which have no candidate user
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • taskCandidateGroup Link icon

      TaskQuery taskCandidateGroup(String candidateGroup)
      Only select tasks for which users in the given group are candidates.

      Per default it only selects tasks which are not already assigned to a user. To also include assigned task in the result specify includeAssignedTasks() in your query.

      Throws:
      ProcessEngineException -
    • taskCandidateGroupExpression Link icon

      TaskQuery taskCandidateGroupExpression(String candidateGroupExpression)
      Only select tasks for which users in the described group by the given expression are candidates.

      Per default it only selects tasks which are not already assigned to a user. To also include assigned task in the result specify includeAssignedTasks() in your query.

      Throws:
      ProcessEngineException -
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • taskCandidateGroupLike Link icon

      TaskQuery taskCandidateGroupLike(String candidateGroupLike)
      Only select tasks whose candidate users belong to groups matching the given parameter. The syntax is that of SQL: for example usage: nameLike(%eximeebpms%)

      Per default it only selects tasks which are not already assigned to a user. To also include assigned task in the result specify includeAssignedTasks() in your query.

      Throws:
      ProcessEngineException -
    • taskCandidateGroupIn Link icon

      TaskQuery taskCandidateGroupIn(List<String> candidateGroups)
      Only select tasks for which the 'candidateGroup' is one of the given groups.

      Per default it only selects tasks which are not already assigned to a user. To also include assigned task in the result specify includeAssignedTasks() in your query.

      Throws:
      ProcessEngineException -
    • taskCandidateGroupInExpression Link icon

      TaskQuery taskCandidateGroupInExpression(String candidateGroupsExpression)
      Only select tasks for which the 'candidateGroup' is one of the described groups of the given expression.

      Per default it only selects tasks which are not already assigned to a user. To also include assigned task in the result specify includeAssignedTasks() in your query.

      Throws:
      ProcessEngineException -
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • includeAssignedTasks Link icon

      TaskQuery includeAssignedTasks()
      Select both assigned and not assigned tasks for candidate user or group queries.

      By default taskCandidateUser(String), taskCandidateGroup(String) and taskCandidateGroupIn(List) queries only select not assigned tasks.

      Throws:
      ProcessEngineException - When no candidate user or group(s) are specified beforehand
    • processInstanceId Link icon

      TaskQuery processInstanceId(String processInstanceId)
      Only select tasks for the given process instance id.
    • processInstanceIdIn Link icon

      TaskQuery processInstanceIdIn(String... processInstanceIds)
      Only select tasks for the given process instance ids.
    • processInstanceBusinessKey Link icon

      TaskQuery processInstanceBusinessKey(String processInstanceBusinessKey)
      Only select tasks for the given process instance business key
    • processInstanceBusinessKeyExpression Link icon

      TaskQuery processInstanceBusinessKeyExpression(String processInstanceBusinessKeyExpression)
      Only select tasks for the given process instance business key described by the given expression
    • processInstanceBusinessKeyIn Link icon

      TaskQuery processInstanceBusinessKeyIn(String... processInstanceBusinessKeys)
      Only select tasks for any of the given the given process instance business keys.
    • processInstanceBusinessKeyLike Link icon

      TaskQuery processInstanceBusinessKeyLike(String processInstanceBusinessKey)
      Only select tasks matching the given process instance business key. The syntax is that of SQL: for example usage: nameLike(%eximeebpms%)
    • processInstanceBusinessKeyLikeExpression Link icon

      TaskQuery processInstanceBusinessKeyLikeExpression(String processInstanceBusinessKeyExpression)
      Only select tasks matching the given process instance business key described by the given expression. The syntax is that of SQL: for example usage: processInstanceBusinessKeyLikeExpression("${ '%eximeebpms%' }")
    • executionId Link icon

      TaskQuery executionId(String executionId)
      Only select tasks for the given execution.
    • activityInstanceIdIn Link icon

      TaskQuery activityInstanceIdIn(String... activityInstanceIds)
      Only select task which have one of the activity instance ids.
    • taskCreatedOn Link icon

      TaskQuery taskCreatedOn(Date createTime)
      Only select tasks that are created on the given date.
    • taskCreatedOnExpression Link icon

      TaskQuery taskCreatedOnExpression(String createTimeExpression)
      Only select tasks that are created on the date resolved from the given expression.
    • taskCreatedBefore Link icon

      TaskQuery taskCreatedBefore(Date before)
      Only select tasks that are created before the given date.
    • taskCreatedBeforeExpression Link icon

      TaskQuery taskCreatedBeforeExpression(String beforeExpression)
      Only select tasks that are created before the date resolved from the given expression.
    • taskCreatedAfter Link icon

      TaskQuery taskCreatedAfter(Date after)
      Only select tasks that are created after the given date.
    • taskCreatedAfterExpression Link icon

      TaskQuery taskCreatedAfterExpression(String afterExpression)
      Only select tasks that are created after the date resolved from the given expression.
    • taskUpdatedAfter Link icon

      TaskQuery taskUpdatedAfter(Date after)
      Only select tasks that were updated after the given date.
    • taskUpdatedAfterExpression Link icon

      TaskQuery taskUpdatedAfterExpression(String afterExpression)
      Only select tasks that were updated after the date resolved from the given expression.
    • excludeSubtasks Link icon

      TaskQuery excludeSubtasks()
      Only select tasks that have no parent (i.e. do not select subtasks).
    • taskDefinitionKey Link icon

      TaskQuery taskDefinitionKey(String key)
      Only select tasks with the given taskDefinitionKey. The task definition key is the id of the userTask: <userTask id="xxx" .../>
    • taskDefinitionKeyLike Link icon

      TaskQuery taskDefinitionKeyLike(String keyLike)
      Only select tasks with a taskDefinitionKey that match the given parameter. The syntax is that of SQL: for example usage: taskDefinitionKeyLike("%eximeebpms%"). The task definition key is the id of the userTask: <userTask id="xxx" .../>
    • taskDefinitionKeyIn Link icon

      TaskQuery taskDefinitionKeyIn(String... taskDefinitionKeys)
      Only select tasks which have one of the taskDefinitionKeys.
    • taskParentTaskId Link icon

      TaskQuery taskParentTaskId(String parentTaskId)
      Select the tasks which are sub tasks of the given parent task.
    • caseInstanceId Link icon

      TaskQuery caseInstanceId(String caseInstanceId)
      Only select tasks for the given case instance id.
    • caseInstanceBusinessKey Link icon

      TaskQuery caseInstanceBusinessKey(String caseInstanceBusinessKey)
      Only select tasks for the given case instance business key
    • caseInstanceBusinessKeyLike Link icon

      TaskQuery caseInstanceBusinessKeyLike(String caseInstanceBusinessKeyLike)
      Only select tasks matching the given case instance business key. The syntax is that of SQL: for example usage: nameLike(%aBusinessKey%)
    • caseExecutionId Link icon

      TaskQuery caseExecutionId(String caseExecutionId)
      Only select tasks for the given case execution.
    • caseDefinitionKey Link icon

      TaskQuery caseDefinitionKey(String caseDefinitionKey)
      Only select tasks which are part of a case instance which has the given case definition key.
    • caseDefinitionId Link icon

      TaskQuery caseDefinitionId(String caseDefinitionId)
      Only select tasks which are part of a case instance which has the given case definition id.
    • caseDefinitionName Link icon

      TaskQuery caseDefinitionName(String caseDefinitionName)
      Only select tasks which are part of a case instance which has the given case definition name.
    • caseDefinitionNameLike Link icon

      TaskQuery caseDefinitionNameLike(String caseDefinitionNameLike)
      Only select tasks which are part of a case instance which case definition name is like the given parameter. The syntax is that of SQL: for example usage: nameLike(%processDefinitionName%)
    • matchVariableNamesIgnoreCase Link icon

      TaskQuery matchVariableNamesIgnoreCase()
      All queries for task-, process- and case-variables will match the variable names in a case-insensitive way.
    • matchVariableValuesIgnoreCase Link icon

      TaskQuery matchVariableValuesIgnoreCase()
      All queries for task-, process- and case-variables will match the variable values in a case-insensitive way.
    • taskVariableValueEquals Link icon

      TaskQuery taskVariableValueEquals(String variableName, Object variableValue)
      Only select tasks which have a local task variable with the given name set to the given value.
    • taskVariableValueNotEquals Link icon

      TaskQuery taskVariableValueNotEquals(String variableName, Object variableValue)
      Only select tasks which have a local task variable with the given name, but with a different value than the passed value. Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
    • taskVariableValueLike Link icon

      TaskQuery taskVariableValueLike(String variableName, String variableValue)
      Only select tasks which have a local task variable with the given name matching the given value. The syntax is that of SQL: for example usage: valueLike(%value%)
    • taskVariableValueGreaterThan Link icon

      TaskQuery taskVariableValueGreaterThan(String variableName, Object variableValue)
      Only select tasks which have a local task variable with the given name and a value greater than the given one.
    • taskVariableValueGreaterThanOrEquals Link icon

      TaskQuery taskVariableValueGreaterThanOrEquals(String variableName, Object variableValue)
      Only select tasks which have a local task variable with the given name and a value greater than or equal to the given one.
    • taskVariableValueLessThan Link icon

      TaskQuery taskVariableValueLessThan(String variableName, Object variableValue)
      Only select tasks which have a local task variable with the given name and a value less than the given one.
    • taskVariableValueLessThanOrEquals Link icon

      TaskQuery taskVariableValueLessThanOrEquals(String variableName, Object variableValue)
      Only select tasks which have a local task variable with the given name and a value less than or equal to the given one.
    • processVariableValueEquals Link icon

      TaskQuery processVariableValueEquals(String variableName, Object variableValue)
      Only select tasks which have are part of a process that have a variable with the given name set to the given value.
    • processVariableValueNotEquals Link icon

      TaskQuery processVariableValueNotEquals(String variableName, Object variableValue)
      Only select tasks which have a variable with the given name, but with a different value than the passed value. Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
    • processVariableValueLike Link icon

      TaskQuery processVariableValueLike(String variableName, String variableValue)
      Only select tasks which are part of a process that have a variable with the given name and matching the given value. The syntax is that of SQL: for example usage: valueLike(%value%)
    • processVariableValueNotLike Link icon

      TaskQuery processVariableValueNotLike(String variableName, String variableValue)
      Only select tasks which are part of a process that have a variable with the given name and not matching the given value. The syntax is that of SQL: for example usage: valueNotLike(%value%)
    • processVariableValueGreaterThan Link icon

      TaskQuery processVariableValueGreaterThan(String variableName, Object variableValue)
      Only select tasks which are part of a process that have a variable with the given name and a value greater than the given one.
    • processVariableValueGreaterThanOrEquals Link icon

      TaskQuery processVariableValueGreaterThanOrEquals(String variableName, Object variableValue)
      Only select tasks which are part of a process that have a variable with the given name and a value greater than or equal to the given one.
    • processVariableValueLessThan Link icon

      TaskQuery processVariableValueLessThan(String variableName, Object variableValue)
      Only select tasks which are part of a process that have a variable with the given name and a value less than the given one.
    • processVariableValueLessThanOrEquals Link icon

      TaskQuery processVariableValueLessThanOrEquals(String variableName, Object variableValue)
      Only select tasks which are part of a process that have a variable with the given name and a value greater than or equal to the given one.
    • caseInstanceVariableValueEquals Link icon

      TaskQuery caseInstanceVariableValueEquals(String variableName, Object variableValue)
      Only select tasks which are part of a case instance that have a variable with the given name set to the given value. The type of variable is determined based on the value, using types configured in ProcessEngineConfigurationImpl.getVariableSerializers().

      Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.

      Parameters:
      variableName - name of the variable, cannot be null.
    • caseInstanceVariableValueNotEquals Link icon

      TaskQuery caseInstanceVariableValueNotEquals(String variableName, Object variableValue)
      Only select tasks which are part of a case instance that have a variable with the given name, but with a different value than the passed value. The type of variable is determined based on the value, using types configured in ProcessEngineConfigurationImpl.getVariableSerializers().

      Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.

      Parameters:
      variableName - name of the variable, cannot be null.
    • caseInstanceVariableValueLike Link icon

      TaskQuery caseInstanceVariableValueLike(String variableName, String variableValue)
      Only select tasks which are part of a case instance that have a variable value like the given value.

      This be used on string variables only.

      Parameters:
      variableName - variable name, cannot be null.
      variableValue - variable value. The string can include the wildcard character '%' to express like-strategy: starts with (string%), ends with (%string) or contains (%string%).
    • caseInstanceVariableValueNotLike Link icon

      TaskQuery caseInstanceVariableValueNotLike(String variableName, String variableValue)
      Only select tasks which are part of a case instance that have a variable value not like the given value.

      This be used on string variables only.

      Parameters:
      variableName - variable name, cannot be null.
      variableValue - variable value. The string can include the wildcard character '%' to express like-strategy: starts with (string%), ends with (%string) or contains (%string%).
    • caseInstanceVariableValueGreaterThan Link icon

      TaskQuery caseInstanceVariableValueGreaterThan(String variableName, Object variableValue)
      Only select tasks which are part of a case instance that have a variable with the given name and a variable value greater than the passed value.

      Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.

      Parameters:
      variableName - variable name, cannot be null.
    • caseInstanceVariableValueGreaterThanOrEquals Link icon

      TaskQuery caseInstanceVariableValueGreaterThanOrEquals(String variableName, Object variableValue)
      Only select tasks which are part of a case instance that have a variable value greater than or equal to the passed value.

      Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.

      Parameters:
      variableName - variable name, cannot be null.
    • caseInstanceVariableValueLessThan Link icon

      TaskQuery caseInstanceVariableValueLessThan(String variableName, Object variableValue)
      Only select tasks which are part of a case instance that have a variable value less than the passed value.

      Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.

      Parameters:
      variableName - variable name, cannot be null.
    • caseInstanceVariableValueLessThanOrEquals Link icon

      TaskQuery caseInstanceVariableValueLessThanOrEquals(String variableName, Object variableValue)
      Only select tasks which are part of a case instance that have a variable value less than or equal to the passed value.

      Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.

      Parameters:
      variableName - variable name, cannot be null.
    • processDefinitionKey Link icon

      TaskQuery processDefinitionKey(String processDefinitionKey)
      Only select tasks which are part of a process instance which has the given process definition key.
    • processDefinitionKeyIn Link icon

      TaskQuery processDefinitionKeyIn(String... processDefinitionKeys)
      Only select tasks which are part of a process instance which has one of the given process definition keys.
    • processDefinitionId Link icon

      TaskQuery processDefinitionId(String processDefinitionId)
      Only select tasks which are part of a process instance which has the given process definition id.
    • processDefinitionName Link icon

      TaskQuery processDefinitionName(String processDefinitionName)
      Only select tasks which are part of a process instance which has the given process definition name.
    • processDefinitionNameLike Link icon

      TaskQuery processDefinitionNameLike(String processDefinitionName)
      Only select tasks which are part of a process instance which process definition name is like the given parameter. The syntax is that of SQL: for example usage: nameLike(%processDefinitionName%)
    • dueDate Link icon

      TaskQuery dueDate(Date dueDate)
      Only select tasks with the given due date.
    • dueDateExpression Link icon

      TaskQuery dueDateExpression(String dueDateExpression)

      Only select tasks with the described due date by the given expression.

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • dueBefore Link icon

      TaskQuery dueBefore(Date dueDate)
      Only select tasks which have a due date before the given date.
    • dueBeforeExpression Link icon

      TaskQuery dueBeforeExpression(String dueDateExpression)

      Only select tasks which have a due date before the described date by the given expression.

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • dueAfter Link icon

      TaskQuery dueAfter(Date dueDate)
      Only select tasks which have a due date after the given date.
    • dueAfterExpression Link icon

      TaskQuery dueAfterExpression(String dueDateExpression)

      Only select tasks which have a due date after the described date by the given expression.

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • followUpDate Link icon

      TaskQuery followUpDate(Date followUpDate)
      Only select tasks with the given follow-up date.
    • followUpDateExpression Link icon

      TaskQuery followUpDateExpression(String followUpDateExpression)

      Only select tasks with the described follow-up date by the given expression.

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • followUpBefore Link icon

      TaskQuery followUpBefore(Date followUpDate)
      Only select tasks which have a follow-up date before the given date.
    • followUpBeforeExpression Link icon

      TaskQuery followUpBeforeExpression(String followUpDateExpression)

      Only select tasks which have a follow-up date before the described date by the given expression.

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • followUpBeforeOrNotExistent Link icon

      TaskQuery followUpBeforeOrNotExistent(Date followUpDate)
      Only select tasks which have no follow-up date or a follow-up date before the given date. Serves the typical use case "give me all tasks without follow-up or follow-up date which is already due"
    • followUpBeforeOrNotExistentExpression Link icon

      TaskQuery followUpBeforeOrNotExistentExpression(String followUpDateExpression)

      Only select tasks which have no follow-up date or a follow-up date before the described date by the given expression. Serves the typical use case "give me all tasks without follow-up or follow-up date which is already due"

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • followUpAfter Link icon

      TaskQuery followUpAfter(Date followUpDate)
      Only select tasks which have a follow-up date after the given date.
    • followUpAfterExpression Link icon

      TaskQuery followUpAfterExpression(String followUpDateExpression)

      Only select tasks which have a follow-up date after the described date by the given expression.

      Throws:
      BadUserRequestException -
      • When the query is executed and expressions are disabled for adhoc queries (in case the query is executed via Query.list(), Query.listPage(int, int), Query.singleResult(), or Query.count()) or stored queries (in case the query is stored along with a filter). Expression evaluation can be activated by setting the process engine configuration properties enableExpressionsInAdhocQueries (default false) and enableExpressionsInStoredQueries (default true) to true.
    • suspended Link icon

      TaskQuery suspended()
      Only select tasks which are suspended, because its process instance was suspended.
    • active Link icon

      TaskQuery active()
      Only select tasks which are active (ie. not suspended)
    • initializeFormKeys Link icon

      TaskQuery initializeFormKeys()
      If called, the form keys and form references of the fetched tasks are initialized and Task.getFormKey() and Task.getCamundaFormRef() will return a value (in case the task has is linked to a form).
      Returns:
      the query itself
      Throws:
      ProcessEngineException - When method has been executed within "or query". Method must be executed on the base query.
    • tenantIdIn Link icon

      TaskQuery tenantIdIn(String... tenantIds)
      Only select tasks with one of the given tenant ids.
      Throws:
      ProcessEngineException -
      • When a query is executed and withoutTenantId() has been executed on the "and query" instance. No exception is thrown when a query is executed and withoutTenantId() has been executed on the "or query" instance.
      • When a null tenant id is passed.
    • withoutTenantId Link icon

      TaskQuery withoutTenantId()
      Only select tasks which have no tenant id.
      Throws:
      ProcessEngineException - When query is executed and tenantIdIn(String...) has been executed on the "and query" instance. No exception is thrown when query is executed and tenantIdIn(String...) has been executed on the "or query" instance.
    • withoutDueDate Link icon

      TaskQuery withoutDueDate()
      Only select tasks which have no due date.
    • orderByTaskId Link icon

      TaskQuery orderByTaskId()
      Order by task id (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByTaskName Link icon

      TaskQuery orderByTaskName()
      Order by task name (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByTaskNameCaseInsensitive Link icon

      TaskQuery orderByTaskNameCaseInsensitive()
      Order by task name case insensitive (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByTaskDescription Link icon

      TaskQuery orderByTaskDescription()
      Order by description (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByTaskPriority Link icon

      TaskQuery orderByTaskPriority()
      Order by priority (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByTaskAssignee Link icon

      TaskQuery orderByTaskAssignee()
      Order by assignee (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByTaskCreateTime Link icon

      TaskQuery orderByTaskCreateTime()
      Order by the time on which the tasks were created (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByLastUpdated Link icon

      TaskQuery orderByLastUpdated()
      Order by the time the task was updated last (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByProcessInstanceId Link icon

      TaskQuery orderByProcessInstanceId()
      Order by process instance id (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByCaseInstanceId Link icon

      TaskQuery orderByCaseInstanceId()
      Order by case instance id (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByExecutionId Link icon

      TaskQuery orderByExecutionId()
      Order by execution id (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByCaseExecutionId Link icon

      TaskQuery orderByCaseExecutionId()
      Order by case execution id (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByDueDate Link icon

      TaskQuery orderByDueDate()
      Order by due date (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByFollowUpDate Link icon

      TaskQuery orderByFollowUpDate()
      Order by follow-up date (needs to be followed by Query.asc() or Query.desc()).
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByProcessVariable Link icon

      TaskQuery orderByProcessVariable(String variableName, ValueType valueType)
      Order by a process instance variable value of a certain type. Calling this method multiple times specifies secondary, tertiary orderings, etc. The ordering of variables with null values is database-specific.
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByExecutionVariable Link icon

      TaskQuery orderByExecutionVariable(String variableName, ValueType valueType)
      Order by an execution variable value of a certain type. Calling this method multiple times specifies secondary, tertiary orderings, etc. The ordering of variables with null values is database-specific.
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByTaskVariable Link icon

      TaskQuery orderByTaskVariable(String variableName, ValueType valueType)
      Order by a task variable value of a certain type. Calling this method multiple times specifies secondary, tertiary orderings, etc. The ordering of variables with null values is database-specific.
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByCaseExecutionVariable Link icon

      TaskQuery orderByCaseExecutionVariable(String variableName, ValueType valueType)
      Order by a task variable value of a certain type. Calling this method multiple times specifies secondary, tertiary orderings, etc. The ordering of variables with null values is database-specific.
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByCaseInstanceVariable Link icon

      TaskQuery orderByCaseInstanceVariable(String variableName, ValueType valueType)
      Order by a task variable value of a certain type. Calling this method multiple times specifies secondary, tertiary orderings, etc. The ordering of variables with null values is database-specific.
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • orderByTenantId Link icon

      TaskQuery orderByTenantId()
      Order by tenant id (needs to be followed by Query.asc() or Query.desc()). Note that the ordering of tasks without tenant id is database-specific.
      Throws:
      ProcessEngineException - When method has been executed within "or query".
    • or Link icon

      TaskQuery or()

      After calling or(), a chain of several filter criteria could follow. Each filter criterion that follows or() will be linked together with an OR expression until the OR query is terminated. To terminate the OR query right after the last filter criterion was applied, endOr() must be invoked.

      Returns:
      an object of the type TaskQuery on which an arbitrary amount of filter criteria could be applied. The several filter criteria will be linked together by an OR expression.
      Throws:
      ProcessEngineException - when or() has been invoked directly after or() or after or() and trailing filter criteria. To prevent throwing this exception, endOr() must be invoked after a chain of filter criteria to mark the end of the OR query.
    • endOr Link icon

      TaskQuery endOr()

      endOr() terminates an OR query on which an arbitrary amount of filter criteria were applied. To terminate the OR query which has been started by invoking or(), endOr() must be invoked. Filter criteria which are applied after calling endOr() are linked together by an AND expression.

      Returns:
      an object of the type TaskQuery on which an arbitrary amount of filter criteria could be applied. The filter criteria will be linked together by an AND expression.
      Throws:
      ProcessEngineException - when endOr() has been invoked before or() was invoked. To prevent throwing this exception, or() must be invoked first.
    • withCommentAttachmentInfo Link icon

      TaskQuery withCommentAttachmentInfo()
      Evaluates existence of attachment and comments associated with the task, defaults to false. Adding the filter will do additional attachment and comments queries to the database, it might slow down the query in case of tables having high volume of data.