Package org.flowable.engine.runtime
Interface ProcessInstanceQuery
- All Superinterfaces:
org.flowable.common.engine.api.query.Query<ProcessInstanceQuery,
ProcessInstance>
- All Known Implementing Classes:
ProcessInstanceQueryImpl
public interface ProcessInstanceQuery
extends org.flowable.common.engine.api.query.Query<ProcessInstanceQuery,ProcessInstance>
Allows programmatic querying of
ProcessInstance
s.- Author:
- Joram Barrez, Tijs Rademakers, Frederik Heremans, Falko Menge
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.flowable.common.engine.api.query.Query
org.flowable.common.engine.api.query.Query.NullHandlingOnOrder
-
Method Summary
Modifier and TypeMethodDescriptionactive()
Only select process instances which are active, which means that neither the process instance nor the corresponding process definition are suspended.activeActivityId
(String activityId) Select the process instances which have an active activity instance like the provided id.activeActivityIds
(Set<String> activityIds) Select the process instances which have an active activity instance like the provided ids.deploymentId
(String deploymentId) Select the process instances which are defined by a deployment with the given id.deploymentIdIn
(List<String> deploymentIds) Select the process instances which are defined by one of the given deployment idsendOr()
End an OR statement.excludeSubprocesses
(boolean excludeSubprocesses) Exclude sub processes from the query result;Include process variables in the process query resultinvolvedGroup
(String groupId, String identityLinkType) Select the process instances with which the group with the given id and identity link type is involved.involvedGroups
(Set<String> groupIds) Select the process instances with which theGroup
s with the given ids are involved.involvedUser
(String userId) Select the process instances with which the user with the given id is involved.involvedUser
(String userId, String identityLinkType) Select the process instances with which the user with the given id and identity link type is involved.Localize process name and description to specified locale.or()
Begin an OR statement.Order by process definition id (needs to be followed byQuery.asc()
orQuery.desc()
).Order by process definition key (needs to be followed byQuery.asc()
orQuery.desc()
).Order by id (needs to be followed byQuery.asc()
orQuery.desc()
).Order by start time (needs to be followed byQuery.asc()
orQuery.desc()
).Order by tenant id (needs to be followed byQuery.asc()
orQuery.desc()
).processDefinitionCategory
(String processDefinitionCategory) Only select process instances whose process definition category is processDefinitionCategory.processDefinitionCategoryLike
(String processDefinitionCategoryLike) Only select process instances whose process definition category is like the given value.processDefinitionCategoryLikeIgnoreCase
(String processDefinitionCategoryLikeIgnoreCase) Only select process instances whose process definition category is like the given value, ignoring upper/lower case.processDefinitionEngineVersion
(String processDefinitionEngineVersion) Select the process instances which are defined by a process definition with the given engine version.processDefinitionId
(String processDefinitionId) Select the process instances which are defined by a process definition with the given id.processDefinitionIds
(Set<String> processDefinitionIds) Select the process instances which are defined by process definitions with the given ids.processDefinitionKey
(String processDefinitionKey) Select the process instances which are defined by a process definition with the given key.processDefinitionKeyLike
(String processDefinitionKeyLike) Select process instances whose process definition key is like the given valueprocessDefinitionKeyLikeIgnoreCase
(String processDefinitionKeyLikeIgnoreCase) Select process instances whose process definition key is like the given value, ignoring upper/lower case.processDefinitionKeys
(Set<String> processDefinitionKeys) Select the process instances which are defined by process definitions with the given keys.processDefinitionName
(String processDefinitionName) Select process instances whose process definition name is processDefinitionNameprocessDefinitionNameLike
(String processDefinitionNameLike) Select process instances whose process definition name is like the given valueprocessDefinitionNameLikeIgnoreCase
(String processDefinitionNameLikeIgnoreCase) Select process instances whose process definition name is like the given value, ignoring upper/lower case.processDefinitionVersion
(Integer processDefinitionVersion) Only select process instances with a certain process definition version.processInstanceBusinessKey
(String processInstanceBusinessKey) Select process instances with the given business keyprocessInstanceBusinessKey
(String processInstanceBusinessKey, String processDefinitionKey) Select process instance with the given business key, unique for the given process definitionprocessInstanceBusinessKeyLike
(String businessKeyLike) Select process instances with a business key like the given value.processInstanceBusinessKeyLikeIgnoreCase
(String businessKeyLikeIgnoreCase) Select process instances with a business key like the given value, ignoring upper/lower case.processInstanceBusinessStatus
(String businessStatus) Select process instances with the given business statusprocessInstanceBusinessStatusLike
(String businessStatusLike) Select process instances with a business status like the given value.processInstanceBusinessStatusLikeIgnoreCase
(String businessStatusLikeIgnoreCase) Select process instances with a business status like the given value, ignoring upper/lower case.processInstanceCallbackId
(String callbackId) Only select process instances with the given callback id.processInstanceCallbackType
(String callbackType) Only select process instances with the given callback type.processInstanceId
(String processInstanceId) Select the process instance with the given idprocessInstanceIds
(Set<String> processInstanceIds) Select process instances whose id is in the given set of idsprocessInstanceName
(String name) Only select process instances with the given name.processInstanceNameLike
(String nameLike) Only select process instances with a name like the given value.processInstanceNameLikeIgnoreCase
(String nameLikeIgnoreCase) Only select process instances with a name like the given value, ignoring upper/lower case.processInstanceParentScopeId
(String parentScopeId) Only select process instances with the given parent process instance id.processInstanceReferenceId
(String referenceId) Only select process instances with the given reference id.processInstanceReferenceType
(String referenceType) Only select process instances with the given callback type.processInstanceRootScopeId
(String rootScopeId) Only select process instances with a root instance with a name like the given value.processInstanceTenantId
(String tenantId) Only select process instances that have the given tenant id.processInstanceTenantIdLike
(String tenantIdLike) Only select process instances with a tenant id like the given one.processInstanceTenantIdLikeIgnoreCase
(String tenantIdLikeIgnoreCase) Only select process instances with a tenant id like the given one, ignoring upper/lower case.Only select process instances that do not have a tenant id.startedAfter
(Date afterTime) Only select process instances started after the given timestartedBefore
(Date beforeTime) Only select process instances started before the given timeOnly select process instances started by the given user idsubProcessInstanceId
(String subProcessInstanceId) Select the process instance that have as sub process instance the given process instance.superProcessInstanceId
(String superProcessInstanceId) Select the process instances which are a sub process instance of the given super process instance.Only select process instances which are suspended, either because the process instance itself is suspended or because the corresponding process definition is suspendedvariableExists
(String name) Only select process instances which have a variable with the given name.variableNotExists
(String name) Only select process instances which does not have a variable with the given name.variableValueEquals
(Object value) Only select process instances which have at least one global variable with the given value.variableValueEquals
(String name, Object value) Only select process instances which have a global variable with the given value.variableValueEqualsIgnoreCase
(String name, String value) Only select process instances which have a local string variable with the given value, case insensitive.variableValueGreaterThan
(String name, Object value) Only select process instances which have a variable value greater than the passed value.variableValueGreaterThanOrEqual
(String name, Object value) Only select process instances which have a global variable value greater than or equal to the passed value.variableValueLessThan
(String name, Object value) Only select process instances which have a global variable value less than the passed value.variableValueLessThanOrEqual
(String name, Object value) Only select process instances which have a global variable value less than or equal to the passed value.variableValueLike
(String name, String value) Only select process instances which have a global variable value like the given value.variableValueLikeIgnoreCase
(String name, String value) Only select process instances which have a global variable value like the given value (case insensitive).variableValueNotEquals
(String name, Object value) Only select process instances which have a global variable with the given name, but with a different value than the passed value.variableValueNotEqualsIgnoreCase
(String name, String value) Only select process instances which have a local string variable which is not the given value, case insensitive.Only select process instances that failed due to an exception happening during a job execution.Instruct localization to fallback to more general locales including the default locale of the JVM if the specified locale is not found.Methods inherited from interface org.flowable.common.engine.api.query.Query
asc, count, desc, list, listPage, orderBy, orderBy, singleResult
-
Method Details
-
processInstanceId
Select the process instance with the given id -
processInstanceIds
Select process instances whose id is in the given set of ids -
processInstanceBusinessKey
Select process instances with the given business key -
processInstanceBusinessKey
ProcessInstanceQuery processInstanceBusinessKey(String processInstanceBusinessKey, String processDefinitionKey) Select process instance with the given business key, unique for the given process definition -
processInstanceBusinessKeyLike
Select process instances with a business key like the given value. -
processInstanceBusinessKeyLikeIgnoreCase
Select process instances with a business key like the given value, ignoring upper/lower case. -
processInstanceBusinessStatus
Select process instances with the given business status -
processInstanceBusinessStatusLike
Select process instances with a business status like the given value. -
processInstanceBusinessStatusLikeIgnoreCase
ProcessInstanceQuery processInstanceBusinessStatusLikeIgnoreCase(String businessStatusLikeIgnoreCase) Select process instances with a business status like the given value, ignoring upper/lower case. -
processInstanceTenantId
Only select process instances that have the given tenant id. -
processInstanceTenantIdLike
Only select process instances with a tenant id like the given one. -
processInstanceTenantIdLikeIgnoreCase
Only select process instances with a tenant id like the given one, ignoring upper/lower case. -
processInstanceWithoutTenantId
ProcessInstanceQuery processInstanceWithoutTenantId()Only select process instances that do not have a tenant id. -
processDefinitionCategory
Only select process instances whose process definition category is processDefinitionCategory. -
processDefinitionCategoryLike
Only select process instances whose process definition category is like the given value. -
processDefinitionCategoryLikeIgnoreCase
ProcessInstanceQuery processDefinitionCategoryLikeIgnoreCase(String processDefinitionCategoryLikeIgnoreCase) Only select process instances whose process definition category is like the given value, ignoring upper/lower case. -
processDefinitionName
Select process instances whose process definition name is processDefinitionName -
processDefinitionNameLike
Select process instances whose process definition name is like the given value -
processDefinitionNameLikeIgnoreCase
ProcessInstanceQuery processDefinitionNameLikeIgnoreCase(String processDefinitionNameLikeIgnoreCase) Select process instances whose process definition name is like the given value, ignoring upper/lower case. -
processDefinitionVersion
Only select process instances with a certain process definition version. Particularly useful when used in combination withprocessDefinitionKey(String)
-
processDefinitionKey
Select the process instances which are defined by a process definition with the given key. -
processDefinitionKeys
Select the process instances which are defined by process definitions with the given keys. -
processDefinitionKeyLike
Select process instances whose process definition key is like the given value -
processDefinitionKeyLikeIgnoreCase
Select process instances whose process definition key is like the given value, ignoring upper/lower case. -
processDefinitionId
Select the process instances which are defined by a process definition with the given id. -
processDefinitionIds
Select the process instances which are defined by process definitions with the given ids. -
processDefinitionEngineVersion
Select the process instances which are defined by a process definition with the given engine version. -
deploymentId
Select the process instances which are defined by a deployment with the given id. -
deploymentIdIn
Select the process instances which are defined by one of the given deployment ids -
superProcessInstanceId
Select the process instances which are a sub process instance of the given super process instance. -
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. -
excludeSubprocesses
Exclude sub processes from the query result; -
activeActivityId
Select the process instances which have an active activity instance like the provided id. -
activeActivityIds
Select the process instances which have an active activity instance like the provided ids. -
involvedUser
Select the process instances with which the user with the given id is involved. -
involvedUser
Select the process instances with which the user with the given id and identity link type is involved. -
involvedGroup
Select the process instances with which the group with the given id and identity link type is involved. -
involvedGroups
Select the process instances with which theGroup
s with the given ids are involved. -
variableValueEquals
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 inProcessEngineConfigurationImpl.getVariableTypes()
. Byte-arrays andSerializable
objects (which are not primitive type wrappers) are not supported.- Parameters:
name
- name of the variable, cannot be null.
-
variableValueEquals
Only select process instances which have at least one global variable with the given value. The type of variable is determined based on the value, using types configured inProcessEngineConfigurationImpl.getVariableTypes()
. Byte-arrays andSerializable
objects (which are not primitive type wrappers) are not supported. -
variableValueEqualsIgnoreCase
Only select process instances which have a local string variable with the given value, case insensitive.This method only works if your database has encoding/collation that supports case-sensitive queries. For example, use "collate UTF-8" on MySQL and for MSSQL, select one of the case-sensitive Collations available (MSDN Server Collation Reference).
- Parameters:
name
- name of the variable, cannot be null.value
- value of the variable, cannot be null.
-
variableValueNotEquals
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.
-
variableValueNotEqualsIgnoreCase
Only select process instances which have a local string variable which is not the given value, case insensitive.This method only works if your database has encoding/collation that supports case-sensitive queries. For example, use "collate UTF-8" on MySQL and for MSSQL, select one of the case-sensitive Collations available (MSDN Server Collation Reference).
- Parameters:
name
- name of the variable, cannot be null.value
- value of the variable, cannot be null.
-
variableValueGreaterThan
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
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
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
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
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%).
-
variableValueLikeIgnoreCase
Only select process instances which have a global variable value like the given value (case insensitive). 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%).
-
variableExists
Only select process instances which have a variable with the given name.- Parameters:
name
- cannot be null.
-
variableNotExists
Only select process instances which does not have a variable with the given name.- Parameters:
name
- cannot be null.
-
suspended
ProcessInstanceQuery suspended()Only select 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 select process instances which are active, which means that neither the process instance nor the corresponding process definition are suspended. -
processInstanceName
Only select process instances with the given name. -
processInstanceNameLike
Only select process instances with a name like the given value. -
processInstanceNameLikeIgnoreCase
Only select process instances with a name like the given value, ignoring upper/lower case. -
processInstanceRootScopeId
Only select process instances with a root instance with a name like the given value. -
processInstanceParentScopeId
Only select process instances with the given parent process instance id. -
processInstanceCallbackId
Only select process instances with the given callback id. -
processInstanceCallbackType
Only select process instances with the given callback type. -
processInstanceReferenceId
Only select process instances with the given reference id. -
processInstanceReferenceType
Only select process instances with the given callback type. -
locale
Localize process name and description to specified locale. -
withLocalizationFallback
ProcessInstanceQuery withLocalizationFallback()Instruct localization to fallback to more general locales including the default locale of the JVM if the specified locale is not found. -
includeProcessVariables
ProcessInstanceQuery includeProcessVariables()Include process variables in the process query result -
withJobException
ProcessInstanceQuery withJobException()Only select process instances that failed due to an exception happening during a job execution. -
or
ProcessInstanceQuery or()Begin an OR statement. Make sure you invoke the endOr method at the end of your OR statement. Only one OR statement is allowed, for the second call to this method an exception will be thrown. -
endOr
ProcessInstanceQuery endOr()End an OR statement. Only one OR statement is allowed, for the second call to this method an exception will be thrown. -
startedBefore
Only select process instances started before the given time -
startedAfter
Only select process instances started after the given time -
startedBy
Only select process instances started by the given user 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()
). -
orderByStartTime
ProcessInstanceQuery orderByStartTime()Order by start time (needs to be followed byQuery.asc()
orQuery.desc()
). -
orderByTenantId
ProcessInstanceQuery orderByTenantId()Order by tenant id (needs to be followed byQuery.asc()
orQuery.desc()
).
-