LoggingInstance loggingInstance = processInstance.getLoggingInstance();
log.debug("flushing logs to logging service.");
Iterator iter = loggingInstance.getLogs().iterator();
while (iter.hasNext()) {
ProcessLog processLog = (ProcessLog) iter.next();
loggingService.log(processLog);
}
} else {
log.debug("ignoring logs. no logging service available.");
}