Search in sources :

Example 1 with HistoricDecisionInstanceEntity

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;
}
Also used : HistoricDecisionInstanceEntity(org.camunda.bpm.engine.impl.history.event.HistoricDecisionInstanceEntity) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition)

Example 2 with HistoricDecisionInstanceEntity

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;
}
Also used : HistoricDecisionEvaluationEvent(org.camunda.bpm.engine.impl.history.event.HistoricDecisionEvaluationEvent) DmnDecisionLogicEvaluationEvent(org.camunda.bpm.dmn.engine.delegate.DmnDecisionLogicEvaluationEvent) ArrayList(java.util.ArrayList) HistoricDecisionInstanceEntity(org.camunda.bpm.engine.impl.history.event.HistoricDecisionInstanceEntity)

Example 3 with HistoricDecisionInstanceEntity

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;
}
Also used : HistoricDecisionInstanceEntity(org.camunda.bpm.engine.impl.history.event.HistoricDecisionInstanceEntity) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition)

Example 4 with HistoricDecisionInstanceEntity

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;
}
Also used : HistoricDecisionInstanceEntity(org.camunda.bpm.engine.impl.history.event.HistoricDecisionInstanceEntity) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition)

Aggregations

HistoricDecisionInstanceEntity (org.camunda.bpm.engine.impl.history.event.HistoricDecisionInstanceEntity)4 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)3 ArrayList (java.util.ArrayList)1 DmnDecisionLogicEvaluationEvent (org.camunda.bpm.dmn.engine.delegate.DmnDecisionLogicEvaluationEvent)1 HistoricDecisionEvaluationEvent (org.camunda.bpm.engine.impl.history.event.HistoricDecisionEvaluationEvent)1