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
FieldsModifier and TypeFieldDescriptionprotected String[]protected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected Stringprotected Stringprotected String[]protected String[]protected Stringprotected List<ProcessInstanceQueryImpl>protected Stringprotected Stringprotected Stringprotected Stringprotected SuspensionStateprotected String[]protected booleanFields inherited from class org.camunda.bpm.engine.impl.AbstractVariableQueryImpl
queryVariableValues, variableNamesIgnoreCase, variableValuesIgnoreCaseFields inherited from class org.camunda.bpm.engine.impl.AbstractQuery
commandExecutor, expressions, maxResultsLimitEnabled, resultType, SORTORDER_ASC, SORTORDER_DESC, validatorsFields inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
authCheck, databaseType, firstResult, maxResults, orderingProperties, parameter, tenantCheck -
Constructor Summary
Constructors -
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.voidaddOrQuery(ProcessInstanceQueryImpl orQuery) caseInstanceId(String caseInstanceId) Selects the process instances which are associated with the given case instance id.protected voiddeploymentId(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 voidlongexecuteCount(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.booleanbooleanbooleanbooleanbooleanbooleanOnly 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.voidvoidsetSuspensionState(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, variableValueNotLikeMethods 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, validateMethods 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, setTenantCheckMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.camunda.bpm.engine.runtime.ProcessInstanceQuery
matchVariableNamesIgnoreCase, matchVariableValuesIgnoreCase, variableValueEquals, variableValueGreaterThan, variableValueGreaterThanOrEqual, variableValueLessThan, variableValueLessThanOrEqual, variableValueLike, variableValueNotEqualsMethods 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:ProcessInstanceQuerySelect the process instance with the given id- Specified by:
processInstanceIdin interfaceProcessInstanceQuery
-
processInstanceIds
Description copied from interface:ProcessInstanceQuerySelect process instances whose id is in the given set of ids- Specified by:
processInstanceIdsin interfaceProcessInstanceQuery
-
processInstanceBusinessKey
Description copied from interface:ProcessInstanceQuerySelect process instances with the given business key- Specified by:
processInstanceBusinessKeyin interfaceProcessInstanceQuery
-
processInstanceBusinessKey
public ProcessInstanceQuery processInstanceBusinessKey(String businessKey, String processDefinitionKey) Description copied from interface:ProcessInstanceQuerySelect process instance with the given business key, unique for the given process definition- Specified by:
processInstanceBusinessKeyin interfaceProcessInstanceQuery
-
processInstanceBusinessKeyLike
Description copied from interface:ProcessInstanceQuerySelect process instances with a business key like the given value.- Specified by:
processInstanceBusinessKeyLikein 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:ProcessInstanceQuerySelects the process instances which are defined by a process definition with the given id.- Specified by:
processDefinitionIdin interfaceProcessInstanceQuery
-
processDefinitionKey
Description copied from interface:ProcessInstanceQuerySelect the process instances which are defined by a process definition with the given key.- Specified by:
processDefinitionKeyin interfaceProcessInstanceQuery
-
processDefinitionKeyIn
Description copied from interface:ProcessInstanceQuerySelect the process instances for any given process definition keys.- Specified by:
processDefinitionKeyInin interfaceProcessInstanceQuery
-
processDefinitionKeyNotIn
Description copied from interface:ProcessInstanceQuerySelect historic process instances that don't have a process-definition of which the key is present in the given list- Specified by:
processDefinitionKeyNotInin interfaceProcessInstanceQuery
-
deploymentId
Description copied from interface:ProcessInstanceQuerySelects the process instances which belong to the given deployment id.- Specified by:
deploymentIdin interfaceProcessInstanceQuery
-
superProcessInstanceId
Description copied from interface:ProcessInstanceQuerySelect the process instances which are a sub process instance of the given super process instance.- Specified by:
superProcessInstanceIdin interfaceProcessInstanceQuery
-
subProcessInstanceId
Description copied from interface:ProcessInstanceQuerySelect 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:
subProcessInstanceIdin interfaceProcessInstanceQuery
-
caseInstanceId
Description copied from interface:ProcessInstanceQuerySelects the process instances which are associated with the given case instance id.- Specified by:
caseInstanceIdin interfaceProcessInstanceQuery
-
superCaseInstanceId
Description copied from interface:ProcessInstanceQuerySelect the process instances which are a sub process instance of the given super case instance.- Specified by:
superCaseInstanceIdin interfaceProcessInstanceQuery
-
subCaseInstanceId
Description copied from interface:ProcessInstanceQuerySelect 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:
subCaseInstanceIdin interfaceProcessInstanceQuery
-
orderByProcessInstanceId
Description copied from interface:ProcessInstanceQueryOrder by id (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByProcessInstanceIdin interfaceProcessInstanceQuery
-
orderByProcessDefinitionId
Description copied from interface:ProcessInstanceQueryOrder by process definition id (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByProcessDefinitionIdin interfaceProcessInstanceQuery
-
orderByProcessDefinitionKey
Description copied from interface:ProcessInstanceQueryOrder by process definition key (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByProcessDefinitionKeyin interfaceProcessInstanceQuery
-
orderByTenantId
Description copied from interface:ProcessInstanceQueryOrder 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:
orderByTenantIdin interfaceProcessInstanceQuery
-
orderByBusinessKey
Description copied from interface:ProcessInstanceQueryOrder by the business key (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByBusinessKeyin interfaceProcessInstanceQuery
-
active
Description copied from interface:ProcessInstanceQueryOnly selects process instances which are active, which means that neither the process instance nor the corresponding process definition are suspended.- Specified by:
activein interfaceProcessInstanceQuery
-
suspended
Description copied from interface:ProcessInstanceQueryOnly selects process instances which are suspended, either because the process instance itself is suspended or because the corresponding process definition is suspended- Specified by:
suspendedin interfaceProcessInstanceQuery
-
withIncident
Description copied from interface:ProcessInstanceQueryOnly selects process instances with at least one incident.- Specified by:
withIncidentin interfaceProcessInstanceQuery
-
incidentType
Description copied from interface:ProcessInstanceQueryOnly selects process instances with the given incident type.- Specified by:
incidentTypein interfaceProcessInstanceQuery
-
incidentId
Description copied from interface:ProcessInstanceQueryOnly selects process instances with the given incident id.- Specified by:
incidentIdin interfaceProcessInstanceQuery
-
incidentMessage
Description copied from interface:ProcessInstanceQueryOnly selects process instances with the given incident message.- Specified by:
incidentMessagein interfaceProcessInstanceQuery
-
incidentMessageLike
Description copied from interface:ProcessInstanceQueryOnly selects process instances with an incident message like the given.- Specified by:
incidentMessageLikein interfaceProcessInstanceQuery
-
tenantIdIn
Description copied from interface:ProcessInstanceQueryOnly select process instances with one of the given tenant ids.- Specified by:
tenantIdInin interfaceProcessInstanceQuery
-
withoutTenantId
Description copied from interface:ProcessInstanceQueryOnly selects process instances which have no tenant id.- Specified by:
withoutTenantIdin interfaceProcessInstanceQuery
-
activityIdIn
Description copied from interface:ProcessInstanceQueryOnly 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:
activityIdInin interfaceProcessInstanceQuery
-
rootProcessInstances
Description copied from interface:ProcessInstanceQueryOnly selects process instances which are top level process instances.- Specified by:
rootProcessInstancesin interfaceProcessInstanceQuery
-
leafProcessInstances
Description copied from interface:ProcessInstanceQueryOnly selects process instances which don't have subprocesses and thus are leaves of the execution tree.- Specified by:
leafProcessInstancesin interfaceProcessInstanceQuery
-
processDefinitionWithoutTenantId
Description copied from interface:ProcessInstanceQueryOnly selects process instances which process definition has no tenant id.- Specified by:
processDefinitionWithoutTenantIdin interfaceProcessInstanceQuery
-
checkQueryOk
protected void checkQueryOk()- Overrides:
checkQueryOkin classAbstractQuery<ProcessInstanceQuery,ProcessInstance>
-
executeCount
- Specified by:
executeCountin classAbstractVariableQueryImpl<ProcessInstanceQuery,ProcessInstance>
-
executeList
Description copied from class:AbstractQueryExecutes the actual query to retrieve the list of results.- Specified by:
executeListin classAbstractVariableQueryImpl<ProcessInstanceQuery,ProcessInstance> page- used if the results must be paged. If null, no paging will be applied.
-
executeIdsList
- Overrides:
executeIdsListin classAbstractQuery<ProcessInstanceQuery,ProcessInstance>
-
executeDeploymentIdMappingsList
public List<ImmutablePair<String,String>> executeDeploymentIdMappingsList(CommandContext commandContext) - Overrides:
executeDeploymentIdMappingsListin classAbstractQuery<ProcessInstanceQuery,ProcessInstance>
-
ensureVariablesInitialized
protected void ensureVariablesInitialized()- Overrides:
ensureVariablesInitializedin 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:ProcessInstanceQueryAfter 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:
orin interfaceProcessInstanceQuery- Returns:
- an object of the type
ProcessInstanceQueryon 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:ProcessInstanceQueryendOr() 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:
endOrin interfaceProcessInstanceQuery- Returns:
- an object of the type
ProcessInstanceQueryon which an arbitrary amount of filter criteria could be applied. The filter criteria will be linked together by an AND expression.
-