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; }
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; }
@Test public void testNoConstraints() { GuidedDecisionTable52 dt = new GuidedDecisionTable52(); Pattern52 p1 = new Pattern52(); p1.setBoundName( "x" ); p1.setFactType( "Context" ); ConditionCol52 c = new ConditionCol52(); 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( SuggestionCompletionEngine.TYPE_STRING ); dt.getActionCols().add( asf ); String[][] data = new String[][]{ new String[]{"1", "desc", "y", "old"} }; dt.setData( upgrader.makeDataLists( data ) ); String drl = GuidedDTDRLPersistence.getInstance().marshal( dt ); assertTrue( drl.indexOf( "Context( )" ) > -1 ); assertTrue( drl.indexOf( "x.setAge" ) > drl.indexOf( "Context( )" ) ); assertFalse( drl.indexOf( "update( x );" ) > -1 ); dt.setData( upgrader.makeDataLists( new String[][]{ new String[]{"1", "desc", "", "old"} } ) ); drl = GuidedDTDRLPersistence.getInstance().marshal( dt ); assertEquals( -1, drl.indexOf( "Context( )" ) ); }
asf.setBoundName( "x" ); asf.setFactField( "age" ); asf.setType( SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER );
asf1.setBoundName( "a" ); asf1.setFactField( "field1" ); asf2.setBoundName( "a" ); asf2.setFactField( "field2" ); asf2.setUpdate( true );
set.setBoundName( "f1" ); set.setFactField( "goo1" ); set.setType( SuggestionCompletionEngine.TYPE_STRING ); set2.setBoundName( "f1" ); set2.setFactField( "goo2" ); set2.setDefaultValue( new DTCellValue52( "whee" ) );
set.setBoundName( "f1" ); set.setFactField( "goo1" ); set.setType( SuggestionCompletionEngine.TYPE_STRING ); set2.setBoundName( "f1" ); set2.setFactField( "goo2" ); set2.setDefaultValue( new DTCellValue52( "whee" ) );
set.setBoundName( "f1" ); set.setFactField( "goo1" ); set.setType( SuggestionCompletionEngine.TYPE_STRING ); set2.setBoundName( "f1" ); set2.setFactField( "goo2" ); set2.setDefaultValue( new DTCellValue52( "whee" ) );
a.setBoundName( "c1" ); a.setFactField( "name" ); dt.getActionCols().add( a ); a2.setBoundName( "c1" ); a2.setFactField( "age" ); dt.getActionCols().add( a2 );
a.setBoundName( "c1" ); a.setFactField( "name" ); dt.getActionCols().add( a ); a2.setBoundName( "c1" ); a2.setFactField( "age" ); dt.getActionCols().add( a2 );
asfc.setBoundName( "d1" ); asfc.setFactField( "age" );
asf.setBoundName( "c1" ); asf.setFactField( "name" ); dt.getActionCols().add( asf ); asf_.setBoundName( "c1" ); asf_.setFactField( "goo" ); dt.getActionCols().add( asf_ ); asf__.setBoundName( "c1" ); asf__.setFactField( "goo" ); asf__.setValueList( "one,two,three" );