Package org.drools.workbench.models.guided.dtable.shared.model

Examples of org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52


        c2.setFactField( "nothing" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c2 );
        dt.getConditions().add( p2 );

        final ActionSetFieldCol52 asf = new ActionSetFieldCol52();
        asf.setBoundName( "c1" );
        asf.setFactField( "name" );
        dt.getActionCols().add( asf );

        final ActionInsertFactCol52 ins = new ActionInsertFactCol52();
        ins.setBoundName( "x" );
        ins.setFactField( "rating" );
        ins.setFactType( "Person" );
        dt.getActionCols().add( ins );

        final ActionInsertFactCol52 ins_ = new ActionInsertFactCol52();
        ins_.setBoundName( "x" );
        ins_.setFactField( "rating" );
        ins_.setFactType( "Person" );
        ins_.setValueList( "one,two,three" );
        dt.getActionCols().add( ins_ );

        final ActionSetFieldCol52 asf_ = new ActionSetFieldCol52();
        asf_.setBoundName( "c1" );
        asf_.setFactField( "goo" );
        dt.getActionCols().add( asf_ );

        final ActionSetFieldCol52 asf__ = new ActionSetFieldCol52();
        asf__.setBoundName( "c1" );
        asf__.setFactField( "goo" );
        asf__.setValueList( "one,two,three" );
        dt.getActionCols().add( asf__ );

        assertTrue( oracle.hasEnums( p1.getFactType(),
                                     c1.getFactField() ) );
        assertFalse( utils.hasValueList( c1 ) );
        String[] r = oracle.getEnums( p1.getFactType(),
                                      c1.getFactField(),
                                      currentValueMap ).getFixedList();
        assertEquals( 2,
                      r.length );
        assertEquals( "bob",
                      r[ 0 ] );
        assertEquals( "michael",
                      r[ 1 ] );

        assertTrue( oracle.hasEnums( p1_.getFactType(),
                                     c1_.getFactField() ) );
        assertFalse( utils.hasValueList( c1_ ) );
        r = oracle.getEnums( p1_.getFactType(),
                             c1_.getFactField(),
                             currentValueMap ).getFixedList();
        assertEquals( 2,
                      r.length );
        assertEquals( "bob",
                      r[ 0 ] );
        assertEquals( "michael",
                      r[ 1 ] );

        assertFalse( oracle.hasEnums( p1_.getFactType(),
                                      c1__.getFactField() ) );
        assertTrue( utils.hasValueList( c1__ ) );
        r = utils.getValueList( c1__ );
        assertEquals( 2,
                      r.length );
        assertEquals( "Male",
                      r[ 0 ] );
        assertEquals( "Female",
                      r[ 1 ] );

        assertTrue( oracle.hasEnums( p1__.getFactType(),
                                     c1___.getFactField() ) );
        assertTrue( utils.hasValueList( c1___ ) );
        r = utils.getValueList( c1___ );
        assertEquals( 3,
                      r.length );
        assertEquals( "one",
                      r[ 0 ] );
        assertEquals( "two",
                      r[ 1 ] );
        assertEquals( "three",
                      r[ 2 ] );

        assertEquals( 0,
                      utils.getValueList( c2 ).length );

        assertTrue( oracle.hasEnums( p1.getFactType(),
                                     asf.getFactField() ) );
        assertFalse( utils.hasValueList( asf ) );
        r = oracle.getEnums( p1.getFactType(),
                             asf.getFactField(),
                             currentValueMap ).getFixedList();
        assertEquals( 2,
                      r.length );
        assertEquals( "bob",
                      r[ 0 ] );
        assertEquals( "michael",
                      r[ 1 ] );

        assertTrue( oracle.hasEnums( ins.getFactType(),
                                     ins.getFactField() ) );
        assertFalse( utils.hasValueList( ins ) );
        r = oracle.getEnums( ins.getFactType(),
                             ins.getFactField(),
                             currentValueMap ).getFixedList();
        assertEquals( 2,
                      r.length );
        assertEquals( "1",
                      r[ 0 ] );
        assertEquals( "2",
                      r[ 1 ] );

        assertTrue( oracle.hasEnums( ins_.getFactType(),
                                     ins_.getFactField() ) );
        assertTrue( utils.hasValueList( ins_ ) );
        r = utils.getValueList( ins_ );
        assertEquals( 3,
                      r.length );
        assertEquals( "one",
                      r[ 0 ] );
        assertEquals( "two",
                      r[ 1 ] );
        assertEquals( "three",
                      r[ 2 ] );

        assertEquals( 0,
                      utils.getValueList( asf_ ).length );

        assertFalse( oracle.hasEnums( p1.getFactType(),
                                      asf__.getFactField() ) );
        assertTrue( utils.hasValueList( asf__ ) );
        r = utils.getValueList( asf__ );
        assertEquals( 3,
                      r.length );
        assertEquals( "one",
View Full Code Here


        c2.setFactField( "age" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c2 );
        dt.getConditions().add( p2 );

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

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

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

        conditionColAge2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( conditionColAge2 );

        dt.getConditions().add( p1 );

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

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

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

        mdc.setMetadata( "cheese" );

        final AttributeCol52 ac = new AttributeCol52();
        ac.setAttribute( "salience" );

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

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

        return nc;

    }

    private ActionSetFieldCol52 makeNewColumn( ActionSetFieldCol c ) {
        ActionSetFieldCol52 nc = new ActionSetFieldCol52();
        nc.setBoundName( c.boundName );
        nc.setDefaultValue( new DTCellValue52( c.defaultValue ) );
        nc.setFactField( c.factField );
        nc.setHeader( c.header );
        nc.setHideColumn( c.hideColumn );
        nc.setType( c.type );
        nc.setUpdate( c.update );
        nc.setValueList( c.valueList );
        nc.setWidth( c.width );
        return nc;
    }
View Full Code Here

        dt.getActionCols().add( ins );

        ActionRetractFactCol52 ret = new ActionRetractFactCol52();
        dt.getActionCols().add( ret );

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

        ActionSetFieldCol52 set2 = new ActionSetFieldCol52();
        set2.setBoundName( "f1" );
        set2.setFactField( "goo2" );
        set2.setDefaultValue( new DTCellValue52( "whee" ) );
        set2.setType( DataType.TYPE_STRING );
        dt.getActionCols().add( set2 );

        dt.setData( DataUtilities.makeDataLists( new String[][]{
                new String[]{ "1", "desc", "42", "33", "michael", "age * 0.2", "age > 7", "6.60", "true", "gooVal1", "f2" },
                new String[]{ "2", "desc", "66", "39", "bob", "age * 0.3", "age > 7", "6.60", "", "gooVal1", "whee" }
View Full Code Here

        dt.getActionCols().add( ins );

        ActionRetractFactCol52 ret = new ActionRetractFactCol52();
        dt.getActionCols().add( ret );

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

        ActionSetFieldCol52 set2 = new ActionSetFieldCol52();
        set2.setBoundName( "f1" );
        set2.setFactField( "goo2" );
        set2.setDefaultValue( new DTCellValue52( "whee" ) );
        set2.setType( DataType.TYPE_STRING );
        dt.getActionCols().add( set2 );

        dt.setData( DataUtilities.makeDataLists( new String[][]{
                new String[]{ "1", "desc", "42", "33", "michael, manik", "age * 0.2", "age > 7", "6.60", "true", "gooVal1", "f2" },
                new String[]{ "2", "desc", "", "39", "bob, frank", "age * 0.3", "age > 7", "6.60", "", "gooVal1", null }
View Full Code Here

        dt.getActionCols().add( ins );

        ActionRetractFactCol52 ret = new ActionRetractFactCol52();
        dt.getActionCols().add( ret );

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

        ActionSetFieldCol52 set2 = new ActionSetFieldCol52();
        set2.setBoundName( "f1" );
        set2.setFactField( "goo2" );
        set2.setDefaultValue( new DTCellValue52( "whee" ) );
        set2.setType( DataType.TYPE_STRING );
        dt.getActionCols().add( set2 );

        dt.setData( DataUtilities.makeDataLists( new String[][]{
                new String[]{ "1", "desc", "42", "33", "michael", "age * 0.2", "BAM", "6.60", "true", "gooVal1", "f2" },
                new String[]{ "2", "desc", "66", "39", "bob", "age * 0.3", "BAM", "6.60", "", "gooVal1", "whee" }
View Full Code Here

        c.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( c );

        dt.getConditions().add( p1 );

        ActionSetFieldCol52 asf = new ActionSetFieldCol52();
        asf.setBoundName( "x" );
        asf.setFactField( "age" );
        asf.setType( DataType.TYPE_STRING );

        dt.getActionCols().add( asf );

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

        allColumns.add( new DescriptionCol52() );
        allColumns.add( new MetadataCol52() );
        allColumns.add( new ConditionCol52() );
        List<ActionCol52> cols = new ArrayList<ActionCol52>();

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

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

        ActionSetFieldCol52 asf2 = new ActionSetFieldCol52();
        asf2.setBoundName( "a" );
        asf2.setFactField( "field2" );
        asf2.setUpdate( true );
        asf2.setType( DataType.TYPE_NUMERIC_INTEGER );
        cols.add( asf2 );

        ActionRetractFactCol52 ret = new ActionRetractFactCol52();
        cols.add( ret );
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52

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.