Class ProcessInstanceQueryImpl
- All Implemented Interfaces:
Serializable
,Command<Object>
,Query<ProcessInstanceQuery,
,ProcessInstance> ProcessInstanceQuery
- Author:
- Tom Baeyens, Joram Barrez, Frederik Heremans, Falko Menge, Daniel Meyer
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.camunda.bpm.engine.impl.AbstractQuery
AbstractQuery.ResultType
-
Field Summary
Modifier and TypeFieldDescriptionprotected String[]
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected String
protected String
protected String[]
protected String[]
protected String
protected List<ProcessInstanceQueryImpl>
protected String
protected String
protected String
protected String
protected SuspensionState
protected String[]
protected boolean
Fields inherited from class org.camunda.bpm.engine.impl.AbstractVariableQueryImpl
queryVariableValues, variableNamesIgnoreCase, variableValuesIgnoreCase
Fields inherited from class org.camunda.bpm.engine.impl.AbstractQuery
commandExecutor, expressions, maxResultsLimitEnabled, resultType, SORTORDER_ASC, SORTORDER_DESC, validators
Fields inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
authCheck, databaseType, firstResult, maxResults, orderingProperties, parameter, tenantCheck
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionactive()
Only selects process instances which are active, which means that neither the process instance nor the corresponding process definition are suspended.activityIdIn
(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.void
addOrQuery
(ProcessInstanceQueryImpl orQuery) caseInstanceId
(String caseInstanceId) Selects the process instances which are associated with the given case instance id.protected void
deploymentId
(String deploymentId) Selects the process instances which belong to the given deployment id.endOr()
endOr() terminates an OR query on which an arbitrary amount of filter criteria were applied.protected void
long
executeCount
(CommandContext commandContext) executeDeploymentIdMappingsList
(CommandContext commandContext) executeIdsList
(CommandContext commandContext) executeList
(CommandContext commandContext, Page page) Executes the actual query to retrieve the list of results.String[]
String[]
String[]
String[]
incidentId
(String incidentId) Only selects process instances with the given incident id.incidentMessage
(String incidentMessage) Only selects process instances with the given incident message.incidentMessageLike
(String incidentMessageLike) Only selects process instances with an incident message like the given.incidentType
(String incidentType) Only selects process instances with the given incident type.boolean
boolean
boolean
boolean
boolean
boolean
Only selects process instances which don't have subprocesses and thus are leaves of the execution tree.or()
After calling or(), a chain of several filter criteria could follow.Order by the business key (needs to be followed byQuery.asc()
orQuery.desc()
).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 tenant id (needs to be followed byQuery.asc()
orQuery.desc()
).processDefinitionId
(String processDefinitionId) Selects the process instances which are defined by a process definition with the given id.processDefinitionKey
(String processDefinitionKey) Select the process instances which are defined by a process definition with the given key.processDefinitionKeyIn
(String... processDefinitionKeys) Select the process instances for any given process definition keys.processDefinitionKeyNotIn
(String... processDefinitionKeys) Select historic process instances that don't have a process-definition of which the key is present in the given listOnly selects process instances which process definition has no tenant id.processInstanceBusinessKey
(String businessKey) Select process instances with the given business keyprocessInstanceBusinessKey
(String businessKey, 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.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 idsOnly selects process instances which are top level process instances.void
void
setSuspensionState
(SuspensionState suspensionState) subCaseInstanceId
(String subCaseInstanceId) Select the process instance that has as sub case instance the given case instance.subProcessInstanceId
(String subProcessInstanceId) Select the process instance that have as sub process instance the given process instance.superCaseInstanceId
(String superCaseInstanceId) Select the process instances which are a sub process instance of the given super case instance.superProcessInstanceId
(String superProcessInstanceId) Select the process instances which are a sub process instance of the given super process instance.Only selects process instances which are suspended, either because the process instance itself is suspended or because the corresponding process definition is suspendedtenantIdIn
(String... tenantIds) Only select process instances with one of the given tenant ids.Only selects process instances with at least one incident.Only selects process instances which have no tenant id.Methods inherited from class org.camunda.bpm.engine.impl.AbstractVariableQueryImpl
addVariable, createQueryVariableValue, getQueryVariableValues, isVariableNamesIgnoreCase, isVariableValuesIgnoreCase, matchVariableNamesIgnoreCase, matchVariableValuesIgnoreCase, validateVariable, variableValueEquals, variableValueGreaterThan, variableValueGreaterThanOrEqual, variableValueLessThan, variableValueLessThanOrEqual, variableValueLike, variableValueNotEquals, variableValueNotLike
Methods inherited from class org.camunda.bpm.engine.impl.AbstractQuery
addExpression, addValidator, asc, checkMaxResultsLimit, count, desc, direction, disableMaxResultsLimit, enableMaxResultsLimit, evaluateExpressions, evaluateExpressionsAndExecuteCount, evaluateExpressionsAndExecuteDeploymentIdMappingsList, evaluateExpressionsAndExecuteIdsList, evaluateExpressionsAndExecuteList, execute, executeResult, executeSingleResult, extend, getExpressions, getMethod, hasExcludingConditions, list, listDeploymentIdMappings, listIds, listPage, mergeExpressions, mergeOrdering, orderBy, orderBy, removeValidator, setCommandExecutor, setExpressions, singleResult, unlimitedList, validate, validate
Methods inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
getAuthCheck, getDatabaseType, getFirstResult, getFirstRow, getLastRow, getMaxResults, getOrderingProperties, getParameter, getTenantCheck, setAuthCheck, setDatabaseType, setFirstResult, setMaxResults, setOrderingProperties, setParameter, setTenantCheck
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.camunda.bpm.engine.runtime.ProcessInstanceQuery
matchVariableNamesIgnoreCase, matchVariableValuesIgnoreCase, variableValueEquals, variableValueGreaterThan, variableValueGreaterThanOrEqual, variableValueLessThan, variableValueLessThanOrEqual, variableValueLike, variableValueNotEquals
Methods inherited from interface org.camunda.bpm.engine.query.Query
asc, count, desc, list, listPage, singleResult, unlimitedList
-
Field Details
-
processInstanceId
-
businessKey
-
businessKeyLike
-
processDefinitionId
-
processInstanceIds
-
processDefinitionKey
-
processDefinitionKeys
-
processDefinitionKeyNotIn
-
deploymentId
-
superProcessInstanceId
-
subProcessInstanceId
-
suspensionState
-
withIncident
protected boolean withIncident -
incidentType
-
incidentId
-
incidentMessage
-
incidentMessageLike
-
caseInstanceId
-
superCaseInstanceId
-
subCaseInstanceId
-
activityIds
-
isRootProcessInstances
protected boolean isRootProcessInstances -
isLeafProcessInstances
protected boolean isLeafProcessInstances -
isTenantIdSet
protected boolean isTenantIdSet -
tenantIds
-
isProcessDefinitionWithoutTenantId
protected boolean isProcessDefinitionWithoutTenantId -
queries
-
isOrQueryActive
protected boolean isOrQueryActive
-
-
Constructor Details
-
ProcessInstanceQueryImpl
public ProcessInstanceQueryImpl() -
ProcessInstanceQueryImpl
-
-
Method Details
-
processInstanceId
Description copied from interface:ProcessInstanceQuery
Select the process instance with the given id- Specified by:
processInstanceId
in interfaceProcessInstanceQuery
-
processInstanceIds
Description copied from interface:ProcessInstanceQuery
Select process instances whose id is in the given set of ids- Specified by:
processInstanceIds
in interfaceProcessInstanceQuery
-
processInstanceBusinessKey
Description copied from interface:ProcessInstanceQuery
Select process instances with the given business key- Specified by:
processInstanceBusinessKey
in interfaceProcessInstanceQuery
-
processInstanceBusinessKey
public ProcessInstanceQuery processInstanceBusinessKey(String businessKey, String processDefinitionKey) Description copied from interface:ProcessInstanceQuery
Select process instance with the given business key, unique for the given process definition- Specified by:
processInstanceBusinessKey
in interfaceProcessInstanceQuery
-
processInstanceBusinessKeyLike
Description copied from interface:ProcessInstanceQuery
Select process instances with a business key like the given value.- Specified by:
processInstanceBusinessKeyLike
in interfaceProcessInstanceQuery
- Parameters:
businessKeyLike
- The string can include the wildcard character '%' to express like-strategy: starts with (string%), ends with (%string) or contains (%string%).
-
processDefinitionId
Description copied from interface:ProcessInstanceQuery
Selects the process instances which are defined by a process definition with the given id.- Specified by:
processDefinitionId
in interfaceProcessInstanceQuery
-
processDefinitionKey
Description copied from interface:ProcessInstanceQuery
Select the process instances which are defined by a process definition with the given key.- Specified by:
processDefinitionKey
in interfaceProcessInstanceQuery
-
processDefinitionKeyIn
Description copied from interface:ProcessInstanceQuery
Select the process instances for any given process definition keys.- Specified by:
processDefinitionKeyIn
in interfaceProcessInstanceQuery
-
processDefinitionKeyNotIn
Description copied from interface:ProcessInstanceQuery
Select historic process instances that don't have a process-definition of which the key is present in the given list- Specified by:
processDefinitionKeyNotIn
in interfaceProcessInstanceQuery
-
deploymentId
Description copied from interface:ProcessInstanceQuery
Selects the process instances which belong to the given deployment id.- Specified by:
deploymentId
in interfaceProcessInstanceQuery
-
superProcessInstanceId
Description copied from interface:ProcessInstanceQuery
Select the process instances which are a sub process instance of the given super process instance.- Specified by:
superProcessInstanceId
in interfaceProcessInstanceQuery
-
subProcessInstanceId
Description copied from interface:ProcessInstanceQuery
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.- Specified by:
subProcessInstanceId
in interfaceProcessInstanceQuery
-
caseInstanceId
Description copied from interface:ProcessInstanceQuery
Selects the process instances which are associated with the given case instance id.- Specified by:
caseInstanceId
in interfaceProcessInstanceQuery
-
superCaseInstanceId
Description copied from interface:ProcessInstanceQuery
Select the process instances which are a sub process instance of the given super case instance.- Specified by:
superCaseInstanceId
in interfaceProcessInstanceQuery
-
subCaseInstanceId
Description copied from interface:ProcessInstanceQuery
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.- Specified by:
subCaseInstanceId
in interfaceProcessInstanceQuery
-
orderByProcessInstanceId
Description copied from interface:ProcessInstanceQuery
Order by id (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByProcessInstanceId
in interfaceProcessInstanceQuery
-
orderByProcessDefinitionId
Description copied from interface:ProcessInstanceQuery
Order by process definition id (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByProcessDefinitionId
in interfaceProcessInstanceQuery
-
orderByProcessDefinitionKey
Description copied from interface:ProcessInstanceQuery
Order by process definition key (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByProcessDefinitionKey
in interfaceProcessInstanceQuery
-
orderByTenantId
Description copied from interface:ProcessInstanceQuery
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.- Specified by:
orderByTenantId
in interfaceProcessInstanceQuery
-
orderByBusinessKey
Description copied from interface:ProcessInstanceQuery
Order by the business key (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByBusinessKey
in interfaceProcessInstanceQuery
-
active
Description copied from interface:ProcessInstanceQuery
Only selects process instances which are active, which means that neither the process instance nor the corresponding process definition are suspended.- Specified by:
active
in interfaceProcessInstanceQuery
-
suspended
Description copied from interface:ProcessInstanceQuery
Only selects process instances which are suspended, either because the process instance itself is suspended or because the corresponding process definition is suspended- Specified by:
suspended
in interfaceProcessInstanceQuery
-
withIncident
Description copied from interface:ProcessInstanceQuery
Only selects process instances with at least one incident.- Specified by:
withIncident
in interfaceProcessInstanceQuery
-
incidentType
Description copied from interface:ProcessInstanceQuery
Only selects process instances with the given incident type.- Specified by:
incidentType
in interfaceProcessInstanceQuery
-
incidentId
Description copied from interface:ProcessInstanceQuery
Only selects process instances with the given incident id.- Specified by:
incidentId
in interfaceProcessInstanceQuery
-
incidentMessage
Description copied from interface:ProcessInstanceQuery
Only selects process instances with the given incident message.- Specified by:
incidentMessage
in interfaceProcessInstanceQuery
-
incidentMessageLike
Description copied from interface:ProcessInstanceQuery
Only selects process instances with an incident message like the given.- Specified by:
incidentMessageLike
in interfaceProcessInstanceQuery
-
tenantIdIn
Description copied from interface:ProcessInstanceQuery
Only select process instances with one of the given tenant ids.- Specified by:
tenantIdIn
in interfaceProcessInstanceQuery
-
withoutTenantId
Description copied from interface:ProcessInstanceQuery
Only selects process instances which have no tenant id.- Specified by:
withoutTenantId
in interfaceProcessInstanceQuery
-
activityIdIn
Description copied from interface:ProcessInstanceQuery
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.
- Specified by:
activityIdIn
in interfaceProcessInstanceQuery
-
rootProcessInstances
Description copied from interface:ProcessInstanceQuery
Only selects process instances which are top level process instances.- Specified by:
rootProcessInstances
in interfaceProcessInstanceQuery
-
leafProcessInstances
Description copied from interface:ProcessInstanceQuery
Only selects process instances which don't have subprocesses and thus are leaves of the execution tree.- Specified by:
leafProcessInstances
in interfaceProcessInstanceQuery
-
processDefinitionWithoutTenantId
Description copied from interface:ProcessInstanceQuery
Only selects process instances which process definition has no tenant id.- Specified by:
processDefinitionWithoutTenantId
in interfaceProcessInstanceQuery
-
checkQueryOk
protected void checkQueryOk()- Overrides:
checkQueryOk
in classAbstractQuery<ProcessInstanceQuery,
ProcessInstance>
-
executeCount
- Specified by:
executeCount
in classAbstractVariableQueryImpl<ProcessInstanceQuery,
ProcessInstance>
-
executeList
Description copied from class:AbstractQuery
Executes the actual query to retrieve the list of results.- Specified by:
executeList
in classAbstractVariableQueryImpl<ProcessInstanceQuery,
ProcessInstance> page
- used if the results must be paged. If null, no paging will be applied.
-
executeIdsList
- Overrides:
executeIdsList
in classAbstractQuery<ProcessInstanceQuery,
ProcessInstance>
-
executeDeploymentIdMappingsList
public List<ImmutablePair<String,String>> executeDeploymentIdMappingsList(CommandContext commandContext) - Overrides:
executeDeploymentIdMappingsList
in classAbstractQuery<ProcessInstanceQuery,
ProcessInstance>
-
ensureVariablesInitialized
protected void ensureVariablesInitialized()- Overrides:
ensureVariablesInitialized
in classAbstractVariableQueryImpl<ProcessInstanceQuery,
ProcessInstance>
-
getProcessInstanceId
-
getProcessInstanceIds
-
getQueries
-
addOrQuery
-
setOrQueryActive
public void setOrQueryActive() -
isOrQueryActive
public boolean isOrQueryActive() -
getActivityIds
-
getBusinessKey
-
getBusinessKeyLike
-
getProcessDefinitionId
-
getProcessDefinitionKey
-
getProcessDefinitionKeys
-
getProcessDefinitionKeyNotIn
-
getDeploymentId
-
getSuperProcessInstanceId
-
getSubProcessInstanceId
-
getSuspensionState
-
setSuspensionState
-
isWithIncident
public boolean isWithIncident() -
getIncidentId
-
getIncidentType
-
getIncidentMessage
-
getIncidentMessageLike
-
getCaseInstanceId
-
getSuperCaseInstanceId
-
getSubCaseInstanceId
-
isTenantIdSet
public boolean isTenantIdSet() -
isRootProcessInstances
public boolean isRootProcessInstances() -
isProcessDefinitionWithoutTenantId
public boolean isProcessDefinitionWithoutTenantId() -
isLeafProcessInstances
public boolean isLeafProcessInstances() -
getTenantIds
-
or
Description copied from interface:ProcessInstanceQuery
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,
ProcessInstanceQuery.endOr()
must be invoked.- Specified by:
or
in interfaceProcessInstanceQuery
- 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.
-
endOr
Description copied from interface:ProcessInstanceQuery
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
ProcessInstanceQuery.or()
, endOr() must be invoked. Filter criteria which are applied after calling endOr() are linked together by an AND expression.- Specified by:
endOr
in interfaceProcessInstanceQuery
- 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.
-