String userId = StringUtil.getString(params.get("userId"));
String processInstanceId = StringUtil.getString(params.get("operProcessInstanceId"));
String[] pids = processInstanceId.split(",");
ProcessEngine engine = getTransactionProcessEngine(userId);
try{
HistoryService historyService = engine.getHistoryService();
List<String> processInstanceIds = new ArrayList<String>();
for(String tmp:pids){
processInstanceIds.add(tmp);
}
historyService.archiveByProcessInstanceIds(processInstanceIds);
}finally{
closeProcessEngine();
}
}