public class SaveLogsOperation implements SaveOperation {
private static final long serialVersionUID = 1L;
public void save(ProcessInstance processInstance, JbpmContext jbpmContext) {
LoggingService loggingService = jbpmContext.getServices().getLoggingService();
if (loggingService != null) {
LoggingInstance loggingInstance = processInstance.getLoggingInstance();
log.debug("posting logs to logging service.");
for (ProcessLog processLog : loggingInstance.getLogs()) {
loggingService.log(processLog);
}
}
else {
log.debug("ignoring logs. no logging service available.");
}