Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-16270

Many to many mapping doesn't work correctly

    XMLWordPrintable

Details

    Description

      In Syndesis, I want to map a single field of all object from the source collection on a field in the target collection.

      However, when I run the integration, the target message contains only array with one null element

      Body: [[{"arr":[{"name":null}]}]] 
      

      Message before DataMapper

      Body: [[{"id":1,"task":"test1","completed":0}, {"id":2,"task":"test2","completed":0}, {"id":3,"task":"test3","completed":0}]] 
      

      Message after DataMapper

      Body: [[{"arr":[{"name":null}]}]] 
      

      Expected message

      Body: [[{"arr":[{"name":"test1"}, {"name":"test2"}, {"name":"test3"}]}]] 
      

      Reproducible on upstream version `1.12.0-20210420` with AtlasMap version `2.2.0-M.4`

      The default postrgesql connection is used as a source (select * from todo)
      AMQ step is used as a target with JSON instance
      e.g.

      {
        "officeNumber": 1,
        "arr": [
          {
            "name":"test1",
            "surname":"surname1",
            "addresses":[
              {
                "street":"street1"
              },
              {
                "street":"street2"
              }
            ]
          }
        ]
      }
      

      The integration is in the attachments.

      This use case worked on previous version `1.12.0-20210414` with AtlasMap version `2.1.6`
      Examples:
      Message before DataMapper

      Body: [] 
      

      Message after DataMapper

      Body: [[{"arr":[]}]]
      

      ====
      Message before DataMapper

      Body: [[{"id":1,"task":"test1","completed":0}, {"id":2,"task":"test2","completed":0}, {"id":3,"task":"test3","completed":0}]] 
      

      Message after DataMapper

      Body: [[{"arr":[{"name":"test1"}, {"name":"test2"}, {"name":"test3"}]}]] 
      

      Attachments

        1. manyToMany.png
          manyToMany.png
          112 kB
        2. Pub-export.zip
          5 kB

        Activity

          People

            toigaras@redhat.com tomohisa igarashi
            mkralik@redhat.com Matej Kralik
            Matej Kralik Matej Kralik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: