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


Java Task.setPriority方法代码示例

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


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

示例1: testHistoricTaskInstanceUpdate

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
@Deployment
public void testHistoricTaskInstanceUpdate() {
  runtimeService.startProcessInstanceByKey("HistoricTaskInstanceTest").getId();

  Task task = taskService.createTaskQuery().singleResult();

  // Update and save the task's fields before it is finished
  task.setPriority(12345);
  task.setDescription("Updated description");
  task.setName("Updated name");
  task.setAssignee("gonzo");
  taskService.saveTask(task);

  taskService.complete(task.getId());
  assertEquals(1, historyService.createHistoricTaskInstanceQuery().count());

  HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().singleResult();
  assertEquals("Updated name", historicTaskInstance.getName());
  assertEquals("Updated description", historicTaskInstance.getDescription());
  assertEquals("gonzo", historicTaskInstance.getAssignee());
  assertEquals("task", historicTaskInstance.getTaskDefinitionKey());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:HistoricTaskInstanceUpdateTest.java

示例2: updateTask

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void updateTask(Task task) {
  task.setName(getName());
  task.setDescription(getDescription());
  task.setPriority(getPriority());
  task.setAssignee(getAssignee());
  task.setOwner(getOwner());

  DelegationState state = null;
  if (getDelegationState() != null) {
    DelegationStateConverter converter = new DelegationStateConverter();
    state = converter.convertQueryParameterToType(getDelegationState());
  }
  task.setDelegationState(state);

  task.setDueDate(getDue());
  task.setFollowUpDate(getFollowUp());
  task.setParentTaskId(getParentTaskId());
  task.setCaseInstanceId(getCaseInstanceId());
  task.setTenantId(getTenantId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:TaskDto.java

示例3: shouldReturnTasksWithMultipleOrCriteria

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
@Test
public void shouldReturnTasksWithMultipleOrCriteria() {
  // given
  Task task1 = taskService.newTask();
  task1.setName("aTaskName");
  taskService.saveTask(task1);

  Task task2 = taskService.newTask();
  task2.setDescription("aTaskDescription");
  taskService.saveTask(task2);

  Task task3 = taskService.newTask();
  taskService.saveTask(task3);

  Task task4 = taskService.newTask();
  task4.setPriority(5);
  taskService.saveTask(task4);

  Task task5 = taskService.newTask();
  task5.setOwner("aTaskOwner");
  taskService.saveTask(task5);

  // when
  List<Task> tasks = taskService.createTaskQuery()
    .or()
      .taskName("aTaskName")
      .taskDescription("aTaskDescription")
      .taskId(task3.getId())
      .taskPriority(5)
      .taskOwner("aTaskOwner")
    .endOr()
    .list();

  // then
  assertEquals(5, tasks.size());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:37,代码来源:TaskQueryOrTest.java

示例4: shouldReturnTasksFilteredByMultipleOrAndCriteria

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
@Test
public void shouldReturnTasksFilteredByMultipleOrAndCriteria() {
  // given
  Task task1 = taskService.newTask();
  task1.setPriority(4);
  taskService.saveTask(task1);

  Task task2 = taskService.newTask();
  task2.setName("aTaskName");
  task2.setOwner("aTaskOwner");
  task2.setAssignee("aTaskAssignee");
  task2.setPriority(4);
  taskService.saveTask(task2);

  Task task3 = taskService.newTask();
  task3.setName("aTaskName");
  task3.setOwner("aTaskOwner");
  task3.setAssignee("aTaskAssignee");
  task3.setPriority(4);
  task3.setDescription("aTaskDescription");
  taskService.saveTask(task3);

  Task task4 = taskService.newTask();
  task4.setOwner("aTaskOwner");
  task4.setAssignee("aTaskAssignee");
  task4.setPriority(4);
  task4.setDescription("aTaskDescription");
  taskService.saveTask(task4);

  Task task5 = taskService.newTask();
  task5.setDescription("aTaskDescription");
  task5.setOwner("aTaskOwner");
  taskService.saveTask(task5);

  // when
  List<Task> tasks = taskService.createTaskQuery()
    .or()
      .taskName("aTaskName")
      .taskDescription("aTaskDescription")
      .taskId(task3.getId())
    .endOr()
    .taskOwner("aTaskOwner")
    .taskPriority(4)
    .taskAssignee("aTaskAssignee")
    .list();

  // then
  assertEquals(3, tasks.size());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:50,代码来源:TaskQueryOrTest.java

示例5: shouldReturnTasksFilteredByMultipleOrQueries

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
@Test
public void shouldReturnTasksFilteredByMultipleOrQueries() {
  // given
  Task task1 = taskService.newTask();
  task1.setName("aTaskName");
  taskService.saveTask(task1);

  Task task2 = taskService.newTask();
  task2.setName("aTaskName");
  task2.setDescription("aTaskDescription");
  taskService.saveTask(task2);

  Task task3 = taskService.newTask();
  task3.setName("aTaskName");
  task3.setDescription("aTaskDescription");
  task3.setOwner("aTaskOwner");
  taskService.saveTask(task3);

  Task task4 = taskService.newTask();
  task4.setName("aTaskName");
  task4.setDescription("aTaskDescription");
  task4.setOwner("aTaskOwner");
  task4.setAssignee("aTaskAssignee");
  taskService.saveTask(task4);

  Task task5 = taskService.newTask();
  task5.setName("aTaskName");
  task5.setDescription("aTaskDescription");
  task5.setOwner("aTaskOwner");
  task5.setAssignee("aTaskAssignee");
  task5.setPriority(4);
  taskService.saveTask(task5);

  Task task6 = taskService.newTask();
  task6.setName("aTaskName");
  task6.setDescription("aTaskDescription");
  task6.setOwner("aTaskOwner");
  task6.setAssignee("aTaskAssignee");
  task6.setPriority(4);
  taskService.saveTask(task6);

  // when
  List<Task> tasks = taskService.createTaskQuery()
    .or()
      .taskName("aTaskName")
      .taskDescription("aTaskDescription")
    .endOr()
    .or()
      .taskName("aTaskName")
      .taskDescription("aTaskDescription")
      .taskAssignee("aTaskAssignee")
    .endOr()
    .or()
      .taskName("aTaskName")
      .taskDescription("aTaskDescription")
      .taskOwner("aTaskOwner")
      .taskAssignee("aTaskAssignee")
    .endOr()
    .or()
      .taskAssignee("aTaskAssignee")
      .taskPriority(4)
    .endOr()
    .list();

  // then
  assertEquals(3, tasks.size());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:68,代码来源:TaskQueryOrTest.java

示例6: createTasksForOrQueries

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
protected void createTasksForOrQueries() {
  Task task1 = taskService.newTask();
  task1.setName("taskForOr");
  task1.setDescription("aTaskDescription");
  task1.setPriority(3);
  taskService.saveTask(task1);

  Task task2 = taskService.newTask();
  task2.setName("taskForOr");
  task2.setDescription("aTaskDescription");
  task2.setAssignee("aTaskAssignee");
  task2.setTenantId("aTenantId");
  taskService.saveTask(task2);

  Task task3 = taskService.newTask();
  task3.setName("taskForOr");
  task3.setOwner("aTaskOwner");
  taskService.saveTask(task3);

  Task task4 = taskService.newTask();
  task4.setName("taskForOr");
  task4.setOwner("aTaskOwner");
  task4.setPriority(3);
  taskService.saveTask(task4);

  Task task5 = taskService.newTask();
  task5.setDescription("aTaskDescription");
  task5.setAssignee("aTaskAssignee");
  taskService.saveTask(task5);

  Task task6 = taskService.newTask();
  task6.setDescription("aTaskDescription");
  task6.setAssignee("aTaskAssignee");
  task6.setTenantId("aTenantId");
  taskService.saveTask(task6);

  Task task7 = taskService.newTask();
  task7.setTenantId("aTenantId");
  task7.setOwner("aTaskOwner");
  task7.setPriority(3);
  task7.setAssignee("aTaskAssignee");
  taskService.saveTask(task7);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:44,代码来源:FilterTaskQueryTest.java

示例7: testHistoricTaskInstance

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
@Deployment
public void testHistoricTaskInstance() throws Exception {
  String processInstanceId = runtimeService.startProcessInstanceByKey("HistoricTaskInstanceTest").getId();

  SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");

  // Set priority to non-default value
  Task runtimeTask = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
  runtimeTask.setPriority(1234);

  // Set due-date
  Date dueDate = sdf.parse("01/02/2003 04:05:06");
  runtimeTask.setDueDate(dueDate);
  taskService.saveTask(runtimeTask);

  String taskId = runtimeTask.getId();
  String taskDefinitionKey = runtimeTask.getTaskDefinitionKey();

  HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().singleResult();
  assertEquals(taskId, historicTaskInstance.getId());
  assertEquals(1234, historicTaskInstance.getPriority());
  assertEquals("Clean up", historicTaskInstance.getName());
  assertEquals("Schedule an engineering meeting for next week with the new hire.", historicTaskInstance.getDescription());
  assertEquals(dueDate, historicTaskInstance.getDueDate());
  assertEquals("kermit", historicTaskInstance.getAssignee());
  assertEquals(taskDefinitionKey, historicTaskInstance.getTaskDefinitionKey());
  assertNull(historicTaskInstance.getEndTime());
  assertNull(historicTaskInstance.getDurationInMillis());

  assertNull(historicTaskInstance.getCaseDefinitionId());
  assertNull(historicTaskInstance.getCaseInstanceId());
  assertNull(historicTaskInstance.getCaseExecutionId());

  // the activity instance id is set
  assertEquals(((TaskEntity)runtimeTask).getExecution().getActivityInstanceId(), historicTaskInstance.getActivityInstanceId());

  runtimeService.setVariable(processInstanceId, "deadline", "yesterday");

  // move clock by 1 second
  Date now = ClockUtil.getCurrentTime();
  ClockUtil.setCurrentTime(new Date(now.getTime() + 1000));

  taskService.complete(taskId);

  assertEquals(1, historyService.createHistoricTaskInstanceQuery().count());

  historicTaskInstance = historyService.createHistoricTaskInstanceQuery().singleResult();
  assertEquals(taskId, historicTaskInstance.getId());
  assertEquals(1234, historicTaskInstance.getPriority());
  assertEquals("Clean up", historicTaskInstance.getName());
  assertEquals("Schedule an engineering meeting for next week with the new hire.", historicTaskInstance.getDescription());
  assertEquals(dueDate, historicTaskInstance.getDueDate());
  assertEquals("kermit", historicTaskInstance.getAssignee());
  assertEquals(TaskEntity.DELETE_REASON_COMPLETED, historicTaskInstance.getDeleteReason());
  assertEquals(taskDefinitionKey, historicTaskInstance.getTaskDefinitionKey());
  assertNotNull(historicTaskInstance.getEndTime());
  assertNotNull(historicTaskInstance.getDurationInMillis());
  assertTrue(historicTaskInstance.getDurationInMillis() >= 1000);
  assertTrue(((HistoricTaskInstanceEntity)historicTaskInstance).getDurationRaw() >= 1000);

  assertNull(historicTaskInstance.getCaseDefinitionId());
  assertNull(historicTaskInstance.getCaseInstanceId());
  assertNull(historicTaskInstance.getCaseExecutionId());

  historyService.deleteHistoricTaskInstance(taskId);

  assertEquals(0, historyService.createHistoricTaskInstanceQuery().count());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:69,代码来源:HistoricTaskInstanceTest.java


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