use of org.guvnor.structure.events.AfterCreateOrganizationalUnitEvent in project kie-wb-common by kiegroup.
the class OrganizationalUnitPopUpPresenter method saveCreation.
void saveCreation(final String name, final String defaultGroupId, final String owner) {
final Command saveCommand = () -> {
final Collection<Repository> repositories = new ArrayList<>();
final List<String> contributors = contributorsManagementPresenter.getSelectedContributorsUserNames();
final RemoteCallback<OrganizationalUnit> successCallback = (OrganizationalUnit newOrganizationalUnit) -> {
afterCreateOrganizationalUnitEvent.fire(new AfterCreateOrganizationalUnitEvent(newOrganizationalUnit));
view.hideBusyIndicator();
notificationEvent.fire(new NotificationEvent(view.getSaveSuccessMessage(), NotificationEvent.NotificationType.SUCCESS));
view.hide();
};
final HasBusyIndicatorDefaultErrorCallback errorCallback = new HasBusyIndicatorDefaultErrorCallback(view);
organizationalUnitService.call(successCallback, errorCallback).createOrganizationalUnit(name, owner, defaultGroupId, repositories, contributors);
};
validateDuplicatedOrganizationalUnit(name, saveCommand);
}
Aggregations