Opc.Ua.Server.StateMachine.ReportEffect C# (CSharp) Method

ReportEffect() protected method

Reports an effect which is an effect of a transition.
protected ReportEffect ( OperationContext context, Transition transition, QualifiedName cause, NodeId effectId ) : void
context OperationContext
transition Transition
cause QualifiedName
effectId NodeId
return void
        protected virtual void ReportEffect(
            OperationContext context, 
            Transition       transition, 
            QualifiedName    cause,
            NodeId           effectId)
        {
            if (effectId == ObjectTypes.TransitionEventType)
            {
                TransitionEvent e = TransitionEvent.Construct(Server);

                e.InitializeNewEvent();
                
                e.Message.Value       = Utils.Format("StateMachine has moved to the {0} state.", transition.ToState.DisplayName);
                e.SourceNode.Value    = NodeId;
                e.SourceName.Value    = BrowseName.Name;
                e.Severity.Value      = 10;
                e.ReceiveTime.Value   = DateTime.UtcNow;
                e.FromState.Value     = transition.FromState.DisplayName;
                e.ToState.Value       = transition.ToState.DisplayName;

                ReportEvent(e);
            }
        }