String emergencyId = ((Emergency) workItem.getParameter("emergency")).getId();
String procedureId = (String) workItem.getParameter("concreteProcedureId");
try {
System.out.println("The procedure "+procedureId+" is finished!");
MessageFactory.sendMessage(new ProcedureCompletedMessage(emergencyId, procedureId, new Date()));
} catch (HornetQException ex) {
Logger.getLogger(NotifyEndOfProcedureWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
}
manager.completeWorkItem(workItem.getId(), null);
}