示例#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_61968Systems(Slave61968System_ID.Get(context), WorkflowActivity_ID.Get(context), UserID.Get(context),
                                                                       AlarmSeverity.Get(context), UniqueKey))
                {
                    res = ARM_Service.ALARM_WriteAlarm_Master61968SlaveSystems(Slave61968System_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);
        }
示例#2
0
        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);
        }