FLUID-5891: Update the valuemapper to support new semantics

Metadata

Source
FLUID-5891
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Kasper Galschiot Markus
Reporter
Kasper Galschiot Markus
Created
2016-04-15T15:03:45.036-0400
Updated
2024-07-22T10:35:30.081-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. Model Transformation System

Description

As can be seen from the notes here (https://pad.gpii.net/mypads/?/mypads/group/technical-discussions-4g920a3/pad/view/valuemapper-transformer-fixup-5na2088) , we will update the valueMapper to support the semantics described in the below. Most important is that the `options` block will be renamed to `match`, we will allow for a top-level `noMatch` key that will be used (if present) if nothing matches in the `match` directive. We will no longer support `defaultInputValue` and `undefinedInputValue`.

For full details on the new format, refer to these notes: https://pad.gpii.net/mypads/?/mypads/group/technical-discussions-4g920a3/pad/view/valuemapper-transformer-fixup-5na2088 (and the documentation once this JIRA is complete)

An example of the format is given here:

{
    type: "fluid.transforms.valueMapper",
    inputPath/input: <path of value to map against>,
    defaultOutputPath: <outputPath to use if none is provided at the match/noMatch level>,
    defaultOutputValue: <outputValue to use if none is provided at the match/noMatch level>,
    match: [{
        partialMatches: <If true, this will allowing matching the inputValue partially>,
        outputUndefinedValue: <If true, the outputValue will be `undefined` -- TRUMPS outputValue>,
        inputValue: <the value to match against>,
        outputValue: <value to output if inputValue is matched. If outputUndefinedValue is given, outputValue will not be used>,
        outputPath: <path to output to>
    }],
    noMatch: {
        outputUndefinedValue: <If true, the outputValue will be `undefined` -- TRUMPS outputValue>,
        outputValue: <value to output if inputValue is matched. If outputUndefinedValue is given, outputValue will not be used>,
        outputPath: <path to output to>
    }
};