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

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


        c2.setFactType( "Driver" );
        c2.setFactField( "age" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c2 );

        ActionSetFieldCol a = new ActionSetFieldCol();
        a.setBoundName( "c1" );
        a.setFactField( "name" );
        dt.getActionCols().add( a );

        ActionSetFieldCol a2 = new ActionSetFieldCol();
        a2.setBoundName( "c1" );
        a2.setFactField( "age" );
        dt.getActionCols().add( a2 );

        ActionInsertFactCol ins = new ActionInsertFactCol();
        ins.setBoundName( "x" );
        ins.setFactType( "Driver" );
View Full Code Here


        conditionColAge2.setFactType( "Driver" );
        conditionColAge2.setFactField( "age" );
        conditionColAge2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( conditionColAge2 );

        ActionSetFieldCol a = new ActionSetFieldCol();
        a.setBoundName( "c1" );
        a.setFactField( "name" );
        dt.getActionCols().add( a );

        ActionSetFieldCol a2 = new ActionSetFieldCol();
        a2.setBoundName( "c1" );
        a2.setFactField( "age" );
        dt.getActionCols().add( a2 );

        ActionInsertFactCol ins = new ActionInsertFactCol();
        ins.setBoundName( "x" );
        ins.setFactType( "Driver" );
View Full Code Here

        mdc.setMetadata( "cheese" );

        AttributeCol ac = new AttributeCol();
        ac.setAttribute( "salience" );

        ActionSetFieldCol asfc = new ActionSetFieldCol();
        asfc.setBoundName( "d1" );
        asfc.setFactField( "age" );

        ActionInsertFactCol aifc = new ActionInsertFactCol();
        aifc.setBoundName( "d2" );
        aifc.setFactType( "Driver" );
        aifc.setFactField( "age" );
View Full Code Here

        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",
                      a3.getFactField() );
        assertEquals( SuggestionCompletionEngine.TYPE_STRING,
                      a3.getType() );

        ActionSetFieldCol a4 = (ActionSetFieldCol) tsdt.getActionCols().get( 3 );
        assertEquals( "f1",
                      a4.getBoundName() );
        assertEquals( "goo2",
                      a4.getFactField() );
        assertEquals( "whee",
                      a4.getDefaultValue() );
        assertEquals( SuggestionCompletionEngine.TYPE_STRING,
                      a4.getType() );

        assertEquals( 2,
                      tsdt.getData().size() );
        isRowEquivalent( tsdt.getData().get( 0 ),
                         dt.getData()[0] );
View Full Code Here

        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( RepositoryUpgradeHelper.makeDataLists( 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", ""}
View Full Code Here

        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( RepositoryUpgradeHelper.makeDataLists( new String[][]{
                new String[]{"1", "desc", "42", "33", "michael", "age * 0.2", "BAM", "6.60", "true", "gooVal1", null},
                new String[]{"2", "desc", "", "39", "bob", "age * 0.3", "BAM", "6.60", "", "gooVal1", ""}
View Full Code Here

        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( RepositoryUpgradeHelper.makeDataLists( new String[][]{
                new String[]{"1", "desc", "42", "33", "michael, manik", "age * 0.2", "age > 7", "6.60", "true", "gooVal1", null},
                new String[]{"2", "desc", "", "39", "bob, frank", "age * 0.3", "age > 7", "6.60", "", "gooVal1", ""}
View Full Code Here

        allColumns.add( new DescriptionCol() );
        allColumns.add( new MetadataCol() );
        allColumns.add( new ConditionCol() );
        List<ActionCol> cols = new ArrayList<ActionCol>();

        ActionSetFieldCol asf1 = new ActionSetFieldCol();
        asf1.setBoundName( "a" );
        asf1.setFactField( "field1" );

        asf1.setType( SuggestionCompletionEngine.TYPE_STRING );
        cols.add( asf1 );

        ActionSetFieldCol asf2 = new ActionSetFieldCol();
        asf2.setBoundName( "a" );
        asf2.setFactField( "field2" );
        asf2.setUpdate( true );
        asf2.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        cols.add( asf2 );

        ActionRetractFactCol ret = new ActionRetractFactCol();
        ret.setBoundName( "ret" );
        cols.add( ret );
View Full Code Here

        ConditionCol c = new ConditionCol();
        c.setBoundName( "x" );
        c.setFactType( "Context" );
        c.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c );
        ActionSetFieldCol asf = new ActionSetFieldCol();
        asf.setBoundName( "x" );
        asf.setFactField( "age" );
        asf.setType( "String" );

        dt.getActionCols().add( asf );

        String[][] data = new String[][]{
                new String[]{"1", "desc", "y", "old"}
View Full Code Here

        ConditionCol c = new ConditionCol();
        c.setBoundName( "x" );
        c.setFactType( "Context" );
        c.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c );
        ActionSetFieldCol asf = new ActionSetFieldCol();
        asf.setBoundName( "x" );
        asf.setFactField( "age" );
        asf.setType( "String" );
        asf.setUpdate( true );

        dt.getActionCols().add( asf );

        String[][] data = new String[][]{
                new String[]{"1", "desc", "y", "old"}
View Full Code Here

TOP

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

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.