GWTServiceLookup.getAlertTemplateService().createAlertTemplate(alertDefinition,
Integer.valueOf(this.resourceType.getId()), new AsyncCallback<Integer>() {
@Override
public void onSuccess(Integer result) {
CoreGUI.getMessageCenter().notify(
new Message(MSG.view_alert_definitions_create_success(), Severity.Info));
alertDefinition.setId(result.intValue());
TemplateAlertDefinitionsView.this.refresh();
resultReceiver.onSuccess(alertDefinition);
}
@Override
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_alert_definitions_create_failure(), caught);
resultReceiver.onFailure(caught);
}
});
} else {
GWTServiceLookup.getAlertTemplateService().updateAlertTemplate(alertDefinition, resetMatching,
new AsyncCallback<AlertDefinition>() {
@Override
public void onSuccess(AlertDefinition result) {
CoreGUI.getMessageCenter().notify(
new Message(MSG.view_alert_definitions_update_success(), Severity.Info));
TemplateAlertDefinitionsView.this.refresh();
resultReceiver.onSuccess(result);
}
@Override