protected override void VisitExists(ReteBuilderContext context, ExistsElement element) { BuildSubnet(context, element.ChildElements.Single()); var betaNode = new ExistsNode(context.BetaSource, context.AlphaSource); if (context.HasSubnet) { betaNode.Conditions.Add(new SubnetCondition()); } context.BetaSource = BuildBetaMemoryNode(context, betaNode); context.ResetAlphaSource(); }
private void BuildExistsNode(ReteBuilderContext context, RuleElement element) { var node = context.AlphaSource .Sinks.OfType <ExistsNode>() .FirstOrDefault(x => x.RightSource == context.AlphaSource && x.LeftSource == context.BetaSource); if (node == null) { node = new ExistsNode(context.BetaSource, context.AlphaSource); } node.NodeInfo.Add(context.Rule, element); BuildBetaMemoryNode(context, node); context.ResetAlphaSource(); }
private void BuildExistsNode(ReteBuilderContext context) { var node = context.AlphaSource .Sinks.OfType <ExistsNode>() .FirstOrDefault(x => x.RightSource == context.AlphaSource && x.LeftSource == context.BetaSource); if (node == null) { node = new ExistsNode(context.BetaSource, context.AlphaSource); if (context.HasSubnet) { node.Conditions.Insert(0, new SubnetCondition()); } } BuildBetaMemoryNode(context, node); context.ResetAlphaSource(); }