Source:
protected boolean canDoAction() { boolean retValue; Guid subscriberId = getParameters().getEventSubscriber().getsubscriber_id(); String event_name = getParameters().getEventSubscriber().getevent_up_name(); int method_id = getParameters().getEventSubscriber().getmethod_id(); List<event_subscriber> subscriptions = DbFacade.getInstance() .getEventDao().getAllForSubscriber(subscriberId); if (IsAlreadySubscribed(subscriptions, subscriberId, event_name, method_id)) { addCanDoActionMessage(VdcBllMessages.EN_ALREADY_SUBSCRIBED); retValue = false; } else { List<event_notification_methods> event_notification_methods = (DbFacade.getInstance() .getEventDao().getEventNotificationMethodsById(method_id)); if (event_notification_methods.size() > 0) { List<EventMap> event_map = DbFacade.getInstance().getEventDao().getEventMapByName(event_name); if (event_map.size() > 0) { String domain = getParameters().getDomain(); DbUser user = DbFacade.getInstance().getDbUserDao().get(subscriberId); if (user == null) { try { user = UserCommandBase.initUser(new VdcUser(subscriberId, "", domain), getParameters() .getSessionId()); if (user == null) { addCanDoActionMessage(VdcBllMessages.USER_MUST_EXIST_IN_DIRECTORY); retValue = false; } else { retValue = ValidateAdd(event_notification_methods, getParameters().getEventSubscriber(), user); } } catch (VdcBLLException vdcBllException) { addCanDoActionMessage(VdcBllMessages.USER_MUST_EXIST_IN_DIRECTORY); retValue = false; } } else { retValue = ValidateAdd(event_notification_methods, getParameters().getEventSubscriber(), user); } } else { addCanDoActionMessage(VdcBllMessages.EN_UNSUPPORTED_NOTIFICATION_EVENT); retValue = false; } } else { addCanDoActionMessage(VdcBllMessages.EN_UNKNOWN_NOTIFICATION_METHOD); retValue = false; } } return retValue; }

Target:
protected boolean canDoAction() { boolean retValue; Guid subscriberId = getParameters().getEventSubscriber().getsubscriber_id(); String eventName = getParameters().getEventSubscriber().getevent_up_name(); int methodId = getParameters().getEventSubscriber().getmethod_id(); List<event_subscriber> subscriptions = DbFacade.getInstance() .getEventDao().getAllForSubscriber(subscriberId); if (IsAlreadySubscribed(subscriptions, subscriberId, eventName, methodId)) { addCanDoActionMessage(VdcBllMessages.EN_ALREADY_SUBSCRIBED); retValue = false; } else { List<event_notification_methods> eventNotificationMethods = (DbFacade.getInstance() .getEventDao().getEventNotificationMethodsById(methodId)); if (eventNotificationMethods.size() > 0) { List<EventMap> eventMap = DbFacade.getInstance().getEventDao().getEventMapByName(eventName); if (eventMap.size() > 0) { String domain = getParameters().getDomain(); DbUser user = DbFacade.getInstance().getDbUserDao().get(subscriberId); if (user == null) { try { user = UserCommandBase.initUser(new VdcUser(subscriberId, "", domain), getParameters() .getSessionId()); if (user == null) { addCanDoActionMessage(VdcBllMessages.USER_MUST_EXIST_IN_DIRECTORY); retValue = false; } else { retValue = ValidateAdd(eventNotificationMethods, getParameters().getEventSubscriber(), user); } } catch (VdcBLLException vdcBllException) { addCanDoActionMessage(VdcBllMessages.USER_MUST_EXIST_IN_DIRECTORY); retValue = false; } } else { retValue = ValidateAdd(eventNotificationMethods, getParameters().getEventSubscriber(), user); } } else { addCanDoActionMessage(VdcBllMessages.EN_UNSUPPORTED_NOTIFICATION_EVENT); retValue = false; } } else { addCanDoActionMessage(VdcBllMessages.EN_UNKNOWN_NOTIFICATION_METHOD); retValue = false; } } return retValue; }