org.camunda.bpm.engine.task.Task.getName()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(152)

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

Task.getName介绍

[英]Name or title of the task.
[中]

代码示例

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

@Override
 public String getProperty(Task obj) {
  return obj.getName();
 }
});

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

public List<String> getTaskNamesFromTasks(List<Task> tasks) {
 List<String> names = new ArrayList<String>();
 for (Task task : tasks) {
  names.add(task.getName());
 }
 return names;
}

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

public static void assertTaskNames(List<Task> actualTasks, String ... expectedTaskNames ) {
 List<String> expectedNames = new ArrayList<String>(Arrays.asList(expectedTaskNames));
 for (Task task : actualTasks) {
  String actualTaskName = task.getName();
  if (expectedNames.contains(actualTaskName)) {
   expectedNames.remove(actualTaskName);
  }
 }
 assertTrue(expectedNames.isEmpty());
}

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

@Deployment(resources = "org/camunda/bpm/engine/test/bpmn/iomapping/InputOutputTest.testThrowErrorInScriptInputOutputMapping.bpmn")
public void FAILING_testBpmnErrorInScriptOutputMapping() {
 Map<String, Object> variables = new HashMap<String, Object>();
 variables.put("throwInMapping", "out");
 variables.put("exception", new BpmnError("error"));
 runtimeService.startProcessInstanceByKey("testProcess", variables);
 //we will only reach the user task if the BPMNError from the script was handled by the boundary event
 Task task = taskService.createTaskQuery().singleResult();
 assertThat(task.getName(), is("User Task"));
}

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

@Deployment
public void testAssigneeExtension() {
 runtimeService.startProcessInstanceByKey("assigneeExtension");
 List<Task> tasks = taskService
  .createTaskQuery()
  .taskAssignee("kermit")
  .list();
 assertEquals(1, tasks.size());
 assertEquals("my task", tasks.get(0).getName());
}

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

@Deployment
public void testTimerOnNestingOfSubprocesses() {
 runtimeService.startProcessInstanceByKey("timerOnNestedSubprocesses");
 List<Task> tasks = taskService.createTaskQuery().orderByTaskName().asc().list();
 assertEquals(2, tasks.size());
 assertEquals("Inner subprocess task 1", tasks.get(0).getName());
 assertEquals("Inner subprocess task 2", tasks.get(1).getName());
 Job timer = managementService.createJobQuery().timers().singleResult();
 managementService.executeJob(timer.getId());
 Task task = taskService.createTaskQuery().singleResult();
 assertEquals("task outside subprocess", task.getName());
}

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

@Deployment
public void testCatchErrorOnEmbeddedSubprocess() {
 runtimeService.startProcessInstanceByKey("boundaryErrorOnEmbeddedSubprocess");
 // After process start, usertask in subprocess should exist
 Task task = taskService.createTaskQuery().singleResult();
 assertEquals("subprocessTask", task.getName());
 // After task completion, error end event is reached and caught
 taskService.complete(task.getId());
 task = taskService.createTaskQuery().singleResult();
 assertEquals("task after catching the error", task.getName());
}

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

@Test
@Deployment
public void testTrueCondition() {
 //given process with boundary conditional event
 //when process is started and execution arrives user task with boundary event
 ProcessInstance procInst = runtimeService.startProcessInstanceByKey(CONDITIONAL_EVENT_PROCESS_KEY);
 //then default evaluation behavior triggers boundary event
 TaskQuery taskQuery = taskService.createTaskQuery().processInstanceId(procInst.getId());
 tasksAfterVariableIsSet = taskQuery.list();
 assertEquals(TASK_AFTER_CONDITION, tasksAfterVariableIsSet.get(0).getName());
 assertEquals(0, conditionEventSubscriptionQuery.list().size());
}

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

@Deployment
public void testMultipleValidConditions() {
 runtimeService.startProcessInstanceByKey("exclusiveGwMultipleValidConditions", CollectionUtil.singletonMap("input", 5));
 assertEquals("Task 2", taskService.createTaskQuery().singleResult().getName());
}

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

