Exemplo n.º 1
0
        /// <summary>
        /// Runs this flow item
        /// </summary>
        /// <returns>Returns the path to take from here</returns>
        public override SMPathOut Run()
        {
            lock (this)
            {
                // If is a flow container
                if (HasChildren)
                {
                    // Run as a container
                    return(base.Run());
                }
                DoRebuild();
                // Evaluate
                if (_propWrapper == null)
                {
                    return(null);
                }

                //Comment Out by Kasem 15-May-2019
                //bool value = (bool)_propWrapper.Invoke();

                bool value = false;
                //Implement Dry Run Signal
                if (UseDryRunLogic && CompMachine.s_machine.IsDryRun)
                {
                    value = this.DryRunLogic;
                }
                else
                {
                    value = (bool)_propWrapper.Invoke();
                }

                foreach (SMPathOut pathOut in _pathList)
                {
                    SMPathOutBool pathOutBool = (pathOut as SMPathOutBool);
                    if (pathOutBool != null)
                    {
                        pathOutBool.ApplyPathDelay(ParentContainer);
                        if (pathOutBool.True == value)
                        {
                            return(pathOut);
                        }
                    }
                }
            }

            return(null);
        }