コード例 #1
0
ファイル: ReteBuilder.cs プロジェクト: zhjrate/NRules
        private static void BuildAdapter(ReteBuilderContext context)
        {
            var adapter = context.BetaSource
                          .Sinks.OfType <ObjectInputAdapter>()
                          .SingleOrDefault();

            if (adapter == null)
            {
                adapter = new ObjectInputAdapter(context.BetaSource);
            }
            context.AlphaSource = adapter;
        }
コード例 #2
0
ファイル: ReteBuilder.cs プロジェクト: arastoul/NRules
        private void BuildAdapter(ReteBuilderContext context)
        {
            var adapter = context.BetaSource
                          .Sinks.OfType <ObjectInputAdapter>()
                          .SingleOrDefault();

            if (adapter == null)
            {
                adapter    = new ObjectInputAdapter(context.BetaSource);
                adapter.Id = GetNodeId();
            }
            adapter.NodeInfo.Add(context.Rule);
            context.AlphaSource = adapter;
        }
コード例 #3
0
ファイル: ReteBuilder.cs プロジェクト: starnovsky/NRules
        private void BuildSubnet(ReteBuilderContext context, RuleElement element)
        {
            var subnetContext = new ReteBuilderContext(context);

            Visit(subnetContext, element);

            if (subnetContext.AlphaSource == null)
            {
                var adapter = new ObjectInputAdapter(subnetContext.BetaSource);
                subnetContext.AlphaSource = adapter;
                context.HasSubnet         = true;
            }
            context.AlphaSource = subnetContext.AlphaSource;
        }
コード例 #4
0
        private void BuildSubnet(ReteBuilderContext context, RuleElement element)
        {
            var subnetContext = new ReteBuilderContext(context);

            Visit(subnetContext, element);

            if (subnetContext.AlphaSource == null)
            {
                var adapter = subnetContext.BetaSource
                              .Sinks.OfType <ObjectInputAdapter>()
                              .SingleOrDefault();
                if (adapter == null)
                {
                    adapter = new ObjectInputAdapter(subnetContext.BetaSource);
                }
                subnetContext.AlphaSource = adapter;
                context.HasSubnet         = true;
            }
            context.AlphaSource = subnetContext.AlphaSource;
        }