Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-5329

Decision History should not thrown an exception if the input/outputs where fetch but are empty

      Scenario

      • A decision table is evaluated but it has not input or output values, (for example see attached DMN file)

      Problem

      • If you query for the historic decision instances including input and outputs like:
      List<HistoricDecisionInstance> decisions = BpmPlatform.getDefaultProcessEngine().getHistoryService().createHistoricDecisionInstanceQuery()
        .decisionDefinitionKey(decisionDefinitionKey)
        .includeOutputs()          
        .list();
      

      and then try to access the outputs or inputs there will be an exception

      for (HistoricDecisionInstance decision : decisions) {
        List<HistoricDecisionOutputInstance> outputs = decision.getOutputs();
        ...
      }
      
      Caused by: org.camunda.bpm.engine.ProcessEngineException: ENGINE-03061 The output instances for the historic decision instance are not fetched. You must call 'includeOutputs()' on the query to enable fetching.
      

      AT

      • if the input/outputs are fetch during the query but are empty an empty list will be returned by getInputs and getOutputs instead of an exception

        This is the controller panel for Smart Panels app

            [CAM-5329] Decision History should not thrown an exception if the input/outputs where fetch but are empty

            The modeler cannot open the attached dmn xml. Given that this is a valid DMN file, is there already a bug report for the modeler?

            Thorben Lindhauer added a comment - The modeler cannot open the attached dmn xml. Given that this is a valid DMN file, is there already a bug report for the modeler?

            The modeler disallows to have no input nor output column (CAM-4306). So not sure if this is a Bug as it isn't a common use case to have no inputs/outputs. Feel free to create a ticket.

            Sebastian Menski added a comment - The modeler disallows to have no input nor output column ( CAM-4306 ). So not sure if this is a Bug as it isn't a common use case to have no inputs/outputs. Feel free to create a ticket.

            Sure, will do that. At least the error message should be better which is "Cannot read property 'inputExpression' of undefined" right now.

            Thorben Lindhauer added a comment - Sure, will do that. At least the error message should be better which is "Cannot read property 'inputExpression' of undefined" right now.

            I totally agree with that.

            Sebastian Menski added a comment - I totally agree with that.

            Shouldn't the attached dmn table always return the single output. DMN spec page 82 says: "By definition, a DecisionRule element that has no conditions is always applicable."

            Thorben Lindhauer added a comment - Shouldn't the attached dmn table always return the single output. DMN spec page 82 says: "By definition, a DecisionRule element that has no conditions is always applicable."

            The DMN Engine returns a result with a single entry which is an empty list. As the table has a single output without a value. Is that not correct?

            Sebastian Menski added a comment - The DMN Engine returns a result with a single entry which is an empty list. As the table has a single output without a value. Is that not correct?

            I am not sure what the best behavior would be. I would have expected that there is actually an output named "Result" with an empty result (e.g. represented by null or with an additional flag if null would be ambiguous). The way it currently is, the historic output instances table is empty, yet a rule matched. In consequence, we cannot tell which rule matched.

            Thorben Lindhauer added a comment - I am not sure what the best behavior would be. I would have expected that there is actually an output named "Result" with an empty result (e.g. represented by null or with an additional flag if null would be ambiguous). The way it currently is, the historic output instances table is empty, yet a rule matched. In consequence, we cannot tell which rule matched.

              sebastian.menski Sebastian Menski
              sebastian.menski Sebastian Menski
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: