use of org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.LiteralValueBuilder in project drools-wb by kiegroup.
the class GuidedDecisionTablePopulater method assertDecisionTableData.
private void assertDecisionTableData(final String varName, final String varDataType, final List<ParameterizedValueBuilder> valueBuilders, final int maxRowCount) {
if (varName.equals("")) {
for (ParameterizedValueBuilder pvb : valueBuilders) {
if (pvb instanceof LiteralValueBuilder) {
for (int iRowIndex = 0; iRowIndex < maxRowCount; iRowIndex++) {
final int _rowIndex = ruleRowStartIndex + iRowIndex + 1;
final int _columnIndex = ruleColumnStartIndex + valueBuilders.indexOf(pvb) + 1;
final List<DTCellValue52> fragmentRow = pvb.getColumnData().get(iRowIndex);
final List<DTCellValue52> dtableRow = dtable.getData().get(iRowIndex);
final DTCellValue52 fragmentCell = fragmentRow.get(0);
assertDTCellValue(varDataType, fragmentCell, (final String value, final DataType.DataTypes dataType) -> addConversionMessage(value, dataType, _rowIndex, _columnIndex));
dtableRow.add(fragmentCell);
}
break;
}
}
} else {
for (ParameterizedValueBuilder pvb : valueBuilders) {
final int varNameIndex = pvb.getParameters().indexOf(varName);
if (varNameIndex > -1) {
for (int iRowIndex = 0; iRowIndex < maxRowCount; iRowIndex++) {
final int _rowIndex = ruleRowStartIndex + iRowIndex + 1;
final int _columnIndex = ruleColumnStartIndex + valueBuilders.indexOf(pvb) + 1;
final List<DTCellValue52> fragmentRow = pvb.getColumnData().get(iRowIndex);
final List<DTCellValue52> dtableRow = dtable.getData().get(iRowIndex);
final DTCellValue52 fragmentCell = fragmentRow.get(varNameIndex);
assertDTCellValue(varDataType, fragmentCell, (final String value, final DataType.DataTypes dataType) -> addConversionMessage(value, dataType, _rowIndex, _columnIndex));
dtableRow.add(fragmentCell);
}
break;
}
}
}
}
Aggregations