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_BalancePS(BalancePS_ID.Get(context), WorkflowActivity_ID.Get(context), UserID.Get(context), AlarmSeverity.Get(context), uniqueKey)) { res = ARM_Service.ALARM_WriteAlarm_BalancePS(BalancePS_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); }