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

Examples of org.drools.ide.common.client.modeldriven.dt52.LimitedEntryBRLActionColumn


        c1.setBinding( "$c1" );

        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        BRLConditionColumn brlCondition = new BRLConditionColumn();
        FactPattern fp = new FactPattern( "Driver" );
        fp.setBoundName( "$brl1" );

        SingleFieldConstraint sfc1 = new SingleFieldConstraint();
        sfc1.setFieldBinding( "$sfc1" );
        sfc1.setOperator( "==" );
        sfc1.setFieldName( "name" );
        sfc1.setFieldType( SuggestionCompletionEngine.TYPE_STRING );

        fp.addConstraint( sfc1 );
        brlCondition.getDefinition().add( fp );
        dt.getConditions().add( brlCondition );

        ActionInsertFactCol52 ins = new ActionInsertFactCol52();
        ins.setBoundName( "$ins" );
        ins.setFactField( "rating" );
View Full Code Here


        c1.setBinding( "$c1" );

        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        BRLConditionColumn brlCondition = new BRLConditionColumn();
        FactPattern fp = new FactPattern( "Driver" );
        fp.setBoundName( "$brl1" );

        SingleFieldConstraint sfc1 = new SingleFieldConstraint();
        sfc1.setFieldBinding( "$sfc1" );
        sfc1.setOperator( "==" );
        sfc1.setFieldName( "name" );
        sfc1.setFieldType( SuggestionCompletionEngine.TYPE_STRING );

        fp.addConstraint( sfc1 );
        brlCondition.getDefinition().add( fp );
        dt.getConditions().add( brlCondition );

        ActionInsertFactCol52 ins = new ActionInsertFactCol52();
        ins.setBoundName( "$ins" );
        ins.setFactField( "rating" );
View Full Code Here

        c1.setBinding( "$c1" );

        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        BRLConditionColumn brlCondition = new BRLConditionColumn();
        FactPattern fp = new FactPattern( "Driver" );
        fp.setBoundName( "$brl1" );

        SingleFieldConstraint sfc1 = new SingleFieldConstraint();
        sfc1.setFieldBinding( "$sfc1" );
        sfc1.setOperator( "==" );
        sfc1.setFieldName( "name" );
        sfc1.setFieldType( SuggestionCompletionEngine.TYPE_STRING );

        fp.addConstraint( sfc1 );
        brlCondition.getDefinition().add( fp );
        dt.getConditions().add( brlCondition );

        ActionInsertFactCol52 ins = new ActionInsertFactCol52();
        ins.setBoundName( "$ins" );
        ins.setFactField( "rating" );
View Full Code Here

        ins.setFactField( "rating" );
        ins.setFactType( "Person" );
        ins.setType( SuggestionCompletionEngine.TYPE_STRING );
        dt.getActionCols().add( ins );

        BRLRuleModel model = new BRLRuleModel( dt );

        assertNotNull( model.getAllVariables() );
        assertEquals( 3,
                      model.getAllVariables().size() );
        assertTrue( model.getAllVariables().contains( "$p1" ) );
        assertTrue( model.getAllVariables().contains( "$c1" ) );
        assertTrue( model.getAllVariables().contains( "$ins" ) );
    }
View Full Code Here

        ins.setFactField( "rating" );
        ins.setFactType( "Person" );
        ins.setType( SuggestionCompletionEngine.TYPE_STRING );
        dt.getActionCols().add( ins );

        BRLRuleModel model = new BRLRuleModel( dt );

        assertNotNull( model.getAllVariables() );
        assertEquals( 5,
                      model.getAllVariables().size() );
        assertTrue( model.getAllVariables().contains( "$p1" ) );
        assertTrue( model.getAllVariables().contains( "$c1" ) );
        assertTrue( model.getAllVariables().contains( "$ins" ) );
        assertTrue( model.getAllVariables().contains( "$brl1" ) );
        assertTrue( model.getAllVariables().contains( "$sfc1" ) );
    }
View Full Code Here

        ins.setFactField( "rating" );
        ins.setFactType( "Person" );
        ins.setType( SuggestionCompletionEngine.TYPE_STRING );
        dt.getActionCols().add( ins );

        BRLRuleModel model = new BRLRuleModel( dt );

        assertNotNull( model.getLHSBoundFacts() );
        assertEquals( 2,
                      model.getLHSBoundFacts().size() );
        assertTrue( model.getLHSBoundFacts().contains( "$p1" ) );
        assertTrue( model.getLHSBoundFacts().contains( "$brl1" ) );

        assertNotNull( model.getLHSBindingType( "$p1" ) );
        assertEquals( "Driver",
                      model.getLHSBindingType( "$p1" ) );
        assertNotNull( model.getLHSBindingType( "$brl1" ) );
        assertEquals( "Driver",
                      model.getLHSBindingType( "$brl1" ) );

        FactPattern r1 = model.getLHSBoundFact( "$p1" );
        assertNotNull( r1 );
        assertTrue( r1 instanceof BRLRuleModel.Pattern52FactPatternAdaptor );
        BRLRuleModel.Pattern52FactPatternAdaptor raif1 = (BRLRuleModel.Pattern52FactPatternAdaptor) r1;
        assertEquals( "Driver",
                      raif1.getFactType() );

        FactPattern r2 = model.getLHSBoundFact( "$brl1" );
        assertNotNull( r2 );
        assertEquals( "Driver",
                      r2.getFactType() );
    }
