use of org.camunda.bpm.engine.DecisionService in project camunda-bpm-platform by camunda.
the class DecisionServiceDelegate method execute.
@Override
public void execute(DelegateExecution execution) throws Exception {
DecisionService decisionService = execution.getProcessEngineServices().getDecisionService();
evaluateDecision(decisionService, execution);
}
use of org.camunda.bpm.engine.DecisionService in project camunda-bpm-platform by camunda.
the class EvaluateDecisionTableStep method execute.
@Override
public void execute(PerfTestRunContext context) {
DecisionService decisionService = processEngine.getDecisionService();
decisionService.evaluateDecisionTableByKey(decisionDefinitionKey, variables);
}
use of org.camunda.bpm.engine.DecisionService in project camunda-bpm-platform by camunda.
the class DecisionDefinitionResourceImpl method evaluateDecision.
@Override
public List<Map<String, VariableValueDto>> evaluateDecision(UriInfo context, EvaluateDecisionDto parameters) {
DecisionService decisionService = engine.getDecisionService();
Map<String, Object> variables = VariableValueDto.toMap(parameters.getVariables(), engine, objectMapper);
try {
DmnDecisionResult decisionResult = decisionService.evaluateDecisionById(decisionDefinitionId).variables(variables).evaluate();
return createDecisionResultDto(decisionResult);
} catch (AuthorizationException e) {
throw e;
} catch (NotFoundException e) {
String errorMessage = String.format("Cannot evaluate decision %s: %s", decisionDefinitionId, e.getMessage());
throw new InvalidRequestException(Status.NOT_FOUND, e, errorMessage);
} catch (NotValidException e) {
String errorMessage = String.format("Cannot evaluate decision %s: %s", decisionDefinitionId, e.getMessage());
throw new InvalidRequestException(Status.BAD_REQUEST, e, errorMessage);
} catch (ProcessEngineException e) {
String errorMessage = String.format("Cannot evaluate decision %s: %s", decisionDefinitionId, e.getMessage());
throw new RestException(Status.INTERNAL_SERVER_ERROR, e, errorMessage);
} catch (DmnEngineException e) {
String errorMessage = String.format("Cannot evaluate decision %s: %s", decisionDefinitionId, e.getMessage());
throw new RestException(Status.INTERNAL_SERVER_ERROR, e, errorMessage);
}
}
use of org.camunda.bpm.engine.DecisionService in project camunda-bpm-platform by camunda.
the class DecisionServiceDelegate method notify.
public void notify(DelegateCaseExecution caseExecution) throws Exception {
DecisionService decisionService = caseExecution.getProcessEngineServices().getDecisionService();
evaluateDecision(decisionService, caseExecution);
}
use of org.camunda.bpm.engine.DecisionService in project camunda-bpm-platform by camunda.
the class DecisionServiceDelegate method evaluate.
public boolean evaluate(DelegateCaseExecution caseExecution) {
DecisionService decisionService = caseExecution.getProcessEngineServices().getDecisionService();
DmnDecisionTableResult result = evaluateDecision(decisionService, caseExecution);
DmnDecisionRuleResult singleResult = result.getSingleResult();
return (Boolean) singleResult.getSingleEntry();
}
Aggregations