Search in sources :

Example 6 with DecisionRequirementsDefinitionEntity

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

the class RedeploymentRegistrationTest method decisionRequirementsDefinitionTestProvider.

protected static TestProvider decisionRequirementsDefinitionTestProvider() {
    return new TestProvider() {

        @Override
        public Command<ProcessApplicationReference> createGetProcessApplicationCommand(final String definitionId) {
            return new Command<ProcessApplicationReference>() {

                public ProcessApplicationReference execute(CommandContext commandContext) {
                    ProcessEngineConfigurationImpl configuration = commandContext.getProcessEngineConfiguration();
                    DeploymentCache deploymentCache = configuration.getDeploymentCache();
                    DecisionRequirementsDefinitionEntity definition = deploymentCache.findDeployedDecisionRequirementsDefinitionById(definitionId);
                    return ProcessApplicationContextUtil.getTargetProcessApplication(definition);
                }
            };
        }

        @Override
        public String getLatestDefinitionIdByKey(RepositoryService repositoryService, String key) {
            return repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(key).latestVersion().singleResult().getId();
        }
    };
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext) Command(org.camunda.bpm.engine.impl.interceptor.Command) DeploymentCache(org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) DecisionRequirementsDefinitionEntity(org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionRequirementsDefinitionEntity) RepositoryService(org.camunda.bpm.engine.RepositoryService)

Aggregations

DecisionRequirementsDefinitionEntity (org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionRequirementsDefinitionEntity)6 ArrayList (java.util.ArrayList)2 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)1 DmnDecision (org.camunda.bpm.dmn.engine.DmnDecision)1 RepositoryService (org.camunda.bpm.engine.RepositoryService)1 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1 DecisionDefinitionEntity (org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionEntity)1 Command (org.camunda.bpm.engine.impl.interceptor.Command)1 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)1