protected String deployment(DeploymentBuilder deploymentBuilder, BpmnModelInstance... bpmnModelInstances) { for (int i = 0; i < bpmnModelInstances.length; i++) { BpmnModelInstance bpmnModelInstance = bpmnModelInstances[i]; deploymentBuilder.addModelInstance("testProcess-"+i+".bpmn", bpmnModelInstance); } return deploymentWithBuilder(deploymentBuilder); }
public void run() { DeploymentBuilder deploymentbuilder = engine.getRepositoryService().createDeployment(); for(int i = 0; i < modelInstances.size(); i++) { deploymentbuilder.addModelInstance("process"+i+".bpmn", modelInstances.get(i)); } deploymentbuilder.deploy(); }
protected DeploymentBuilder createDeploymentBuilder() { return repositoryService .createDeployment() .addModelInstance("testProcess.bpmn", emptyProcess); }
protected static void deployModel(ProcessEngine processEngine, String deploymentName, String resourceName, BpmnModelInstance modelInstance) { processEngine.getRepositoryService() .createDeployment() .name(deploymentName) .addModelInstance(resourceName + ".bpmn20.xml", modelInstance) .deploy(); } }
protected static void deployModel(ProcessEngine processEngine, String deploymentName, String resourceName, BpmnModelInstance modelInstance) { processEngine.getRepositoryService() .createDeployment() .name(deploymentName) .addModelInstance(resourceName + ".bpmn20.xml", modelInstance) .deploy(); } }
protected DeploymentWithDefinitions deploy(DeploymentBuilder deploymentBuilder, List<BpmnModelInstance> bpmnModelInstances, List<String> resources) { int i = 0; for (BpmnModelInstance bpmnModelInstance : bpmnModelInstances) { deploymentBuilder.addModelInstance(i + "_" + DEFAULT_BPMN_RESOURCE_NAME, bpmnModelInstance); i++; } for (String resource : resources) { deploymentBuilder.addClasspathResource(resource); } return deploy(deploymentBuilder); }
protected Deployment deploy(List<BpmnModelInstance> modelInstances) { DeploymentBuilder deploymentbuilder = processEngineConfiguration.getRepositoryService().createDeployment(); for (int i = 0; i < modelInstances.size(); i++) { deploymentbuilder.addModelInstance("process" + i + ".bpmn", modelInstances.get(i)); } return testRule.deploy(deploymentbuilder); }
protected void deployProcess(BpmnModelInstance process) { Deployment deployment = repositoryService.createDeployment() .addModelInstance("testProcess.bpmn", process) .deploy(); deploymentIds.add(deployment.getId()); }
protected ProcessInstance deployAndStartProcess(BpmnModelInstance bpmnModelInstance, Map<String, Object> variablesMap) { deploymentId = repositoryService.createDeployment() .addModelInstance("process.bpmn", bpmnModelInstance) .deploy().getId(); String processDefinitionKey = bpmnModelInstance.getDefinitions().getRootElements().iterator().next().getId(); return runtimeService.startProcessInstanceByKey(processDefinitionKey, variablesMap); }
@Test public void testDeployDmnModelInstanceNegativeHistoryTimeToLive() throws Exception { // given DmnModelInstance dmnModelInstance = createDmnModelInstanceNegativeHistoryTimeToLive(); try { testRule.deploy(repositoryService.createDeployment().addModelInstance("foo.dmn", dmnModelInstance)); fail("Exception for negative time to live value is expected."); } catch (ProcessEngineException ex) { assertTrue(ex.getCause().getMessage().contains("negative value is not allowed")); } }
@Before public void setUp() { MockitoAnnotations.initMocks(this); ProcessEngineImpl.EXT_TASK_CONDITIONS.addConsumer(condition); deploymentId = rule.getRepositoryService() .createDeployment() .addModelInstance("process.bpmn", testProcess) .deploy() .getId(); }
protected void deployAndStartProcess(BpmnModelInstance modelInstance, BpmnModelInstance testProcess) { engineRule.manageDeployment(engineRule.getRepositoryService().createDeployment() .addModelInstance("process.bpmn", modelInstance).deploy()); engineRule.manageDeployment(engineRule.getRepositoryService().createDeployment() .addModelInstance("testProcess.bpmn", testProcess).deploy()); engineRule.getRuntimeService().startProcessInstanceByKey(PROCESS_ID); }
protected void deployMixedProcess(BpmnModelInstance model, String parentId, String activityId, boolean isInterrupting) { BpmnModelInstance modelInstance = addEventSubProcess(model, parentId, TASK_AFTER_CONDITIONAL_START_EVENT, isInterrupting); modelInstance = addBoundaryEvent(modelInstance, activityId, TASK_AFTER_CONDITIONAL_BOUNDARY_EVENT, isInterrupting); engine.manageDeployment(repositoryService.createDeployment().addModelInstance(CONDITIONAL_MODEL, modelInstance).deploy()); }
@Test public void createDeploymentWithAuthenticatedTenant() { identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE)); repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess) .tenantId(TENANT_ONE).deploy(); identityService.clearAuthentication(); DeploymentQuery query = repositoryService.createDeploymentQuery(); assertThat(query.count(), is(1L)); assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L)); }
@Test public void createDeploymentDisabledTenantCheck() { processEngineConfiguration.setTenantCheckEnabled(false); identityService.setAuthentication("user", null, null); repositoryService.createDeployment().addModelInstance("emptyProcessOne", emptyProcess).tenantId(TENANT_ONE).deploy(); repositoryService.createDeployment().addModelInstance("emptyProcessTwo", startEndProcess).tenantId(TENANT_TWO).deploy(); DeploymentQuery query = repositoryService.createDeploymentQuery(); assertThat(query.count(), is(2L)); assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L)); assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L)); }
@Test public void createDeploymentForAnotherTenant() { identityService.setAuthentication("user", null, null); repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess) .tenantId(TENANT_ONE).deploy(); identityService.clearAuthentication(); DeploymentQuery query = repositoryService.createDeploymentQuery(); assertThat(query.count(), is(1L)); assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L)); }
private void deploy() { BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(PROCESS_ID) .startEvent() .serviceTask() .camundaClass(ModelExecutionContextServiceTask.class.getName()) .endEvent() .done(); deploymentId = repositoryService.createDeployment().addModelInstance("process.bpmn", modelInstance).deploy().getId(); }
public void testDeployCmmnModelInstance() throws Exception { // given CmmnModelInstance modelInstance = createCmmnModelInstance(); // when deploymentWithBuilder(repositoryService.createDeployment().addModelInstance("foo.cmmn", modelInstance)); // then assertNotNull(repositoryService.createCaseDefinitionQuery().caseDefinitionResourceName("foo.cmmn").singleResult()); }
public void testDeployBpmnModelInstance() throws Exception { // given final BpmnModelInstance modelInstance = Bpmn.createExecutableProcess("foo").startEvent().userTask().endEvent().done(); // when deploymentWithBuilder(repositoryService.createDeployment() .addModelInstance("foo.bpmn", modelInstance)); // then assertNotNull(repositoryService.createProcessDefinitionQuery().processDefinitionResourceName("foo.bpmn").singleResult()); }
@Test public void testPurge() { // given data BpmnModelInstance test = Bpmn.createExecutableProcess(PROCESS_DEF_KEY).startEvent().endEvent().done(); engineRule.getRepositoryService().createDeployment().addModelInstance(PROCESS_MODEL_NAME, test).deploy(); engineRule.getRuntimeService().startProcessInstanceByKey(PROCESS_DEF_KEY); // when purge is executed ManagementServiceImpl managementService = (ManagementServiceImpl) engineRule.getManagementService(); managementService.purge(); // then no more data exist assertAndEnsureCleanDbAndCache(engineRule.getProcessEngine(), true); }