当前位置: 首页>>代码示例>>Java>>正文


Java CamundaExecutionListener.setCamundaClass方法代码示例

本文整理汇总了Java中org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener.setCamundaClass方法的典型用法代码示例。如果您正苦于以下问题:Java CamundaExecutionListener.setCamundaClass方法的具体用法?Java CamundaExecutionListener.setCamundaClass怎么用?Java CamundaExecutionListener.setCamundaClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener的用法示例。


在下文中一共展示了CamundaExecutionListener.setCamundaClass方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testExecutionListenerExtension

import org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener; //导入方法依赖的package包/类
@Test
public void testExecutionListenerExtension() {
  CamundaExecutionListener processListener = process.getExtensionElements().getElementsQuery().filterByType(CamundaExecutionListener.class).singleResult();
  CamundaExecutionListener startEventListener = startEvent.getExtensionElements().getElementsQuery().filterByType(CamundaExecutionListener.class).singleResult();
  CamundaExecutionListener serviceTaskListener = serviceTask.getExtensionElements().getElementsQuery().filterByType(CamundaExecutionListener.class).singleResult();
  assertThat(processListener.getCamundaClass()).isEqualTo(TEST_CLASS_XML);
  assertThat(processListener.getCamundaEvent()).isEqualTo(TEST_EXECUTION_EVENT_XML);
  assertThat(startEventListener.getCamundaExpression()).isEqualTo(TEST_EXPRESSION_XML);
  assertThat(startEventListener.getCamundaEvent()).isEqualTo(TEST_EXECUTION_EVENT_XML);
  assertThat(serviceTaskListener.getCamundaDelegateExpression()).isEqualTo(TEST_DELEGATE_EXPRESSION_XML);
  assertThat(serviceTaskListener.getCamundaEvent()).isEqualTo(TEST_EXECUTION_EVENT_XML);
  processListener.setCamundaClass(TEST_CLASS_API);
  processListener.setCamundaEvent(TEST_EXECUTION_EVENT_API);
  startEventListener.setCamundaExpression(TEST_EXPRESSION_API);
  startEventListener.setCamundaEvent(TEST_EXECUTION_EVENT_API);
  serviceTaskListener.setCamundaDelegateExpression(TEST_DELEGATE_EXPRESSION_API);
  serviceTaskListener.setCamundaEvent(TEST_EXECUTION_EVENT_API);
  assertThat(processListener.getCamundaClass()).isEqualTo(TEST_CLASS_API);
  assertThat(processListener.getCamundaEvent()).isEqualTo(TEST_EXECUTION_EVENT_API);
  assertThat(startEventListener.getCamundaExpression()).isEqualTo(TEST_EXPRESSION_API);
  assertThat(startEventListener.getCamundaEvent()).isEqualTo(TEST_EXECUTION_EVENT_API);
  assertThat(serviceTaskListener.getCamundaDelegateExpression()).isEqualTo(TEST_DELEGATE_EXPRESSION_API);
  assertThat(serviceTaskListener.getCamundaEvent()).isEqualTo(TEST_EXECUTION_EVENT_API);
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:25,代码来源:CamundaExtensionsTest.java

示例2: testSetLocalScopeWithExecutionListenerTake

import org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener; //导入方法依赖的package包/类
@Test
public void testSetLocalScopeWithExecutionListenerTake() {
  BpmnModelInstance modelInstance = Bpmn.createExecutableProcess("process")
    .startEvent().id("activityId")
    .sequenceFlowId("sequenceFlow")
    .endEvent()
    .done();

  CamundaExecutionListener listener = modelInstance.newInstance(CamundaExecutionListener.class);
  listener.setCamundaEvent(ExecutionListener.EVENTNAME_TAKE);
  listener.setCamundaClass(ExecutionListener.class.getName());
  modelInstance.<SequenceFlow>getModelElementById("sequenceFlow").builder().addExtensionElement(listener);

  testHelper.deploy(modelInstance);
  engineRule.getRuntimeService().startProcessInstanceByKey("process");
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:TargetVariableScopeTest.java

示例3: camundaExecutionListenerClass

import org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener; //导入方法依赖的package包/类
public B camundaExecutionListenerClass(String eventName, String fullQualifiedClassName) {
  CamundaExecutionListener executionListener = createInstance(CamundaExecutionListener.class);
  executionListener.setCamundaEvent(eventName);
  executionListener.setCamundaClass(fullQualifiedClassName);

  addExtensionElement(executionListener);

  return myself;
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:10,代码来源:AbstractFlowNodeBuilder.java

示例4: createModelAccessTask

import org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener; //导入方法依赖的package包/类
protected Task createModelAccessTask(BpmnModelInstance modelInstance, Class<?> delegateClass) {
  ManualTask task = modelInstance.newInstance(ManualTask.class);
  task.setId("manualTask");
  CamundaExecutionListener executionListener = modelInstance.newInstance(CamundaExecutionListener.class);
  executionListener.setCamundaEvent(ExecutionListener.EVENTNAME_START);
  executionListener.setCamundaClass(delegateClass.getName());
  task.builder().addExtensionElement(executionListener);
  return task;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:10,代码来源:ListenerProcessEngineServicesAccessTest.java

示例5: testSetVariableInTakeListener

import org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener; //导入方法依赖的package包/类
@Test
public void testSetVariableInTakeListener() {
  BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(CONDITIONAL_EVENT_PROCESS_KEY)
    .startEvent()
    .userTask(TASK_BEFORE_CONDITION_ID)
    .name(TASK_BEFORE_CONDITION)
    .sequenceFlowId(FLOW_ID)
    .userTask(TASK_WITH_CONDITION_ID)
    .endEvent()
    .done();
  CamundaExecutionListener listener = modelInstance.newInstance(CamundaExecutionListener.class);
  listener.setCamundaEvent(ExecutionListener.EVENTNAME_TAKE);
  listener.setCamundaClass(specifier.getDelegateClass().getName());
  modelInstance.<SequenceFlow>getModelElementById(FLOW_ID).builder().addExtensionElement(listener);
  deployConditionalEventSubProcess(modelInstance, CONDITIONAL_EVENT_PROCESS_KEY, specifier.getCondition(), true);

  // given
  ProcessInstance procInst = runtimeService.startProcessInstanceByKey(CONDITIONAL_EVENT_PROCESS_KEY);

  TaskQuery taskQuery = taskService.createTaskQuery().processInstanceId(procInst.getId());
  Task task = taskQuery.singleResult();
  assertNotNull(task);
  assertEquals(TASK_BEFORE_CONDITION, task.getName());

  //when task is completed
  taskService.complete(task.getId());

  //then take listener sets variable
  //conditional event is triggered
  tasksAfterVariableIsSet = taskQuery.list();
  assertEquals(specifier.getExpectedInterruptingCount(), taskQuery.taskName(TASK_AFTER_CONDITION).count());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:33,代码来源:TriggerConditionalEventFromDelegationCodeTest.java

示例6: testNonInterruptingSetVariableInTakeListener

import org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener; //导入方法依赖的package包/类
@Test
public void testNonInterruptingSetVariableInTakeListener() {
  BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(CONDITIONAL_EVENT_PROCESS_KEY)
    .startEvent()
    .userTask(TASK_BEFORE_CONDITION_ID)
    .name(TASK_BEFORE_CONDITION)
    .sequenceFlowId(FLOW_ID)
    .userTask(TASK_WITH_CONDITION_ID)
    .endEvent()
    .done();
  CamundaExecutionListener listener = modelInstance.newInstance(CamundaExecutionListener.class);
  listener.setCamundaEvent(ExecutionListener.EVENTNAME_TAKE);
  listener.setCamundaClass(specifier.getDelegateClass().getName());
  modelInstance.<SequenceFlow>getModelElementById(FLOW_ID).builder().addExtensionElement(listener);
  deployConditionalEventSubProcess(modelInstance, CONDITIONAL_EVENT_PROCESS_KEY, specifier.getCondition(), false);

  // given
  ProcessInstance procInst = runtimeService.startProcessInstanceByKey(CONDITIONAL_EVENT_PROCESS_KEY);

  TaskQuery taskQuery = taskService.createTaskQuery().processInstanceId(procInst.getId());
  Task task = taskQuery.singleResult();
  assertNotNull(task);
  assertEquals(TASK_BEFORE_CONDITION, task.getName());

  //when task is completed
  taskService.complete(task.getId());

  //then take listener sets variable
  //non interrupting boundary event is triggered
  tasksAfterVariableIsSet = taskQuery.list();
  assertEquals(1 + specifier.getExpectedNonInterruptingCount(), tasksAfterVariableIsSet.size());
  assertEquals(specifier.getExpectedNonInterruptingCount(), taskQuery.taskName(TASK_AFTER_CONDITION).count());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:34,代码来源:TriggerConditionalEventFromDelegationCodeTest.java

示例7: testSetVariableInTakeListenerWithAsyncBefore

import org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener; //导入方法依赖的package包/类
@Test
public void testSetVariableInTakeListenerWithAsyncBefore() {
  BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(CONDITIONAL_EVENT_PROCESS_KEY)
    .startEvent()
    .userTask(TASK_BEFORE_CONDITION_ID)
    .name(TASK_BEFORE_CONDITION)
    .sequenceFlowId(FLOW_ID)
    .userTask(TASK_WITH_CONDITION_ID).camundaAsyncBefore()
    .endEvent()
    .done();
  CamundaExecutionListener listener = modelInstance.newInstance(CamundaExecutionListener.class);
  listener.setCamundaEvent(ExecutionListener.EVENTNAME_TAKE);
  listener.setCamundaClass(specifier.getDelegateClass().getName());
  modelInstance.<SequenceFlow>getModelElementById(FLOW_ID).builder().addExtensionElement(listener);
  deployConditionalEventSubProcess(modelInstance, CONDITIONAL_EVENT_PROCESS_KEY, specifier.getCondition(), true);

  // given
  ProcessInstance procInst = runtimeService.startProcessInstanceByKey(CONDITIONAL_EVENT_PROCESS_KEY);

  TaskQuery taskQuery = taskService.createTaskQuery().processInstanceId(procInst.getId());
  Task task = taskQuery.singleResult();
  assertNotNull(task);
  assertEquals(TASK_BEFORE_CONDITION, task.getName());

  //when task is completed
  taskService.complete(task.getId());

  //then take listener sets variable
  //conditional event is triggered
  tasksAfterVariableIsSet = taskQuery.list();
  assertEquals(specifier.getExpectedInterruptingCount(), taskQuery.taskName(TASK_AFTER_CONDITION).count());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:33,代码来源:TriggerConditionalEventFromDelegationCodeTest.java

示例8: testNonInterruptingSetVariableInTakeListenerWithAsyncBefore

import org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener; //导入方法依赖的package包/类
@Test
public void testNonInterruptingSetVariableInTakeListenerWithAsyncBefore() {
  BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(CONDITIONAL_EVENT_PROCESS_KEY)
    .startEvent()
    .userTask(TASK_BEFORE_CONDITION_ID)
    .name(TASK_BEFORE_CONDITION)
    .sequenceFlowId(FLOW_ID)
    .userTask(TASK_WITH_CONDITION_ID).camundaAsyncBefore()
    .endEvent()
    .done();
  CamundaExecutionListener listener = modelInstance.newInstance(CamundaExecutionListener.class);
  listener.setCamundaEvent(ExecutionListener.EVENTNAME_TAKE);
  listener.setCamundaClass(specifier.getDelegateClass().getName());
  modelInstance.<SequenceFlow>getModelElementById(FLOW_ID).builder().addExtensionElement(listener);
  deployConditionalEventSubProcess(modelInstance, CONDITIONAL_EVENT_PROCESS_KEY, specifier.getCondition(), false);

  // given
  ProcessInstance procInst = runtimeService.startProcessInstanceByKey(CONDITIONAL_EVENT_PROCESS_KEY);

  TaskQuery taskQuery = taskService.createTaskQuery().processInstanceId(procInst.getId());

  //when task is completed
  taskService.complete(taskQuery.singleResult().getId());

  //then take listener sets variable
  //non interrupting boundary event is triggered
  assertEquals(specifier.getExpectedNonInterruptingCount(),  taskService.createTaskQuery().taskName(TASK_AFTER_CONDITION).count());

  //and job was created
  Job job = engine.getManagementService().createJobQuery().singleResult();
  assertNotNull(job);


  //when job is executed task is created
  engine.getManagementService().executeJob(job.getId());
  //when all tasks are completed
  assertEquals(specifier.getExpectedNonInterruptingCount() + 1, taskQuery.count());
  for (Task task : taskQuery.list()) {
    taskService.complete(task.getId());
  }

  //then no task exist and process instance is ended
  tasksAfterVariableIsSet = taskQuery.list();
  assertEquals(0, tasksAfterVariableIsSet.size());
  assertNull(runtimeService.createProcessInstanceQuery().singleResult());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:47,代码来源:TriggerConditionalEventFromDelegationCodeTest.java


注:本文中的org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener.setCamundaClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。