previousVersionNum, previousState);
CacheValue context =
updateContext.getIfPresent(new CacheKey(transUnit.getId(),
transUnit.getLocaleId()));
TransUnitUpdated updated;
if (context != null) {
updated =
new TransUnitUpdated(updateInfo, context.editorClientId,
context.updateType);
log.debug("about to publish trans unit updated event {}", updated);
} else if (ServletContexts.instance().getRequest() != null) {
String sessionId =
ServletContexts.instance().getRequest().getSession()
.getId();
EditorClientId editorClientId = new EditorClientId(sessionId, -1);
updated =
new TransUnitUpdated(updateInfo, editorClientId,
TransUnitUpdated.UpdateType.NonEditorSave);
} else {
updated =
new TransUnitUpdated(updateInfo, new EditorClientId(
"unknown", -1),
TransUnitUpdated.UpdateType.NonEditorSave);
}
if (Events.exists()) {
Events.instance().raiseTransactionSuccessEvent(