HistoryService historyService = engine.getHistoryService();
List<String> processInstanceIds = new ArrayList<String>();
for(String tmp:pids){
processInstanceIds.add(tmp);
}
historyService.archiveByProcessInstanceIds(processInstanceIds);
}finally{
closeProcessEngine();
}
}