For details about the history mechanism as such, refer to the History and AuditEvent Log.

History level FULL is required. Otherwise, no historyfor decisions is created.

Query for evaluated Decisions

The History Service can be used to query for HistoricDecisionInstances. Forexample, use the following query to get all history entries for a decisiondefinition with key checkOrder ordered by the time when the decision wasevaluated.

Decisions which were evaluated from a can befiltered by the process definition id or key and process instance id.

  1. HistoryService historyService = processEngine.getHistoryService();
  2. List<HistoricDecisionInstance> historicDecisionInstances = historyService
  3. .createHistoricDecisionInstanceQuery()
  4. .processDefinitionId("processDefinitionId")
  5. .list();
  6. historicDecisionInstances = historyService
  7. .processDefinitionKey("processDefinitionKey")
  8. .list();
  9. .createHistoricDecisionInstanceQuery()
  10. .processInstanceId("processInstanceId")
  11. .list();

Note that the inputs and outputs of a decision are not included in the queryresult by default. Call the methods includeInputs() and includeOutputs() onthe query to retrieve the inputs and outputs from the result.

  1. List<HistoricDecisionInstance> historicDecisions = processEngine
  2. .getHistoryService()
  3. .createHistoricDecisionInstanceQuery()
  4. .decisionDefinitionKey("checkOrder")
  5. .includeInputs()
  6. .includeOutputs()

The Historic Decision Instance

The HistoricDecisionInstance contains information about a singleevaluation of a decision.

In case the decision was evaluated from a process, information of the processdefinition, the process instance and the activity is set in theHistoricDecisionInstance. The same applies for decisions evaluated froma case, where the history instance will reference the corresponding caseinstances.

Additionally, if the decision is a decision table with hit policy collect andan aggregator function, then the result of the aggregation can be retrieved bythe getCollectResultValue() method.

The represents one input of anevaluated decision (e.g., an input clause of a decision table).

  1. // id of the input clause
  2. String clauseId = input.getClauseId();
  3. // label of the input clause
  4. String clauseName = input.getClauseName();
  5. // evaluated value of the input expression
  6. Object value = input.getValue();
  7. // evaluated value of the input expression as typed value
  8. // which contains type information

Note that the value may be the result of a type transformation in case theinput specifies a type.

Historic Decision Output Instance

The HistoricDecisionOutputInstance represents one output entry of anevaluated decision. If the decision is implemented as decision table, theHistoricDecisionInstance contains one HistoricDecisionOutputInstancefor each output clause and matched rule.

Note that the value may be the result of a type transformation in case theoutput specifies a type.

Cockpit