FLUID-5473: defaultOutputValue in valueMapper isn't applied in case of no match/ambiguous match

Metadata

Source
FLUID-5473
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Kasper Galschiot Markus
Reporter
Cindy Li
Created
2014-07-15T14:06:46.849-0400
Updated
2016-09-22T22:36:59.912-0400
Versions
  1. 1.5
Fixed Versions
N/A
Component
  1. Model Transformation System

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.

Comments