use of org.activiti.explorer.ui.event.SubmitEventListener in project Activiti by Activiti.
the class ReassignAssigneeListener method buttonClick.
public void buttonClick(ClickEvent event) {
List<String> ignoredIds = null;
if (task.getAssignee() != null) {
ignoredIds = Arrays.asList(task.getAssignee());
}
final SelectUsersPopupWindow involvePeoplePopupWindow = new SelectUsersPopupWindow(i18nManager.getMessage(Messages.TASK_ASSIGNEE_REASSIGN), false, ignoredIds);
involvePeoplePopupWindow.addListener(new SubmitEventListener() {
protected void submitted(SubmitEvent event) {
// Update assignee
String selectedUser = involvePeoplePopupWindow.getSelectedUserId();
String originAssignee = task.getAssignee();
task.setAssignee(selectedUser);
if (selectedUser != null) {
ProcessEngines.getDefaultProcessEngine().getTaskService().setAssignee(task.getId(), selectedUser);
} else if (originAssignee != null) {
ProcessEngines.getDefaultProcessEngine().getTaskService().deleteUserIdentityLink(task.getId(), originAssignee, IdentityLinkType.ASSIGNEE);
} else {
return;
}
// Update UI
taskDetailPanel.notifyAssigneeChanged();
}
protected void cancelled(SubmitEvent event) {
}
});
ExplorerApp.get().getViewManager().showPopupWindow(involvePeoplePopupWindow);
}
Aggregations