示例#1
0
        /**
         * Spawns the child task. This method creates a new HierarchicalContext,
         * sets its parent to the context of the ExecutionHierarchicalContextManager, and spawns
         * the child task using this HierarchicalContext.
         *
         * @see jbt.execution.core.ExecutionTask#internalSpawn()
         */

        protected override void InternalSpawn()
        {
            var newContext = new HierarchicalContext();

            newContext.SetParent(Context);
            _child = ((ModelDecorator)ModelTask).getChild().CreateExecutor(
                Executor, this);
            _child.AddTaskListener(this);
            _child.Spawn(newContext);
        }
        public void Indexer_pulls_variables_from_parent_when_they_dont_exist_in_the_current_context()
        {
            var parentContext = new HierarchicalContext();

            parentContext.SetVariable("Hello", true);

            var childContext = new HierarchicalContext();

            childContext.SetParent(parentContext);

            var context = (IContext)childContext;

            Assert.IsTrue((bool)context["Hello"]);
        }