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(); } }
public void testInvalidSubProcessWithSignalStartEvent() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testInvalidSubProcessWithSignalStartEvent"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Exception expected: Process definition could be parsed, although the sub process contains a signal start event."); } catch (ProcessEngineException e) { assertTextPresent("signalEventDefintion only allowed on start event if subprocess is an event subprocess", e.getMessage()); } }
public void testInvalidSubProcessWithErrorStartEvent() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testInvalidSubProcessWithErrorStartEvent"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Exception expected: Process definition could be parsed, although the sub process contains a error start event."); } catch (ProcessEngineException e) { assertTextPresent("errorEventDefinition only allowed on start event if subprocess is an event subprocess", e.getMessage()); } }
public void testInvalidSubProcessWithEscalationStartEvent() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testInvalidSubProcessWithEscalationStartEvent"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Exception expected: Process definition could be parsed, although the sub process contains a escalation start event."); } catch (ProcessEngineException e) { assertTextPresent("escalationEventDefinition is not allowed on start event within a subprocess", e.getMessage()); } }
public void testInvalidSubProcessWithCompensationStartEvent() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testInvalidSubProcessWithCompensationStartEvent"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Exception expected: Process definition could be parsed, although the sub process contains a compensation start event."); } catch (ProcessEngineException e) { assertTextPresent("compensateEventDefinition is not allowed on start event within a subprocess", e.getMessage()); } }
public void parseInvalidConditionalEvent(String processDefinitionResource) { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), processDefinitionResource); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Exception expected: Process definition could be parsed, conditional event definition contains no condition."); } catch (ProcessEngineException e) { assertTextPresent("Conditional event must contain an expression for evaluation.", e.getMessage()); } }
public void testParseProcessDefinitionNegativTtl() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testParseProcessDefinitionNegativeTtl"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Exception expected: Process definition historyTimeToLive value can not be parsed."); } catch (ProcessEngineException e) { assertTextPresent("Cannot parse historyTimeToLive", e.getMessage()); } }
public void testInvalidTransactionWithConditionalStartEvent() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testInvalidTransactionWithConditionalStartEvent"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Exception expected: Process definition could be parsed, although the sub process contains a conditional start event."); } catch (ProcessEngineException e) { assertTextPresent("conditionalEventDefinition is not allowed on start event within a subprocess", e.getMessage()); } }
public void testInvalidTransactionWithErrorStartEvent() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testInvalidTransactionWithErrorStartEvent"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Exception expected: Process definition could be parsed, although the sub process contains a error start event."); } catch (ProcessEngineException e) { assertTextPresent("errorEventDefinition only allowed on start event if subprocess is an event subprocess", e.getMessage()); } }
public void testInvalidTransactionWithCompensationStartEvent() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testInvalidTransactionWithCompensationStartEvent"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Exception expected: Process definition could be parsed, although the sub process contains a compensation start event."); } catch (ProcessEngineException e) { assertTextPresent("compensateEventDefinition is not allowed on start event within a subprocess", e.getMessage()); } }
public void testExpressionParsingErrors() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testExpressionParsingErrors"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Exception expected: Process definition could not be parsed, the expression contains an escalation start event."); } catch (ProcessEngineException e) { assertTextPresent("Error parsing '${currentUser()': syntax error at position 15, encountered 'null', expected '}'", e.getMessage()); } }
public void testInvalidAsyncAfterEventBasedGateway() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testInvalidAsyncAfterEventBasedGateway"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail(); } catch (ProcessEngineException e) { // fail on asyncAfter assertTextPresent("'asyncAfter' not supported for", e.getMessage()); } }
public void testEmptyCamundaInSourceThrowsError() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testEmptyCamundaInSourceThrowsError"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Process camunda:in extension element should contain source!"); } catch (ProcessEngineException e) { assertTextPresent("Empty attribute 'source' when passing variables", e.getMessage()); } }
public void testNoCamundaInTargetThrowsError() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testNoCamundaInTargetThrowsError"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail("Process camunda:in extension element should contain target!"); } catch (ProcessEngineException e) { assertTextPresent("Missing attribute 'target' when attribute 'source' or 'sourceExpression' is set", e.getMessage()); } }
@Override protected void setUp() throws Exception { deploymentThreeId = repositoryService.createDeployment().name("thirdDeployment").addClasspathResource(getResourceThreePath()).deploy().getId(); super.setUp(); }
public void testEmptyCamundaOutSourceWithoutValidation() { try { processEngineConfiguration.setDisableStrictCallActivityValidation(true); String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testEmptyCamundaOutSourceThrowsError"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); } finally { processEngineConfiguration.setDisableStrictCallActivityValidation(false); repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true); } }
@Test public void duplicateIdInDeployment() { String resourceName1 = "org/camunda/bpm/engine/test/dmn/deployment/DecisionDefinitionDeployerTest.testDuplicateIdInDeployment.dmn11.xml"; String resourceName2 = "org/camunda/bpm/engine/test/dmn/deployment/DecisionDefinitionDeployerTest.testDuplicateIdInDeployment2.dmn11.xml"; thrown.expect(ProcessEngineException.class); thrown.expectMessage("duplicateDecision"); repositoryService.createDeployment() .addClasspathResource(resourceName1) .addClasspathResource(resourceName2) .name("duplicateIds") .deploy(); }
public void testEmptyCamundaInTargetWithoutValidation() { try { processEngineConfiguration.setDisableStrictCallActivityValidation(true); String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testEmptyCamundaInTargetThrowsError"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); } finally { processEngineConfiguration.setDisableStrictCallActivityValidation(false); repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true); } }
public void testInvalidProcessDefinition() { try { String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testInvalidProcessDefinition"); repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy(); fail(); } catch (ProcessEngineException e) { assertTextPresent("cvc-complex-type.3.2.2:", e.getMessage()); assertTextPresent("invalidAttribute", e.getMessage()); assertTextPresent("process", e.getMessage()); } }