Package org.drools.reteoo

Examples of org.drools.reteoo.ConditionalBranchEvaluator


public class ConditionalBranchBuilder implements ReteooComponentBuilder {

    public void build( BuildContext context, BuildUtils utils, RuleConditionElement rce ) {
        ConditionalBranch conditionalBranch = (ConditionalBranch) rce;
        ConditionalBranchEvaluator branchEvaluator = buildConditionalBranchEvaluator( context, conditionalBranch );

        context.pushRuleComponent( rce );

        ConditionalBranchNode node = new ConditionalBranchNode( context.getNextId(),
                                                                context.getTupleSource(),
View Full Code Here


        RuleTerminalNode terminalNode = buildTerminalNodeForNamedConsequence(context, conditionalBranch.getNamedConsequence());
        terminalNode.networkUpdated(new UpdateContext());
        // adds the terminal node to the list of nodes created/added by this sub-rule
        context.getNodes().add(terminalNode);

        return new ConditionalBranchEvaluator( conditionalBranch.getEvalCondition(),
                                               context.getTupleSource().getPartitionId(),
                                               terminalNode,
                                               conditionalBranch.getNamedConsequence().isBreaking(),
                                               conditionalBranch.getElseBranch() != null ? buildConditionalBranchEvaluator( context, conditionalBranch.getElseBranch() ) : null  );
    }
View Full Code Here

public class ConditionalBranchBuilder implements ReteooComponentBuilder {

    public void build( BuildContext context, BuildUtils utils, RuleConditionElement rce ) {
        ConditionalBranch conditionalBranch = (ConditionalBranch) rce;
        ConditionalBranchEvaluator branchEvaluator = buildConditionalBranchEvaluator( context, conditionalBranch );

        context.pushRuleComponent( rce );

        ConditionalBranchNode node = new ConditionalBranchNode( context.getNextId(),
                                                                context.getTupleSource(),
View Full Code Here

        RuleTerminalNode terminalNode = buildTerminalNodeForNamedConsequence(context, conditionalBranch.getNamedConsequence());
        terminalNode.networkUpdated(new UpdateContext());
        // adds the terminal node to the list of nodes created/added by this sub-rule
        context.addNode(terminalNode);

        return new ConditionalBranchEvaluator( conditionalBranch.getEvalCondition(),
                                               context.getTupleSource().getPartitionId(),
                                               terminalNode,
                                               conditionalBranch.getNamedConsequence().isBreaking(),
                                               conditionalBranch.getElseBranch() != null ? buildConditionalBranchEvaluator( context, conditionalBranch.getElseBranch() ) : null  );
    }
View Full Code Here

                                  InternalWorkingMemory wm,
                                  LeftTupleSets srcLeftTuples,
                                  LeftTupleSets trgLeftTuples) {
            boolean tupleMemoryEnabled = true;

            ConditionalBranchEvaluator branchEvaluator = branchNode.getBranchEvaluator();           
           
            for ( LeftTuple leftTuple = srcLeftTuples.getInsertFirst(); leftTuple != null; ) {
                LeftTuple next = leftTuple.getStagedNext();
               
                boolean breaking = false;
                ConditionalExecution conditionalExecution = branchEvaluator.evaluate( leftTuple, wm, cbm.context );

                if ( conditionalExecution != null ) {
                    RuleTerminalNode rtn = ( RuleTerminalNode ) conditionalExecution.getSink().getFirstLeftTupleSink();
                    LeftTuple branchedLeftTuple = rtn.createLeftTuple( leftTuple, 
                                                                       rtn,
View Full Code Here

                                  LeftTupleSets srcLeftTuples,
                                  LeftTupleSets trgLeftTuples,
                                  LeftTupleSets stagedLeftTuples) {
            boolean tupleMemoryEnabled = true;

            ConditionalBranchEvaluator branchEvaluator = branchNode.getBranchEvaluator();
           
            for ( LeftTuple leftTuple = srcLeftTuples.getUpdateFirst(); leftTuple != null; ) {
                LeftTuple next = leftTuple.getStagedNext();
               
                LeftTuple rtnLeftTuple = ( LeftTuple ) leftTuple.getObject();
                LeftTuple mainLeftTuple = leftTuple.getFirstChild();
                          
                RuleTerminalNode oldRtn = null;
                if ( rtnLeftTuple != null ) {
                    oldRtn = ( RuleTerminalNode ) rtnLeftTuple.getSink();
                }
               
                ConditionalExecution conditionalExecution = branchEvaluator.evaluate( leftTuple, wm, cbm.context );
               
                RuleTerminalNode newRtn = null;
                boolean breaking = false;
                if ( conditionalExecution != null ) {
                    newRtn = ( RuleTerminalNode ) conditionalExecution.getSink().getFirstLeftTupleSink();
View Full Code Here

TOP

Related Classes of org.drools.reteoo.ConditionalBranchEvaluator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.