Search in sources :

Example 1 with DmnDecisionEvaluationEventImpl

use of org.camunda.bpm.dmn.engine.impl.delegate.DmnDecisionEvaluationEventImpl in project camunda-engine-dmn by camunda.

the class DefaultDmnDecisionContext method generateDecisionEvaluationEvent.

protected void generateDecisionEvaluationEvent(List<DmnDecisionLogicEvaluationEvent> evaluatedEvents) {
    DmnDecisionLogicEvaluationEvent rootEvaluatedEvent = null;
    DmnDecisionEvaluationEventImpl decisionEvaluationEvent = new DmnDecisionEvaluationEventImpl();
    long executedDecisionElements = 0L;
    for (DmnDecisionLogicEvaluationEvent evaluatedEvent : evaluatedEvents) {
        executedDecisionElements += evaluatedEvent.getExecutedDecisionElements();
        rootEvaluatedEvent = evaluatedEvent;
    }
    decisionEvaluationEvent.setDecisionResult(rootEvaluatedEvent);
    decisionEvaluationEvent.setExecutedDecisionElements(executedDecisionElements);
    evaluatedEvents.remove(rootEvaluatedEvent);
    decisionEvaluationEvent.setRequiredDecisionResults(evaluatedEvents);
    for (DmnDecisionEvaluationListener evaluationListener : evaluationListeners) {
        evaluationListener.notify(decisionEvaluationEvent);
    }
}
Also used : DmnDecisionEvaluationListener(org.camunda.bpm.dmn.engine.delegate.DmnDecisionEvaluationListener) DmnDecisionLogicEvaluationEvent(org.camunda.bpm.dmn.engine.delegate.DmnDecisionLogicEvaluationEvent) DmnDecisionEvaluationEventImpl(org.camunda.bpm.dmn.engine.impl.delegate.DmnDecisionEvaluationEventImpl)

Aggregations

DmnDecisionEvaluationListener (org.camunda.bpm.dmn.engine.delegate.DmnDecisionEvaluationListener)1 DmnDecisionLogicEvaluationEvent (org.camunda.bpm.dmn.engine.delegate.DmnDecisionLogicEvaluationEvent)1 DmnDecisionEvaluationEventImpl (org.camunda.bpm.dmn.engine.impl.delegate.DmnDecisionEvaluationEventImpl)1