Find easy way to extract the type of a combined report

XMLWordPrintable

    • Type: Task
    • Resolution: Done
    • Priority: L3 - Default
    • 2.5.0-alpha1, 2.5.0
    • Affects Version/s: None
    • Component/s: backend
    • None

      Right now, we have several places where we actually need to find out which kind of combined report is on hand. For instance and excerpt of the CombinedReportResult:

        public List<String[]> getResultAsCsv(final Integer limit, final Integer offset, Set<String> excludedColumns) {
          Optional firstResultOptional = reportResultDto.getResult().values().stream().findFirst();
          List<String[]> csvStrings;
          if (firstResultOptional.isPresent()) {
           Object firstResult = firstResultOptional.get();
            if (firstResult instanceof ProcessReportMapResultDto) {
              CombinedProcessReportResultDto<ProcessReportMapResultDto> combinedResult =
                (CombinedProcessReportResultDto<ProcessReportMapResultDto>) reportResultDto;
              csvStrings = mapCombinedMapResultToCsv(limit, offset, combinedResult);
            }
      // .....
      

      Instead of going through the result itself and we should be able to infer the type directly.

        This is the controller panel for Smart Panels app

              Assignee:
              Unassigned
              Reporter:
              Johannes
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: