Opc.Ua.FiniteStateMachineState.CauseProcessingCompleted C# (CSharp) Method

CauseProcessingCompleted() public method

Updates the state machine to reflect the successful processing of a method.
public CauseProcessingCompleted ( ISystemContext context, uint causeId ) : void
context ISystemContext The context.
causeId uint The cause id.
return void
        public void CauseProcessingCompleted(ISystemContext context, uint causeId)
        {
            // get the transition.
            uint transitionId = GetTransitionForCause(context, causeId);

            if (transitionId == 0)
            {
                return;
            }

            // get the new state.
            uint newState = GetNewStateForTransition(context, transitionId);

            if (newState == 0)
            {
                return;
            }

            // save the last state.
            if (m_lastState == null)
            {
                m_lastState = new FiniteStateVariableState(this);
            }

            m_lastState.SetChildValue(context, null, CurrentState, false);

            // update state and transition variables.
            UpdateStateVariable(context, newState, CurrentState);
            UpdateTransitionVariable(context, transitionId, LastTransition);
        }