Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-5473

defaultOutputValue in valueMapper isn't applied in case of no match/ambiguous match

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Labels:
      None

      Description

      This use case requires the transformed result to be determined by multiple model values:

      Scenario 1:

      model = {
          flashing: true,
          noflashing: false
      };
      
      expected = {
          flashing: "flashing"
      }
      

      Scenario 2:

      model = {
          flashing: false,
          noflashing: true
      };
      
      expected = {
          flashing: "noflashing"
      }
      

      Scenario 3: In the case of other model value combinations,

      expected = {
          flashing: "flashing"
      }
      

      So, the transformation rule is,

      {
          type: "fluid.transforms.valueMapper",
          defaultOutputPath: "flashing",
          defaultOutputValue: "unknown",
          options: [
              {
                  inputPath: "flashing",
                  inputValue: true,
                  outputValue: "flashing"
              },
              {
                  inputPath: "noflashing",
                  inputValue: true,
                  outputValue: "noflashing"
              }
          ]
      }
      

      Scenario 1 & 2 are transformed successfully, but scenario 3 outputs an empty object rather than the expected.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kaspermarkus Kasper Galschiot Markus
                Reporter:
                cli@ocad.ca Cindy Qi Li
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: