use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache in project camunda-bpm-platform by camunda.
the class RedeploymentRegistrationTest method decisionDefinitionTestProvider.
protected static TestProvider decisionDefinitionTestProvider() {
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();
DecisionDefinitionEntity definition = deploymentCache.findDeployedDecisionDefinitionById(definitionId);
return ProcessApplicationContextUtil.getTargetProcessApplication(definition);
}
};
}
@Override
public String getLatestDefinitionIdByKey(RepositoryService repositoryService, String key) {
return repositoryService.createDecisionDefinitionQuery().decisionDefinitionKey(key).latestVersion().singleResult().getId();
}
};
}
Aggregations