Package org.drools.core.base

Examples of org.drools.core.base.SalienceInteger


                };

        final Rule rule0 = new Rule("test-rule0");
        rule0.setAgendaGroup("rule-flow-group-0");
        rule0.setConsequence(consequence0);
        rule0.setSalience(new SalienceInteger(10));

        final RuleTerminalNode node0 = new RuleTerminalNode(3,
                                                            new MockTupleSource(2),
                                                            rule0,
                                                            rule0.getLhs(),
View Full Code Here


    private void buildSalience(final RuleBuildContext context) {
        String salienceText = context.getRuleDescr().getSalience();
        if ( salienceText != null && !salienceText.equals( "" ) ) {
            try {
                // First check if it is an Integer
                Salience salience = new SalienceInteger( Integer.parseInt( salienceText ) );
                context.getRule().setSalience( salience );
            } catch ( Exception e ) {
                // It wasn't an integer, so build as an expression
                context.getDialect().getSalienceBuilder().build( context );
            }
View Full Code Here

    private void buildSalience(final RuleBuildContext context) {
        String salienceText = context.getRuleDescr().getSalience();
        if ( salienceText != null && !salienceText.equals( "" ) ) {
            try {
                // First check if it is an Integer
                Salience salience = new SalienceInteger( Integer.parseInt( salienceText ) );
                context.getRule().setSalience( salience );
            } catch ( Exception e ) {
                // It wasn't an integer, so build as an expression
                context.getDialect().getSalienceBuilder().build( context );
            }
View Full Code Here

       
        this.unlinkingEnabled = context.getRuleBase().getConfiguration().isPhreakEnabled();

        setFireDirect( rule.getActivationListener().equals( "direct" ) );
        if ( isFireDirect() ) {
            rule.setSalience( new SalienceInteger(Integer.MAX_VALUE) );
        }

        setDeclarations( this.subrule.getOuterDeclarations() );

        initDeclaredMask(context);       
View Full Code Here

       
        this.unlinkingEnabled = context.getRuleBase().getConfiguration().isPhreakEnabled();

        setFireDirect( rule.getActivationListener().equals( "direct" ) );
        if ( isFireDirect() ) {
            rule.setSalience( new SalienceInteger(Integer.MAX_VALUE) );
        }

        setDeclarations( this.subrule.getOuterDeclarations() );

        initDeclaredMask(context);       
View Full Code Here

                                                                                 null,
                                                                                 new DefaultFactHandle());

        final RuleImpl rule1 = new RuleImpl("test-rule1");
        rule1.setActivationGroup("activation-group-0");
        rule1.setSalience(new SalienceInteger(10));
        final RuleTerminalNode node1 = new RuleTerminalNode(5,
                                                            new MockTupleSource(4),
                                                            rule1,
                                                            rule1.getLhs(),
                                                            0,
                                                            buildContext);
        rule1.setConsequence(consequence);
        final PropagationContext context1 = pctxFactory.createPropagationContext(0,
                                                                                 PropagationContext.INSERTION,
                                                                                 rule1,
                                                                                 null,
                                                                                 new DefaultFactHandle());

        final RuleImpl rule2 = new RuleImpl("test-rule2");
        rule2.setSalience(new SalienceInteger(-5));
        final RuleTerminalNode node2 = new RuleTerminalNode(7,
                                                            new MockTupleSource(6),
                                                            rule2,
                                                            rule2.getLhs(),
                                                            0,
                                                            buildContext);
        rule2.setConsequence(consequence);
        final PropagationContext context2 = pctxFactory.createPropagationContext(0,
                                                                                 PropagationContext.INSERTION,
                                                                                 rule2,
                                                                                 null,
                                                                                 new DefaultFactHandle());

        final RuleImpl rule3 = new RuleImpl("test-rule3",
                                    "agendaGroup3");
        rule3.setSalience(new SalienceInteger(-10));
        rule3.setActivationGroup("activation-group-3");
        final RuleTerminalNode node3 = new RuleTerminalNode(9,
                                                            new MockTupleSource(8),
                                                            rule3,
                                                            rule3.getLhs(),
View Full Code Here

                                                            buildContext);

        final RuleImpl rule2 = new RuleImpl("test-rule2");
        rule2.setAgendaGroup("rule-flow-group-2");
        rule2.setConsequence(consequence);
        rule2.setSalience(new SalienceInteger(10));

        final RuleTerminalNode node2 = new RuleTerminalNode(5,
                                                            new MockTupleSource(2),
                                                            rule2,
                                                            rule2.getLhs(),
View Full Code Here

                };

        final RuleImpl rule0 = new RuleImpl("test-rule0");
        rule0.setAgendaGroup("rule-flow-group-0");
        rule0.setConsequence(consequence0);
        rule0.setSalience(new SalienceInteger(10));

        final RuleTerminalNode node0 = new RuleTerminalNode(3,
                                                            new MockTupleSource(2),
                                                            rule0,
                                                            rule0.getLhs(),
View Full Code Here

    private void buildSalience(final RuleBuildContext context) {
        String salienceText = context.getRuleDescr().getSalience();
        if ( salienceText != null && !salienceText.equals( "" ) ) {
            try {
                // First check if it is an Integer
                Salience salience = new SalienceInteger( Integer.parseInt( salienceText ) );
                context.getRule().setSalience( salience );
            } catch ( Exception e ) {
                // It wasn't an integer, so build as an expression
                context.getDialect().getSalienceBuilder().build( context );
            }
View Full Code Here

    private void buildSalience(final RuleBuildContext context) {
        String salienceText = context.getRuleDescr().getSalience();
        if ( salienceText != null && !salienceText.equals( "" ) ) {
            try {
                // First check if it is an Integer
                Salience salience = new SalienceInteger( Integer.parseInt( salienceText ) );
                context.getRule().setSalience( salience );
            } catch ( Exception e ) {
                // It wasn't an integer, so build as an expression
                context.getDialect().getSalienceBuilder().build( context );
            }
View Full Code Here

TOP

Related Classes of org.drools.core.base.SalienceInteger

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.