public HistoricTaskInstance getLastTask(String processInstanceId){
ListPage<HistoricTaskInstance> page = new ListPage<HistoricTaskInstance>(1);
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
query.finished(); //已完成任务
query.processInstanceId(processInstanceId);
query.orderByHistoricTaskInstanceEndTime().desc();
return ((ListPage<HistoricTaskInstance>)query(query,page)).getFirst();
}
/**