Search in sources :

Example 1 with DmnDecisionLiteralExpressionEvaluationEvent

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

the class DecisionLiteralExpressionEvaluationHandler method generateDecisionResult.

@Override
public DmnDecisionResult generateDecisionResult(DmnDecisionLogicEvaluationEvent event) {
    DmnDecisionLiteralExpressionEvaluationEvent evaluationEvent = (DmnDecisionLiteralExpressionEvaluationEvent) event;
    DmnDecisionResultEntriesImpl result = new DmnDecisionResultEntriesImpl();
    result.putValue(evaluationEvent.getOutputName(), evaluationEvent.getOutputValue());
    return new DmnDecisionResultImpl(Collections.<DmnDecisionResultEntries>singletonList(result));
}
Also used : DmnDecisionResultImpl(org.camunda.bpm.dmn.engine.impl.DmnDecisionResultImpl) DmnDecisionLiteralExpressionEvaluationEvent(org.camunda.bpm.dmn.engine.delegate.DmnDecisionLiteralExpressionEvaluationEvent) DmnDecisionResultEntriesImpl(org.camunda.bpm.dmn.engine.impl.DmnDecisionResultEntriesImpl)

Example 2 with DmnDecisionLiteralExpressionEvaluationEvent

use of org.camunda.bpm.dmn.engine.delegate.DmnDecisionLiteralExpressionEvaluationEvent in project camunda-bpm-platform by camunda.

the class DefaultDmnHistoryEventProducer method initDecisionInstanceEvent.

protected void initDecisionInstanceEvent(HistoricDecisionInstanceEntity event, DmnDecisionLogicEvaluationEvent evaluationEvent, HistoryEventTypes eventType) {
    event.setEventType(eventType.getEventName());
    DecisionDefinition decision = (DecisionDefinition) evaluationEvent.getDecision();
    event.setDecisionDefinitionId(decision.getId());
    event.setDecisionDefinitionKey(decision.getKey());
    event.setDecisionDefinitionName(decision.getName());
    if (decision.getDecisionRequirementsDefinitionId() != null) {
        event.setDecisionRequirementsDefinitionId(decision.getDecisionRequirementsDefinitionId());
        event.setDecisionRequirementsDefinitionKey(decision.getDecisionRequirementsDefinitionKey());
    }
    if (evaluationEvent instanceof DmnDecisionTableEvaluationEvent) {
        initDecisionInstanceEventForDecisionTable(event, (DmnDecisionTableEvaluationEvent) evaluationEvent);
    } else if (evaluationEvent instanceof DmnDecisionLiteralExpressionEvaluationEvent) {
        initDecisionInstanceEventForDecisionLiteralExpression(event, (DmnDecisionLiteralExpressionEvaluationEvent) evaluationEvent);
    } else {
        event.setInputs(Collections.<HistoricDecisionInputInstance>emptyList());
        event.setOutputs(Collections.<HistoricDecisionOutputInstance>emptyList());
    }
}
Also used : HistoricDecisionInputInstance(org.camunda.bpm.engine.history.HistoricDecisionInputInstance) DmnDecisionLiteralExpressionEvaluationEvent(org.camunda.bpm.dmn.engine.delegate.DmnDecisionLiteralExpressionEvaluationEvent) DmnDecisionTableEvaluationEvent(org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationEvent) HistoricDecisionOutputInstance(org.camunda.bpm.engine.history.HistoricDecisionOutputInstance) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition)

Aggregations

DmnDecisionLiteralExpressionEvaluationEvent (org.camunda.bpm.dmn.engine.delegate.DmnDecisionLiteralExpressionEvaluationEvent)2 DmnDecisionTableEvaluationEvent (org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationEvent)1 DmnDecisionResultEntriesImpl (org.camunda.bpm.dmn.engine.impl.DmnDecisionResultEntriesImpl)1 DmnDecisionResultImpl (org.camunda.bpm.dmn.engine.impl.DmnDecisionResultImpl)1 HistoricDecisionInputInstance (org.camunda.bpm.engine.history.HistoricDecisionInputInstance)1 HistoricDecisionOutputInstance (org.camunda.bpm.engine.history.HistoricDecisionOutputInstance)1 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)1