Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-6348

Worksheet ignored when creating package description for decision table

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Explained
    • Affects Version/s: 7.54.0.Final
    • Fix Version/s: None
    • Component/s: decision tables
    • Labels:
      None
    • Sprint:
      2021 Week 19-21 (from May 10)
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      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;
        }
      

        Attachments

          Activity

            People

            Assignee:
            mfusco@redhat.com Mario Fusco
            Reporter:
            evantoli Evan Toli (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: