Opc.Ua.AcknowledgeableConditionState.ProcessBeforeAcknowledge C# (CSharp) Method

ProcessBeforeAcknowledge() protected method

Does any processing before adding a comment to a condition.
protected ProcessBeforeAcknowledge ( ISystemContext context, byte eventId, Opc.Ua.LocalizedText comment ) : ServiceResult
context ISystemContext The system context.
eventId byte The identifier for the event which is the target for the comment.
comment Opc.Ua.LocalizedText The comment.
return ServiceResult
        protected virtual ServiceResult ProcessBeforeAcknowledge(
            ISystemContext context,
            byte[] eventId,
            LocalizedText comment)
        {
            if (eventId == null)
            {
                return StatusCodes.BadEventIdUnknown;
            }

            if (!this.EnabledState.Id.Value)
            {
                return StatusCodes.BadConditionDisabled;
            }
            
            if (OnAcknowledge != null)
            {
                try
                {
                    return OnAcknowledge(context, this, eventId, comment);
                }
                catch (Exception e)
                {
                    return ServiceResult.Create(e, StatusCodes.BadUnexpectedError, "Unexpected error acknowledging a Condition.");
                }
            }

            return ServiceResult.Good;
        }