Ejemplo n.º 1
0
        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_PS(PS_ID.Get(context), WorkflowActivity_ID.Get(context), UserID.Get(context),
                                                             AlarmSeverity.Get(context), UniqueKey))
                {
                    res = ARM_Service.ALARM_WriteAlarm_PS(PS_ID.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);
        }