本文整理了Java中org.camunda.bpm.engine.RepositoryService.createDeployment
方法的一些代码示例,展示了RepositoryService.createDeployment
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RepositoryService.createDeployment
方法的具体详情如下:
包路径:org.camunda.bpm.engine.RepositoryService
类名称:RepositoryService
方法名:createDeployment
[英]Starts creating a new deployment
[中]开始创建新部署
代码示例来源:origin: camunda/camunda-bpm-platform
public void run() {
try {
FileInputStream fis = new FileInputStream(new File(filename));
processEngine.getRepositoryService()
.createDeployment()
.addInputStream(filename, fis)
.deploy();
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
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);
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
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();
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testParseSwitchedSourceAndTargetRefsForAssociations() {
repositoryService.createDeployment()
.addClasspathResource("org/camunda/bpm/engine/test/bpmn/parse/BpmnParseTest.testParseSwitchedSourceAndTargetRefsForAssociations.bpmn20.xml").deploy();
assertEquals(1, repositoryService.createProcessDefinitionQuery().count());
repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true);
}
代码示例来源:origin: camunda/camunda-bpm-platform
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);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@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));
}
代码示例来源:origin: camunda/camunda-bpm-platform
protected void deployProcess(BpmnModelInstance process) {
Deployment deployment = repositoryService.createDeployment()
.addModelInstance("testProcess.bpmn", process)
.deploy();
deploymentIds.add(deployment.getId());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testDuplicateAssigneeDeclaration() {
try {
String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testDuplicateAssigneeDeclaration");
repositoryService.createDeployment().addClasspathResource(resource).deploy();
fail("Invalid BPMN 2.0 process should not parse, but it gets parsed sucessfully");
} catch (ProcessEngineException e) {
// Exception is to be expected
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testIllegalUseOfResultVariableName() {
try {
repositoryService.createDeployment().addClasspathResource("org/camunda/bpm/engine/test/bpmn/servicetask/JavaServiceTaskTest.testIllegalUseOfResultVariableName.bpmn20.xml").deploy();
fail();
} catch (ProcessEngineException e) {
assertTrue(e.getMessage().contains("resultVariable"));
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
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());
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
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());
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
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());
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
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());
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
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());
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
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());
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
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());
}
代码示例来源:origin: camunda/camunda-bpm-platform
@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();
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Before
public void setup() {
repositoryService = activitiRule.getRepositoryService();
deploymentId = repositoryService.createDeployment()
.addClasspathResource("org/camunda/bpm/engine/test/api/repository/diagram/" + xmlFileName)
.addClasspathResource("org/camunda/bpm/engine/test/api/repository/diagram/" + imageFileName)
.deploy()
.getId();
processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
}
代码示例来源:origin: camunda/camunda-bpm-platform
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());
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testTimerStartEventPriorityOnActivity() {
// given a timer start job
org.camunda.bpm.engine.repository.Deployment deployment = repositoryService
.createDeployment()
.addClasspathResource("org/camunda/bpm/engine/test/bpmn/job/JobPrioritizationBpmnConstantValueTest.testTimerStartEventPriorityOnActivity.bpmn20.xml")
.deploy();
Job job = managementService.createJobQuery().singleResult();
// then the timer start job has the priority defined in the process definition
assertEquals(1515, job.getPriority());
// cleanup
repositoryService.deleteDeployment(deployment.getId(), true);
}
内容来源于网络,如有侵权,请联系作者删除!