use of org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionRequirementsDefinitionEntity 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.engine.impl.dmn.entity.repository.DecisionRequirementsDefinitionEntity in project camunda-bpm-platform by camunda.
the class DecisionRequirementsDefinitionTransformHandler method createFromDefinitions.
@Override
protected DmnDecisionRequirementsGraphImpl createFromDefinitions(DmnElementTransformContext context, Definitions definitions) {
DecisionRequirementsDefinitionEntity entity = (DecisionRequirementsDefinitionEntity) super.createFromDefinitions(context, definitions);
entity.setCategory(definitions.getNamespace());
return entity;
}
use of org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionRequirementsDefinitionEntity in project camunda-bpm-platform by camunda.
the class GetDeploymentDecisionRequirementsDefinitionCmd method execute.
public DecisionRequirementsDefinition execute(CommandContext commandContext) {
ensureNotNull("decisionRequirementsDefinitionId", decisionRequirementsDefinitionId);
DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache();
DecisionRequirementsDefinitionEntity decisionRequirementsDefinition = deploymentCache.findDeployedDecisionRequirementsDefinitionById(decisionRequirementsDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadDecisionRequirementsDefinition(decisionRequirementsDefinition);
}
return decisionRequirementsDefinition;
}
use of org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionRequirementsDefinitionEntity in project camunda-bpm-platform by camunda.
the class DecisionRequirementsDefinitionDeployer method ensureNoDuplicateDefinitionKeys.
@Override
protected void ensureNoDuplicateDefinitionKeys(List<DecisionRequirementsDefinitionEntity> definitions) {
// ignore decision requirements definitions which will not be persistent
ArrayList<DecisionRequirementsDefinitionEntity> persistableDefinitions = new ArrayList<DecisionRequirementsDefinitionEntity>();
for (DecisionRequirementsDefinitionEntity definition : definitions) {
if (isDecisionRequirementsDefinitionPersistable(definition)) {
persistableDefinitions.add(definition);
}
}
super.ensureNoDuplicateDefinitionKeys(persistableDefinitions);
}
use of org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionRequirementsDefinitionEntity in project camunda-bpm-platform by camunda.
the class DecisionRequirementsDefinitionDeployer method transformDefinitions.
@Override
protected List<DecisionRequirementsDefinitionEntity> transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties) {
byte[] bytes = resource.getBytes();
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
try {
DecisionRequirementsDefinitionEntity drd = transformer.createTransform().modelInstance(inputStream).transformDecisionRequirementsGraph();
return Collections.singletonList(drd);
} catch (Exception e) {
throw LOG.exceptionParseDmnResource(resource.getName(), e);
}
}
Aggregations