Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-16472

Relationship properties sent to repo as part of defaultPostMapping patch

    XMLWordPrintable

    Details

    • Target Version/s:
    • Story Points:
      2
    • Sprint:
      IDM - 2021.6, IDM - 2021.7
    • Support Ticket IDs:
    • Season:
      2021.Summer

      Description

      When managed/user is the source in a mapping, the defaultPostMapping.groovy script will update its "lastSync" attribute after a sync for that mapping completes. When this happens, relationships which are "returnedByDefault" are somehow being included in the request from the managed service to the repo service. Depending on how the repo service has been configured, this will result in one of two things:

      1) If generic, then the fullobject attribute will contain the extra copy of relationship data

      2) If explicit, then warnings are produced on the IDM console regarding un-mapped values being discarded.

      This can be reproduced like so:

       

      1) Create a mapping from managed/user to any target

      2) Set "returnByDefault": true for manager in the managed/user schema

      3) Add an "onStore" script for managed/user which prints out the object, like so:

      console.log(JSON.stringify(object, null, 4)) 

      4) Create a managed/user that has a manager defined

       

      Note the logs produced by the onStore script. You should never see "manager" included in the content, because it's a relationship value. And when you create the managed/user, you see that it is correctly omitted. However, due to the defaultPostMapping behavior, you'll see another log entry produced as part of that onStore event. This second log entry will incorrectly include the "manager" attribute, resulting in one of the two above-mentioned undesirable outcomes.

       

      Work-around:

      In the onStore script, manually delete the relationship attributes from the object, like so:

      delete object.manager; 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kyle.voos Kyle Voos
              Reporter:
              jake.feasel Jake Feasel
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: