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

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


                + "calendars \"myCalendar\", \"Yet Another Calendar\"\n"
                + "when\n"
                + "then\n"
                + "end";

        RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                           Collections.EMPTY_LIST,
                                                                           dmo );
        assertEquals( 1,
                      m.attributes.length );
        assertEquals( "calendars",
View Full Code Here


                dmo.getPackageGlobals()
            ).thenReturn(
                globals
                        );

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

        assertTrue( m.rhs[ 0 ] instanceof ActionCallMethod );
        ActionCallMethod actionGlobalCollectionAdd = (ActionCallMethod) m.rhs[ 0 ];
View Full Code Here

        HashMap<String, String> globals = new HashMap<String, String>();

        when( dmo.getPackageGlobals() ).thenReturn( globals );

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

        assertEquals( 2, m.getImports().getImports().size() );

        assertTrue( m.rhs[ 0 ] instanceof ActionCallMethod );
        ActionCallMethod mc = (ActionCallMethod) m.rhs[ 0 ];
        assertEquals( "put", mc.getMethodName() );
        assertEquals( "m", mc.getVariable() );
View Full Code Here

        methodInformation.put( "java.util.Map", mapMethodInformation );

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

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

        assertTrue( m.rhs[ 0 ] instanceof ActionCallMethod );
        ActionCallMethod mc = (ActionCallMethod) m.rhs[ 0 ];
View Full Code Here

        methodInformation.put( "org.mortgages.MyType", mapMethodInformation );

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

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

        assertTrue( m.rhs[ 0 ] instanceof ActionCallMethod );
        ActionCallMethod mc = (ActionCallMethod) m.rhs[ 0 ];
View Full Code Here

        methodInformation.put( "org.mortgages.MyType", mapMethodInformation );

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

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

        assertTrue( m.rhs[ 0 ] instanceof ActionCallMethod );
        ActionCallMethod mc = (ActionCallMethod) m.rhs[ 0 ];
View Full Code Here

                dmo.getPackageGlobals()
            ).thenReturn(
                globals
                        );

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

        assertTrue( m.rhs[ 0 ] instanceof ActionGlobalCollectionAdd );
        ActionGlobalCollectionAdd actionGlobalCollectionAdd = (ActionGlobalCollectionAdd) m.rhs[ 0 ];
View Full Code Here

                + "when\n"
                + "Applicant( age <= 22 )\n"
                + "then\n"
                + "end";

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

        assertNotNull( m );
        assertEquals( "rule1",
View Full Code Here

                              new ArrayList<String>(),
                              "int",
                              null,
                              DataType.TYPE_NUMERIC_INTEGER );

        RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                           Collections.EMPTY_LIST,
                                                                           dmo );
        assertEquals( 1,
                      m.lhs.length );
        assertTrue( m.lhs[ 0 ] instanceof FactPattern );
View Full Code Here

        addModelField( "Company",
                       "emps",
                       "java.util.List",
                       DataType.TYPE_COLLECTION );

        RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                           Collections.EMPTY_LIST,
                                                                           dmo );
        assertEquals( 1,
                      m.rhs.length );
        assertTrue( m.rhs[ 0 ] instanceof ActionSetField );
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.