public LimitedGuidedDecisionTableBuilder withAction(String boundName, String factField, String typeNumericInteger, DTCellValue52 value) { LimitedEntryActionSetFieldCol52 ins = new LimitedEntryActionSetFieldCol52(); ins.setBoundName(boundName); ins.setFactField(factField); ins.setValue(value); ins.setType(typeNumericInteger); table.getActionCols().add(ins); return this; } }
@Test public void simpleActionSetField() { final AtomicBoolean calledBack = new AtomicBoolean(false); setupPatternAndCondition(); final LimitedEntryActionSetFieldCol52 asf = new LimitedEntryActionSetFieldCol52(); asf.setBoundName("$p"); asf.setFactField("name"); asf.setValue(new DTCellValue52("Michael")); model.getActionCols().add(asf); when(dmo.getFieldType(eq("Person"), eq("name"))).thenReturn(DataType.TYPE_STRING); builder.generateDefinition(dtPresenter, asf, (String definition) -> { calledBack.set(true); assertEquals("$p.setName( \"Michael\" );", definition); }); assertTrue(calledBack.get()); }
public LimitedGuidedDecisionTableBuilder withAction(String boundName, String factField, String typeNumericInteger, DTCellValue52 value) { LimitedEntryActionSetFieldCol52 ins = new LimitedEntryActionSetFieldCol52(); ins.setBoundName(boundName); ins.setFactField(factField); ins.setValue(value); ins.setType(typeNumericInteger); table.getActionCols().add(ins); return this; } }
@Test public void simpleActionUpdateField() { final AtomicBoolean calledBack = new AtomicBoolean(false); setupLimitedEntryPatternAndCondition(); final LimitedEntryActionSetFieldCol52 asf = new LimitedEntryActionSetFieldCol52(); asf.setBoundName("$p"); asf.setFactField("name"); asf.setValue(new DTCellValue52("Michael")); asf.setUpdate(true); model.getActionCols().add(asf); when(dmo.getFieldType(eq("Person"), eq("name"))).thenReturn(DataType.TYPE_STRING); builder.generateDefinition(dtPresenter, asf, (String definition) -> { calledBack.set(true); assertEquals("modify( $p ) {<br/>" + "setName( \"Michael\" )<br/>" + "}", definition); }); assertTrue(calledBack.get()); } }
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; } }
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; } }
a1.setBoundName("c1"); a1.setFactField("name"); a1.setValue(new DTCellValue52("a1name"));
asf1.setBoundName("p1"); asf1.setFactField("colour"); asf1.setValue(new DTCellValue52("Blue"));
column.setBoundName("boundName"); column.setValueList("valueList"); column.setHeader("header");