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( )" ) ); }
ActionSetFieldCol52 set = new ActionSetFieldCol52(); set.setFactField( "foo" ); dt.getActionCols().add( set );
dt.getConditions().add( p1 ); ActionSetFieldCol52 asf = new ActionSetFieldCol52(); asf.setBoundName( "x" ); asf.setFactField( "age" );
List<ActionCol52> cols = new ArrayList<ActionCol52>(); ActionSetFieldCol52 asf1 = new ActionSetFieldCol52(); asf1.setBoundName( "a" ); asf1.setFactField( "field1" ); cols.add( asf1 ); ActionSetFieldCol52 asf2 = new ActionSetFieldCol52(); asf2.setBoundName( "a" ); asf2.setFactField( "field2" );
dt.getActionCols().add( ret ); ActionSetFieldCol52 set = new ActionSetFieldCol52(); set.setBoundName( "f1" ); set.setFactField( "goo1" ); dt.getActionCols().add( set ); ActionSetFieldCol52 set2 = new ActionSetFieldCol52(); set2.setBoundName( "f1" ); set2.setFactField( "goo2" );
dt.getActionCols().add( ret ); ActionSetFieldCol52 set = new ActionSetFieldCol52(); set.setBoundName( "f1" ); set.setFactField( "goo1" ); dt.getActionCols().add( set ); ActionSetFieldCol52 set2 = new ActionSetFieldCol52(); set2.setBoundName( "f1" ); set2.setFactField( "goo2" );
dt.getActionCols().add( ret ); ActionSetFieldCol52 set = new ActionSetFieldCol52(); set.setBoundName( "f1" ); set.setFactField( "goo1" ); dt.getActionCols().add( set ); ActionSetFieldCol52 set2 = new ActionSetFieldCol52(); set2.setBoundName( "f1" ); set2.setFactField( "goo2" );
dt.getConditions().add( p2 ); ActionSetFieldCol52 a = new ActionSetFieldCol52(); a.setBoundName( "c1" ); a.setFactField( "name" ); dt.getActionCols().add( a ); ActionSetFieldCol52 a2 = new ActionSetFieldCol52(); a2.setBoundName( "c1" ); a2.setFactField( "age" );
ActionSetFieldCol52 a = new ActionSetFieldCol52(); a.setBoundName( "c1" ); a.setFactField( "name" ); dt.getActionCols().add( a ); ActionSetFieldCol52 a2 = new ActionSetFieldCol52(); a2.setBoundName( "c1" ); a2.setFactField( "age" );
ac.setAttribute( "salience" ); ActionSetFieldCol52 asfc = new ActionSetFieldCol52(); asfc.setBoundName( "d1" ); asfc.setFactField( "age" );
dt.getConditions().add( p2 ); ActionSetFieldCol52 asf = new ActionSetFieldCol52(); asf.setBoundName( "c1" ); asf.setFactField( "name" ); dt.getActionCols().add( ins_ ); ActionSetFieldCol52 asf_ = new ActionSetFieldCol52(); asf_.setBoundName( "c1" ); asf_.setFactField( "goo" ); dt.getActionCols().add( asf_ ); ActionSetFieldCol52 asf__ = new ActionSetFieldCol52(); asf__.setBoundName( "c1" ); asf__.setFactField( "goo" );