use of org.camunda.bpm.engine.RepositoryService in project camunda-bpm-platform by camunda.
the class DeploymentResourceImpl method deleteDeployment.
@Override
public void deleteDeployment(String deploymentId, UriInfo uriInfo) {
RepositoryService repositoryService = getProcessEngine().getRepositoryService();
Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
if (deployment == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Deployment with id '" + deploymentId + "' do not exist");
}
boolean cascade = isQueryPropertyEnabled(uriInfo, CASCADE);
boolean skipCustomListeners = isQueryPropertyEnabled(uriInfo, "skipCustomListeners");
boolean skipIoMappings = isQueryPropertyEnabled(uriInfo, "skipIoMappings");
repositoryService.deleteDeployment(deploymentId, cascade, skipCustomListeners, skipIoMappings);
}
use of org.camunda.bpm.engine.RepositoryService in project camunda-bpm-platform by camunda.
the class DeploymentResourceImpl method getDeployment.
public DeploymentDto getDeployment() {
RepositoryService repositoryService = getProcessEngine().getRepositoryService();
Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
if (deployment == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Deployment with id '" + deploymentId + "' does not exist");
}
return DeploymentDto.fromDeployment(deployment);
}
use of org.camunda.bpm.engine.RepositoryService in project camunda-bpm-platform by camunda.
the class DeployCmd method scheduleProcessDefinitionActivation.
protected void scheduleProcessDefinitionActivation(CommandContext commandContext, DeploymentEntity deployment) {
if (deploymentBuilder.getProcessDefinitionsActivationDate() != null) {
RepositoryService repositoryService = commandContext.getProcessEngineConfiguration().getRepositoryService();
for (ProcessDefinition processDefinition : deployment.getDeployedProcessDefinitions()) {
// If activation date is set, we first suspend all the process definition
repositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionId(processDefinition.getId()).suspend();
// And we schedule an activation at the provided date
repositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionId(processDefinition.getId()).executionDate(deploymentBuilder.getProcessDefinitionsActivationDate()).activate();
}
}
}
use of org.camunda.bpm.engine.RepositoryService in project camunda-bpm-platform by camunda.
the class CmmnDeployerTest method testCmmnDeployment.
public void testCmmnDeployment() {
String deploymentId = processEngine.getRepositoryService().createDeployment().addClasspathResource("org/camunda/bpm/engine/test/cmmn/deployment/CmmnDeploymentTest.testSimpleDeployment.cmmn").deploy().getId();
// there should be one deployment
RepositoryService repositoryService = processEngine.getRepositoryService();
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
assertEquals(1, deploymentQuery.count());
// there should be one case definition
CaseDefinitionQuery query = processEngine.getRepositoryService().createCaseDefinitionQuery();
assertEquals(1, query.count());
CaseDefinition caseDefinition = query.singleResult();
assertEquals("Case_1", caseDefinition.getKey());
processEngine.getRepositoryService().deleteDeployment(deploymentId);
}
use of org.camunda.bpm.engine.RepositoryService in project camunda-bpm-platform by camunda.
the class CmmnDeployerTest method verifyCmmnResourceDeployed.
protected void verifyCmmnResourceDeployed(String resourcePath) {
String deploymentId = processEngine.getRepositoryService().createDeployment().addClasspathResource(resourcePath).deploy().getId();
// there should be one deployment
RepositoryService repositoryService = processEngine.getRepositoryService();
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
assertEquals(1, deploymentQuery.count());
// there should be one case definition
CaseDefinitionQuery query = processEngine.getRepositoryService().createCaseDefinitionQuery();
assertEquals(1, query.count());
CaseDefinition caseDefinition = query.singleResult();
assertEquals("Case_1", caseDefinition.getKey());
processEngine.getRepositoryService().deleteDeployment(deploymentId);
}
Aggregations