Uploaded image for project: 'MidPoint'
  1. MidPoint
  2. MID-3778

Results of "discovery" operation are not correctly integrated into main operation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Reviewed
    • Affects Version/s: 3.5 (Einstein)
    • Fix Version/s: 4.1
    • Component/s: None
    • Labels:
      None

      Description

      We have a resource with attribute name.givenName. There's a weak inbound (into extension/slackFirstName) and strong outbound (from extension/slackFirstName resp. givenName if extension/slackFirstName does not exist).

      <attribute>
        <c:ref>ri:name.givenName</c:ref>
        <displayName>First name</displayName>
        <description>Value of the firstname attribute.</description>
        <inbound>
          <strength>weak</strength>
          <target>
            <c:path>extension/slackFirstName</c:path>
          </target>
        </inbound>
        <outbound>
          <strength>strong</strength>
          <source>
            <c:path>$user/givenName</c:path>
          </source>
          <source>
            <c:path>$user/extension/slackFirstName</c:path>
          </source>
          <expression>
            <script>
              <code>
                if (!basic.isEmpty(slackFirstName)) {
                  return slackFirstName
                }
                return basic.toAscii(givenName);
              </code>
            </script>
          </expression>
        </outbound>
      </attribute>
      
      1. User has no account in midPoint but on the resource there's already "his" account (with filled-in name.givenName)
      2. We start reconcile on the user.
      3. Projector computes a new account, with name.givenName having default value (derived from givenName)
      4. When creating this new account, AlreadyExistsException occurs, and discovery is started.
      5. Discovery correctly applies inbounds (sets extension/slackFirstName) and finishes its work.
        #) (Now to problem occurs) Projector continues in original operation. Although it reads current state of the user and his account, computations are not consistent.

      In particular, when it tries to computenew value for attribute/name.givenName (using strong outbound) it knows nothing about the current value of extension/slackFirstName:

      ---[ MAPPING  in outbound mapping for {.../resource/instance-3}name.givenName in resource:2556e12c-d5ef-42bb-8079-abea9526face(Slack)]---------------------------
      Source: givenName: old=PP({.../common/common-3}givenName):[PPV(PolyString:test)], delta=null, new=PP({.../common/common-3}givenName):[PPV(PolyString:test)]
      Source: slackFirstName: old=null, delta=null, new=null
      Target: com.evolveum.midpoint.common.refinery.LayerRefinedAttributeDefinitionImpl@333e1875
      Expression: script: ScriptExpression( // use existing one if we need if (!basic...)
      Condition: true -> true
      Result: unchanged: test
      

      Note the Source: slackFirstName: old=null, delta=null, new=null line.

      (Obviously it took old value and delta - there's no information about what was done during discovery.)

      Conclusion: Perhaps we need a more sophisticated algorithm for IDI computation. Or to better integrate results from the discovery into main clockwork run.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mederly Pavol Mederly
              Reporter:
              mederly Pavol Mederly
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: