use of org.camunda.bpm.dmn.engine.DmnDecision in project camunda-engine-dmn by camunda.
the class DefaultDmnEngine method parseDecision.
public DmnDecision parseDecision(String decisionKey, InputStream inputStream) {
ensureNotNull("decisionKey", decisionKey);
List<DmnDecision> decisions = parseDecisions(inputStream);
for (DmnDecision decision : decisions) {
if (decisionKey.equals(decision.getKey())) {
return decision;
}
}
throw LOG.unableToFindDecisionWithKey(decisionKey);
}
use of org.camunda.bpm.dmn.engine.DmnDecision in project camunda-engine-dmn by camunda.
the class DefaultDmnEngine method parseDecision.
public DmnDecision parseDecision(String decisionKey, DmnModelInstance dmnModelInstance) {
ensureNotNull("decisionKey", decisionKey);
List<DmnDecision> decisions = parseDecisions(dmnModelInstance);
for (DmnDecision decision : decisions) {
if (decisionKey.equals(decision.getKey())) {
return decision;
}
}
throw LOG.unableToFindDecisionWithKey(decisionKey);
}
use of org.camunda.bpm.dmn.engine.DmnDecision in project camunda-engine-dmn by camunda.
the class DefaultDmnEngine method evaluateDecision.
public DmnDecisionResult evaluateDecision(String decisionKey, InputStream inputStream, VariableContext variableContext) {
ensureNotNull("decisionKey", decisionKey);
List<DmnDecision> decisions = parseDecisions(inputStream);
for (DmnDecision decision : decisions) {
if (decisionKey.equals(decision.getKey())) {
return evaluateDecision(decision, variableContext);
}
}
throw LOG.unableToFindDecisionWithKey(decisionKey);
}
use of org.camunda.bpm.dmn.engine.DmnDecision in project camunda-bpm-platform by camunda.
the class DecisionDefinitionDeployer method transformDefinitions.
@Override
protected List<DecisionDefinitionEntity> transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties) {
List<DecisionDefinitionEntity> decisions = new ArrayList<DecisionDefinitionEntity>();
// get the decisions from the deployed drd instead of parse the DMN again
DecisionRequirementsDefinitionEntity deployedDrd = findDeployedDrdForResource(deployment, resource.getName());
if (deployedDrd == null) {
throw LOG.exceptionNoDrdForResource(resource.getName());
}
Collection<DmnDecision> decisionsOfDrd = deployedDrd.getDecisions();
for (DmnDecision decisionOfDrd : decisionsOfDrd) {
DecisionDefinitionEntity decisionEntity = (DecisionDefinitionEntity) decisionOfDrd;
if (DecisionRequirementsDefinitionDeployer.isDecisionRequirementsDefinitionPersistable(deployedDrd)) {
decisionEntity.setDecisionRequirementsDefinitionId(deployedDrd.getId());
decisionEntity.setDecisionRequirementsDefinitionKey(deployedDrd.getKey());
}
decisions.add(decisionEntity);
}
if (!DecisionRequirementsDefinitionDeployer.isDecisionRequirementsDefinitionPersistable(deployedDrd)) {
deployment.removeArtifact(deployedDrd);
}
return decisions;
}
use of org.camunda.bpm.dmn.engine.DmnDecision in project camunda-bpm-platform by camunda.
the class DecisionInvocation method invoke.
@Override
protected void invoke() throws Exception {
final DmnEngine dmnEngine = Context.getProcessEngineConfiguration().getDmnEngine();
invocationResult = dmnEngine.evaluateDecision((DmnDecision) decisionDefinition, variableContext);
}
Aggregations