Esempio n. 1
0
        private void BuildSelectionNode(ReteBuilderContext context, ConditionElement condition)
        {
            var           alphaCondition = ExpressionCompiler.CompileAlphaCondition(condition);
            SelectionNode selectionNode  = context.CurrentAlphaNode
                                           .ChildNodes.OfType <SelectionNode>()
                                           .FirstOrDefault(sn => sn.Condition.Equals(alphaCondition));

            if (selectionNode == null)
            {
                selectionNode = new SelectionNode(alphaCondition);
                context.CurrentAlphaNode.ChildNodes.Add(selectionNode);
            }
            context.CurrentAlphaNode = selectionNode;
        }