Class HistoricDetailQueryImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.db.ListQueryParameterObject
-
- org.camunda.bpm.engine.impl.AbstractQuery<HistoricDetailQuery,HistoricDetail>
-
- org.camunda.bpm.engine.impl.HistoricDetailQueryImpl
-
- All Implemented Interfaces:
java.io.Serializable,HistoricDetailQuery,Command<java.lang.Object>,Query<HistoricDetailQuery,HistoricDetail>
public class HistoricDetailQueryImpl extends AbstractQuery<HistoricDetailQuery,HistoricDetail> implements HistoricDetailQuery
- Author:
- Tom Baeyens
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.camunda.bpm.engine.impl.AbstractQuery
AbstractQuery.ResultType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringactivityIdprotected java.lang.StringactivityInstanceIdprotected java.lang.StringcaseExecutionIdprotected java.lang.StringcaseInstanceIdprotected java.lang.StringdetailIdprotected booleanexcludeTaskRelatedprotected java.lang.StringexecutionIdprotected booleaninitialprotected booleanisByteArrayFetchingEnabledprotected booleanisCustomObjectDeserializationEnabledprotected booleanisTenantIdSetprotected java.util.DateoccurredAfterprotected java.util.DateoccurredBeforeprotected java.lang.StringprocessInstanceIdprotected java.lang.String[]processInstanceIdsprotected java.lang.LongsequenceCounterprotected java.lang.StringtaskIdprotected java.lang.String[]tenantIdsprotected java.lang.Stringtypeprotected java.lang.StringuserOperationIdprotected java.lang.StringvariableInstanceIdprotected java.lang.String[]variableTypes-
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
Constructors Constructor Description HistoricDetailQueryImpl()HistoricDetailQueryImpl(CommandExecutor commandExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HistoricDetailQueryactivityId(java.lang.String activityId)Only select historic variable updates associated to the givenactivity instance.HistoricDetailQueryactivityInstanceId(java.lang.String activityInstanceId)Only select historic variable updates associated to the givenactivity instance.HistoricDetailQuerycaseExecutionId(java.lang.String caseExecutionId)Only select historic variable updates with the given case execution.HistoricDetailQuerycaseInstanceId(java.lang.String caseInstanceId)Only select historic variable updates with the given case instance.HistoricDetailQuerydetailId(java.lang.String id)Only select the historic detail with the given id.HistoricDetailQuerydisableBinaryFetching()Disable fetching of byte array and file values.HistoricDetailQuerydisableCustomObjectDeserialization()Disable deserialization of variable values that are custom objects.HistoricDetailQueryexcludeTaskDetails()Exclude all task-relatedHistoricDetails, so only items which have no task-id set will be selected.longexecuteCount(CommandContext commandContext)java.util.List<HistoricDetail>executeList(CommandContext commandContext, Page page)Executes the actual query to retrieve the list of results.HistoricDetailQueryexecutionId(java.lang.String executionId)Only select historic variable updates with the given execution.HistoricDetailQueryformFields()Only selectHistoricFormFields.HistoricDetailQueryformProperties()Only selectHistoricFormPropertys.java.lang.StringgetActivityId()java.lang.StringgetCaseExecutionId()java.lang.StringgetCaseInstanceId()java.lang.StringgetDetailId()booleangetExcludeTaskRelated()java.lang.StringgetExecutionId()java.util.DategetOccurredAfter()java.util.DategetOccurredBefore()java.lang.StringgetProcessInstanceId()java.lang.String[]getProcessInstanceIds()java.lang.StringgetTaskId()java.lang.StringgetType()HistoricDetailQueryinitial()Only select historic details that were set during the process start.booleanisInitial()booleanisTenantIdSet()HistoricDetailQueryoccurredAfter(java.util.Date date)Only select historic details that have occurred after the given date (inclusive).HistoricDetailQueryoccurredBefore(java.util.Date date)Only select historic details that have occurred before the given date (inclusive).HistoricDetailQueryorderByFormPropertyId()HistoricDetailQueryorderByProcessInstanceId()HistoricDetailQueryorderByTenantId()Order by tenant id (needs to be followed byQuery.asc()orQuery.desc()).HistoricDetailQueryorderByTime()HistoricDetailQueryorderByVariableName()HistoricDetailQueryorderByVariableRevision()HistoricDetailQueryorderByVariableType()HistoricDetailQueryorderPartiallyByOccurrence()Sort thehistoric detail eventsin the order in which they occurred and needs to be followed byQuery.asc()orQuery.desc().HistoricDetailQueryprocessInstanceId(java.lang.String processInstanceId)Only select historic variable updates with the given process instance.HistoricDetailQueryprocessInstanceIdIn(java.lang.String... processInstanceIds)Only select historic details with the given process instance ids.HistoricDetailQueryImplsequenceCounter(long sequenceCounter)protected booleanshouldFetchValue(HistoricDetailVariableInstanceUpdateEntity entity)HistoricDetailQuerytaskId(java.lang.String taskId)Only select historic variable updates associated to the givenhistoric task instance.HistoricDetailQuerytenantIdIn(java.lang.String... tenantIds)Only select historic details with one of the given tenant ids.HistoricDetailQueryuserOperationId(java.lang.String userOperationId)Select historic details related with given userOperationId.HistoricDetailQueryvariableInstanceId(java.lang.String variableInstanceId)Only select historic variable updates associated to the givenhistoric variable instance.HistoricDetailQueryvariableTypeIn(java.lang.String... variableTypes)Only select historic process variables which match one of the given variable types.HistoricDetailQueryvariableUpdates()Only selectHistoricVariableUpdates.HistoricDetailQuerywithoutTenantId()Only selects historic details that have no tenant id.-
Methods inherited from class org.camunda.bpm.engine.impl.AbstractQuery
addExpression, addValidator, asc, checkMaxResultsLimit, checkQueryOk, count, desc, direction, disableMaxResultsLimit, enableMaxResultsLimit, evaluateExpressions, evaluateExpressionsAndExecuteCount, evaluateExpressionsAndExecuteDeploymentIdMappingsList, evaluateExpressionsAndExecuteIdsList, evaluateExpressionsAndExecuteList, execute, executeDeploymentIdMappingsList, executeIdsList, 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.impl.interceptor.Command
isRetryable
-
Methods inherited from interface org.camunda.bpm.engine.query.Query
asc, count, desc, list, listPage, singleResult, unlimitedList
-
-
-
-
Field Detail
-
detailId
protected java.lang.String detailId
-
taskId
protected java.lang.String taskId
-
processInstanceId
protected java.lang.String processInstanceId
-
caseInstanceId
protected java.lang.String caseInstanceId
-
executionId
protected java.lang.String executionId
-
caseExecutionId
protected java.lang.String caseExecutionId
-
activityId
protected java.lang.String activityId
-
activityInstanceId
protected java.lang.String activityInstanceId
-
type
protected java.lang.String type
-
variableInstanceId
protected java.lang.String variableInstanceId
-
variableTypes
protected java.lang.String[] variableTypes
-
tenantIds
protected java.lang.String[] tenantIds
-
isTenantIdSet
protected boolean isTenantIdSet
-
processInstanceIds
protected java.lang.String[] processInstanceIds
-
userOperationId
protected java.lang.String userOperationId
-
sequenceCounter
protected java.lang.Long sequenceCounter
-
occurredBefore
protected java.util.Date occurredBefore
-
occurredAfter
protected java.util.Date occurredAfter
-
initial
protected boolean initial
-
excludeTaskRelated
protected boolean excludeTaskRelated
-
isByteArrayFetchingEnabled
protected boolean isByteArrayFetchingEnabled
-
isCustomObjectDeserializationEnabled
protected boolean isCustomObjectDeserializationEnabled
-
-
Constructor Detail
-
HistoricDetailQueryImpl
public HistoricDetailQueryImpl()
-
HistoricDetailQueryImpl
public HistoricDetailQueryImpl(CommandExecutor commandExecutor)
-
-
Method Detail
-
detailId
public HistoricDetailQuery detailId(java.lang.String id)
Description copied from interface:HistoricDetailQueryOnly select the historic detail with the given id.- Specified by:
detailIdin interfaceHistoricDetailQuery- Parameters:
id- the historic detail to select- Returns:
- the query builder
-
variableInstanceId
public HistoricDetailQuery variableInstanceId(java.lang.String variableInstanceId)
Description copied from interface:HistoricDetailQueryOnly select historic variable updates associated to the givenhistoric variable instance.- Specified by:
variableInstanceIdin interfaceHistoricDetailQuery
-
variableTypeIn
public HistoricDetailQuery variableTypeIn(java.lang.String... variableTypes)
Description copied from interface:HistoricDetailQueryOnly select historic process variables which match one of the given variable types.- Specified by:
variableTypeInin interfaceHistoricDetailQuery
-
processInstanceId
public HistoricDetailQuery processInstanceId(java.lang.String processInstanceId)
Description copied from interface:HistoricDetailQueryOnly select historic variable updates with the given process instance.ProcessInstanceids andHistoricProcessInstanceids match.- Specified by:
processInstanceIdin interfaceHistoricDetailQuery
-
caseInstanceId
public HistoricDetailQuery caseInstanceId(java.lang.String caseInstanceId)
Description copied from interface:HistoricDetailQueryOnly select historic variable updates with the given case instance.CaseInstanceids andHistoricCaseInstanceids match.- Specified by:
caseInstanceIdin interfaceHistoricDetailQuery
-
executionId
public HistoricDetailQuery executionId(java.lang.String executionId)
Description copied from interface:HistoricDetailQueryOnly select historic variable updates with the given execution. Note thatExecutionids are not stored in the history as first class citizen, only process instances are.- Specified by:
executionIdin interfaceHistoricDetailQuery
-
caseExecutionId
public HistoricDetailQuery caseExecutionId(java.lang.String caseExecutionId)
Description copied from interface:HistoricDetailQueryOnly select historic variable updates with the given case execution. Note thatCaseExecutionids are not stored in the history as first class citizen, only case instances are.- Specified by:
caseExecutionIdin interfaceHistoricDetailQuery
-
activityId
public HistoricDetailQuery activityId(java.lang.String activityId)
Description copied from interface:HistoricDetailQueryOnly select historic variable updates associated to the givenactivity instance.- Specified by:
activityIdin interfaceHistoricDetailQuery
-
activityInstanceId
public HistoricDetailQuery activityInstanceId(java.lang.String activityInstanceId)
Description copied from interface:HistoricDetailQueryOnly select historic variable updates associated to the givenactivity instance.- Specified by:
activityInstanceIdin interfaceHistoricDetailQuery
-
taskId
public HistoricDetailQuery taskId(java.lang.String taskId)
Description copied from interface:HistoricDetailQueryOnly select historic variable updates associated to the givenhistoric task instance.- Specified by:
taskIdin interfaceHistoricDetailQuery
-
formProperties
public HistoricDetailQuery formProperties()
Description copied from interface:HistoricDetailQueryOnly selectHistoricFormPropertys.- Specified by:
formPropertiesin interfaceHistoricDetailQuery
-
formFields
public HistoricDetailQuery formFields()
Description copied from interface:HistoricDetailQueryOnly selectHistoricFormFields.- Specified by:
formFieldsin interfaceHistoricDetailQuery
-
variableUpdates
public HistoricDetailQuery variableUpdates()
Description copied from interface:HistoricDetailQueryOnly selectHistoricVariableUpdates.- Specified by:
variableUpdatesin interfaceHistoricDetailQuery
-
tenantIdIn
public HistoricDetailQuery tenantIdIn(java.lang.String... tenantIds)
Description copied from interface:HistoricDetailQueryOnly select historic details with one of the given tenant ids.- Specified by:
tenantIdInin interfaceHistoricDetailQuery
-
withoutTenantId
public HistoricDetailQuery withoutTenantId()
Description copied from interface:HistoricDetailQueryOnly selects historic details that have no tenant id.- Specified by:
withoutTenantIdin interfaceHistoricDetailQuery
-
processInstanceIdIn
public HistoricDetailQuery processInstanceIdIn(java.lang.String... processInstanceIds)
Description copied from interface:HistoricDetailQueryOnly select historic details with the given process instance ids.- Specified by:
processInstanceIdInin interfaceHistoricDetailQuery
-
userOperationId
public HistoricDetailQuery userOperationId(java.lang.String userOperationId)
Description copied from interface:HistoricDetailQuerySelect historic details related with given userOperationId.- Specified by:
userOperationIdin interfaceHistoricDetailQuery
-
sequenceCounter
public HistoricDetailQueryImpl sequenceCounter(long sequenceCounter)
-
excludeTaskDetails
public HistoricDetailQuery excludeTaskDetails()
Description copied from interface:HistoricDetailQueryExclude all task-relatedHistoricDetails, so only items which have no task-id set will be selected. When used together withHistoricDetailQuery.taskId(String), this call is ignored task details are NOT excluded.- Specified by:
excludeTaskDetailsin interfaceHistoricDetailQuery
-
occurredBefore
public HistoricDetailQuery occurredBefore(java.util.Date date)
Description copied from interface:HistoricDetailQueryOnly select historic details that have occurred before the given date (inclusive).- Specified by:
occurredBeforein interfaceHistoricDetailQuery
-
occurredAfter
public HistoricDetailQuery occurredAfter(java.util.Date date)
Description copied from interface:HistoricDetailQueryOnly select historic details that have occurred after the given date (inclusive).- Specified by:
occurredAfterin interfaceHistoricDetailQuery
-
executeCount
public long executeCount(CommandContext commandContext)
- Specified by:
executeCountin classAbstractQuery<HistoricDetailQuery,HistoricDetail>
-
disableBinaryFetching
public HistoricDetailQuery disableBinaryFetching()
Description copied from interface:HistoricDetailQueryDisable 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.- Specified by:
disableBinaryFetchingin interfaceHistoricDetailQuery- Returns:
- the query builder
-
disableCustomObjectDeserialization
public HistoricDetailQuery disableCustomObjectDeserialization()
Description copied from interface:HistoricDetailQueryDisable 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.- Specified by:
disableCustomObjectDeserializationin interfaceHistoricDetailQuery
-
initial
public HistoricDetailQuery initial()
Description copied from interface:HistoricDetailQueryOnly select historic details that were set during the process start.- Specified by:
initialin interfaceHistoricDetailQuery
-
executeList
public java.util.List<HistoricDetail> executeList(CommandContext commandContext, Page page)
Description copied from class:AbstractQueryExecutes the actual query to retrieve the list of results.- Specified by:
executeListin classAbstractQuery<HistoricDetailQuery,HistoricDetail>page- used if the results must be paged. If null, no paging will be applied.
-
shouldFetchValue
protected boolean shouldFetchValue(HistoricDetailVariableInstanceUpdateEntity entity)
-
orderByProcessInstanceId
public HistoricDetailQuery orderByProcessInstanceId()
- Specified by:
orderByProcessInstanceIdin interfaceHistoricDetailQuery
-
orderByTime
public HistoricDetailQuery orderByTime()
- Specified by:
orderByTimein interfaceHistoricDetailQuery
-
orderByVariableName
public HistoricDetailQuery orderByVariableName()
- Specified by:
orderByVariableNamein interfaceHistoricDetailQuery
-
orderByFormPropertyId
public HistoricDetailQuery orderByFormPropertyId()
- Specified by:
orderByFormPropertyIdin interfaceHistoricDetailQuery
-
orderByVariableRevision
public HistoricDetailQuery orderByVariableRevision()
- Specified by:
orderByVariableRevisionin interfaceHistoricDetailQuery
-
orderByVariableType
public HistoricDetailQuery orderByVariableType()
- Specified by:
orderByVariableTypein interfaceHistoricDetailQuery
-
orderPartiallyByOccurrence
public HistoricDetailQuery orderPartiallyByOccurrence()
Description copied from interface:HistoricDetailQuerySort the
historic detail eventsin the order in which they occurred and needs to be followed byQuery.asc()orQuery.desc().The set of all
historic variable update eventsis a partially ordered set. Due to this facthistoric variable update eventsfor two differentvariable instancesare incomparable. So that it is not possible to sort thehistoric variable update eventsfor twovariable instancesin the order they occurred. Just for onevariable instancethe set ofhistoric variable update eventscan be totally ordered by usingHistoricDetailQuery.variableInstanceId(String)andHistoricDetailQuery.orderPartiallyByOccurrence()which will return a result set ordered by its occurrence.For example:
An execution variablemyVariablewill 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
HistoricDetailQuery.variableInstanceId(String)andHistoricDetailQuery.orderPartiallyByOccurrence()it is possible to sort the events in the order in which they occurred. The following queryhistoryService.createHistoricDetailQuery()
.variableInstanceId("myVariableInstId")
.orderPartiallyByOccurrence()
.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 ahistoric form field eventcan occur only once.- Specified by:
orderPartiallyByOccurrencein interfaceHistoricDetailQuery
-
orderByTenantId
public HistoricDetailQuery orderByTenantId()
Description copied from interface:HistoricDetailQueryOrder by tenant id (needs to be followed byQuery.asc()orQuery.desc()). Note that the ordering of historic details without tenant id is database-specific.- Specified by:
orderByTenantIdin interfaceHistoricDetailQuery
-
getProcessInstanceId
public java.lang.String getProcessInstanceId()
-
getCaseInstanceId
public java.lang.String getCaseInstanceId()
-
getExecutionId
public java.lang.String getExecutionId()
-
getCaseExecutionId
public java.lang.String getCaseExecutionId()
-
getTaskId
public java.lang.String getTaskId()
-
getActivityId
public java.lang.String getActivityId()
-
getType
public java.lang.String getType()
-
getExcludeTaskRelated
public boolean getExcludeTaskRelated()
-
getDetailId
public java.lang.String getDetailId()
-
getProcessInstanceIds
public java.lang.String[] getProcessInstanceIds()
-
getOccurredBefore
public java.util.Date getOccurredBefore()
-
getOccurredAfter
public java.util.Date getOccurredAfter()
-
isTenantIdSet
public boolean isTenantIdSet()
-
isInitial
public boolean isInitial()
-
-