本文整理汇总了Java中org.activiti.engine.task.Task.getParentTaskId方法的典型用法代码示例。如果您正苦于以下问题:Java Task.getParentTaskId方法的具体用法?Java Task.getParentTaskId怎么用?Java Task.getParentTaskId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.task.Task
的用法示例。
在下文中一共展示了Task.getParentTaskId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TaskVo
import org.activiti.engine.task.Task; //导入方法依赖的package包/类
public TaskVo(Task task) {
this.id = task.getId();
this.name = task.getName();
this.title = task.getDescription();
this.priority = task.getPriority();
this.owner = task.getOwner();
this.assignee = task.getAssignee();
this.processInstanceId = task.getProcessInstanceId();
this.executionId = task.getExecutionId();
this.processDefinitionId = task.getProcessDefinitionId();
this.createTime = task.getCreateTime();
this.taskDefinitionKey = task.getTaskDefinitionKey();
this.dueDate = task.getDueDate();
this.category = task.getCategory();
this.parentTaskId = task.getParentTaskId();
this.tenantId = task.getTenantId();
this.formKey = task.getFormKey();
this.suspended = task.isSuspended();
}
示例2: completeTask
import org.activiti.engine.task.Task; //导入方法依赖的package包/类
/**
* 完成任务.
*/
public void completeTask(String taskId, String userId,
Map<String, Object> variables) {
TaskService taskService = processEngine.getTaskService();
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
if (task == null) {
throw new IllegalStateException("任务不存在");
}
// 先设置登录用户
IdentityService identityService = processEngine.getIdentityService();
identityService.setAuthenticatedUserId(userId);
// 处理子任务
if ("subtask".equals(task.getCategory())) {
processEngine.getManagementService().executeCommand(
new DeleteTaskWithCommentCmd(taskId, "完成"));
int count = jdbcTemplate.queryForObject(
"select count(*) from ACT_RU_TASK where PARENT_TASK_ID_=?",
Integer.class, task.getParentTaskId());
if (count > 1) {
return;
}
taskId = task.getParentTaskId();
}
processEngine.getManagementService().executeCommand(
new CompleteTaskWithCommentCmd(taskId, variables, "完成"));
}
示例3: readTaskForm
import org.activiti.engine.task.Task; //导入方法依赖的package包/类
/**
* 读取用户任务的表单字段
*/
@RequestMapping(value = "task/getform/{taskId}")
public ModelAndView readTaskForm(@PathVariable("taskId") String taskId) throws Exception {
String viewName = "chapter6/task-form";
ModelAndView mav = new ModelAndView(viewName);
TaskFormData taskFormData = formService.getTaskFormData(taskId);
Task task = null;
// 外置表单
if (taskFormData != null && taskFormData.getFormKey() != null) {
Object renderedTaskForm = formService.getRenderedTaskForm(taskId);
task = taskService.createTaskQuery().taskId(taskId).singleResult();
mav.addObject("taskFormData", renderedTaskForm);
mav.addObject("hasFormKey", true);
} else if (taskFormData != null) { // 动态表单
mav.addObject("taskFormData", taskFormData);
task = taskFormData.getTask();
} else { // 手动创建的任务(包括子任务)
task = taskService.createTaskQuery().taskId(taskId).singleResult();
mav.addObject("manualTask", true);
}
mav.addObject("task", task);
// 读取任务参与人列表
List<IdentityLink> identityLinksForTask = taskService.getIdentityLinksForTask(taskId);
mav.addObject("identityLinksForTask", identityLinksForTask);
// 读取所有人员
List<User> users = identityService.createUserQuery().list();
mav.addObject("users", users);
// 读取所有组
List<Group> groups = identityService.createGroupQuery().list();
mav.addObject("groups", groups);
// 读取子任务
List<HistoricTaskInstance> subTasks = historyService.createHistoricTaskInstanceQuery().taskParentTaskId(taskId).list();
mav.addObject("subTasks", subTasks);
// 读取上级任务
if (task != null && task.getParentTaskId() != null) {
HistoricTaskInstance parentTask = historyService.createHistoricTaskInstanceQuery().taskId(task.getParentTaskId()).singleResult();
mav.addObject("parentTask", parentTask);
}
// 读取附件
List<Attachment> attachments = null;
if (task.getTaskDefinitionKey() != null) {
attachments = taskService.getTaskAttachments(taskId);
} else {
attachments = taskService.getProcessInstanceAttachments(task.getProcessInstanceId());
}
mav.addObject("attachments", attachments);
return mav;
}