use of org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionEntity in project camunda-bpm-platform by camunda.
the class GetDeploymentDmnModelInstanceCmd method execute.
public DmnModelInstance execute(CommandContext commandContext) {
ensureNotNull("decisionDefinitionId", decisionDefinitionId);
DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache();
DecisionDefinitionEntity decisionDefinition = deploymentCache.findDeployedDecisionDefinitionById(decisionDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadDecisionDefinition(decisionDefinition);
}
DmnModelInstance modelInstance = deploymentCache.findDmnModelInstanceForDecisionDefinition(decisionDefinitionId);
ensureNotNull(DmnModelInstanceNotFoundException.class, "No DMN model instance found for decision definition id " + decisionDefinitionId, "modelInstance", modelInstance);
return modelInstance;
}
use of org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionEntity 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.DecisionDefinitionEntity in project camunda-bpm-platform by camunda.
the class DecisionDefinitionHandler method createFromDecision.
@Override
protected DmnDecisionImpl createFromDecision(DmnElementTransformContext context, Decision decision) {
DecisionDefinitionEntity decisionDefinition = (DecisionDefinitionEntity) super.createFromDecision(context, decision);
String category = context.getModelInstance().getDefinitions().getNamespace();
decisionDefinition.setCategory(category);
decisionDefinition.setHistoryTimeToLive(ParseUtil.parseHistoryTimeToLive(decision.getCamundaHistoryTimeToLiveString()));
decisionDefinition.setVersionTag(decision.getVersionTag());
return decisionDefinition;
}
use of org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionEntity in project camunda-bpm-platform by camunda.
the class DecisionDefinitionCache method findDeployedDefinitionByKeyAndVersion.
public DecisionDefinitionEntity findDeployedDefinitionByKeyAndVersion(String definitionKey, Integer definitionVersion) {
DecisionDefinitionEntity definition = ((DecisionDefinitionManager) getManager()).findDecisionDefinitionByKeyAndVersion(definitionKey, definitionVersion);
checkInvalidDefinitionByKeyAndVersion(definitionKey, definitionVersion, definition);
definition = resolveDefinition(definition);
return definition;
}
use of org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionEntity in project camunda-bpm-platform by camunda.
the class UpdateDecisionDefinitionHistoryTimeToLiveCmd method execute.
public Void execute(CommandContext commandContext) {
checkAuthorization(commandContext);
ensureNotNull(BadUserRequestException.class, "decisionDefinitionId", decisionDefinitionId);
if (historyTimeToLive != null) {
ensureGreaterThanOrEqual(BadUserRequestException.class, "", "historyTimeToLive", historyTimeToLive, 0);
}
DecisionDefinitionEntity decisionDefinitionEntity = commandContext.getDecisionDefinitionManager().findDecisionDefinitionById(decisionDefinitionId);
decisionDefinitionEntity.setHistoryTimeToLive(historyTimeToLive);
return null;
}
Aggregations