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

Using "fluid.transforms.arrayToSetMembership" with any other transformations in modelRelay option causes the source array value disappear

    XMLWordPrintable

Details

    Description

      In a component with the default model and the modelRelay option as this:

      ...
      model:

      { forArrayToSetMembership: ["value1"], forIdentity: ["value2"] }

      ,
      modelRelay: [{
      source: "

      {fluid9999}.model.forIdentity",
      target: "{fluid9999}

      .model.modelInTransit.forIdentity",
      singleTransform:

      { type: "fluid.transforms.identity" }

      }, {
      source: "

      {fluid9999}.model.forArrayToSetMembership",
      target: "{fluid9999}

      .model.modelInTransit",
      singleTransform: {
      type: "fluid.transforms.arrayToSetMembership",
      options:

      { "value1": "value1" }

      }
      }]
      ...

      The expected model structure after instantiating this component is:

      {
      forArrayToSetMembership: ["value1"],
      forIdentity: ["value2"],
      modelInTransit:

      { value1: true, forIdentity: ["value2"] }

      }

      However, in the result model, the default value "value1" in the source array element "forArrayToSetMembership" for "fluid.transforms.arrayToSetMembership" disappears that causes the relay generates the wrong target model value that looks like:

      {
      forArrayToSetMembership: [],
      forIdentity: ["value2"],
      modelInTransit:

      { value1: false, forIdentity: ["value2"] }

      }

      To produce it, two things to pay attention:

      1. The source array element for "fluid.transforms.arrayToSetMembership" has at least one array value;
      2. Must have at least another relay in the modelRelay option besides "fluid.transforms.arrayToSetMembership".

      Note that once removing other relays from modelRelay option and having "fluid.transforms.arrayToSetMembership" as the only transformation in there, the relay works fine with keeping the source array value intact and creating the correct target model.

      Attachments

        Issue Links

          Activity

            People

              antranig Antranig Basman
              cli@ocad.ca Cindy Qi Li
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: