本文整理了Java中org.camunda.bpm.engine.task.Task.getPriority()
方法的一些代码示例,展示了Task.getPriority()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.getPriority()
方法的具体详情如下:
包路径:org.camunda.bpm.engine.task.Task
类名称:Task
方法名:getPriority
[英]indication of how important/urgent this task is with a number between 0 and 100 where higher values mean a higher priority and lower values mean lower priority: [0..19] lowest, [20..39] low, [40..59] normal, [60..79] high [80..100] highest
[中]用0到100之间的数字表示此任务的重要性/紧迫性,其中较高的值表示较高的优先级,较低的值表示较低的优先级:[0..19]最低,[20..39]低,[40..59]正常,[60..79]高[80..100]最高
代码示例来源:origin: camunda/camunda-bpm-platform
@Override
public Integer getProperty(Task obj) {
return obj.getPriority();
}
});
代码示例来源:origin: camunda/camunda-bpm-platform
public Task build() {
Task mockTask = mock(Task.class);
when(mockTask.getId()).thenReturn(id);
when(mockTask.getName()).thenReturn(name);
when(mockTask.getAssignee()).thenReturn(assignee);
when(mockTask.getCreateTime()).thenReturn(createTime);
when(mockTask.getDueDate()).thenReturn(dueDate);
when(mockTask.getFollowUpDate()).thenReturn(followUpDate);
when(mockTask.getDelegationState()).thenReturn(delegationState);
when(mockTask.getDescription()).thenReturn(description);
when(mockTask.getExecutionId()).thenReturn(executionId);
when(mockTask.getOwner()).thenReturn(owner);
when(mockTask.getParentTaskId()).thenReturn(parentTaskId);
when(mockTask.getPriority()).thenReturn(priority);
when(mockTask.getProcessDefinitionId()).thenReturn(processDefinitionId);
when(mockTask.getProcessInstanceId()).thenReturn(processInstanceId);
when(mockTask.getTaskDefinitionKey()).thenReturn(taskDefinitionKey);
when(mockTask.getCaseDefinitionId()).thenReturn(caseDefinitionId);
when(mockTask.getCaseInstanceId()).thenReturn(caseInstanceId);
when(mockTask.getCaseExecutionId()).thenReturn(caseExecutionId);
when(mockTask.getFormKey()).thenReturn(formKey);
when(mockTask.getTenantId()).thenReturn(tenantId);
return mockTask;
}
代码示例来源:origin: camunda/camunda-bpm-platform
private void testPriorityExtension(int priority) throws Exception {
final Map<String, Object> variables = new HashMap<String, Object>();
variables.put("taskPriority", priority);
// Start process-instance, passing priority that should be used as task priority
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("taskPriorityExtension", variables);
final Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
assertEquals(priority, task.getPriority());
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Deployment
public void testPriorityExtensionString() throws Exception {
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("taskPriorityExtensionString");
final Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
assertEquals(42, task.getPriority());
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testStandaloneTaskSetPriorityWithTaskAssignPermission() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
deleteTask(taskId, true);
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testStandaloneTaskSetPriority() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, taskId, userId, UPDATE);
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
deleteTask(taskId, true);
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testCaseTaskSetPriority() {
// given
createCaseInstanceByKey(CASE_KEY);
String taskId = selectSingleTask().getId();
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testProcessTaskSetPriorityWithUpdatePersmissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, UPDATE);
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testProcessTaskSetPriorityWithTaskAssignPermissionOnAnyTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, ANY, userId, TASK_ASSIGN);
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testProcessTaskSetPriorityWithTaskAssignPermissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testProcessTaskSetPriorityWithUpdatePersmissionOnAnyTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, ANY, userId, UPDATE);
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testProcessTaskSetPriorityWithUpdateTasksPersmissionOnProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, UPDATE_TASK);
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testProcessTaskSetPriorityWithTaskAssignPermissionOnProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, TASK_ASSIGN);
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testProcessTaskSetPriorityWithTaskAssignPermission() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, TASK_ASSIGN);
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void testProcessTaskSetPriority() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, UPDATE);
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, UPDATE_TASK);
// when
taskService.setPriority(taskId, 80);
// then
Task task = selectSingleTask();
assertNotNull(task);
assertEquals(80, task.getPriority());
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Test
public void testSetPriority() {
Task task = taskService.newTask();
taskService.saveTask(task);
taskService.setPriority(task.getId(), 12345);
// Fetch task again to check if the priority is set
task = taskService.createTaskQuery().taskId(task.getId()).singleResult();
assertEquals(12345, task.getPriority());
taskService.deleteTask(task.getId(), true);
}
代码示例来源:origin: camunda/camunda-bpm-platform
dto.owner = task.getOwner();
dto.parentTaskId = task.getParentTaskId();
dto.priority = task.getPriority();
dto.processDefinitionId = task.getProcessDefinitionId();
dto.processInstanceId = task.getProcessInstanceId();
代码示例来源:origin: camunda/camunda-bpm-platform
dto.owner = task.getOwner();
dto.parentTaskId = task.getParentTaskId();
dto.priority = task.getPriority();
dto.processDefinitionId = task.getProcessDefinitionId();
dto.processInstanceId = task.getProcessInstanceId();
代码示例来源:origin: camunda/camunda-bpm-platform
@Deployment
public void testTaskPropertiesNotNull() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess");
List<String> activeActivityIds = runtimeService.getActiveActivityIds(processInstance.getId());
Task task = taskService.createTaskQuery().singleResult();
assertNotNull(task.getId());
assertEquals("my task", task.getName());
assertEquals("Very important", task.getDescription());
assertTrue(task.getPriority() > 0);
assertEquals("kermit", task.getAssignee());
assertEquals(processInstance.getId(), task.getProcessInstanceId());
assertEquals(processInstance.getId(), task.getExecutionId());
assertNotNull(task.getProcessDefinitionId());
assertNotNull(task.getTaskDefinitionKey());
assertNotNull(task.getCreateTime());
// the next test verifies that if an execution creates a task, that no events are created during creation of the task.
if (processEngineConfiguration.getHistoryLevel().getId() >= ProcessEngineConfigurationImpl.HISTORYLEVEL_ACTIVITY) {
assertEquals(0, taskService.getTaskEvents(task.getId()).size());
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
dto.owner = task.getOwner();
dto.parentTaskId = task.getParentTaskId();
dto.priority = task.getPriority();
dto.processDefinitionId = task.getProcessDefinitionId();
dto.processInstanceId = task.getProcessInstanceId();
内容来源于网络,如有侵权,请联系作者删除!