本文整理汇总了Java中org.activiti.engine.task.Task.setDelegationState方法的典型用法代码示例。如果您正苦于以下问题:Java Task.setDelegationState方法的具体用法?Java Task.setDelegationState怎么用?Java Task.setDelegationState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.task.Task
的用法示例。
在下文中一共展示了Task.setDelegationState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testTaskDelegation
import org.activiti.engine.task.Task; //导入方法依赖的package包/类
public void testTaskDelegation() {
Task task = taskService.newTask();
task.setOwner("johndoe");
task.delegate("joesmoe");
taskService.saveTask(task);
String taskId = task.getId();
task = taskService.createTaskQuery().taskId(taskId).singleResult();
assertEquals("johndoe", task.getOwner());
assertEquals("joesmoe", task.getAssignee());
assertEquals(DelegationState.PENDING, task.getDelegationState());
taskService.resolveTask(taskId);
task = taskService.createTaskQuery().taskId(taskId).singleResult();
assertEquals("johndoe", task.getOwner());
assertEquals("johndoe", task.getAssignee());
assertEquals(DelegationState.RESOLVED, task.getDelegationState());
task.setAssignee(null);
task.setDelegationState(null);
taskService.saveTask(task);
task = taskService.createTaskQuery().taskId(taskId).singleResult();
assertEquals("johndoe", task.getOwner());
assertNull(task.getAssignee());
assertNull(task.getDelegationState());
task.setAssignee("jackblack");
task.setDelegationState(DelegationState.RESOLVED);
taskService.saveTask(task);
task = taskService.createTaskQuery().taskId(taskId).singleResult();
assertEquals("johndoe", task.getOwner());
assertEquals("jackblack", task.getAssignee());
assertEquals(DelegationState.RESOLVED, task.getDelegationState());
// Finally, delete task
taskService.deleteTask(taskId, true);
}