String internalId = pi.getInternalId();
logger.info("Processing deadlines for process: " + internalId);
ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
pi = ctx.getProcessInstanceDAO().getProcessInstance(pi.getId());
if (pi == null) {
throw new ProcessToolException("Unable to find process instance by internal id: " + internalId);
}
Set<ProcessDeadline> deadlines = pi.findAttributesByClass(ProcessDeadline.class);
if (!deadlines.isEmpty()) {
logger.info("Found deadline configurations for process: " + pi.getInternalId());
ProcessToolBpmSession bpmSession = ctx.getProcessToolSessionFactory().createAutoSession();