Exemple #1
0
        private bool IsBlockingState(Relation.RelationType type)
        {
            if (type == Relation.RelationType.Condition)
            {
                return(!Excluded && !Executed);
            }
            if (type == Relation.RelationType.Milestone)
            {
                return(!Excluded && Pending);
            }

            return(false); // Others can't block execution
        }
Exemple #2
0
        private void ChangeState(Relation.RelationType type)
        {
            switch (type)
            {
            case Relation.RelationType.Include:
                Excluded = false;
                break;

            case Relation.RelationType.Exclude:
                Excluded = true;
                break;

            case Relation.RelationType.Response:
                Pending = true;
                break;
            }
        }
Exemple #3
0
        private void TryDischarge(Relation.RelationType type)
        {
            if (!IsBlockingState(type))
            {
                return;
            }
            TryExecute();
            if (!IsBlockingState(type))
            {
                return;
            }

            TryExclude();
            if (!IsBlockingState(type))
            {
                return;
            }

            TryMakeExecuteable();
            TryExecute();
        }