use of org.camunda.bpm.engine.impl.history.event.HistoricDecisionInstanceEntity in project camunda-bpm-platform by camunda.
the class DefaultDmnHistoryEventProducer method createDecisionEvaluatedEvt.
protected HistoricDecisionInstanceEntity createDecisionEvaluatedEvt(DmnDecisionLogicEvaluationEvent evaluationEvent, CaseExecutionEntity execution) {
// create event instance
HistoricDecisionInstanceEntity event = newDecisionInstanceEventEntity(execution, evaluationEvent);
// initialize event
initDecisionInstanceEvent(event, evaluationEvent, HistoryEventTypes.DMN_DECISION_EVALUATE);
setReferenceToCaseInstance(event, execution);
// set current time as evaluation time
event.setEvaluationTime(ClockUtil.getCurrentTime());
DecisionDefinition decisionDefinition = (DecisionDefinition) evaluationEvent.getDecision();
String tenantId = execution.getTenantId();
if (tenantId == null) {
tenantId = provideTenantId(decisionDefinition, event);
}
event.setTenantId(tenantId);
return event;
}
use of org.camunda.bpm.engine.impl.history.event.HistoricDecisionInstanceEntity in project camunda-bpm-platform by camunda.
the class DefaultDmnHistoryEventProducer method createHistoryEvent.
protected HistoryEvent createHistoryEvent(DmnDecisionEvaluationEvent evaluationEvent, HistoricDecisionInstanceSupplier supplier) {
HistoricDecisionEvaluationEvent event = newDecisionEvaluationEvent(evaluationEvent);
HistoricDecisionInstanceEntity rootDecisionEvent = supplier.createHistoricDecisionInstance(evaluationEvent.getDecisionResult());
event.setRootHistoricDecisionInstance(rootDecisionEvent);
List<HistoricDecisionInstanceEntity> requiredDecisionEvents = new ArrayList<HistoricDecisionInstanceEntity>();
for (DmnDecisionLogicEvaluationEvent requiredDecisionResult : evaluationEvent.getRequiredDecisionResults()) {
HistoricDecisionInstanceEntity requiredDecisionEvent = supplier.createHistoricDecisionInstance(requiredDecisionResult);
requiredDecisionEvents.add(requiredDecisionEvent);
}
event.setRequiredHistoricDecisionInstances(requiredDecisionEvents);
return event;
}
use of org.camunda.bpm.engine.impl.history.event.HistoricDecisionInstanceEntity in project camunda-bpm-platform by camunda.
the class DefaultDmnHistoryEventProducer method createDecisionEvaluatedEvt.
protected HistoricDecisionInstanceEntity createDecisionEvaluatedEvt(DmnDecisionLogicEvaluationEvent evaluationEvent, ExecutionEntity execution) {
// create event instance
HistoricDecisionInstanceEntity event = newDecisionInstanceEventEntity(execution, evaluationEvent);
// initialize event
initDecisionInstanceEvent(event, evaluationEvent, HistoryEventTypes.DMN_DECISION_EVALUATE);
setReferenceToProcessInstance(event, execution);
// set current time as evaluation time
event.setEvaluationTime(ClockUtil.getCurrentTime());
DecisionDefinition decisionDefinition = (DecisionDefinition) evaluationEvent.getDecision();
String tenantId = execution.getTenantId();
if (tenantId == null) {
tenantId = provideTenantId(decisionDefinition, event);
}
event.setTenantId(tenantId);
return event;
}
use of org.camunda.bpm.engine.impl.history.event.HistoricDecisionInstanceEntity in project camunda-bpm-platform by camunda.
the class DefaultDmnHistoryEventProducer method createDecisionEvaluatedEvt.
protected HistoricDecisionInstanceEntity createDecisionEvaluatedEvt(DmnDecisionLogicEvaluationEvent evaluationEvent) {
// create event instance
HistoricDecisionInstanceEntity event = newDecisionInstanceEventEntity(evaluationEvent);
// initialize event
initDecisionInstanceEvent(event, evaluationEvent, HistoryEventTypes.DMN_DECISION_EVALUATE);
// set current time as evaluation time
event.setEvaluationTime(ClockUtil.getCurrentTime());
// set the user id if there is an authenticated user and no process instance
setUserId(event);
DecisionDefinition decisionDefinition = (DecisionDefinition) evaluationEvent.getDecision();
String tenantId = decisionDefinition.getTenantId();
if (tenantId == null) {
tenantId = provideTenantId(decisionDefinition, event);
}
event.setTenantId(tenantId);
return event;
}
Aggregations