Interface HistoricProcessInstanceQuery

All Superinterfaces:
Query<HistoricProcessInstanceQuery,HistoricProcessInstance>
All Known Implementing Classes:
HistoricProcessInstanceQueryImpl

public interface HistoricProcessInstanceQuery extends Query<HistoricProcessInstanceQuery,HistoricProcessInstance>
Allows programmatic querying of HistoricProcessInstances.
Author:
Tom Baeyens, Joram Barrez, Falko Menge
  • Method Details

    • processInstanceId

      HistoricProcessInstanceQuery processInstanceId(String processInstanceId)
      Only select historic process instances with the given process instance. ProcessInstance ids and HistoricProcessInstance ids match.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • processInstanceIds

      HistoricProcessInstanceQuery processInstanceIds(Set<String> processInstanceIds)
      Only select historic process instances whose id is in the given set of ids. ProcessInstance ids and HistoricProcessInstance ids match.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • rootProcessInstanceId

      HistoricProcessInstanceQuery rootProcessInstanceId(String rootProcessInstanceId)
      Only select historic process instances for the given root process instance id
    • processInstanceIdNotIn

      default HistoricProcessInstanceQuery processInstanceIdNotIn(String... processInstanceIdNotIn)
      Only select historic process instances whose id is not in the given set of ids. ProcessInstance ids and HistoricProcessInstance ids match.
    • processDefinitionId

      HistoricProcessInstanceQuery processDefinitionId(String processDefinitionId)
      Only select historic process instances for the given process definition
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • processDefinitionKey

      HistoricProcessInstanceQuery processDefinitionKey(String processDefinitionKey)
      Only select historic process instances that are defined by a process definition with the given key.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • processDefinitionKeyIn

      HistoricProcessInstanceQuery processDefinitionKeyIn(String... processDefinitionKeys)
      Only select historic process instances that are defined by any given process definition key.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • processDefinitionKeyNotIn

      HistoricProcessInstanceQuery processDefinitionKeyNotIn(List<String> processDefinitionKeys)
      Only select historic process instances that don't have a process-definition of which the key is present in the given list
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • processDefinitionName

      HistoricProcessInstanceQuery processDefinitionName(String processDefinitionName)
      Only select historic process instances that are defined by a process definition with the given name.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • processDefinitionNameLike

      HistoricProcessInstanceQuery processDefinitionNameLike(String nameLike)
      Only select historic process instances that are defined by process definition which name is like the given value.
      Parameters:
      nameLike - The string can include the wildcard character '%' to express like-strategy: starts with (string%), ends with (%string) or contains (%string%).
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • processInstanceBusinessKey

      HistoricProcessInstanceQuery processInstanceBusinessKey(String processInstanceBusinessKey)
      Only select historic process instances with the given business key
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • processInstanceBusinessKeyIn

      HistoricProcessInstanceQuery processInstanceBusinessKeyIn(String... processInstanceBusinessKeyIn)
      Only select historic process instances whose business key is in the given set.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • processInstanceBusinessKeyLike

      HistoricProcessInstanceQuery processInstanceBusinessKeyLike(String processInstanceBusinessKeyLike)
      Only select historic process instances which had 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%).
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • finished

      Only select historic process instances that are completely finished.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • unfinished

      Only select historic process instance that are not yet finished.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • withIncidents

      Only select historic process instances with incidents
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • withRootIncidents

      HistoricProcessInstanceQuery withRootIncidents()
      Only select historic process instances with root incidents
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • incidentIdIn

      HistoricProcessInstanceQuery incidentIdIn(String... incidentIds)
      Only select historic process instances that have incidents with given ids.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • incidentStatus

      HistoricProcessInstanceQuery incidentStatus(String status)
      Only select historic process instances with incident status either 'open' or 'resolved'. To get all process instances with incidents, use withIncidents().
      Parameters:
      status - indicates the incident status, which is either 'open' or 'resolved'
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • incidentType

      HistoricProcessInstanceQuery incidentType(String incidentType)
      Only selects process instances with the given incident type.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • incidentMessage

      HistoricProcessInstanceQuery incidentMessage(String incidentMessage)
      Only select historic process instances with the given incident message.
      Parameters:
      incidentMessage - Incidents Message for which the historic process instances should be selected
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • incidentMessageLike

      HistoricProcessInstanceQuery incidentMessageLike(String incidentMessageLike)
      Only select historic process instances which had an incident message like the given value.
      Parameters:
      incidentMessageLike - The string can include the wildcard character '%' to express like-strategy: starts with (string%), ends with (%string) or contains (%string%).
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • withJobsRetrying

      default HistoricProcessInstanceQuery withJobsRetrying()
      Only select historic process instances which are associated with jobs that have exceptions and retries left.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • caseInstanceId

      HistoricProcessInstanceQuery caseInstanceId(String caseInstanceId)
      Only select historic process instances which are associated with the given case instance id.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • matchVariableNamesIgnoreCase

      HistoricProcessInstanceQuery matchVariableNamesIgnoreCase()
      The query will match the names of variables in a case-insensitive way.
    • matchVariableValuesIgnoreCase

      HistoricProcessInstanceQuery matchVariableValuesIgnoreCase()
      The query will match the values of variables in a case-insensitive way.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • variableValueEquals

      HistoricProcessInstanceQuery variableValueEquals(String name, Object value)
      Only select process instances which had a global variable with the given value when they ended. Only select process instances which have a variable value greater than the passed value. The type only applies to already ended process instances, otherwise use a ProcessInstanceQuery instead! The type of the variable is determined based on the value, using types configured in ProcessEngineConfigurationImpl.getVariableSerializers(). Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
      Parameters:
      name - of the variable, cannot be null.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • variableValueNotEquals

      HistoricProcessInstanceQuery variableValueNotEquals(String name, Object value)
      Only select process instances which had a global variable with the given name, but with a different value than the passed value when they ended. Only select process instances which have a variable value greater than the passed value. Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
      Parameters:
      name - of the variable, cannot be null.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • variableValueGreaterThan

      HistoricProcessInstanceQuery variableValueGreaterThan(String name, Object value)
      Only select process instances which had a global variable value greater than the passed value when they ended. Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported. Only select process instances which have a variable value greater than the passed value.
      Parameters:
      name - cannot be null.
      value - cannot be null.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • variableValueGreaterThanOrEqual

      HistoricProcessInstanceQuery variableValueGreaterThanOrEqual(String name, Object value)
      Only select process instances which had a global variable value greater than or equal to the passed value when they ended. Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported. Only applies to already ended process instances, otherwise use a ProcessInstanceQuery instead!
      Parameters:
      name - cannot be null.
      value - cannot be null.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • variableValueLessThan

      HistoricProcessInstanceQuery variableValueLessThan(String name, Object value)
      Only select process instances which had a global variable value less than the passed value when the ended. Only applies to already ended process instances, otherwise use a ProcessInstanceQuery instead! Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
      Parameters:
      name - cannot be null.
      value - cannot be null.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • variableValueLessThanOrEqual

      HistoricProcessInstanceQuery variableValueLessThanOrEqual(String name, Object value)
      Only select process instances which has a global variable value less than or equal to the passed value when they ended. Only applies to already ended process instances, otherwise use a ProcessInstanceQuery instead! Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
      Parameters:
      name - cannot be null.
      value - cannot be null.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • variableValueLike

      HistoricProcessInstanceQuery variableValueLike(String name, String value)
      Only select process instances which had global variable value like the given value when they ended. Only applies to already ended process instances, otherwise use a ProcessInstanceQuery instead! This can be used on string variables only.
      Parameters:
      name - cannot be null.
      value - cannot be null. The string can include the wildcard character '%' to express like-strategy: starts with (string%), ends with (%string) or contains (%string%).
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • startedBefore

      HistoricProcessInstanceQuery startedBefore(Date date)
      Only select historic process instances that were started before the given date.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • startedAfter

      HistoricProcessInstanceQuery startedAfter(Date date)
      Only select historic process instances that were started after the given date.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • finishedBefore

      HistoricProcessInstanceQuery finishedBefore(Date date)
      Only select historic process instances that were started before the given date.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • finishedAfter

      HistoricProcessInstanceQuery finishedAfter(Date date)
      Only select historic process instances that were started after the given date.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • startedBy

      Only select historic process instance that are started by the given user.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • orderByProcessInstanceId

      HistoricProcessInstanceQuery orderByProcessInstanceId()
      Order by the process instance id (needs to be followed by Query.asc() or Query.desc()).
    • orderByProcessDefinitionId

      HistoricProcessInstanceQuery orderByProcessDefinitionId()
      Order by the process definition id (needs to be followed by Query.asc() or Query.desc()).
    • orderByProcessDefinitionKey

      HistoricProcessInstanceQuery orderByProcessDefinitionKey()
      Order by the process definition key (needs to be followed by Query.asc() or Query.desc()).
    • orderByProcessDefinitionName

      HistoricProcessInstanceQuery orderByProcessDefinitionName()
      Order by the process definition name (needs to be followed by Query.asc() or Query.desc()).
    • orderByProcessDefinitionVersion

      HistoricProcessInstanceQuery orderByProcessDefinitionVersion()
      Order by the process definition version (needs to be followed by Query.asc() or Query.desc()).
    • orderByProcessInstanceBusinessKey

      HistoricProcessInstanceQuery orderByProcessInstanceBusinessKey()
      Order by the business key (needs to be followed by Query.asc() or Query.desc()).
    • orderByProcessInstanceStartTime

      HistoricProcessInstanceQuery orderByProcessInstanceStartTime()
      Order by the start time (needs to be followed by Query.asc() or Query.desc()).
    • orderByProcessInstanceEndTime

      HistoricProcessInstanceQuery orderByProcessInstanceEndTime()
      Order by the end time (needs to be followed by Query.asc() or Query.desc()).
    • orderByProcessInstanceDuration

      HistoricProcessInstanceQuery orderByProcessInstanceDuration()
      Order by the duration of the process instance (needs to be followed by Query.asc() or Query.desc()).
    • rootProcessInstances

      HistoricProcessInstanceQuery rootProcessInstances()
      Only select historic process instances that are top level process instances.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • superProcessInstanceId

      HistoricProcessInstanceQuery superProcessInstanceId(String superProcessInstanceId)
      Only select historic process instances started by the given process instance.
      invalid @link
      {@link ProcessInstance) ids and {@link HistoricProcessInstance
      } ids match.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • subProcessInstanceId

      HistoricProcessInstanceQuery subProcessInstanceId(String subProcessInstanceId)
      Only select historic process instances having a sub process instance with the given process instance id.

      Note that there will always be maximum only one such process instance that can be the result of this query.

      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • superCaseInstanceId

      HistoricProcessInstanceQuery superCaseInstanceId(String superCaseInstanceId)
      Only select historic process instances started by the given case instance.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • subCaseInstanceId

      HistoricProcessInstanceQuery subCaseInstanceId(String subCaseInstanceId)
      Only select historic process instances having a sub case instance with the given case instance id.

      Note that there will always be maximum only one such process instance that can be the result of this query.

      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • tenantIdIn

      HistoricProcessInstanceQuery tenantIdIn(String... tenantIds)
      Only select historic process instances with one of the given tenant ids.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • withoutTenantId

      HistoricProcessInstanceQuery withoutTenantId()
      Only selects historic process instances which have no tenant id.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • orderByTenantId

      HistoricProcessInstanceQuery orderByTenantId()
      Order by tenant id (needs to be followed by Query.asc() or Query.desc()). Note that the ordering of historic process instances without tenant id is database-specific.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • startDateBy

      Deprecated, for removal: This API element is subject to removal in a future version.
      Only select historic process instances that were started as of the provided date. (Date will be adjusted to reflect midnight)
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • startDateOn

      Deprecated, for removal: This API element is subject to removal in a future version.
      Only select historic process instances that were started on the provided date.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • finishDateBy

      Deprecated, for removal: This API element is subject to removal in a future version.
      Only select historic process instances that were finished as of the provided date. (Date will be adjusted to reflect one second before midnight)
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • finishDateOn

      Deprecated, for removal: This API element is subject to removal in a future version.
      Only select historic process instances that were finished on provided date.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • executedActivityAfter

      HistoricProcessInstanceQuery executedActivityAfter(Date date)
      Only select historic process instances that executed an activity after the given date.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • executedActivityBefore

      HistoricProcessInstanceQuery executedActivityBefore(Date date)
      Only select historic process instances that executed an activity before the given date.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • executedActivityIdIn

      HistoricProcessInstanceQuery executedActivityIdIn(String... ids)
      Only select historic process instances that executed activities with given ids.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • activeActivityIdIn

      HistoricProcessInstanceQuery activeActivityIdIn(String... ids)
      Only select historic process instances that have active activities with given ids.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • activityIdIn

      HistoricProcessInstanceQuery activityIdIn(String... ids)
      Only select historic process instances with an active activity with one of the given ids. In contrast to the `activeActivityIdIn` filter, it can query for async and incident activities.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • executedJobAfter

      HistoricProcessInstanceQuery executedJobAfter(Date date)
      Only select historic process instances that executed an job after the given date.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • executedJobBefore

      HistoricProcessInstanceQuery executedJobBefore(Date date)
      Only select historic process instances that executed an job before the given date.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • active

      Only select historic process instances that are active.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • suspended

      Only select historic process instances that are suspended.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • completed

      Only select historic process instances that are completed.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • externallyTerminated

      HistoricProcessInstanceQuery externallyTerminated()
      Only select historic process instances that are externallyTerminated.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • internallyTerminated

      HistoricProcessInstanceQuery internallyTerminated()
      Only select historic process instances that are internallyTerminated.
      Returns:
      HistoricProcessInstanceQuery A modified query with applied filter
    • 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 HistoricProcessInstanceQuery 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

      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 HistoricProcessInstanceQuery 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 before or() was invoked. To prevent throwing this exception, or() must be invoked first.