Search in sources :

Example 1 with DecisionInvocation

use of org.camunda.bpm.engine.impl.dmn.invocation.DecisionInvocation in project camunda-bpm-platform by camunda.

the class DecisionEvaluationUtil method evaluateDecision.

public static DmnDecisionResult evaluateDecision(DecisionDefinition decisionDefinition, VariableMap variables) throws Exception {
    DecisionInvocation invocation = createInvocation(decisionDefinition, variables);
    invoke(invocation);
    return invocation.getInvocationResult();
}
Also used : DecisionInvocation(org.camunda.bpm.engine.impl.dmn.invocation.DecisionInvocation)

Example 2 with DecisionInvocation

use of org.camunda.bpm.engine.impl.dmn.invocation.DecisionInvocation in project camunda-bpm-platform by camunda.

the class DecisionEvaluationUtil method evaluateDecision.

public static void evaluateDecision(AbstractVariableScope execution, BaseCallableElement callableElement, String resultVariable, DecisionResultMapper decisionResultMapper) throws Exception {
    DecisionDefinition decisionDefinition = resolveDecisionDefinition(callableElement, execution);
    DecisionInvocation invocation = createInvocation(decisionDefinition, execution);
    invoke(invocation);
    DmnDecisionResult result = invocation.getInvocationResult();
    if (result != null) {
        execution.setVariableLocalTransient(DECISION_RESULT_VARIABLE, result);
        if (resultVariable != null && decisionResultMapper != null) {
            Object mappedDecisionResult = decisionResultMapper.mapDecisionResult(result);
            execution.setVariable(resultVariable, mappedDecisionResult);
        }
    }
}
Also used : DmnDecisionResult(org.camunda.bpm.dmn.engine.DmnDecisionResult) DecisionInvocation(org.camunda.bpm.engine.impl.dmn.invocation.DecisionInvocation) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition)

Aggregations

DecisionInvocation (org.camunda.bpm.engine.impl.dmn.invocation.DecisionInvocation)2 DmnDecisionResult (org.camunda.bpm.dmn.engine.DmnDecisionResult)1 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)1