コード例 #1
0
  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);
      }
    }
  }
コード例 #2
0
 public static DmnDecisionResult evaluateDecision(
     DecisionDefinition decisionDefinition, VariableMap variables) throws Exception {
   DecisionInvocation invocation = createInvocation(decisionDefinition, variables);
   invoke(invocation);
   return invocation.getInvocationResult();
 }