public TaskEventTextResolver() {
this.i18nManager = ExplorerApp.get().getI18nManager();
}
public Label resolveText(Event event) {
IdentityService identityService = ProcessEngines.getDefaultProcessEngine().getIdentityService();
User user = identityService.createUserQuery().userId(event.getUserId()).singleResult();
String eventAuthor = "<span class='" + ExplorerLayout.STYLE_TASK_EVENT_AUTHOR + "'>"
+ user.getFirstName() + " " + user.getLastName() + "</span> ";
String text = null;
if (Event.ACTION_ADD_USER_LINK.equals(event.getAction())) {
User involvedUser = identityService.createUserQuery().userId(event.getMessageParts().get(0)).singleResult();
text = i18nManager.getMessage(Messages.EVENT_ADD_USER_LINK,
eventAuthor,
involvedUser.getFirstName() + " " + involvedUser.getLastName(),
event.getMessageParts().get(1)); // second msg part = role
} else if (Event.ACTION_DELETE_USER_LINK.equals(event.getAction())) {
User involvedUser = identityService.createUserQuery().userId(event.getMessageParts().get(0)).singleResult();
text = i18nManager.getMessage(Messages.EVENT_DELETE_USER_LINK,
eventAuthor,
involvedUser.getFirstName() + " " + involvedUser.getLastName(),
event.getMessageParts().get(1));
} else if (Event.ACTION_ADD_GROUP_LINK.equals(event.getAction())) {