use of org.camunda.bpm.engine.repository.Deployment 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.repository.Deployment 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.repository.Deployment in project camunda-bpm-platform by camunda.
the class SpringProcessApplicationTest method testPostDeployRegistrationPa.
@Test
public void testPostDeployRegistrationPa() {
// this test verifies that a process application is able to register a deployment from the @PostDeploy callback:
AbstractApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/camunda/bpm/engine/spring/test/application/PostDeployRegistrationPaTest-context.xml");
applicationContext.start();
ProcessEngine processEngine = BpmPlatform.getDefaultProcessEngine();
// create a manual deployment:
Deployment deployment = processEngine.getRepositoryService().createDeployment().addClasspathResource("org/camunda/bpm/engine/spring/test/application/process.bpmn20.xml").deploy();
// lookup the process application spring bean:
PostDeployRegistrationPa processApplication = applicationContext.getBean("customProcessApplicaiton", PostDeployRegistrationPa.class);
Assert.assertFalse(processApplication.isPostDeployInvoked());
processApplication.deploy();
Assert.assertTrue(processApplication.isPostDeployInvoked());
// the process application was not invoked
Assert.assertFalse(processApplication.isInvoked());
// start process instance:
processEngine.getRuntimeService().startProcessInstanceByKey("startToEnd");
// now the process application was invoked:
Assert.assertTrue(processApplication.isInvoked());
// undeploy PA
Assert.assertFalse(processApplication.isPreUndeployInvoked());
processApplication.undeploy();
Assert.assertTrue(processApplication.isPreUndeployInvoked());
// manually undeploy the process
processEngine.getRepositoryService().deleteDeployment(deployment.getId(), true);
applicationContext.close();
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationInTransactionTest method deployModelInstance.
private void deployModelInstance(BpmnModelInstance modelInstance) {
DeploymentBuilder deploymentbuilder = repositoryService.createDeployment();
deploymentbuilder.addModelInstance("process0.bpmn", modelInstance);
Deployment deployment = deploymentbuilder.deploy();
rule.manageDeployment(deployment);
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class RegisterDeploymentCmd method execute.
public Void execute(CommandContext commandContext) {
Deployment deployment = commandContext.getDeploymentManager().findDeploymentById(deploymentId);
ensureNotNull("Deployment " + deploymentId + " does not exist", "deployment", deployment);
commandContext.getAuthorizationManager().checkCamundaAdmin();
Context.getProcessEngineConfiguration().getRegisteredDeployments().add(deploymentId);
return null;
}
Aggregations