Package org.drools.ide.common.client.modeldriven.brl

Examples of org.drools.ide.common.client.modeldriven.brl.RuleModel.addAttribute()


    String expected = "rule \"my rule\"\n\tno-loop true\n\tdialect \"mvel\"\n\twhen\n\t\tPerson( )\n"
        + "\t\tAccident( )\n\tthen\n\t\tinsertLogical( new Report() );\nend\n";
    final RuleModel m = new RuleModel();
    m.addLhsItem(new FactPattern("Person"));
    m.addLhsItem(new FactPattern("Accident"));
    m.addAttribute(new RuleAttribute("no-loop", "true"));

    m.addRhsItem(new ActionInsertLogicalFact("Report"));

    m.name = "my rule";
View Full Code Here


  private RuleModel getComplexModel() {
    final RuleModel m = new RuleModel();
    m.name = "Complex Rule";

    m.addAttribute(new RuleAttribute("no-loop", "true"));
    m.addAttribute(new RuleAttribute("salience", "-10"));
    m.addAttribute(new RuleAttribute("agenda-group", "aGroup"));

    final FactPattern pat = new FactPattern("Person");
    pat.boundName = "p1";
View Full Code Here

  private RuleModel getComplexModel() {
    final RuleModel m = new RuleModel();
    m.name = "Complex Rule";

    m.addAttribute(new RuleAttribute("no-loop", "true"));
    m.addAttribute(new RuleAttribute("salience", "-10"));
    m.addAttribute(new RuleAttribute("agenda-group", "aGroup"));

    final FactPattern pat = new FactPattern("Person");
    pat.boundName = "p1";
    final SingleFieldConstraint con = new SingleFieldConstraint();
View Full Code Here

    final RuleModel m = new RuleModel();
    m.name = "Complex Rule";

    m.addAttribute(new RuleAttribute("no-loop", "true"));
    m.addAttribute(new RuleAttribute("salience", "-10"));
    m.addAttribute(new RuleAttribute("agenda-group", "aGroup"));

    final FactPattern pat = new FactPattern("Person");
    pat.boundName = "p1";
    final SingleFieldConstraint con = new SingleFieldConstraint();
    con.setFieldBinding("f1");
View Full Code Here

    public void testBasics() {
        final BRLPersistence p = BRXMLPersistence.getInstance();
        final RuleModel m = new RuleModel();
        m.addLhsItem( new FactPattern( "Person" ) );
        m.addLhsItem( new FactPattern( "Accident" ) );
        m.addAttribute( new RuleAttribute( "no-loop",
                                           "true" ) );

        m.addRhsItem( new ActionInsertFact( "Report" ) );
        ActionGlobalCollectionAdd ag = new ActionGlobalCollectionAdd();
        ag.factName = "x";
View Full Code Here

    }

    private RuleModel getComplexModel() {
        final RuleModel m = new RuleModel();

        m.addAttribute( new RuleAttribute( "no-loop",
                                           "true" ) );

        final FactPattern pat = new FactPattern("Person");
        pat.boundName = "p1";
        final SingleFieldConstraint con = new SingleFieldConstraint();
View Full Code Here

    @Test
    public void testAttributes() {
    final RuleModel m = new RuleModel();
    final RuleAttribute at = new RuleAttribute("salience", "42");
    m.addAttribute(at);
    assertEquals(1, m.attributes.length);
    assertEquals(at, m.attributes[0]);

    final RuleAttribute at2 = new RuleAttribute("agenda-group", "x");
    m.addAttribute(at2);
View Full Code Here

    m.addAttribute(at);
    assertEquals(1, m.attributes.length);
    assertEquals(at, m.attributes[0]);

    final RuleAttribute at2 = new RuleAttribute("agenda-group", "x");
    m.addAttribute(at2);
    assertEquals(2, m.attributes.length);
    assertEquals(at2, m.attributes[1]);

    m.removeAttribute(0);
    assertEquals(1, m.attributes.length);
View Full Code Here

    public void testBasics() {
        final BRLPersistence p = BRXMLPersistence.getInstance();
        final RuleModel m = new RuleModel();
        m.addLhsItem( new FactPattern( "Person" ) );
        m.addLhsItem( new FactPattern( "Accident" ) );
        m.addAttribute( new RuleAttribute( "no-loop",
                                           "true" ) );

        m.addRhsItem( new ActionInsertFact( "Report" ) );
        ActionGlobalCollectionAdd ag = new ActionGlobalCollectionAdd();
        ag.factName = "x";
View Full Code Here

    }

    private RuleModel getComplexModel() {
        final RuleModel m = new RuleModel();

        m.addAttribute( new RuleAttribute( "no-loop",
                                           "true" ) );

        final FactPattern pat = new FactPattern();
        pat.boundName = "p1";
        pat.factType = "Person";
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.