Uploaded image for project: 'Camunda Optimize'
  1. Camunda Optimize
  2. OPT-1907

Find easy way to extract the type of a combined report

    XMLWordPrintable

    Details

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

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            johannes.heinemann Johannes Heinemann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: