/**
* 根据流程实例id获取上一个节点的信息
*
* @param proInsId
* @param historyService
* @return
*/
public static HistoricTaskInstance queryUpOneNodeMessage(String proInsId, HistoryService historyService) {
//上一个节点
List<HistoricTaskInstance> list = historyService
.createHistoricTaskInstanceQuery()
.processInstanceId(proInsId)
.orderByHistoricTaskInstanceEndTime()
.desc()
.list();
HistoricTaskInstance taskInstance = null;
if (!list.isEmpty()) {
if (list.get(0).getEndTime() != null) {
taskInstance = list.get(0);
}
}
return taskInstance;
}
/**
* 根据任务id获取上一个节点的信息
*
* @param taskId
* @return
*/
public static HistoricTaskInstance queryUpOneNode(String taskId, HistoryService historyService) {
//上一个节点
List<HistoricTaskInstance> list = historyService
.createHistoricTaskInstanceQuery()
.taskId(taskId).orderByHistoricTaskInstanceEndTime()
.desc()
.list();
HistoricTaskInstance taskInstance = null;
if (!list.isEmpty()) {
if (list.get(0).getEndTime() != null) {
taskInstance = list.get(0);
}
}
return taskInstance;
}
Activiti6.0获取上一节点的两种方式
最新推荐文章于 2023-02-04 22:33:25 发布