Package org.drools.brms.client.modeldriven.brl

Examples of org.drools.brms.client.modeldriven.brl.CompositeFactPattern


        con.value = "42";
        pat.addConstraint( con );

        m.addLhsItem( pat );

        final CompositeFactPattern comp = new CompositeFactPattern( "not" );
        comp.addFactPattern( new FactPattern( "Cancel" ) );
        m.addLhsItem( comp );

        final ActionUpdateField set = new ActionUpdateField();
        set.variable = "p1";
        set.addFieldValue( new ActionFieldValue( "status",
View Full Code Here


    }

    public void testInvalidComposite() throws Exception {
        RuleModel m = new RuleModel();
        CompositeFactPattern com = new CompositeFactPattern("not");
        m.addLhsItem( com );

        String s = BRDRLPersistence.getInstance().marshal( m );
        assertNotNull(s);

        m.addLhsItem( new CompositeFactPattern("or") );
        m.addLhsItem( new CompositeFactPattern("exists") );
        s = BRDRLPersistence.getInstance().marshal( m );
        assertNotNull(s);
    }
View Full Code Here

        SingleFieldConstraint sfc2 = new SingleFieldConstraint("q");
        x.addConstraint( sfc2 );
        sfc2.fieldBinding = "field2";
       
       
        model.lhs[1] = new CompositeFactPattern();
    
        List vars = model.getAllVariables();
        assertEquals(3, vars.size());
        assertEquals("boundFact", vars.get( 0 ));
        assertEquals("field1", vars.get( 1 ));
View Full Code Here

        con.value = "42";
        pat.addConstraint( con );

        m.addLhsItem( pat );

        final CompositeFactPattern comp = new CompositeFactPattern( "not" );
        comp.addFactPattern( new FactPattern( "Cancel" ) );
        m.addLhsItem( comp );

        final ActionUpdateField set = new ActionUpdateField();
        set.variable = "p1";
        set.addFieldValue( new ActionFieldValue( "status",
View Full Code Here

    }
   
    public void testInvalidComposite() throws Exception {
        RuleModel m = new RuleModel();
        CompositeFactPattern com = new CompositeFactPattern("not");
        m.addLhsItem( com );
       
        String s = BRDRLPersistence.getInstance().marshal( m );
        assertNotNull(s);
       
        m.addLhsItem( new CompositeFactPattern("or") );
        m.addLhsItem( new CompositeFactPattern("exists") );
        s = BRDRLPersistence.getInstance().marshal( m );
        assertNotNull(s);
    }
View Full Code Here

        con.value = "42";
        pat.addConstraint( con );

        m.addLhsItem( pat );

        final CompositeFactPattern comp = new CompositeFactPattern( "not" );
        comp.addFactPattern( new FactPattern( "Cancel" ) );
        m.addLhsItem( comp );

        final ActionUpdateField set = new ActionUpdateField();
        set.variable = "p1";
        set.addFieldValue( new ActionFieldValue( "status",
View Full Code Here

import org.drools.brms.client.modeldriven.brl.FactPattern;

public class CompositeFactPatternTest extends TestCase {

    public void testAddPattern() {
        final CompositeFactPattern pat = new CompositeFactPattern();
        final FactPattern x = new FactPattern();
        pat.addFactPattern( x );
        assertEquals( 1,
                      pat.patterns.length );

        final FactPattern y = new FactPattern();
        pat.addFactPattern( y );
        assertEquals( 2,
                      pat.patterns.length );
        assertEquals( x,
                      pat.patterns[0] );
        assertEquals( y,
View Full Code Here

        con.value = "42";
        pat.addConstraint( con );

        m.addLhsItem( pat );

        final CompositeFactPattern comp = new CompositeFactPattern( "not" );
        comp.addFactPattern( new FactPattern( "Cancel" ) );
        m.addLhsItem( comp );

        final ActionUpdateField set = new ActionUpdateField();
        set.variable = "p1";
        set.addFieldValue( new ActionFieldValue( "status",
View Full Code Here

    }

    public void testInvalidComposite() throws Exception {
        RuleModel m = new RuleModel();
        CompositeFactPattern com = new CompositeFactPattern("not");
        m.addLhsItem( com );

        String s = BRDRLPersistence.getInstance().marshal( m );
        assertNotNull(s);

        m.addLhsItem( new CompositeFactPattern("or") );
        m.addLhsItem( new CompositeFactPattern("exists") );
        s = BRDRLPersistence.getInstance().marshal( m );
        assertNotNull(s);
    }
View Full Code Here

TOP

Related Classes of org.drools.brms.client.modeldriven.brl.CompositeFactPattern

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.