private ConditionCol52 makeNewColumn(ConditionCol c) { ConditionCol52 nc = new ConditionCol52(); nc.setConstraintValueType( c.constraintValueType ); nc.setDefaultValue( new DTCellValue52( c.defaultValue ) ); nc.setFactField( c.factField ); nc.setFieldType( SuggestionCompletionEngine.TYPE_STRING ); nc.setHeader( c.header ); nc.setHideColumn( c.hideColumn ); nc.setOperator( c.operator ); nc.setValueList( c.valueList ); nc.setWidth( c.width ); return nc; }
private ConditionCol52 makeNewColumn(ConditionCol c) { ConditionCol52 nc = new ConditionCol52(); nc.setConstraintValueType( c.constraintValueType ); nc.setDefaultValue( new DTCellValue52( c.defaultValue ) ); nc.setFactField( c.factField ); nc.setFieldType( SuggestionCompletionEngine.TYPE_STRING ); nc.setHeader( c.header ); nc.setHideColumn( c.hideColumn ); nc.setOperator( c.operator ); nc.setValueList( c.valueList ); nc.setWidth( c.width ); return nc; }
@Test public void testNoConstraintLists() { GuidedDecisionTable52 dt = new GuidedDecisionTable52(); // add cols for LHS ConditionCol52 c1 = new ConditionCol52(); Pattern52 p1 = new Pattern52(); p1.setBoundName( "c1" ); p1.setFactType( "Driver" ); c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL ); p1.getChildColumns().add( c1 ); dt.getConditions().add( p1 ); ConditionCol52 c2 = new ConditionCol52(); Pattern52 p2 = new Pattern52(); p2.setBoundName( "c2" ); p2.setFactType( "Driver" ); c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL ); c2.setValueList( "a,b,c" ); p2.getChildColumns().add( c2 ); dt.getConditions().add( p1 ); SuggestionCompletionEngine sce = new SuggestionCompletionEngine(); sce.putDataEnumList( "Driver.name", new String[]{"bob", "michael"} ); assertEquals( 0, dt.getValueList( c1 ).length ); assertEquals( 3, dt.getValueList( c2 ).length ); }
c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE ); c1.setFieldType( SuggestionCompletionEngine.TYPE_STRING ); c1.setValueList( "getAge()>10,getAge()>20,getAge()>30" ); p1.getChildColumns().add( c1 ); dt.getConditions().add( p1 );
c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_PREDICATE ); c1.setFieldType( SuggestionCompletionEngine.TYPE_STRING ); c1.setValueList( "age>10,age>20,age>30" ); p1.getChildColumns().add( c1 ); dt.getConditions().add( p1 );
p1_.getChildColumns().add( c1__ ); c1__.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE ); c1__.setValueList( "Male,Female" ); dt.getConditions().add( p1_ ); c1___.setFactField( "name" ); c1___.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL ); c1___.setValueList( "one,two,three" ); p1__.getChildColumns().add( c1___ ); dt.getConditions().add( p1__ );