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

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


        clone.value = attr.value;
        return clone;
    }

    private RuleMetadata visitRuleMetadata(RuleMetadata md) {
        RuleMetadata clone = new RuleMetadata();
        clone.attributeName = md.attributeName;
        clone.value = md.value;
        return clone;
    }
View Full Code Here


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

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

        final RuleMetadata rm = new RuleMetadata( "foo",
                                                  "bar" );

        // test add
        m.addMetadata( rm );
        assertEquals( 1,
                      m.metadataList.length );
        assertEquals( rm,
                      m.metadataList[0] );

        // should be able to find it
        RuleMetadata gm = m.getMetaData( "foo" );
        assertNotNull( gm );

        // test add and remove
        final RuleMetadata rm2 = new RuleMetadata( "foo2",
                                                   "bar2" );
        m.addMetadata( rm2 );
        assertEquals( 2,
                      m.metadataList.length );
        assertEquals( rm2,
View Full Code Here

    @Test
    public void testRuleMetadata() {

        RuleModel model = new RuleModel();
        model.metadataList = new RuleMetadata[2];
        model.metadataList[0] = new RuleMetadata( "md0",
                                                  "md0Value" );
        model.metadataList[1] = new RuleMetadata( "md1",
                                                  "md1Value" );

        RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
        RuleModel clone = cloneVisitor.visitRuleModel( model );
View Full Code Here

            int index = allColumns.indexOf( meta );

            String cell = GuidedDTDRLOtherwiseHelper.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

Related Classes of org.drools.ide.common.client.modeldriven.brl.RuleMetadata

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.