View Full Code Here

        ins.setFactField( "rating" );
        ins.setFactType( "Person" );
        ins.setType( SuggestionCompletionEngine.TYPE_STRING );
        dt.getActionCols().add( ins );

        BRLRuleModel model = new BRLRuleModel( dt );

        FieldConstraint fcr1 = model.getLHSBoundField( "$sfc1" );
        assertNotNull( fcr1 );
        assertTrue( fcr1 instanceof SingleFieldConstraint );
        SingleFieldConstraint fcr1sfc = (SingleFieldConstraint) fcr1;
        assertEquals( "name",
                      fcr1sfc.getFieldName() );
View Full Code Here

        aif.fieldValues[0].nature = BaseSingleFieldConstraint.TYPE_LITERAL;

        brlAction.getDefinition().add( aif );
        dt.getActionCols().add( brlAction );

        BRLRuleModel model = new BRLRuleModel( dt );

        assertNotNull( model.getAllVariables() );
        assertEquals( 4,
                      model.getAllVariables().size() );
        assertTrue( model.getAllVariables().contains( "$p1" ) );
        assertTrue( model.getAllVariables().contains( "$c1" ) );
        assertTrue( model.getAllVariables().contains( "$ins" ) );
        assertTrue( model.getAllVariables().contains( "$aif" ) );

        assertNotNull( model.getRHSBoundFacts() );
        assertEquals( 2,
                      model.getRHSBoundFacts().size() );
        assertTrue( model.getRHSBoundFacts().contains( "$ins" ) );
        assertTrue( model.getRHSBoundFacts().contains( "$aif" ) );

        ActionInsertFact r1 = model.getRHSBoundFact( "$ins" );
        assertNotNull( r1 );
        assertTrue( r1 instanceof BRLRuleModel.ActionInsertFactCol52ActionInsertFactAdaptor );
        BRLRuleModel.ActionInsertFactCol52ActionInsertFactAdaptor raif1 = (BRLRuleModel.ActionInsertFactCol52ActionInsertFactAdaptor) r1;
        assertEquals( "Person",
                      raif1.factType );
        assertEquals( "rating",
                      raif1.fieldValues[0].field );
        assertEquals( SuggestionCompletionEngine.TYPE_STRING,
                      raif1.fieldValues[0].type );
        assertNull( raif1.fieldValues[0].value );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      raif1.fieldValues[0].nature );

        ActionInsertFact r2 = model.getRHSBoundFact( "$aif" );
        assertNotNull( r2 );
        assertTrue( r2 instanceof ActionInsertFact );
        ActionInsertFact raif2 = (ActionInsertFact) r2;
        assertEquals( "Person",
                      raif2.factType );
View Full Code Here

        aif.fieldValues[0].nature = BaseSingleFieldConstraint.TYPE_LITERAL;

        brlAction.getDefinition().add( aif );
        dt.getActionCols().add( brlAction );

        BRLRuleModel model = new BRLRuleModel( dt );

        assertNotNull( model.getRHSBoundFacts() );
        assertEquals( 3,
                      model.getRHSBoundFacts().size() );
        assertTrue( model.getRHSBoundFacts().contains( "$ins" ) );
        assertTrue( model.getRHSBoundFacts().contains( "$ins2" ) );
        assertTrue( model.getRHSBoundFacts().contains( "$aif" ) );

        ActionInsertFact r1 = model.getRHSBoundFact( "$ins" );
        assertNotNull( r1 );
        assertTrue( r1 instanceof BRLRuleModel.ActionInsertFactCol52ActionInsertFactAdaptor );
        BRLRuleModel.ActionInsertFactCol52ActionInsertFactAdaptor raif1 = (BRLRuleModel.ActionInsertFactCol52ActionInsertFactAdaptor) r1;
        assertEquals( "Person",
                      raif1.factType );
        assertEquals( "rating",
                      raif1.fieldValues[0].field );
        assertEquals( SuggestionCompletionEngine.TYPE_STRING,
                      raif1.fieldValues[0].type );
        assertNull( raif1.fieldValues[0].value );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      raif1.fieldValues[0].nature );

        ActionInsertFact r2 = model.getRHSBoundFact( "$ins2" );
        assertNotNull( r2 );
        assertTrue( r2 instanceof BRLRuleModel.ActionInsertFactCol52ActionInsertLogicalFactAdaptor );
        BRLRuleModel.ActionInsertFactCol52ActionInsertLogicalFactAdaptor raif2 = (BRLRuleModel.ActionInsertFactCol52ActionInsertLogicalFactAdaptor) r2;
        assertEquals( "Person2",
                      raif2.factType );
        assertEquals( "rating2",
                      raif2.fieldValues[0].field );
        assertEquals( SuggestionCompletionEngine.TYPE_STRING,
                      raif2.fieldValues[0].type );
        assertNull( raif2.fieldValues[0].value );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      raif2.fieldValues[0].nature );

        ActionInsertFact r3 = model.getRHSBoundFact( "$aif" );
        assertNotNull( r3 );
        assertTrue( r3 instanceof ActionInsertFact );
        ActionInsertFact raif3 = (ActionInsertFact) r3;
        assertEquals( "Person",
                      raif3.factType );
View Full Code Here

        Pattern52 p1 = new Pattern52();
        p1.setFactType( "Driver" );
        p1.setBoundName( "$p1" );

        ConditionCol52 c1 = new ConditionCol52();
        c1.setFactField( "name" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        c1.setBinding( "$c1" );

        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        ActionInsertFactCol52 ins = new ActionInsertFactCol52();
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.dt52.LimitedEntryBRLActionColumn

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.