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

Examples of org.drools.ide.common.client.modeldriven.dt.ActionRetractFactCol


        ins.setFactType( "Cheese" );
        ins.setFactField( "price" );
        ins.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        dt.getActionCols().add( ins );

        ActionRetractFactCol ret = new ActionRetractFactCol();
        ret.setBoundName( "f2" );
        dt.getActionCols().add( ret );

        ActionSetFieldCol set = new ActionSetFieldCol();
        set.setBoundName( "f1" );
        set.setFactField( "goo1" );
View Full Code Here


        ins.setFactType( "Cheese" );
        ins.setFactField( "price" );
        ins.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        dt.getActionCols().add( ins );

        ActionRetractFactCol ret = new ActionRetractFactCol();
        ret.setBoundName( "f2" );
        dt.getActionCols().add( ret );

        ActionSetFieldCol set = new ActionSetFieldCol();
        set.setBoundName( "f1" );
        set.setFactField( "goo1" );
View Full Code Here

        asf2.setFactField( "field2" );
        asf2.setUpdate( true );
        asf2.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        cols.add( asf2 );

        ActionRetractFactCol ret = new ActionRetractFactCol();
        ret.setBoundName( "ret" );
        cols.add( ret );

        ActionInsertFactCol ins1 = new ActionInsertFactCol();
        ins1.setBoundName( "ins" );
        ins1.setFactType( "Cheese" );
View Full Code Here

        ins.setFactType( "Cheese" );
        ins.setFactField( "price" );
        ins.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        dt.getActionCols().add( ins );

        ActionRetractFactCol ret = new ActionRetractFactCol();
        ret.setBoundName( "f2" );
        dt.getActionCols().add( ret );

        ActionSetFieldCol set = new ActionSetFieldCol();
        set.setBoundName( "f1" );
        set.setFactField( "goo1" );
        set.setType( SuggestionCompletionEngine.TYPE_STRING );
        dt.getActionCols().add( set );

        ActionSetFieldCol set2 = new ActionSetFieldCol();
        set2.setBoundName( "f1" );
        set2.setFactField( "goo2" );
        set2.setDefaultValue( "whee" );
        set2.setType( SuggestionCompletionEngine.TYPE_STRING );
        dt.getActionCols().add( set2 );

        dt.setData( new String[][]{
                new String[]{"1", "desc", "42", "33", "michael", "age * 0.2", "age > 7", "6.60", "true", "gooVal1", null},
                new String[]{"2", "desc", "", "39", "bob", "age * 0.3", "age > 7", "6.60", "", "gooVal1", ""}
        } );

        TypeSafeGuidedDecisionTable tsdt = RepositoryUpgradeHelper.convertGuidedDTModel( dt );

        assertEquals( "michael",
                      tsdt.getTableName() );

        assertEquals( 1,
                      tsdt.getMetadataCols().size() );
        assertEquals( "legacy",
                      tsdt.getMetadataCols().get( 0 ).getMetadata() );
        assertEquals( "yes",
                      tsdt.getMetadataCols().get( 0 ).getDefaultValue() );

        assertEquals( 1,
                      tsdt.getAttributeCols().size() );
        assertEquals( "salience",
                      tsdt.getAttributeCols().get( 0 ).getAttribute() );
        assertEquals( "66",
                      tsdt.getAttributeCols().get( 0 ).getDefaultValue() );

        assertEquals( 4,
                      tsdt.getConditionCols().size() );

        assertEquals( "f1",
                      tsdt.getConditionCols().get( 0 ).getBoundName() );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      tsdt.getConditionCols().get( 0 ).getConstraintValueType() );
        assertEquals( "age",
                      tsdt.getConditionCols().get( 0 ).getFactField() );
        assertEquals( "Driver",
                      tsdt.getConditionCols().get( 0 ).getFactType() );
        assertEquals( "Driver f1 age",
                      tsdt.getConditionCols().get( 0 ).getHeader() );
        assertEquals( "==",
                      tsdt.getConditionCols().get( 0 ).getOperator() );

        assertEquals( "f1",
                      tsdt.getConditionCols().get( 1 ).getBoundName() );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      tsdt.getConditionCols().get( 1 ).getConstraintValueType() );
        assertEquals( "name",
                      tsdt.getConditionCols().get( 1 ).getFactField() );
        assertEquals( "Driver",
                      tsdt.getConditionCols().get( 1 ).getFactType() );
        assertEquals( "Driver f1 name",
                      tsdt.getConditionCols().get( 1 ).getHeader() );
        assertEquals( "==",
                      tsdt.getConditionCols().get( 1 ).getOperator() );

        assertEquals( "f1",
                      tsdt.getConditionCols().get( 2 ).getBoundName() );
        assertEquals( BaseSingleFieldConstraint.TYPE_RET_VALUE,
                      tsdt.getConditionCols().get( 2 ).getConstraintValueType() );
        assertEquals( "rating",
                      tsdt.getConditionCols().get( 2 ).getFactField() );
        assertEquals( "Driver",
                      tsdt.getConditionCols().get( 2 ).getFactType() );
        assertEquals( "Driver rating",
                      tsdt.getConditionCols().get( 2 ).getHeader() );
        assertEquals( "==",
                      tsdt.getConditionCols().get( 2 ).getOperator() );

        assertEquals( "f2",
                      tsdt.getConditionCols().get( 3 ).getBoundName() );
        assertEquals( BaseSingleFieldConstraint.TYPE_PREDICATE,
                      tsdt.getConditionCols().get( 3 ).getConstraintValueType() );
        assertEquals( "(not needed)",
                      tsdt.getConditionCols().get( 3 ).getFactField() );
        assertEquals( "Driver",
                      tsdt.getConditionCols().get( 3 ).getFactType() );
        assertEquals( "Driver 2 pimp",
                      tsdt.getConditionCols().get( 3 ).getHeader() );

        assertEquals( 4,
                      tsdt.getActionCols().size() );

        ActionInsertFactCol a1 = (ActionInsertFactCol) tsdt.getActionCols().get( 0 );
        assertEquals( "ins",
                      a1.getBoundName() );
        assertEquals( "Cheese",
                      a1.getFactType() );
        assertEquals( "price",
                      a1.getFactField() );
        assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
                      a1.getType() );

        ActionRetractFactCol a2 = (ActionRetractFactCol) tsdt.getActionCols().get( 1 );
        assertEquals( "f2",
                      a2.getBoundName() );

        ActionSetFieldCol a3 = (ActionSetFieldCol) tsdt.getActionCols().get( 2 );
        assertEquals( "f1",
                      a3.getBoundName() );
        assertEquals( "goo1",
View Full Code Here

        ins.factType = "Cheese";
        ins.factField = "price";
        ins.type = SuggestionCompletionEngine.TYPE_NUMERIC;
        dt.actionCols.add( ins );

        ActionRetractFactCol ret = new ActionRetractFactCol();
        ret.boundName = "f2";
        dt.actionCols.add( ret );

        ActionSetFieldCol set = new ActionSetFieldCol();
        set.boundName = "f1";
View Full Code Here

        ins.factType = "Cheese";
        ins.factField = "price";
        ins.type = SuggestionCompletionEngine.TYPE_NUMERIC;
        dt.actionCols.add( ins );

        ActionRetractFactCol ret = new ActionRetractFactCol();
        ret.boundName = "f2";
        dt.actionCols.add( ret );

        ActionSetFieldCol set = new ActionSetFieldCol();
        set.boundName = "f1";
View Full Code Here

                    ActionFieldValue val = new ActionFieldValue( ac.getFactField(),
                                                                 cell,
                                                                 ac.getType() );
                    ins.addFieldValue( val );
                } else if ( c instanceof ActionRetractFactCol ) {
                    ActionRetractFactCol rf = (ActionRetractFactCol) c;
                    LabelledAction a = findByLabelledAction( actions,
                                                             rf.getBoundName() );
                    if ( a == null ) {
                        a = new LabelledAction();
                        a.action = new ActionRetractFact( rf.getBoundName() );
                        a.boundName = rf.getBoundName();
                        actions.add( a );
                    }
                } else if ( c instanceof ActionSetFieldCol ) {
                    ActionSetFieldCol sf = (ActionSetFieldCol) c;
                    LabelledAction a = findByLabelledAction( actions,
View Full Code Here

        ins.factType = "Cheese";
        ins.factField = "price";
        ins.type = SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER;
        dt.actionCols.add( ins );

        ActionRetractFactCol ret = new ActionRetractFactCol();
        ret.boundName = "ret1";
        dt.actionCols.add( ret );

        ActionSetFieldCol set = new ActionSetFieldCol();
        set.boundName = "f1";
View Full Code Here

        ins.factType = "Cheese";
        ins.factField = "price";
        ins.type = SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER;
        dt.actionCols.add( ins );

        ActionRetractFactCol ret = new ActionRetractFactCol();
        ret.boundName = "ret1";
        dt.actionCols.add( ret );

        ActionSetFieldCol set = new ActionSetFieldCol();
        set.boundName = "f1";
View Full Code Here

                    ActionFieldValue val = new ActionFieldValue( ac.getFactField(),
                                                                 cell,
                                                                 ac.getType() );
                    ins.addFieldValue( val );
                } else if ( c instanceof ActionRetractFactCol ) {
                    ActionRetractFactCol rf = (ActionRetractFactCol) c;
                    LabelledAction a = findByLabelledAction( actions,
                                                             rf.getBoundName() );
                    if ( a == null ) {
                        a = new LabelledAction();
                        a.action = new ActionRetractFact( rf.getBoundName() );
                        a.boundName = rf.getBoundName();
                        actions.add( a );
                    }
                } else if ( c instanceof ActionSetFieldCol ) {
                    ActionSetFieldCol sf = (ActionSetFieldCol) c;
                    LabelledAction a = findByLabelledAction( actions,
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.dt.ActionRetractFactCol

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.