Examples of RuleAttribute


Examples of org.drools.ide.common.client.modeldriven.brl.RuleAttribute

        }
        throw new IllegalArgumentException( "Class " + o.getClass().getName() + " is not recognised" );
    }

    private RuleAttribute visitRuleAttribute(RuleAttribute attr) {
        RuleAttribute clone = new RuleAttribute();
        clone.attributeName = attr.attributeName;
        clone.value = attr.value;
        return clone;
    }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.RuleAttribute

        clone.setNegated( model.isNegated() );

        if ( model.attributes != null ) {
            clone.attributes = new RuleAttribute[model.attributes.length];
            for ( int i = 0; i < model.attributes.length; i++ ) {
                RuleAttribute attr = model.attributes[i];
                clone.attributes[i] = (RuleAttribute) visit( attr );
            }
        }
        if ( model.metadataList != null ) {
            clone.metadataList = new RuleMetadata[model.metadataList.length];
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.RuleAttribute

                           new Listener() {
                               public void handleEvent(Event event) {
                                   if ( combo.getSelectionIndex() == 0 ) {
                                       return;
                                   }
                                   modeller.getModel().addAttribute( new RuleAttribute( combo.getText(),
                                                                                        "" ) );
                                   modeller.setDirty( true );
                                   modeller.reloadOptions();
                                   close();
                               }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.RuleAttribute

        String expected = "rule \"my rule\"\n\tno-loop true\n\tdialect \"mvel\"\n\twhen\n\t\tPerson( )\n"
                          + "\t\tAccident( )\n\tthen\n\t\tinsert( 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 ActionInsertFact( "Report" ) );
        m.name = "my rule";
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.RuleAttribute

        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

Examples of org.drools.ide.common.client.modeldriven.brl.RuleAttribute

    @Test
    public void testAttr() {
        RuleModel m = new RuleModel();
        m.attributes = new RuleAttribute[1];
        m.attributes[0] = new RuleAttribute( "enabled",
                                             "true" );
        final String drl = brlPersistence.marshal( m );

        assertTrue( drl.indexOf( "enabled true" ) > 0 );
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.RuleAttribute

    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.setBoundName( "p1" );
        final SingleFieldConstraint con = new SingleFieldConstraint();
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.RuleAttribute

        RuleModel m = new RuleModel();

        String s = BRDRLPersistence.getInstance().marshal( m );
        assertTrue( s.indexOf( "mvel" ) > -1 );

        m.addAttribute( new RuleAttribute( "dialect",
                                           "goober" ) );
        s = BRDRLPersistence.getInstance().marshal( m );
        assertFalse( s.indexOf( "mvel" ) > -1 );
        assertTrue( s.indexOf( "goober" ) > -1 );
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.RuleAttribute

    @Test
    public void testLockOnActive() {
        RuleModel m = new RuleModel();

        m.addAttribute( new RuleAttribute( "lock-on-active",
                                           "true" ) );
        m.addAttribute( new RuleAttribute( "auto-focus",
                                           "true" ) );
        m.addAttribute( new RuleAttribute( "duration",
                                           "42" ) );

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

        assertTrue( s.indexOf( "lock-on-active true" ) > -1 );
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.RuleAttribute

        String expected = "rule \"my rule\"\n\tno-loop true\n\tdialect \"mvel\"\n\twhen\n\t\tPerson( )\n"
                          + "\t\tAccident( )\n\tthen\n\t\tinsert( new Report() );\n\t\tresults.add(f);\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 ActionInsertFact( "Report" ) );
        ActionGlobalCollectionAdd add = new ActionGlobalCollectionAdd();
        add.globalName = "results";
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.