protected void fireWorkflowCompletionEvent(CoreSession session) {
EventFirer.fireEvent(session, this, null, DocumentRoutingConstants.Events.afterRouteFinish.name());
Map<String, Serializable> eventProperties = new HashMap<String, Serializable>();
long duration = RoutingAuditHelper.computeDurationSinceWfStarted(getDocument().getId());
if (duration >= 0) {
eventProperties.put(RoutingAuditHelper.TIME_SINCE_WF_STARTED, duration);
}
eventProperties.put(RoutingAuditHelper.WORKFLOW_INITATIOR, this.getInitiator());
if (this instanceof GraphRoute) {
eventProperties.put(RoutingAuditHelper.WORKFLOW_VARIABLES, (Serializable) ((GraphRoute) this).getVariables());
}
eventProperties.put("modelId", getModelId());
eventProperties.put("modelName", getModelName());
EventFirer.fireEvent(session, this, eventProperties, DocumentRoutingConstants.Events.afterWorkflowFinish.name());
}