Package org.drools.workbench.models.datamodel.rule

Examples of org.drools.workbench.models.datamodel.rule.RuleModel


        String dslDefinition = "There is a {rating} rated applicant older than {age} years";
        String dslFile = "[when]" + dslDefinition + "= Applicant( creditRating == \"{rating}\", age > {age} )";

        when( dmo.getPackageName() ).thenReturn( "org.mortgages" );

        final RuleModel model = RuleModelDRLPersistenceImpl.getInstance().unmarshalUsingDSL( drl,
                                                                                             new ArrayList<String>(),
                                                                                             dmo,
                                                                                             new String[]{ dslFile } );

        assertEquals( 1, model.lhs.length );
View Full Code Here


        String dslDefinition = "Price is ${p}";
        String dslFile = "[when]" + dslDefinition + "= Item( price == \"{p}\" )";

        when( dmo.getPackageName() ).thenReturn( "org.mortgages" );

        final RuleModel model = RuleModelDRLPersistenceImpl.getInstance().unmarshalUsingDSL( drl,
                                                                                             new ArrayList<String>(),
                                                                                             dmo,
                                                                                             new String[]{ dslFile } );

        assertEquals( 1, model.lhs.length );
View Full Code Here

                + "end\n";

        final String dslDefinition = "The credit rating is {rating:ENUM:Applicant.creditRating}";
        final String dslFile = "[when]" + dslDefinition + "=Applicant( creditRating == {rating} )";

        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshalUsingDSL( drl,
                                                                                         new ArrayList<String>(),
                                                                                         dmo,
                                                                                         new String[]{ dslFile } );

        assertNotNull( m );
View Full Code Here

                + "end\n";

        final String dslDefinition = "Set applicant name to {name:\\w+ \\w+}";
        final String dslFile = "[then]" + dslDefinition + "=$a.setName( \"{name}\" )";

        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshalUsingDSL( drl,
                                                                                         new ArrayList<String>(),
                                                                                         dmo,
                                                                                         new String[]{ dslFile } );

        assertNotNull( m );
View Full Code Here

        methodInformation.put( "java.lang.String", mapMethodInformation );

        when( dmo.getProjectMethodInformation() ).thenReturn( methodInformation );

        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl, Collections.EMPTY_LIST, dmo );

        assertNotNull( m );

        assertEquals( 2, m.rhs.length );
        assertTrue( m.rhs[ 0 ] instanceof ActionCallMethod );
View Full Code Here

        addModelField( "org.test.Person",
                       "field1",
                       "java.lang.Integer",
                       DataType.TYPE_NUMERIC_INTEGER );

        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                                 new ArrayList<String>(),
                                                                                 dmo );

        assertNotNull( m );
View Full Code Here

        addModelField( "org.test.Person",
                       "field1",
                       "java.lang.Integer",
                       DataType.TYPE_NUMERIC_INTEGER );

        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                                 new ArrayList<String>(),
                                                                                 dmo );

        assertNotNull( m );
View Full Code Here

        addModelField( "org.test.Person",
                       "field1",
                       "java.lang.Integer",
                       DataType.TYPE_NUMERIC_INTEGER );

        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                                 new ArrayList<String>(),
                                                                                 dmo );

        assertNotNull( m );
View Full Code Here

        addModelField( "org.test.Person",
                       "field1",
                       "java.lang.Integer",
                       DataType.TYPE_NUMERIC_INTEGER );

        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                                 new ArrayList<String>(),
                                                                                 dmo );

        assertNotNull( m );
View Full Code Here

                       "java.lang.Integer",
                       DataType.TYPE_NUMERIC_INTEGER );

        when( dmo.getPackageName() ).thenReturn( "org.test" );

        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                                 new ArrayList<String>(),
                                                                                 dmo );

        assertNotNull( m );
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.datamodel.rule.RuleModel

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.