@Deployment
public void testNoIdOnSequenceFlow() {
 runtimeService.startProcessInstanceByKey("noIdOnSequenceFlow", CollectionUtil.singletonMap("input", 3));
 Task task = taskService.createTaskQuery().singleResult();
 assertEquals("Input is more than one", task.getName());
}

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

public void tesBasicTaskPropertiesNotNull() {
 Task task = taskService.createTaskQuery().taskId(taskIds.get(0)).singleResult();
 assertNotNull(task.getDescription());
 assertNotNull(task.getId());
 assertNotNull(task.getName());
 assertNotNull(task.getCreateTime());
}

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

public void testExecuteTaskQuerySingleResult() {
 TaskQuery query = taskService.createTaskQuery();
 query.taskDelegationState(DelegationState.PENDING);
 saveQuery(query);
 Task task = filterService.singleResult(filter.getId());
 assertNotNull(task);
 assertEquals("Task 1", task.getName());
}

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

@Deployment
public void testDivergingExclusiveGateway() {
 for (int i = 1; i <= 3; i++) {
  ProcessInstance pi = runtimeService.startProcessInstanceByKey("exclusiveGwDiverging", CollectionUtil.singletonMap("input", i));
  assertEquals("Task " + i, taskService.createTaskQuery().singleResult().getName());
  runtimeService.deleteProcessInstance(pi.getId(), "testing deletion");
 }
}

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

@Test
@Deployment(resources = {"org/camunda/bpm/engine/test/bpmn/tasklistener/TaskListenerTest.bpmn20.xml"})
public void testTaskCreateListener() {
 runtimeService.startProcessInstanceByKey("taskListenerProcess");
 Task task = taskService.createTaskQuery().singleResult();
 assertEquals("Schedule meeting", task.getName());
 assertEquals("TaskCreateListener is listening!", task.getDescription());
}

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

@Deployment
public void testDecideBasedOnBeanMethod() {
 runtimeService.startProcessInstanceByKey("decisionBasedOnBeanMethod",
     CollectionUtil.singletonMap("order", new ExclusiveGatewayTestOrder(300)));
 Task task = taskService.createTaskQuery().singleResult();
 assertNotNull(task);
 assertEquals("Gold Member service", task.getName());
}

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

@Deployment
public void testDecideBasedOnBeanProperty() {
 runtimeService.startProcessInstanceByKey("decisionBasedOnBeanProperty",
     CollectionUtil.singletonMap("order", new ExclusiveGatewayTestOrder(150)));
 Task task = taskService.createTaskQuery().singleResult();
 assertNotNull(task);
 assertEquals("Standard service", task.getName());
}

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

private void assertThatExceptionHasBeenCaught(String procId) {
 // The service task will throw an error event,
 // which is caught on the service task boundary
 assertEquals("No tasks found in task list.", 1, taskService.createTaskQuery().count());
 Task task = taskService.createTaskQuery().singleResult();
 assertEquals("Escalated Exception Task", task.getName());
 // Completing the task will end the process instance
 taskService.complete(task.getId());
 assertProcessEnded(procId);
}

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

private void assertThatErrorHasBeenCaught(String procId) {
 // The process will throw an error event,
 // which is caught and escalated by a User Task
 assertEquals("No tasks found in task list.", 1, taskService.createTaskQuery().count());
 Task task = taskService.createTaskQuery().singleResult();
 assertEquals("Escalated Task", task.getName());
 // Completing the Task will end the process instance
 taskService.complete(task.getId());
 assertProcessEnded(procId);
}

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

@Deployment
public void testUelExpression() {
 Map<String, Object> variables = CollectionUtil.singletonMap("input", "right");
 ProcessInstance pi = runtimeService.startProcessInstanceByKey("condSeqFlowUelExpr", variables);
 Task task = taskService
  .createTaskQuery()
  .processInstanceId(pi.getId())
  .singleResult();
 assertNotNull(task);
 assertEquals("task right", task.getName());
}

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

@Deployment
public void testSimpleProcess() {
 runtimeService.startProcessInstanceByKey("simpleProcess");
 Task task = taskService.createTaskQuery().singleResult();
 assertEquals("My Task", task.getName());
 taskService.complete(task.getId());
 assertEquals(0, runtimeService.createProcessInstanceQuery().count());
}

相关文章