use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools-wb by kiegroup.
the class AnalyzerUpdateTestBase method appendActionColumn.
protected void appendActionColumn(final int columnNumber, final ActionSetFieldCol52 actionSetField, final Comparable... cellValues) throws BuildException {
table52.getActionCols().add(actionSetField);
for (int i = 0; i < cellValues.length; i++) {
table52.getData().get(i).add(new DTCellValue52(cellValues[i]));
}
updateManager.newColumn(table52, new ModelMetaDataEnhancer(table52).getHeaderMetaData(), analyzerProvider.getFactTypes(), columnNumber);
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools-wb by kiegroup.
the class DecisionTableAnalyzerConflictResolverLimitedDTableTest method testConflict.
@Test
public void testConflict() throws Exception {
table52 = new LimitedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withIntegerColumn("a", "Person", "age", "==", 0).withAction("a", "approved", DataType.TYPE_BOOLEAN, new DTCellValue52() {
{
setBooleanValue(true);
}
}).withAction("a", "approved", DataType.TYPE_BOOLEAN, new DTCellValue52() {
{
setBooleanValue(false);
}
}).withData(new Object[][] { { 1, "description", true, true, false }, { 2, "description", true, false, true } }).buildTable();
fireUpAnalyzer();
assertContains(analyzerProvider.getAnalysisReport(), CONFLICTING_ROWS, Severity.WARNING, 2);
assertContains(analyzerProvider.getAnalysisReport(), CONFLICTING_ROWS, Severity.WARNING, 1);
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools-wb by kiegroup.
the class LimitedGuidedDecisionTableBuilder method withIntegerColumn.
public LimitedGuidedDecisionTableBuilder withIntegerColumn(final String boundName, final String factType, final String field, final String operator, final int value) {
final Pattern52 pattern = findPattern(boundName, factType);
final LimitedEntryConditionCol52 condition = new LimitedEntryConditionCol52();
condition.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
condition.setFieldType(DataType.TYPE_NUMERIC_INTEGER);
condition.setFactField(field);
condition.setHeader("Some header");
condition.setOperator(operator);
condition.setValue(new DTCellValue52() {
{
setNumericValue(new Integer(value));
}
});
pattern.getChildColumns().add(condition);
addPattern(pattern);
return this;
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools-wb by kiegroup.
the class DTCellValueWidgetFactory method makeNumericByteTextBox.
private AbstractRestrictedEntryTextBox makeNumericByteTextBox(final DTCellValue52 value) {
final AbstractRestrictedEntryTextBox tb = new NumericByteTextBox(allowEmptyValues);
final Byte numericValue = (Byte) value.getNumericValue();
tb.setValue(numericValue == null ? "" : numericValue.toString());
// Wire up update handler
tb.setEnabled(!isReadOnly);
addNumericTextBoxChangeHandler(tb, value, (input -> Byte.valueOf(input)), (Byte) null, new Byte("0"));
return tb;
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools-wb by kiegroup.
the class DTCellValueWidgetFactory method makeNumericIntegerTextBox.
private AbstractRestrictedEntryTextBox makeNumericIntegerTextBox(final DTCellValue52 value) {
final AbstractRestrictedEntryTextBox tb = new NumericIntegerTextBox(allowEmptyValues);
final Integer numericValue = (Integer) value.getNumericValue();
tb.setValue(numericValue == null ? "" : numericValue.toString());
// Wire up update handler
tb.setEnabled(!isReadOnly);
addNumericTextBoxChangeHandler(tb, value, (input -> Integer.valueOf(input)), (Integer) null, 0);
return tb;
}
Aggregations