org.camunda.bpm.engine.history
Interface HistoricDetailQuery

All Superinterfaces:
Query<HistoricDetailQuery,HistoricDetail>
All Known Implementing Classes:
HistoricDetailQueryImpl

public interface HistoricDetailQuery
extends Query<HistoricDetailQuery,HistoricDetail>

Programmatic querying for HistoricDetails.

Author:
Tom Baeyens

Method Summary
 HistoricDetailQuery activityId(String activityId)
          Deprecated. since 5.2, use activityInstanceId(String) instead
 HistoricDetailQuery activityInstanceId(String activityInstanceId)
          Only select historic variable updates associated to the given activity instance.
 HistoricDetailQuery caseExecutionId(String caseExecutionId)
          Only select historic variable updates with the given case execution.
 HistoricDetailQuery caseInstanceId(String caseInstanceId)
          Only select historic variable updates with the given case instance.
 HistoricDetailQuery detailId(String id)
          Only select the historic detail with the given id.
 HistoricDetailQuery disableBinaryFetching()
          Disable fetching of byte array and file values.
 HistoricDetailQuery disableCustomObjectDeserialization()
          Disable deserialization of variable values that are custom objects.
 HistoricDetailQuery excludeTaskDetails()
          Exclude all task-related HistoricDetails, so only items which have no task-id set will be selected.
 HistoricDetailQuery executionId(String executionId)
          Only select historic variable updates with the given execution.
 HistoricDetailQuery formFields()
          Only select HistoricFormFields.
 HistoricDetailQuery formProperties()
          Deprecated. 
 HistoricDetailQuery orderByFormPropertyId()
           
 HistoricDetailQuery orderByProcessInstanceId()
           
 HistoricDetailQuery orderByTenantId()
          Order by tenant id (needs to be followed by Query.asc() or Query.desc()).
 HistoricDetailQuery orderByTime()
           
 HistoricDetailQuery orderByVariableName()
           
 HistoricDetailQuery orderByVariableRevision()
           
 HistoricDetailQuery orderByVariableType()
           
 HistoricDetailQuery orderPartiallyByOccurrence()
          Sort the historic detail events in the order in which they occurred and needs to be followed by Query.asc() or Query.desc().
 HistoricDetailQuery processInstanceId(String processInstanceId)
          Only select historic variable updates with the given process instance.
 HistoricDetailQuery taskId(String taskId)
          Only select historic variable updates associated to the given historic task instance.
 HistoricDetailQuery tenantIdIn(String... tenantIds)
          Only select historic details with one of the given tenant ids.
 HistoricDetailQuery userOperationId(String userOperationId)
          Select historic details related with given userOperationId.
 HistoricDetailQuery variableInstanceId(String variableInstanceId)
          Only select historic variable updates associated to the given historic variable instance.
 HistoricDetailQuery variableUpdates()
          Only select HistoricVariableUpdates.
 
Methods inherited from interface org.camunda.bpm.engine.query.Query
asc, count, desc, list, listPage, singleResult
 

Method Detail

detailId

HistoricDetailQuery detailId(String id)
Only select the historic detail with the given id.

Parameters:
id - the historic detail to select
Returns:
the query builder

processInstanceId

HistoricDetailQuery processInstanceId(String processInstanceId)
Only select historic variable updates with the given process instance. ProcessInstance ids and HistoricProcessInstance ids match.


caseInstanceId

HistoricDetailQuery caseInstanceId(String caseInstanceId)
Only select historic variable updates with the given case instance. CaseInstance ids and HistoricCaseInstance ids match.


executionId

HistoricDetailQuery executionId(String executionId)
Only select historic variable updates with the given execution. Note that Execution ids are not stored in the history as first class citizen, only process instances are.


caseExecutionId

HistoricDetailQuery caseExecutionId(String caseExecutionId)
Only select historic variable updates with the given case execution. Note that CaseExecution ids are not stored in the history as first class citizen, only case instances are.


activityId

HistoricDetailQuery activityId(String activityId)
Deprecated. since 5.2, use activityInstanceId(String) instead

Only select historic variable updates associated to the given activity instance.


activityInstanceId

HistoricDetailQuery activityInstanceId(String activityInstanceId)
Only select historic variable updates associated to the given activity instance.


taskId

HistoricDetailQuery taskId(String taskId)
Only select historic variable updates associated to the given historic task instance.


variableInstanceId

HistoricDetailQuery variableInstanceId(String variableInstanceId)
Only select historic variable updates associated to the given historic variable instance.


formProperties

@Deprecated
HistoricDetailQuery formProperties()
Deprecated. 

Only select HistoricFormPropertys.


formFields

HistoricDetailQuery formFields()
Only select HistoricFormFields.


variableUpdates

HistoricDetailQuery variableUpdates()
Only select HistoricVariableUpdates.


disableBinaryFetching

HistoricDetailQuery disableBinaryFetching()
Disable fetching of byte array and file values. By default, the query will fetch such values. By calling this method you can prevent the values of (potentially large) blob data chunks to be fetched. The variables themselves are nonetheless included in the query result.

Returns:
the query builder

disableCustomObjectDeserialization

HistoricDetailQuery disableCustomObjectDeserialization()
Disable deserialization of variable values that are custom objects. By default, the query will attempt to deserialize the value of these variables. By calling this method you can prevent such attempts in environments where their classes are not available. Independent of this setting, variable serialized values are accessible.


excludeTaskDetails

HistoricDetailQuery excludeTaskDetails()
Exclude all task-related HistoricDetails, so only items which have no task-id set will be selected. When used together with taskId(String), this call is ignored task details are NOT excluded.


tenantIdIn

HistoricDetailQuery tenantIdIn(String... tenantIds)
Only select historic details with one of the given tenant ids.


userOperationId

HistoricDetailQuery userOperationId(String userOperationId)
Select historic details related with given userOperationId.


orderByTenantId

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


orderByProcessInstanceId

HistoricDetailQuery orderByProcessInstanceId()

orderByVariableName

HistoricDetailQuery orderByVariableName()

orderByFormPropertyId

HistoricDetailQuery orderByFormPropertyId()

orderByVariableType

HistoricDetailQuery orderByVariableType()

orderByVariableRevision

HistoricDetailQuery orderByVariableRevision()

orderByTime

HistoricDetailQuery orderByTime()

orderPartiallyByOccurrence

HistoricDetailQuery orderPartiallyByOccurrence()

Sort the historic detail events in the order in which they occurred and needs to be followed by Query.asc() or Query.desc().

The set of all historic variable update events is a partially ordered set. Due to this fact historic variable update events for two different variable instances are incomparable. So that it is not possible to sort the historic variable update events for two variable instances in the order they occurred. Just for one variable instance the set of historic variable update events can be totally ordered by using variableInstanceId(String) and orderPartiallyByOccurrence() which will return a result set ordered by its occurrence.

For example:
An execution variable myVariable will be updated multiple times:

runtimeService.setVariable("anExecutionId", "myVariable", 1000);
execution.setVariable("myVariable", 5000);
runtimeService.setVariable("anExecutionId", "myVariable", 2500);
runtimeService.removeVariable("anExecutionId", "myVariable");

As a result there exists four historic variable update events.

By using variableInstanceId(String) and orderPartiallyByOccurrence() it is possible to sort the events in the order in which they occurred. The following query

historyService.createHistoricDetailQuery()
  .variableInstanceId("myVariableInstId")
  .orderBySequenceCounter()
  .asc()
  .list()

will return the following totally ordered result set

[
  HistoricVariableUpdate[id: "myVariableInstId", variableName: "myVariable", value: 1000],
  HistoricVariableUpdate[id: "myVariableInstId", variableName: "myVariable", value: 5000],
  HistoricVariableUpdate[id: "myVariableInstId", variableName: "myVariable", value: 2500]
  HistoricVariableUpdate[id: "myVariableInstId", variableName: "myVariable", value: null]
]

Note:
Please note that a historic form field event can occur only once.

Since:
7.3


Copyright © 2017 camunda services GmbH. All rights reserved.