org.camunda.bpm.model.bpmn.Bpmn.createExecutableProcess()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中org.camunda.bpm.model.bpmn.Bpmn.createExecutableProcess()方法的一些代码示例,展示了Bpmn.createExecutableProcess()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bpmn.createExecutableProcess()方法的具体详情如下:
包路径:org.camunda.bpm.model.bpmn.Bpmn
类名称:Bpmn
方法名:createExecutableProcess

Bpmn.createExecutableProcess介绍

暂无

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

private BpmnModelInstance prepareSimpleProcess(String name) {
 BpmnModelInstance calledA = Bpmn.createExecutableProcess(name)
   .startEvent()
   .userTask("Task" + name)
   .endEvent()
   .done();
 return calledA;
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected BpmnModelInstance createModelInstance() {
  BpmnModelInstance instance = Bpmn.createExecutableProcess("process")
    .startEvent("start")
    .userTask("userTask1")
    .endEvent("end")
    .done();
  return instance;
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected BpmnModelInstance createProcessWithUserTask(String key) {
 double random = Math.random();
 return Bpmn.createExecutableProcess(key)
  .name("name_" + key)
  .startEvent()
   .userTask(key + "_" + random + "_task1")
    .name(key + " Task 1")
  .endEvent()
  .done();
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected BpmnModelInstance createProcessWithServiceTask(String key) {
 return Bpmn.createExecutableProcess(key)
  .startEvent()
  .serviceTask()
   .camundaExpression("${true}")
  .endEvent()
 .done();
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected BpmnModelInstance createProcessWithServiceTask(String key) {
 return Bpmn.createExecutableProcess(key)
  .startEvent()
  .serviceTask()
   .camundaExpression("${true}")
  .endEvent()
 .done();
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected BpmnModelInstance createProcessWithUserTask(String key) {
 return Bpmn.createExecutableProcess(key)
   .startEvent()
   .userTask(key + "_task1")
    .name(key + " Task 1")
   .endEvent()
   .done();
}

代码示例来源:origin: camunda/camunda-bpm-platform

public static BpmnModelInstance prepareMessageEventProcess() {
 return Bpmn.createExecutableProcess(PROCESS_ID)
   .startEvent()
    .intermediateThrowEvent(FAILING_EVENT)
     .camundaAsyncBefore(true)
      .camundaFailedJobRetryTimeCycle(SCHEDULE)
      .message(MESSAGE)
     .serviceTask()
      .camundaClass(FailingDelegate.class.getName())
   .done();
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected void createBusinessKeyDeployment(String aBusinessKey) {
 BpmnModelInstance modelInstance = Bpmn.createExecutableProcess("aProcessDefinition")
  .startEvent()
   .userTask()
  .endEvent()
  .done();
 deployment(modelInstance);
 runtimeService.startProcessInstanceByKey("aProcessDefinition", aBusinessKey);
}

代码示例来源:origin: camunda/camunda-bpm-platform

private BpmnModelInstance prepareFailingBusinessRuleTask() {
 BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(PROCESS_ID)
   .startEvent()
   .businessRuleTask()
    .camundaClass(FAILING_CLASS)
    .camundaAsyncBefore()
   .endEvent()
   .done();
 return modelInstance;
}

代码示例来源:origin: camunda/camunda-bpm-platform

public static BpmnModelInstance prepareEscalationEventProcess() {
 return Bpmn.createExecutableProcess(PROCESS_ID)
   .startEvent()
    .intermediateThrowEvent(FAILING_EVENT)
     .camundaAsyncBefore(true)
     .camundaFailedJobRetryTimeCycle(SCHEDULE)
     .escalation(MESSAGE)
    .serviceTask()
     .camundaClass(FailingDelegate.class.getName())
   .endEvent()
   .done();
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Before
public void createBpmnModelInstance() {
 this.instance = Bpmn.createExecutableProcess("process1")
   .startEvent("start")
   .userTask("user1")
   .sequenceFlowId("seq")
   .userTask("user2")
   .endEvent("end")
   .done();
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected BpmnModelInstance createFailingProcess() {
 return Bpmn.createExecutableProcess("Process")
  .startEvent()
  .serviceTask("failing")
  .camundaAsyncAfter()
  .camundaAsyncBefore()
  .camundaClass(FailingDelegate.class)
  .endEvent()
  .done();
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void testPropagateTenantIdToProcessDefinition() {
 deploymentForTenant(TENANT_ID,  Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY).done());
 ProcessDefinition processDefinition = repositoryService
   .createProcessDefinitionQuery()
   .singleResult();
 assertNotNull(processDefinition);
 // inherit the tenant id from deployment
 assertEquals(TENANT_ID, processDefinition.getTenantId());
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Before
public void createBpmnModelInstance() {
 this.instance = Bpmn.createExecutableProcess("process1")
   .startEvent("start")
   .userTask("user1")
   .sequenceFlowId("seq")
   .userTask("user2")
   .userTask("user3")
   .endEvent("end")
   .done();
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected static StringAsset createScriptTaskProcess(String scriptFormat, String scriptText) {
 BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(PROCESS_ID)
  .startEvent()
  .scriptTask()
   .scriptFormat(scriptFormat)
   .scriptText(scriptText)
   .userTask()
  .endEvent()
  .done();
 return new StringAsset(Bpmn.convertToString(modelInstance));
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected static StringAsset createScriptTaskProcess(String scriptFormat, String scriptText, String pdk) {
 BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(pdk)
  .startEvent()
  .scriptTask()
   .scriptFormat(scriptFormat)
   .scriptText(scriptText)
   .userTask()
  .endEvent()
  .done();
 return new StringAsset(Bpmn.convertToString(modelInstance));
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void setsTenantId() {
 String tenantId = TENANT_ID;
 StaticTenantIdTestProvider tenantIdProvider = new StaticTenantIdTestProvider(tenantId);
 TestTenantIdProvider.delegate = tenantIdProvider;
 testRule.deploy(Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY).startEvent().userTask().done());
 // if a process instance is started
 engineRule.getRuntimeService().startProcessInstanceByKey(PROCESS_DEFINITION_KEY);
 // then the tenant id provider can set the tenant id to a value
 ProcessInstance processInstance = engineRule.getRuntimeService().createProcessInstanceQuery().singleResult();
 assertThat(processInstance.getTenantId(), is(tenantId));
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected void assertStartProcessInstance() {
 deployModel(Bpmn.createExecutableProcess(CALLED_PROCESS_DEF_ID)
  .startEvent()
  .userTask(TASK_DEF_KEY)
  .endEvent()
 .done());
 // if
 runtimeService.startProcessInstanceByKey(PROCESS_DEF_KEY);
 // then
 // the started process instance is still active and waiting at the user task
 assertEquals(1, taskService.createTaskQuery().taskDefinitionKey(TASK_DEF_KEY).count());
}

代码示例来源:origin: camunda/camunda-bpm-platform

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());
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void testDefaultDeploymentSource() {
 String key = "process";
 BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
 DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
 Deployment deployment = repositoryService
   .createDeployment(processApplication.getReference())
   .name("first-deployment-with-a-source")
   .addModelInstance("process.bpmn", model)
   .deploy();
 assertEquals(ProcessApplicationDeployment.PROCESS_APPLICATION_DEPLOYMENT_SOURCE, deploymentQuery.deploymentName("first-deployment-with-a-source").singleResult().getSource());
 deleteDeployments(deployment);
}

相关文章