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

GetTransitionForCause() protected method

Returns the transition for the cause given the current state.
protected GetTransitionForCause ( ISystemContext context, uint causeId ) : uint
context ISystemContext
causeId uint
return uint
        protected virtual uint GetTransitionForCause(ISystemContext context, uint causeId)
        {
            uint currentState = GetCurrentStateId();

            if (currentState == 0)
            {
                return 0;
            }

            uint[,] causeMappings = CauseMappings;

            if (causeMappings == null)
            {
                return 0;
            }

            int length = causeMappings.GetLength(0);

            for (int ii = 0; ii < length; ii++)
            {
                if (causeMappings[ii,0] == causeId && causeMappings[ii,1] == currentState)
                {
                    return causeMappings[ii,2];
                }
            }
                
            return 0;
        }