org.camunda.bpm.engine.runtime
Interface ProcessInstanceQuery

All Superinterfaces:
Query<ProcessInstanceQuery,ProcessInstance>
All Known Implementing Classes:
ProcessInstanceQueryImpl

public interface ProcessInstanceQuery
extends Query<ProcessInstanceQuery,ProcessInstance>

Allows programmatic querying of ProcessInstances.

Author:
Joram Barrez, Frederik Heremans, Falko Menge

Method Summary
 ProcessInstanceQuery active()
          Only selects process instances which are active, which means that neither the process instance nor the corresponding process definition are suspended.
 ProcessInstanceQuery caseInstanceId(String caseInstanceId)
          Selects the process instances which are associated with the given case instance id.
 ProcessInstanceQuery deploymentId(String deploymentId)
          Selects the process instances which belong to the given deployment id.
 ProcessInstanceQuery incidentId(String incidentId)
          Only selects process instances with the given incident id.
 ProcessInstanceQuery incidentMessage(String incidentMessage)
          Only selects process instances with the given incident message.
 ProcessInstanceQuery incidentMessageLike(String incidentMessageLike)
          Only selects process instances with an incident message like the given.
 ProcessInstanceQuery incidentType(String incidentType)
          Only selects process instances with the given incident type.
 ProcessInstanceQuery orderByProcessDefinitionId()
          Order by process definition id (needs to be followed by Query.asc() or Query.desc()).
 ProcessInstanceQuery orderByProcessDefinitionKey()
          Order by process definition key (needs to be followed by Query.asc() or Query.desc()).
 ProcessInstanceQuery orderByProcessInstanceId()
          Order by id (needs to be followed by Query.asc() or Query.desc()).
 ProcessInstanceQuery orderByTenantId()
          Order by tenant id (needs to be followed by Query.asc() or Query.desc()).
 ProcessInstanceQuery processDefinitionId(String processDefinitionId)
          Selects the process instances which are defined by a process definition with the given id.
 ProcessInstanceQuery processDefinitionKey(String processDefinitionKey)
          Select the process instances which are defined by a process definition with the given key.
 ProcessInstanceQuery processInstanceBusinessKey(String processInstanceBusinessKey)
          Select process instances with the given business key
 ProcessInstanceQuery processInstanceBusinessKey(String processInstanceBusinessKey, String processDefinitionKey)
          Select process instance with the given business key, unique for the given process definition
 ProcessInstanceQuery processInstanceId(String processInstanceId)
          Select the process instance with the given id
 ProcessInstanceQuery processInstanceIds(Set<String> processInstanceIds)
          Select process instances whose id is in the given set of ids
 ProcessInstanceQuery subCaseInstanceId(String subCaseInstanceId)
          Select the process instance that has as sub case instance the given case instance.
 ProcessInstanceQuery subProcessInstanceId(String subProcessInstanceId)
          Select the process instance that have as sub process instance the given process instance.
 ProcessInstanceQuery superCaseInstanceId(String superCaseInstanceId)
          Select the process instances which are a sub process instance of the given super case instance.
 ProcessInstanceQuery superProcessInstanceId(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 suspended
 ProcessInstanceQuery tenantIdIn(String... tenantIds)
          Only select process instances with one of the given tenant ids.
 ProcessInstanceQuery variableValueEquals(String name, Object value)
          Only select process instances which have a global variable with the given value.
 ProcessInstanceQuery variableValueGreaterThan(String name, Object value)
          Only select process instances which have a variable value greater than the passed value.
 ProcessInstanceQuery variableValueGreaterThanOrEqual(String name, Object value)
          Only select process instances which have a global variable value greater than or equal to the passed value.
 ProcessInstanceQuery variableValueLessThan(String name, Object value)
          Only select process instances which have a global variable value less than the passed value.
 ProcessInstanceQuery variableValueLessThanOrEqual(String name, Object value)
          Only select process instances which have a global variable value less than or equal to the passed value.
 ProcessInstanceQuery variableValueLike(String name, String value)
          Only select process instances which have a global variable value like the given value.
 ProcessInstanceQuery 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.
 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
 

Method Detail

processInstanceId

ProcessInstanceQuery processInstanceId(String processInstanceId)
Select the process instance with the given id


processInstanceIds

ProcessInstanceQuery processInstanceIds(Set<String> processInstanceIds)
Select process instances whose id is in the given set of ids


processInstanceBusinessKey

ProcessInstanceQuery processInstanceBusinessKey(String 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


processDefinitionKey

ProcessInstanceQuery processDefinitionKey(String processDefinitionKey)
Select the process instances which are defined by a process definition with the given key.


processDefinitionId

ProcessInstanceQuery processDefinitionId(String processDefinitionId)
Selects the process instances which are defined by a process definition with the given id.


deploymentId

ProcessInstanceQuery deploymentId(String deploymentId)
Selects the process instances which belong to the given deployment id.

Since:
7.4

superProcessInstanceId

ProcessInstanceQuery superProcessInstanceId(String superProcessInstanceId)
Select the process instances which are a sub process instance of the given super process instance.


subProcessInstanceId

ProcessInstanceQuery subProcessInstanceId(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(String caseInstanceId)
Selects the process instances which are associated with the given case instance id.


superCaseInstanceId

ProcessInstanceQuery superCaseInstanceId(String superCaseInstanceId)
Select the process instances which are a sub process instance of the given super case instance.

Since:
7.3

subCaseInstanceId

ProcessInstanceQuery subCaseInstanceId(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

variableValueEquals

ProcessInstanceQuery variableValueEquals(String name,
                                         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 in ProcessEngineConfiguration#getVariableSerializers(). Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.

Parameters:
name - name of the variable, cannot be null.

variableValueNotEquals

ProcessInstanceQuery 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. Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.

Parameters:
name - name of the variable, cannot be null.

variableValueGreaterThan

ProcessInstanceQuery variableValueGreaterThan(String name,
                                              Object value)
Only select process instances which have a variable value greater than the passed value. Booleans, Byte-arrays and Serializable 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(String name,
                                                     Object value)
Only select process instances which have a global 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:
name - variable name, cannot be null.
value - variable value, cannot be null.

variableValueLessThan

ProcessInstanceQuery variableValueLessThan(String name,
                                           Object value)
Only select process instances which have a global variable value less than the passed value. Booleans, Byte-arrays and Serializable 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(String name,
                                                  Object value)
Only select process instances which have a global 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:
name - variable name, cannot be null.
value - variable value, cannot be null.

variableValueLike

ProcessInstanceQuery variableValueLike(String name,
                                       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.


incidentType

ProcessInstanceQuery incidentType(String incidentType)
Only selects process instances with the given incident type.


incidentId

ProcessInstanceQuery incidentId(String incidentId)
Only selects process instances with the given incident id.


incidentMessage

ProcessInstanceQuery incidentMessage(String incidentMessage)
Only selects process instances with the given incident message.


incidentMessageLike

ProcessInstanceQuery incidentMessageLike(String incidentMessageLike)
Only selects process instances with an incident message like the given.


tenantIdIn

ProcessInstanceQuery tenantIdIn(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.


orderByProcessInstanceId

ProcessInstanceQuery orderByProcessInstanceId()
Order by id (needs to be followed by Query.asc() or Query.desc()).


orderByProcessDefinitionKey

ProcessInstanceQuery orderByProcessDefinitionKey()
Order by process definition key (needs to be followed by Query.asc() or Query.desc()).


orderByProcessDefinitionId

ProcessInstanceQuery orderByProcessDefinitionId()
Order by process definition id (needs to be followed by Query.asc() or Query.desc()).


orderByTenantId

ProcessInstanceQuery orderByTenantId()
Order by tenant id (needs to be followed by Query.asc() or Query.desc()). Note that the ordering of process instances without tenant id is database-specific.



Copyright © 2016 camunda services GmbH. All rights reserved.