try {
if (context == FormContext.Type) {
AlertTemplateManagerLocal alertTemplateManager = LookupUtil.getAlertTemplateManager();
alertTemplateManager.updateAlertTemplate(subject, alertDef, true);
} else if (context == FormContext.Resource) {
AlertDefinitionManagerLocal alertDefinitionManager = LookupUtil.getAlertDefinitionManager();
alertDefinitionManager.updateAlertDefinition(subject, alertDef.getId(), alertDef, true);
} else if (context == FormContext.Group) {
GroupAlertDefinitionManagerLocal groupAlertDefinitionManager = LookupUtil
.getGroupAlertDefinitionManager();
groupAlertDefinitionManager.updateGroupAlertDefinitions(subject, alertDef, true);
} else {