Search in sources :

Example 1 with DataType

use of org.kie.soup.project.datamodel.oracle.DataType in project drools-wb by kiegroup.

the class BRLActionColumnDefinitionBuilder method makeRowData.

private List<DTCellValue52> makeRowData(final ColumnUtilities columnUtilities, final BRLActionColumn brlColumn) {
    final List<DTCellValue52> row = new ArrayList<>();
    row.add(new DTCellValue52(1));
    row.add(new DTCellValue52("desc"));
    for (BRLActionVariableColumn brlVariableColumn : brlColumn.getChildColumns()) {
        final DataType.DataTypes dataType = columnUtilities.getDataType(brlVariableColumn);
        row.add(makeCell(dataType));
    }
    return row;
}
Also used : ArrayList(java.util.ArrayList) DataType(org.kie.soup.project.datamodel.oracle.DataType) BRLActionVariableColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLActionVariableColumn) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)

Example 2 with DataType

use of org.kie.soup.project.datamodel.oracle.DataType in project drools-wb by kiegroup.

the class ActionInsertFactFieldsPage method assertDefaultValue.

@Override
public void assertDefaultValue(final ActionInsertFactCol52 selectedAction) {
    final List<String> valueList = Arrays.asList(columnUtilities.getValueList(selectedAction));
    if (valueList.size() > 0) {
        final String defaultValue = cellUtilities.asString(selectedAction.getDefaultValue());
        if (!valueList.contains(defaultValue)) {
            selectedAction.getDefaultValue().clearValues();
        }
    } else {
        // Ensure the Default Value has been updated to represent the column's data-type.
        final DTCellValue52 defaultValue = selectedAction.getDefaultValue();
        final DataType.DataTypes dataType = columnUtilities.getDataType(selectedAction);
        cellUtilities.convertDTCellValueType(dataType, defaultValue);
    }
}
Also used : DataType(org.kie.soup.project.datamodel.oracle.DataType) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)

Example 3 with DataType

use of org.kie.soup.project.datamodel.oracle.DataType in project drools-wb by kiegroup.

the class FactPatternConstraintsPage method assertDefaultValue.

@Override
public void assertDefaultValue(final Pattern52 selectedPattern, final ConditionCol52 selectedCondition) {
    final List<String> valueList = Arrays.asList(columnUtilities.getValueList(selectedCondition));
    if (valueList.size() > 0) {
        final String defaultValue = cellUtilities.asString(selectedCondition.getDefaultValue());
        if (!valueList.contains(defaultValue)) {
            selectedCondition.getDefaultValue().clearValues();
        }
    } else {
        // Ensure the Default Value has been updated to represent the column's data-type.
        final DTCellValue52 defaultValue = selectedCondition.getDefaultValue();
        final DataType.DataTypes dataType = columnUtilities.getDataType(selectedPattern, selectedCondition);
        cellUtilities.convertDTCellValueType(dataType, defaultValue);
    }
}
Also used : DataType(org.kie.soup.project.datamodel.oracle.DataType) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)

Example 4 with DataType

use of org.kie.soup.project.datamodel.oracle.DataType in project drools-wb by kiegroup.

the class ActionSetFieldsPage method assertDefaultValue.

@Override
public void assertDefaultValue(final Pattern52 selectedPattern, final ActionSetFieldCol52 selectedAction) {
    final List<String> valueList = Arrays.asList(columnUtilities.getValueList(selectedAction));
    if (valueList.size() > 0) {
        final String defaultValue = cellUtilities.asString(selectedAction.getDefaultValue());
        if (!valueList.contains(defaultValue)) {
            selectedAction.getDefaultValue().clearValues();
        }
    } else {
        // Ensure the Default Value has been updated to represent the column's data-type.
        final DTCellValue52 defaultValue = selectedAction.getDefaultValue();
        final DataType.DataTypes dataType = columnUtilities.getDataType(selectedPattern, selectedAction);
        cellUtilities.convertDTCellValueType(dataType, defaultValue);
    }
}
Also used : DataType(org.kie.soup.project.datamodel.oracle.DataType) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)

Example 5 with DataType

use of org.kie.soup.project.datamodel.oracle.DataType in project drools-wb by kiegroup.

the class ConditionColumnPlugin method assertDefaultValue.

void assertDefaultValue() {
    final CellUtilities cellUtilities = new CellUtilities();
    final AsyncPackageDataModelOracle oracle = presenter.getDataModelOracle();
    final ColumnUtilities columnUtilities = new ColumnUtilities(model(), oracle);
    final List<String> valueList = Arrays.asList(columnUtilities.getValueList(editingCol));
    if (valueList.size() > 0) {
        final String defaultValue = cellUtilities.asString(editingCol().getDefaultValue());
        if (!valueList.contains(defaultValue)) {
            editingCol.getDefaultValue().clearValues();
        }
    } else {
        // Ensure the Default Value has been updated to represent the column's data-type.
        final DTCellValue52 defaultValue = editingCol().getDefaultValue();
        final DataType.DataTypes dataType = columnUtilities.getDataType(editingPattern(), editingCol());
        cellUtilities.convertDTCellValueType(dataType, defaultValue);
    }
}
Also used : AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) CellUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.CellUtilities) DataType(org.kie.soup.project.datamodel.oracle.DataType) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)

Aggregations

DataType (org.kie.soup.project.datamodel.oracle.DataType)10 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)9 ArrayList (java.util.ArrayList)4 BigDecimal (java.math.BigDecimal)1 BigInteger (java.math.BigInteger)1 Date (java.util.Date)1 BRLActionVariableColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLActionVariableColumn)1 BRLConditionVariableColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLConditionVariableColumn)1 LimitedEntryCol (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryCol)1 CellUtilities (org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.CellUtilities)1 ColumnUtilities (org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities)1 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)1