protected override bool Execute(CodeActivityContext context) { bool res = false; string Message = CheckStr(AlarmMessage.Get(context), 1024); string ShortMessage = CheckStr(ShortAlarmMessage.Get(context), 128); string Description = CheckStr(AlarmDescription.Get(context), 1024); string UniqueKey = CheckStr(AlarmUniqueKey.Get(context), 1024); try { if (MonitoringChangesAlarm.isChangesAlarm_User(WorkflowActivity_ID.Get(context), UserID.Get(context), AlarmSeverity.Get(context), UniqueKey)) { res = ARM_Service.ALARM_WriteAlarm_Users(WorkflowActivity_ID.Get(context), UserID.Get(context), AlarmSettingID.Get(context), AlarmSeverity.Get(context), Message, ShortMessage, Description, UniqueKey, AlarmDateTime.Get(context)); } } catch (Exception ex) { Error.Set(context, ex.Message); if (!HideException.Get(context)) { throw ex; } } return(string.IsNullOrEmpty(Error.Get(context)) && res); }
protected override bool Execute(CodeActivityContext context) { var res = false; var message = CheckStr(AlarmMessage.Get(context), 1024); var shortMessage = CheckStr(ShortAlarmMessage.Get(context), 128); var description = CheckStr(AlarmDescription.Get(context), 1024); var uniqueKey = CheckStr(AlarmUniqueKey.Get(context), 1024); try { if (MonitoringChangesAlarm.isChangesAlarm_BalanceFreeHierarchy(BalanceFreeHierarchy_UN.Get(context), WorkflowActivity_ID.Get(context), UserID.Get(context), AlarmSeverity.Get(context), uniqueKey)) { res = ARM_Service.ALARM_WriteAlarm_BalanceFreeHierarchy(BalanceFreeHierarchy_UN.Get(context), WorkflowActivity_ID.Get(context), UserID.Get(context), AlarmSettingID.Get(context), AlarmSeverity.Get(context), message, shortMessage, description, uniqueKey, AlarmDateTime.Get(context)); } } catch (Exception ex) { Error.Set(context, ex.Message); if (!HideException.Get(context)) { throw ex; } } return(string.IsNullOrEmpty(Error.Get(context)) && res); }