Search in sources :

Example 1 with GuidedDecisionTableSourceBuilderDirect

use of org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSourceBuilderDirect in project drools-wb by kiegroup.

the class GuidedDecisionTableGeneratorListener method assertValueBuildersRowData.

private void assertValueBuildersRowData() {
    // new row is created the GuidedDecisionTableSourceBuilders contain sufficient row data
    if (_sourceBuilders != null) {
        final int rowCount = getRowCount();
        final int columnCount = _sourceBuilders.size();
        for (GuidedDecisionTableSourceBuilder sb : _sourceBuilders) {
            if (sb instanceof GuidedDecisionTableSourceBuilderDirect) {
                final GuidedDecisionTableSourceBuilderDirect sbd = (GuidedDecisionTableSourceBuilderDirect) sb;
                if (sbd.getRowCount() < rowCount) {
                    sbd.addCellValue(rowCount, columnCount, "");
                }
            } else if (sb instanceof GuidedDecisionTableSourceBuilderIndirect) {
                final GuidedDecisionTableSourceBuilderIndirect sbi = (GuidedDecisionTableSourceBuilderIndirect) sb;
                for (ParameterizedValueBuilder pvb : sbi.getValueBuilders().values()) {
                    if (pvb.getColumnData().size() < rowCount) {
                        pvb.addCellValue(rowCount, columnCount, "");
                    }
                }
            }
        }
    }
}
Also used : ParameterizedValueBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.ParameterizedValueBuilder) GuidedDecisionTableSourceBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSourceBuilder) GuidedDecisionTableSourceBuilderDirect(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSourceBuilderDirect) GuidedDecisionTableSourceBuilderIndirect(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSourceBuilderIndirect)

Aggregations

GuidedDecisionTableSourceBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSourceBuilder)1 GuidedDecisionTableSourceBuilderDirect (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSourceBuilderDirect)1 GuidedDecisionTableSourceBuilderIndirect (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSourceBuilderIndirect)1 ParameterizedValueBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.ParameterizedValueBuilder)1