private ActionSetFieldCol52 makeNewActionSetColumn() { switch ( model.getTableFormat() ) { case LIMITED_ENTRY: return new LimitedEntryActionSetFieldCol52(); default: return new ActionSetFieldCol52(); } }
private ActionSetFieldCol52 makeNewActionColumn( final AvailableField f ) { final GuidedDecisionTable52.TableFormat format = presenter.getTableFormat(); if ( format == GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY ) { final ActionSetFieldCol52 a = new ActionSetFieldCol52(); a.setBoundName( availablePatternsSelection.getBoundName() ); a.setFactField( f.getName() ); a.setType( f.getType() ); return a; } else { final LimitedEntryActionSetFieldCol52 a = new LimitedEntryActionSetFieldCol52(); a.setBoundName( availablePatternsSelection.getBoundName() ); a.setFactField( f.getName() ); a.setType( f.getType() ); return a; } }
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" );
@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( DataType.TYPE_STRING ); dt.getActionCols().add( asf ); String[][] data = new String[][]{ new String[]{ "1", "desc", "y", "old" } }; dt.setData( DataUtilities.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( DataUtilities.makeDataLists( new String[][]{ new String[]{ "1", "desc", "", "old" } } ) ); drl = GuidedDTDRLPersistence.getInstance().marshal( dt ); assertEquals( -1, drl.indexOf( "Context( )" ) ); }
private ActionSetFieldCol52 cloneActionSetColumn( ActionSetFieldCol52 col ) { ActionSetFieldCol52 clone = null; if ( col instanceof LimitedEntryActionSetFieldCol52 ) { clone = new LimitedEntryActionSetFieldCol52(); DTCellValue52 dcv = cloneLimitedEntryValue( ( (LimitedEntryCol) col ).getValue() ); ( (LimitedEntryCol) clone ).setValue( dcv ); } else { clone = new ActionSetFieldCol52(); } clone.setBoundName( col.getBoundName() ); clone.setFactField( col.getFactField() ); clone.setHeader( col.getHeader() ); clone.setType( col.getType() ); clone.setValueList( col.getValueList() ); clone.setUpdate( col.isUpdate() ); clone.setDefaultValue( new DTCellValue52( col.getDefaultValue() ) ); clone.setHideColumn( col.isHideColumn() ); return clone; }
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 ); 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" );
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" );
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" );
ac.setAttribute( "salience" ); final ActionSetFieldCol52 asfc = new ActionSetFieldCol52(); asfc.setBoundName( "d1" ); asfc.setFactField( "age" );
dt.getConditions().add( p2 ); final ActionSetFieldCol52 asf = new ActionSetFieldCol52(); asf.setBoundName( "c1" ); asf.setFactField( "name" ); 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" );