Examples of RuleMetadata


Examples of org.drools.spring.metadata.RuleMetadata

    private AnnotationRuleMetadataSource source = new AnnotationRuleMetadataSource();

    public void testNoAnnotation() throws Exception {
        class PojoRule {}

        RuleMetadata metadata = source.getRuleMetadata(PojoRule.class);

        assertNull(metadata);
    }
View Full Code Here

Examples of org.drools.spring.metadata.RuleMetadata

    public void testNoValues() throws Exception {
        @Rule
        class PojoRule {}

        RuleMetadata metadata = source.getRuleMetadata(PojoRule.class);

        assertNull(metadata);
    }
View Full Code Here

Examples of org.drools.spring.metadata.RuleMetadata

    public void testDefaultValues() throws Exception {
        @Rule("myRule")
        class PojoRule {}

        RuleMetadata metadata = source.getRuleMetadata(PojoRule.class);

        assertEquals("myRule", metadata.getName());
        assertNull(metadata.getDocumentation());
        assertNull(metadata.getSalience());
        assertNull(metadata.getDuration());
        assertNull(metadata.getNoLoop());
    }
View Full Code Here

Examples of org.drools.spring.metadata.RuleMetadata

    public void testNameDefaulted() throws Exception {
        @Rule(documentation="myDocumentation")
        class PojoRule {}

        RuleMetadata metadata = source.getRuleMetadata(PojoRule.class);

        assertEquals(PojoRule.class.getName(), metadata.getName());
        assertEquals("myDocumentation",  metadata.getDocumentation());
    }
View Full Code Here

Examples of org.drools.spring.metadata.RuleMetadata

              salience=10,
              duration=20,
              loop=Loop.ALLOW)
        class PojoRule {}

        RuleMetadata metadata = source.getRuleMetadata(PojoRule.class);

        assertEquals("myRule", metadata.getName());
        assertEquals("myDocumentation", metadata.getDocumentation());
        assertEquals(10, (int)metadata.getSalience());
        assertEquals(20, (long)metadata.getDuration());
        assertTrue(metadata.getNoLoop());
    }
View Full Code Here

Examples of org.drools.workbench.models.commons.shared.rule.RuleMetadata

            HorizontalPanel hp = new HorizontalPanel();
            hp.add( new SmallLabel( Constants.INSTANCE.Metadata2() ) );
            layout.addRow( hp );
        }
        for ( int i = 0; i < meta.length; i++ ) {
            RuleMetadata rmd = meta[ i ];
            layout.addAttribute( rmd.getAttributeName(),
                                 getEditorWidget( rmd,
                                                  i,
                                                  isReadOnly ) );
        }
        RuleAttribute[] attrs = model.attributes;
View Full Code Here

Examples of org.drools.workbench.models.commons.shared.rule.RuleMetadata

        list.addChangeHandler( new ChangeHandler() {
            public void onChange( ChangeEvent event ) {
                String attr = list.getItemText( list.getSelectedIndex() );
                if ( attr.equals( RuleAttributeWidget.LOCK_LHS ) || attr.equals( RuleAttributeWidget.LOCK_RHS ) ) {
                    model.addMetadata( new RuleMetadata( attr,
                                                         "true" ) );
                } else {
                    model.addAttribute( new RuleAttribute( attr,
                                                           "" ) );
                }
View Full Code Here

Examples of org.drools.workbench.models.commons.shared.rule.RuleMetadata

                                 final Command refresh ) {
        Button freezeConditions = new Button( Constants.INSTANCE.Conditions() );
        freezeConditions.addClickHandler( new ClickHandler() {

            public void onClick( ClickEvent event ) {
                model.addMetadata( new RuleMetadata( RuleAttributeWidget.LOCK_LHS,
                                                     "true" ) );
                refresh.execute();
                hide();
            }
        } );
        Button freezeActions = new Button( Constants.INSTANCE.Actions() );
        freezeActions.addClickHandler( new ClickHandler() {

            public void onClick( ClickEvent event ) {
                model.addMetadata( new RuleMetadata( RuleAttributeWidget.LOCK_RHS,
                                                     "true" ) );
                refresh.execute();
                hide();
            }
        } );
View Full Code Here

Examples of org.drools.workbench.models.commons.shared.rule.RuleMetadata

        addbutton.addClickHandler( new ClickHandler() {

            public void onClick( ClickEvent event ) {

                model.addMetadata( new RuleMetadata( box.getText(),
                                                     "" ) );
                refresh.execute();
                hide();
            }
        } );
View Full Code Here

Examples of org.drools.workbench.models.commons.shared.rule.RuleMetadata

            int index = allColumns.indexOf( meta );

            String cell = GuidedDTDRLUtilities.convertDTCellValueToString( row.get( index ) );

            if ( validCell( cell ) ) {
                metadataList.add( new RuleMetadata( meta.getMetadata(),
                                                    cell ) );
            }
        }
        if ( metadataList.size() > 0 ) {
            rm.metadataList = metadataList.toArray( new RuleMetadata[ metadataList.size() ] );
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.