Exemplo n.º 1
0
        public override BaseJoin compileJoin(ICondition condition, int position, Rule.IRule rule)
        {
            Binding[]         binds    = getBindings(condition, rule, position);
            TemporalCondition tc       = (TemporalCondition)condition;
            TemporalEqNode    joinNode = null;

            //deal with the CE which is not NOT CE.
            if (!tc.Negated)
            {
                if (binds.Length > 0 && tc.HasPredicateJoin)
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (binds.Length > 0 && tc.HasNotEqual)
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (binds.Length > 0)
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
            }

            //deal with the CE which is NOT CE.
            if (tc.Negated)
            {
                if (binds.Length > 0 && tc.HasPredicateJoin)
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (tc.HasNotEqual)
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
                else
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
            }
            joinNode.Bindings         = binds;
            joinNode.RightElapsedTime = tc.RelativeTime * 1000;
            return(joinNode);
        }
Exemplo n.º 2
0
        public override BaseJoin compileJoin(ICondition condition, int position, Rule.IRule rule)
        {
            Binding[] binds = getBindings(condition, rule, position);
            TemporalCondition tc = (TemporalCondition) condition;
            TemporalEqNode joinNode = null;
            //deal with the CE which is not NOT CE.
            if (!tc.Negated)
            {
                if (binds.Length > 0 && tc.HasPredicateJoin)
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (binds.Length > 0 && tc.HasNotEqual)
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (binds.Length > 0)
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
            }

            //deal with the CE which is NOT CE.
            if (tc.Negated)
            {
                if (binds.Length > 0 && tc.HasPredicateJoin)
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (tc.HasNotEqual)
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
                else
                {
                    joinNode = new TemporalEqNode(ruleCompiler.Engine.nextNodeId());
                }
            }
            joinNode.Bindings = binds;
            joinNode.RightElapsedTime = tc.RelativeTime*1000;
            return joinNode;
        }