Search in sources :

Example 1 with DecisionDefinitionManager

use of org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionManager in project camunda-bpm-platform by camunda.

the class DeploymentManager method deleteDecisionDeployment.

protected void deleteDecisionDeployment(String deploymentId, boolean cascade) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if (processEngineConfiguration.isDmnEnabled()) {
        DecisionDefinitionManager decisionDefinitionManager = getDecisionDefinitionManager();
        List<DecisionDefinition> decisionDefinitions = decisionDefinitionManager.findDecisionDefinitionByDeploymentId(deploymentId);
        if (cascade) {
            // delete historic decision instances
            for (DecisionDefinition decisionDefinition : decisionDefinitions) {
                getHistoricDecisionInstanceManager().deleteHistoricDecisionInstancesByDecisionDefinitionId(decisionDefinition.getId());
            }
        }
        // delete decision definitions from db
        decisionDefinitionManager.deleteDecisionDefinitionsByDeploymentId(deploymentId);
        DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache();
        for (DecisionDefinition decisionDefinition : decisionDefinitions) {
            String decisionDefinitionId = decisionDefinition.getId();
            // remove decision definitions from cache:
            deploymentCache.removeDecisionDefinition(decisionDefinitionId);
        }
    }
}
Also used : DecisionDefinitionManager(org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionManager) DeploymentCache(org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition)

Example 2 with DecisionDefinitionManager

use of org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionManager 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;
}
Also used : DecisionDefinitionManager(org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionManager) DecisionDefinitionEntity(org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionEntity)

Aggregations

DecisionDefinitionManager (org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionManager)2 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1 DecisionDefinitionEntity (org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionEntity)1 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)1 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)1