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

Filter in correlation generates duplicate output

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.3.1
    • Fix Version/s: 3.4 (Heisenberg)
    • Component/s: Repository
    • Labels:
      None

      Description

      Filter in correlation generates duplicate output. In example later filter finds 9 users, but all of them are only one (ZP204058). Result is DISPUTED, but it is wrong, must be LINKED.

      Filter definition:

      <correlation>
      <q:or>
      <q:equal>
      <q:path>c:employeeNumber</q:path>
      <expression>
      <variable>
      <name xmlns:my="http://ami.cz/xml/ns/userExtension">my:OsCislo</name>
      <c:path>$account/attributes/ri:OsCislo</c:path>
      </variable>
      <script>
      <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language>
      <code>
      if (OsCislo)

      { return OsCislo; }

      ;
      return "-1";
      </code>
      </script>
      </expression>
      </q:equal>
      <q:equal>
      <q:path>
      declare namespace ext="http://ami.cz/xml/ns/userExtension";
      extension/ext:ZAM_UsrID</q:path>
      <expression>
      <variable>
      <name xmlns:my="http://ami.cz/xml/ns/userExtension">my:UsrID</name>
      <c:path>$account/attributes/ri:UsrID</c:path>
      </variable>
      <script>
      <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language>
      <code>
      if (UsrID)

      { return UsrID; };
      return "-1";
      </code>
      </script>
      </expression>
      </q:equal>
      <q:equal>
      <q:path>
      declare namespace ext="http://ami.cz/xml/ns/userExtension";
      extension/ext:BRIG_UsrID</q:path>
      <expression>
      <variable>
      <name xmlns:my="http://ami.cz/xml/ns/userExtension">my:UsrID</name>
      <c:path>$account/attributes/ri:UsrID</c:path>
      </variable>
      <script>
      <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language>
      <code>
      if (UsrID) { return UsrID; }

      ;
      return "-1";
      </code>
      </script>
      </expression>
      </q:equal>
      <q:equal>
      <q:path>
      declare namespace ext="http://ami.cz/xml/ns/userExtension";
      extension/ext:EXT_UsrID</q:path>
      <expression>
      <variable>
      <name xmlns:my="http://ami.cz/xml/ns/userExtension">my:UsrID</name>
      <c:path>$account/attributes/ri:UsrID</c:path>
      </variable>
      <script>
      <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language>
      <code>
      if (UsrID)

      { return UsrID; }

      ;
      return "-1";
      </code>
      </script>
      </expression>
      </q:equal>
      <q:equal>
      <q:path>c:name</q:path>
      <expression>
      <variable>
      <name xmlns:my="http://ami.cz/xml/ns/userExtension">my:givenName</name>
      <c:path>$account/attributes/ri:Jmeno</c:path>
      </variable>
      <variable>
      <name xmlns:my="http://ami.cz/xml/ns/userExtension">my:familyName</name>
      <c:path>$account/attributes/ri:Prijmeni</c:path>
      </variable>
      <variable>
      <name xmlns:my="http://ami.cz/xml/ns/userExtension">my:osCislo</name>
      <c:path>$account/attributes/ri:OsCislo</c:path>
      </variable>
      <script>
      <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language>
      <code>
      import java.text.Normalizer;

      gName = Normalizer.normalize(givenName.toString(), Normalizer.Form.NFD);
      fName = Normalizer.normalize(familyName.toString(), Normalizer.Form.NFD);
      normGName = gName.replaceAll("
      p

      {InCombiningDiacriticalMarks}+", "");
      normFName = fName.replaceAll("
      p{InCombiningDiacriticalMarks}

      +", "");
      inicialy = normFName.substring(0,1) + normGName.substring(0,1);
      return basic.uc(inicialy) + osCislo;
      </code>
      </script>
      </expression>
      </q:equal>
      </q:or>
      </correlation>

      LOG Output:

      2016-05-13 13:50:46,477 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] DEBUG (com.evolveum.midpoint.model.impl.sync.SynchronizationService): SYNCHRONIZATION: received change notification ResourceObjectShadowChangeDescription(objectDelta=ObjectDelta(ShadowType:6c2c9941-d978-4977-9c63-7bb3885097cd,ADD: shadow:6c2c9941-d978-4977-9c63-7bb3885097cd(204058)), currentShadow=shadow:6c2c9941-d978-4977-9c63-7bb3885097cd(204058), oldShadow=null, sourceChannel=http://midpoint.evolveum.com/xml/ns/public/provisioning/channels-3#import, resource=resource:resource-tdi-zam(TDI: Zaměstnanci))
      2016-05-13 13:50:46,481 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] TRACE (com.evolveum.midpoint.model.impl.sync.SynchronizationService): SYNCHRONIZATION determined policy: uzivatel
      2016-05-13 13:50:46,482 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] TRACE (com.evolveum.midpoint.model.impl.sync.SynchronizationService): Synchronization is enabled, focus class: class com.evolveum.midpoint.xml.ns._public.common.common_3.UserType, found applicable policy: uzivatel
      2016-05-13 13:50:46,482 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] TRACE (com.evolveum.midpoint.model.impl.sync.SynchronizationService): Determining situation for resource object shadow.
      2016-05-13 13:50:46,485 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] TRACE (com.evolveum.midpoint.model.impl.sync.SynchronizationService): Resource object shadow doesn't have owner.
      2016-05-13 13:50:46,486 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] TRACE (com.evolveum.midpoint.model.impl.sync.SynchronizationService): SYNCHRONIZATION: CORRELATION: Looking for list of UserType objects based on correlation rule.
      2016-05-13 13:50:46,486 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] TRACE (com.evolveum.midpoint.model.impl.sync.CorrelationConfirmationEvaluator): Condition null in correlation expression evaluated to true
      2016-05-13 13:50:46,490 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] TRACE (com.evolveum.midpoint.model.impl.sync.CorrelationConfirmationEvaluator): SYNCHRONIZATION: CORRELATION: expression for results in filter
      filter:
      OR:
      EQUAL:
      PATH: employeeNumber
      DEF: PPD:

      {.../common/common-3}employeeNumber {xsd:}string[0,1],RAM
      VALUE:
      204058
      EQUAL:
      PATH: extension/ZAM_UsrID
      DEF: PPD:{http://ami.cz/xml/ns/userExtension}ZAM_UsrID {xsd}string[0,1],RAM,runtime
      VALUE:
      635923355434173669
      EQUAL:
      PATH: extension/BRIG_UsrID
      DEF: PPD:{http://ami.cz/xml/ns/userExtension}BRIG_UsrID {xsd:}string[0,1],RAM,runtime
      VALUE:
      635923355434173669
      EQUAL:
      PATH: extension/EXT_UsrID
      DEF: PPD:{http://ami.cz/xml/ns/userExtension}EXT_UsrID {xsd}string[0,1],RAM,runtime
      VALUE:
      635923355434173669
      EQUAL:
      PATH: name
      DEF: PPD:{.../common/common-3}

      name

      {http://prism.evolveum.com/xml/ns/public/types-3}

      PolyStringType[0,1],RAM
      VALUE:
      PolyString(ZP204058,zp204058)
      paging: null
      2016-05-13 13:50:47,060 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] DEBUG (com.evolveum.midpoint.model.impl.sync.CorrelationConfirmationEvaluator): SYNCHRONIZATION: CORRELATION: expression for shadow:6c2c9941-d978-4977-9c63-7bb3885097cd(204058) returned 9 users: [user:3a6047ae-0631-4c6d-82ff-98f29e20244f(ZP204058),user:3a6047ae-0631-4c6d-82ff-98f29e20244f(ZP204058),user:3a6047ae-0631-4c6d-82ff-98f29e20244f(ZP204058),...]
      2016-05-13 13:50:47,060 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] TRACE (com.evolveum.midpoint.model.impl.sync.SynchronizationService): SYNCHRONIZATION: CONFIRMATION: no confirmation defined.
      2016-05-13 13:50:47,061 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] DEBUG (com.evolveum.midpoint.model.impl.sync.SynchronizationService): SYNCHRONIZATION: SITUATION: 'disputed', currentOwner=null, correlatedOwner=null
      2016-05-13 13:50:47,129 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] TRACE (com.evolveum.midpoint.model.impl.sync.SynchronizationService): Using default reaction null
      2016-05-13 13:50:47,129 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] TRACE (com.evolveum.midpoint.model.impl.sync.SynchronizationService): No reaction is defined for situation DISPUTED in resource:resource-tdi-zam(TDI: Zaměstnanci)
      2016-05-13 13:50:47,129 [RESOURCE_OBJECT_CHANGE_LISTENER] [http-bio-8080-exec-1] DEBUG (com.evolveum.midpoint.model.impl.sync.SynchronizationService): SYNCHRONIZATION: DONE for shadow:6c2c9941-d978-4977-9c63-7bb3885097cd(204058)
      (

        Attachments

          Activity

            People

            • Assignee:
              rpudil Roman Pudil
              Reporter:
              rpudil Roman Pudil
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: