Activiti finds process status (process next step)

Reference link: http://pjwqh.blog.51cto.com/632548/1654178

The database has an act_hi_actinst table, which stores all the activities of the process instance. Find the corresponding API and get the following methods:
historyService.createHistoricActivityInstanceQuery()//
    .processInstanceId (if.getProcessInstanceId ()) //
    .unfinished()//Unfinished activity (task)
    .singleResult();


If the search result is null, the process instance has been completed. If it is not empty, the found activity is the next link of the process instance. At this point, the process status (the next step of the process) has been successfully found.

HistoricActivityInstance hai=historyService.createHistoricActivityInstanceQuery()//
    .processInstanceId (if.getProcessInstanceId ()) //
    .unfinished()
    .singleResult();
if(hai!=null){
    map.put("piState", hai.getActivityName());// Process state
}else{
    map.put("piState", "End");// Process state
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326089456&siteId=291194637