Search in sources :

Example 36 with DTCellValue52

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);
}
Also used : ModelMetaDataEnhancer(org.drools.workbench.services.verifier.plugin.client.builders.ModelMetaDataEnhancer) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)

Example 37 with DTCellValue52

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);
}
Also used : Import(org.kie.soup.project.datamodel.imports.Import) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) LimitedGuidedDecisionTableBuilder(org.drools.workbench.services.verifier.webworker.client.testutil.LimitedGuidedDecisionTableBuilder) Test(org.junit.Test)

Example 38 with DTCellValue52

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;
}
Also used : Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) LimitedEntryConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryConditionCol52) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)

Example 39 with DTCellValue52

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;
}
Also used : ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52) OperatorsOracle(org.kie.soup.project.datamodel.oracle.OperatorsOracle) NumericBigDecimalTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigDecimalTextBox) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) GuidedDecisionTableConstants(org.drools.workbench.screens.guided.dtable.client.resources.i18n.GuidedDecisionTableConstants) Arrays(java.util.Arrays) DataType(org.kie.soup.project.datamodel.oracle.DataType) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) ApplicationPreferences(org.kie.workbench.common.services.shared.preferences.ApplicationPreferences) ListBox(org.gwtbootstrap3.client.ui.ListBox) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Function(java.util.function.Function) LimitedEntryDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.LimitedEntryDropDownManager) BigDecimal(java.math.BigDecimal) DateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat) DatePicker(org.uberfire.ext.widgets.common.client.common.DatePicker) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox) Map(java.util.Map) BigInteger(java.math.BigInteger) Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) DefaultValueDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.DefaultValueDropDownManager) DropDownData(org.kie.soup.project.datamodel.oracle.DropDownData) DTColumnConfig52(org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52) NumericShortTextBox(org.uberfire.ext.widgets.common.client.common.NumericShortTextBox) NumericTextBox(org.uberfire.ext.widgets.common.client.common.NumericTextBox) NumericIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericIntegerTextBox) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) LimitedEntryCol(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryCol) Set(java.util.Set) TextBox(org.gwtbootstrap3.client.ui.TextBox) ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) EnumDropDownUtilities(org.kie.workbench.common.widgets.client.widget.EnumDropDownUtilities) List(java.util.List) Widget(com.google.gwt.user.client.ui.Widget) NumericLongTextBox(org.uberfire.ext.widgets.common.client.common.NumericLongTextBox) Label(org.gwtbootstrap3.client.ui.Label) NumericDoubleTextBox(org.uberfire.ext.widgets.common.client.common.NumericDoubleTextBox) NumericFloatTextBox(org.uberfire.ext.widgets.common.client.common.NumericFloatTextBox) NumericByteTextBox(org.uberfire.ext.widgets.common.client.common.NumericByteTextBox) NumericBigIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigIntegerTextBox) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox) NumericByteTextBox(org.uberfire.ext.widgets.common.client.common.NumericByteTextBox)

Example 40 with DTCellValue52

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;
}
Also used : BigInteger(java.math.BigInteger) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52) OperatorsOracle(org.kie.soup.project.datamodel.oracle.OperatorsOracle) NumericBigDecimalTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigDecimalTextBox) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) GuidedDecisionTableConstants(org.drools.workbench.screens.guided.dtable.client.resources.i18n.GuidedDecisionTableConstants) Arrays(java.util.Arrays) DataType(org.kie.soup.project.datamodel.oracle.DataType) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) ApplicationPreferences(org.kie.workbench.common.services.shared.preferences.ApplicationPreferences) ListBox(org.gwtbootstrap3.client.ui.ListBox) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Function(java.util.function.Function) LimitedEntryDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.LimitedEntryDropDownManager) BigDecimal(java.math.BigDecimal) DateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat) DatePicker(org.uberfire.ext.widgets.common.client.common.DatePicker) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox) Map(java.util.Map) BigInteger(java.math.BigInteger) Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) DefaultValueDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.DefaultValueDropDownManager) DropDownData(org.kie.soup.project.datamodel.oracle.DropDownData) DTColumnConfig52(org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52) NumericShortTextBox(org.uberfire.ext.widgets.common.client.common.NumericShortTextBox) NumericTextBox(org.uberfire.ext.widgets.common.client.common.NumericTextBox) NumericIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericIntegerTextBox) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) LimitedEntryCol(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryCol) Set(java.util.Set) TextBox(org.gwtbootstrap3.client.ui.TextBox) ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) EnumDropDownUtilities(org.kie.workbench.common.widgets.client.widget.EnumDropDownUtilities) List(java.util.List) Widget(com.google.gwt.user.client.ui.Widget) NumericLongTextBox(org.uberfire.ext.widgets.common.client.common.NumericLongTextBox) Label(org.gwtbootstrap3.client.ui.Label) NumericDoubleTextBox(org.uberfire.ext.widgets.common.client.common.NumericDoubleTextBox) NumericFloatTextBox(org.uberfire.ext.widgets.common.client.common.NumericFloatTextBox) NumericByteTextBox(org.uberfire.ext.widgets.common.client.common.NumericByteTextBox) NumericBigIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericBigIntegerTextBox) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) NumericIntegerTextBox(org.uberfire.ext.widgets.common.client.common.NumericIntegerTextBox) AbstractRestrictedEntryTextBox(org.uberfire.ext.widgets.common.client.common.AbstractRestrictedEntryTextBox)

Aggregations

DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)244 Test (org.junit.Test)121 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)53 ArrayList (java.util.ArrayList)51 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)46 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)46 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)39 LimitedEntryConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryConditionCol52)39 AttributeCol52 (org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52)30 List (java.util.List)29 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)28 BaseSingleFieldConstraint (org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint)27 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)25 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)24 RowNumberCol52 (org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52)23 DescriptionCol52 (org.drools.workbench.models.guided.dtable.shared.model.DescriptionCol52)21 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)20 SingleFieldConstraint (org.drools.workbench.models.datamodel.rule.SingleFieldConstraint)20 GuidedDTTemplateDataProvider (org.drools.workbench.models.guided.dtable.backend.util.GuidedDTTemplateDataProvider)20 TemplateDataProvider (org.drools.workbench.models.guided.dtable.backend.util.TemplateDataProvider)20