use of org.camunda.bpm.engine.repository.DeploymentWithDefinitions in project camunda-bpm-platform by camunda.
the class ProcessEngineTestRule method deploy.
public DeploymentWithDefinitions deploy(DeploymentBuilder deploymentBuilder) {
DeploymentWithDefinitions deployment = deploymentBuilder.deployWithResult();
processEngineRule.manageDeployment(deployment);
return deployment;
}
use of org.camunda.bpm.engine.repository.DeploymentWithDefinitions in project camunda-bpm-platform by camunda.
the class DeploymentResourceImpl method redeploy.
public DeploymentDto redeploy(UriInfo uriInfo, RedeploymentDto redeployment) {
DeploymentWithDefinitions deployment = null;
try {
deployment = tryToRedeploy(redeployment);
} catch (NotFoundException e) {
throw createInvalidRequestException("redeploy", Status.NOT_FOUND, e);
} catch (NotValidException e) {
throw createInvalidRequestException("redeploy", Status.BAD_REQUEST, e);
}
DeploymentWithDefinitionsDto deploymentDto = DeploymentWithDefinitionsDto.fromDeployment(deployment);
URI uri = uriInfo.getBaseUriBuilder().path(relativeRootResourcePath).path(DeploymentRestService.PATH).path(deployment.getId()).build();
// GET /
deploymentDto.addReflexiveLink(uri, HttpMethod.GET, "self");
return deploymentDto;
}
use of org.camunda.bpm.engine.repository.DeploymentWithDefinitions in project camunda-bpm-platform by camunda.
the class DeploymentTest method shouldDeleteDeployment.
@Test
public void shouldDeleteDeployment() {
BpmnModelInstance instance = Bpmn.createExecutableProcess("process").startEvent().endEvent().done();
DeploymentWithDefinitions deployment = engineRule.getRepositoryService().createDeployment().addModelInstance("foo.bpmn", instance).deployWithResult();
engineRule.getRepositoryService().deleteDeployment(deployment.getId(), true);
long count = engineRule.getRepositoryService().createDeploymentQuery().count();
assertEquals(0, count);
}
use of org.camunda.bpm.engine.repository.DeploymentWithDefinitions in project camunda-bpm-platform by camunda.
the class ModificationExecutionSyncTest method createModificationWithNotMatchingProcessDefinitionId.
@Test
public void createModificationWithNotMatchingProcessDefinitionId() {
DeploymentWithDefinitions deployment = testRule.deploy(instance);
deployment.getDeployedProcessDefinitions().get(0);
List<String> processInstanceIds = helper.startInstances("process1", 2);
try {
runtimeService.createModification("foo").cancelAllForActivity("activityId").processInstanceIds(processInstanceIds).execute();
fail("Should not succed");
} catch (ProcessEngineException e) {
assertThat(e.getMessage(), containsString("processDefinition is null"));
}
}
use of org.camunda.bpm.engine.repository.DeploymentWithDefinitions in project camunda-bpm-platform by camunda.
the class ModificationExecutionSyncTest method testStartAfter.
@Test
public void testStartAfter() {
DeploymentWithDefinitions deployment = testRule.deploy(instance);
ProcessDefinition definition = deployment.getDeployedProcessDefinitions().get(0);
List<String> processInstanceIds = helper.startInstances("process1", 2);
runtimeService.createModification(definition.getId()).startAfterActivity("user2").processInstanceIds(processInstanceIds).execute();
for (String processInstanceId : processInstanceIds) {
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(definition.getId()).activity("user1").activity("user3").done());
}
}
Aggregations