Interface ProcessInstanceQuery
-
- All Superinterfaces:
Query<ProcessInstanceQuery,ProcessInstance>
- All Known Implementing Classes:
ProcessInstanceQueryImpl
public interface ProcessInstanceQuery extends Query<ProcessInstanceQuery,ProcessInstance>
Allows programmatic querying ofProcessInstance
s.- Author:
- Joram Barrez, Frederik Heremans, Falko Menge
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ProcessInstanceQuery
active()
Only selects process instances which are active, which means that neither the process instance nor the corresponding process definition are suspended.ProcessInstanceQuery
activityIdIn(java.lang.String... activityIds)
Only selects process instances with leaf activity instances or transition instances (async before, async after) in at least one of the given activity ids.ProcessInstanceQuery
caseInstanceId(java.lang.String caseInstanceId)
Selects the process instances which are associated with the given case instance id.ProcessInstanceQuery
deploymentId(java.lang.String deploymentId)
Selects the process instances which belong to the given deployment id.ProcessInstanceQuery
endOr()
endOr() terminates an OR query on which an arbitrary amount of filter criteria were applied.ProcessInstanceQuery
incidentId(java.lang.String incidentId)
Only selects process instances with the given incident id.ProcessInstanceQuery
incidentMessage(java.lang.String incidentMessage)
Only selects process instances with the given incident message.ProcessInstanceQuery
incidentMessageLike(java.lang.String incidentMessageLike)
Only selects process instances with an incident message like the given.ProcessInstanceQuery
incidentType(java.lang.String incidentType)
Only selects process instances with the given incident type.ProcessInstanceQuery
leafProcessInstances()
Only selects process instances which don't have subprocesses and thus are leaves of the execution tree.ProcessInstanceQuery
matchVariableNamesIgnoreCase()
The query will match the names of process-variables in a case-insensitive way.ProcessInstanceQuery
matchVariableValuesIgnoreCase()
The query will match the values of process-variables in a case-insensitive way.ProcessInstanceQuery
or()
After calling or(), a chain of several filter criteria could follow.ProcessInstanceQuery
orderByBusinessKey()
Order by the business key (needs to be followed byQuery.asc()
orQuery.desc()
).ProcessInstanceQuery
orderByProcessDefinitionId()
Order by process definition id (needs to be followed byQuery.asc()
orQuery.desc()
).ProcessInstanceQuery
orderByProcessDefinitionKey()
Order by process definition key (needs to be followed byQuery.asc()
orQuery.desc()
).ProcessInstanceQuery
orderByProcessInstanceId()
Order by id (needs to be followed byQuery.asc()
orQuery.desc()
).ProcessInstanceQuery
orderByTenantId()
Order by tenant id (needs to be followed byQuery.asc()
orQuery.desc()
).ProcessInstanceQuery
processDefinitionId(java.lang.String processDefinitionId)
Selects the process instances which are defined by a process definition with the given id.ProcessInstanceQuery
processDefinitionKey(java.lang.String processDefinitionKey)
Select the process instances which are defined by a process definition with the given key.ProcessInstanceQuery
processDefinitionKeyIn(java.lang.String... processDefinitionKeys)
Select the process instances for any given process definition keys.ProcessInstanceQuery
processDefinitionKeyNotIn(java.lang.String... processDefinitionKeys)
Select historic process instances that don't have a process-definition of which the key is present in the given listProcessInstanceQuery
processDefinitionWithoutTenantId()
Only selects process instances which process definition has no tenant id.ProcessInstanceQuery
processInstanceBusinessKey(java.lang.String processInstanceBusinessKey)
Select process instances with the given business keyProcessInstanceQuery
processInstanceBusinessKey(java.lang.String processInstanceBusinessKey, java.lang.String processDefinitionKey)
Select process instance with the given business key, unique for the given process definitionProcessInstanceQuery
processInstanceBusinessKeyLike(java.lang.String processInstanceBusinessKeyLike)
Select process instances with a business key like the given value.ProcessInstanceQuery
processInstanceId(java.lang.String processInstanceId)
Select the process instance with the given idProcessInstanceQuery
processInstanceIds(java.util.Set<java.lang.String> processInstanceIds)
Select process instances whose id is in the given set of idsProcessInstanceQuery
rootProcessInstances()
Only selects process instances which are top level process instances.ProcessInstanceQuery
subCaseInstanceId(java.lang.String subCaseInstanceId)
Select the process instance that has as sub case instance the given case instance.ProcessInstanceQuery
subProcessInstanceId(java.lang.String subProcessInstanceId)
Select the process instance that have as sub process instance the given process instance.ProcessInstanceQuery
superCaseInstanceId(java.lang.String superCaseInstanceId)
Select the process instances which are a sub process instance of the given super case instance.ProcessInstanceQuery
superProcessInstanceId(java.lang.String superProcessInstanceId)
Select the process instances which are a sub process instance of the given super process instance.ProcessInstanceQuery
suspended()
Only selects process instances which are suspended, either because the process instance itself is suspended or because the corresponding process definition is suspendedProcessInstanceQuery
tenantIdIn(java.lang.String... tenantIds)
Only select process instances with one of the given tenant ids.ProcessInstanceQuery
variableValueEquals(java.lang.String name, java.lang.Object value)
Only select process instances which have a global variable with the given value.ProcessInstanceQuery
variableValueGreaterThan(java.lang.String name, java.lang.Object value)
Only select process instances which have a variable value greater than the passed value.ProcessInstanceQuery
variableValueGreaterThanOrEqual(java.lang.String name, java.lang.Object value)
Only select process instances which have a global variable value greater than or equal to the passed value.ProcessInstanceQuery
variableValueLessThan(java.lang.String name, java.lang.Object value)
Only select process instances which have a global variable value less than the passed value.ProcessInstanceQuery
variableValueLessThanOrEqual(java.lang.String name, java.lang.Object value)
Only select process instances which have a global variable value less than or equal to the passed value.ProcessInstanceQuery
variableValueLike(java.lang.String name, java.lang.String value)
Only select process instances which have a global variable value like the given value.ProcessInstanceQuery
variableValueNotEquals(java.lang.String name, java.lang.Object value)
Only select process instances which have a global variable with the given name, but with a different value than the passed value.ProcessInstanceQuery
withIncident()
Only selects process instances with at least one incident.ProcessInstanceQuery
withoutTenantId()
Only selects process instances which have no tenant id.-
Methods inherited from interface org.camunda.bpm.engine.query.Query
asc, count, desc, list, listPage, singleResult, unlimitedList
-
-
-
-
Method Detail
-
processInstanceId
ProcessInstanceQuery processInstanceId(java.lang.String processInstanceId)
Select the process instance with the given id
-
processInstanceIds
ProcessInstanceQuery processInstanceIds(java.util.Set<java.lang.String> processInstanceIds)
Select process instances whose id is in the given set of ids
-
processInstanceBusinessKey
ProcessInstanceQuery processInstanceBusinessKey(java.lang.String processInstanceBusinessKey)
Select process instances with the given business key
-
processInstanceBusinessKey
ProcessInstanceQuery processInstanceBusinessKey(java.lang.String processInstanceBusinessKey, java.lang.String processDefinitionKey)
Select process instance with the given business key, unique for the given process definition
-
processInstanceBusinessKeyLike
ProcessInstanceQuery processInstanceBusinessKeyLike(java.lang.String processInstanceBusinessKeyLike)
Select process instances with a business key like the given value.- Parameters:
processInstanceBusinessKeyLike
- The string can include the wildcard character '%' to express like-strategy: starts with (string%), ends with (%string) or contains (%string%).
-
processDefinitionKey
ProcessInstanceQuery processDefinitionKey(java.lang.String processDefinitionKey)
Select the process instances which are defined by a process definition with the given key.
-
processDefinitionKeyIn
ProcessInstanceQuery processDefinitionKeyIn(java.lang.String... processDefinitionKeys)
Select the process instances for any given process definition keys.
-
processDefinitionKeyNotIn
ProcessInstanceQuery processDefinitionKeyNotIn(java.lang.String... processDefinitionKeys)
Select historic process instances that don't have a process-definition of which the key is present in the given list
-
processDefinitionId
ProcessInstanceQuery processDefinitionId(java.lang.String processDefinitionId)
Selects the process instances which are defined by a process definition with the given id.
-
deploymentId
ProcessInstanceQuery deploymentId(java.lang.String deploymentId)
Selects the process instances which belong to the given deployment id.- Since:
- 7.4
-
superProcessInstanceId
ProcessInstanceQuery superProcessInstanceId(java.lang.String superProcessInstanceId)
Select the process instances which are a sub process instance of the given super process instance.
-
subProcessInstanceId
ProcessInstanceQuery subProcessInstanceId(java.lang.String subProcessInstanceId)
Select the process instance that have as sub process instance the given process instance. Note that there will always be maximum only one such process instance that can be the result of this query.
-
caseInstanceId
ProcessInstanceQuery caseInstanceId(java.lang.String caseInstanceId)
Selects the process instances which are associated with the given case instance id.
-
superCaseInstanceId
ProcessInstanceQuery superCaseInstanceId(java.lang.String superCaseInstanceId)
Select the process instances which are a sub process instance of the given super case instance.- Since:
- 7.3
-
subCaseInstanceId
ProcessInstanceQuery subCaseInstanceId(java.lang.String subCaseInstanceId)
Select the process instance that has as sub case instance the given case instance. Note that there will always be at most one such process instance that can be the result of this query.- Since:
- 7.3
-
matchVariableNamesIgnoreCase
ProcessInstanceQuery matchVariableNamesIgnoreCase()
The query will match the names of process-variables in a case-insensitive way.
-
matchVariableValuesIgnoreCase
ProcessInstanceQuery matchVariableValuesIgnoreCase()
The query will match the values of process-variables in a case-insensitive way.
-
variableValueEquals
ProcessInstanceQuery variableValueEquals(java.lang.String name, java.lang.Object value)
Only select process instances which have a global variable with the given value. The type of variable is determined based on the value, using types configured inProcessEngineConfiguration#getVariableSerializers()
. Byte-arrays andSerializable
objects (which are not primitive type wrappers) are not supported.- Parameters:
name
- name of the variable, cannot be null.
-
variableValueNotEquals
ProcessInstanceQuery variableValueNotEquals(java.lang.String name, java.lang.Object value)
Only select process instances which have a global variable with the given name, but with a different value than the passed value. Byte-arrays andSerializable
objects (which are not primitive type wrappers) are not supported.- Parameters:
name
- name of the variable, cannot be null.
-
variableValueGreaterThan
ProcessInstanceQuery variableValueGreaterThan(java.lang.String name, java.lang.Object value)
Only select process instances which have a variable value greater than the passed value. Booleans, Byte-arrays andSerializable
objects (which are not primitive type wrappers) are not supported.- Parameters:
name
- variable name, cannot be null.value
- variable value, cannot be null.
-
variableValueGreaterThanOrEqual
ProcessInstanceQuery variableValueGreaterThanOrEqual(java.lang.String name, java.lang.Object value)
Only select process instances which have a global variable value greater than or equal to the passed value. Booleans, Byte-arrays andSerializable
objects (which are not primitive type wrappers) are not supported.- Parameters:
name
- variable name, cannot be null.value
- variable value, cannot be null.
-
variableValueLessThan
ProcessInstanceQuery variableValueLessThan(java.lang.String name, java.lang.Object value)
Only select process instances which have a global variable value less than the passed value. Booleans, Byte-arrays andSerializable
objects (which are not primitive type wrappers) are not supported.- Parameters:
name
- variable name, cannot be null.value
- variable value, cannot be null.
-
variableValueLessThanOrEqual
ProcessInstanceQuery variableValueLessThanOrEqual(java.lang.String name, java.lang.Object value)
Only select process instances which have a global variable value less than or equal to the passed value. Booleans, Byte-arrays andSerializable
objects (which are not primitive type wrappers) are not supported.- Parameters:
name
- variable name, cannot be null.value
- variable value, cannot be null.
-
variableValueLike
ProcessInstanceQuery variableValueLike(java.lang.String name, java.lang.String value)
Only select process instances which have a global variable value like the given value. This be used on string variables only.- Parameters:
name
- variable name, cannot be null.value
- variable value, cannot be null. The string can include the wildcard character '%' to express like-strategy: starts with (string%), ends with (%string) or contains (%string%).
-
suspended
ProcessInstanceQuery suspended()
Only selects process instances which are suspended, either because the process instance itself is suspended or because the corresponding process definition is suspended
-
active
ProcessInstanceQuery active()
Only selects process instances which are active, which means that neither the process instance nor the corresponding process definition are suspended.
-
withIncident
ProcessInstanceQuery withIncident()
Only selects process instances with at least one incident.
-
incidentType
ProcessInstanceQuery incidentType(java.lang.String incidentType)
Only selects process instances with the given incident type.
-
incidentId
ProcessInstanceQuery incidentId(java.lang.String incidentId)
Only selects process instances with the given incident id.
-
incidentMessage
ProcessInstanceQuery incidentMessage(java.lang.String incidentMessage)
Only selects process instances with the given incident message.
-
incidentMessageLike
ProcessInstanceQuery incidentMessageLike(java.lang.String incidentMessageLike)
Only selects process instances with an incident message like the given.
-
tenantIdIn
ProcessInstanceQuery tenantIdIn(java.lang.String... tenantIds)
Only select process instances with one of the given tenant ids.
-
withoutTenantId
ProcessInstanceQuery withoutTenantId()
Only selects process instances which have no tenant id.
-
activityIdIn
ProcessInstanceQuery activityIdIn(java.lang.String... activityIds)
Only selects process instances with leaf activity instances or transition instances (async before, async after) in at least one of the given activity ids.
Leaf instance means this filter works for instances of a user task is matched, but not the embedded sub process it is contained in.
-
rootProcessInstances
ProcessInstanceQuery rootProcessInstances()
Only selects process instances which are top level process instances.
-
leafProcessInstances
ProcessInstanceQuery leafProcessInstances()
Only selects process instances which don't have subprocesses and thus are leaves of the execution tree.
-
processDefinitionWithoutTenantId
ProcessInstanceQuery processDefinitionWithoutTenantId()
Only selects process instances which process definition has no tenant id.
-
orderByProcessInstanceId
ProcessInstanceQuery orderByProcessInstanceId()
Order by id (needs to be followed byQuery.asc()
orQuery.desc()
).
-
orderByProcessDefinitionKey
ProcessInstanceQuery orderByProcessDefinitionKey()
Order by process definition key (needs to be followed byQuery.asc()
orQuery.desc()
).
-
orderByProcessDefinitionId
ProcessInstanceQuery orderByProcessDefinitionId()
Order by process definition id (needs to be followed byQuery.asc()
orQuery.desc()
).
-
orderByTenantId
ProcessInstanceQuery orderByTenantId()
Order by tenant id (needs to be followed byQuery.asc()
orQuery.desc()
). Note that the ordering of process instances without tenant id is database-specific.
-
orderByBusinessKey
ProcessInstanceQuery orderByBusinessKey()
Order by the business key (needs to be followed byQuery.asc()
orQuery.desc()
).
-
or
ProcessInstanceQuery 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
ProcessInstanceQuery
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
ProcessInstanceQuery 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
ProcessInstanceQuery
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 beforeor()
was invoked. To prevent throwing this exception,or()
must be invoked first.
-
-