-
Bug
-
Resolution: Not a Bug
-
Major
-
None
-
7.54.0.Final
-
None
-
2021 Week 19-21 (from May 10)
-
Undefined
-
NEW
-
NEW
The configured worksheet is ignored when creating package description for decision table.
This means that the rules for the decision template are always created from the first sheet in the XLS spreadsheet instead of the specified sheet.
I think the code in this method --> DecisionTableProviderImpl.loadFromInputStreamWithTemplates needs to become:
public List<String> loadFromInputStreamWithTemplates(Resource resource, DecisionTableConfiguration configuration) { List<String> drls = new ArrayList<String>( configuration.getRuleTemplateConfigurations().size() ); ExternalSpreadsheetCompiler converter = new ExternalSpreadsheetCompiler(); for ( RuleTemplateConfiguration template : configuration.getRuleTemplateConfigurations() ) { try { if ( StringUtils.isEmpty( configuration.getWorksheetName() ) ) { drls.add(converter.compile(resource.getInputStream(), template.getTemplate().getInputStream(), InputType.getInputTypeFromDecisionTableInputType(configuration.getInputType()), template.getRow(), template.getCol())); } else { drls.add(converter.compile(resource.getInputStream(), configuration.getWorksheetName(), template.getTemplate().getInputStream(), InputType.getInputTypeFromDecisionTableInputType(configuration.getInputType()), template.getRow(), template.getCol())); } } catch (IOException e) { logger.error( "Cannot open " + template.getTemplate(), e ); } } return drls; }