本文整理汇总了Java中org.activiti.engine.history.HistoricTaskInstance.getParentTaskId方法的典型用法代码示例。如果您正苦于以下问题:Java HistoricTaskInstance.getParentTaskId方法的具体用法?Java HistoricTaskInstance.getParentTaskId怎么用?Java HistoricTaskInstance.getParentTaskId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.history.HistoricTaskInstance
的用法示例。
在下文中一共展示了HistoricTaskInstance.getParentTaskId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: viewHistoryTask
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
/**
* 查看已结束任务
*/
@RequestMapping(value = "task/archived/{taskId}")
public ModelAndView viewHistoryTask(@PathVariable("taskId") String taskId) throws Exception {
String viewName = "chapter6/task-form-archived";
ModelAndView mav = new ModelAndView(viewName);
HistoricTaskInstance task = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
if (task.getParentTaskId() != null) {
HistoricTaskInstance parentTask = historyService.createHistoricTaskInstanceQuery().taskId(task.getParentTaskId()).singleResult();
mav.addObject("parentTask", parentTask);
}
mav.addObject("task", task);
// 读取子任务
List<HistoricTaskInstance> subTasks = historyService.createHistoricTaskInstanceQuery().taskParentTaskId(taskId).list();
mav.addObject("subTasks", subTasks);
// 读取附件
List<Attachment> attachments = null;
if (task.getTaskDefinitionKey() != null) {
attachments = taskService.getTaskAttachments(taskId);
} else {
attachments = taskService.getProcessInstanceAttachments(task.getProcessInstanceId());
}
mav.addObject("attachments", attachments);
return mav;
}