<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Mariano,</p>
    <p>I would probably start with something like this:</p>
    <p>                        <correlation><br>
                                      <q:and><br>
                                              <q:equal><br>
                                                     
      <q:path>c:name</q:path><br>
                                                      <expression><br>
                                                     
      <path>$account/attributes/icfs:name</path><br>
                                                     
      </expression><br>
                                              </q:equal><br>
                                              <q:equal><br>
                                                     
      <q:path>c:employeeType</q:path><br>
                                                      <q:value><b>EMPLOYEE</b></q:value><br>
                                              </q:equal><br>
                                      </q:and><br>
                              </correlation><br>
    </p>
    <p>Similar logic used here: samples/resources/openldap$ less
      openldap-localhost-advanced-sync-modifytimestamp.xml     <br>
    </p>
    Ivan<br>
    <br>
    <div class="moz-cite-prefix">On 09/29/2016 09:03 PM, mariano marron
      wrote:<br>
    </div>
    <blockquote
cite="mid:CALrFv6m4AXX_Ka5qq87XQZ5JTJijW3vnLNuc69FtueEw=JX6cw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>Hi everyone! The issue I have is the following.<br>
                  <br>
                </div>
                I have accounts in a resource that I want to link to
                existing users in MidPoint based on a condition: if the
                user in MidPoint has a certain "employeeType" value, I
                want the account in the resource to get linked to that
                user. Otherwise, the user shouldn't be linked.<br>
              </div>
              I understand that I can add the following code to the
              synchronization of the resource:<br>
              <br>
              <i>   <synchronization><br>
                      <objectSynchronization><br>
                         <enabled>true</enabled><br>
                         <correlation><br>
                            <condition><br>
                              <script><br>
                                  <code><br>
                                    <b>basic.getAttributeValue(account,
                  'name') == "xxxxxxx"</b><br>
                                  </code><br>
                                </script><br>
                            </condition><br>
                <br>
                            <q:equal><br>
                               <q:path>c:name</q:path><br>
                               <expression><br>
                                  <c:path>declare namespace icfs='<a
                  moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>';
                $account/attributes/icfs:name</c:path><br>
                               </expression><br>
                            </q:equal><br>
                         </correlation></i><br>
              <br>
            </div>
            But that "name" attribute, refeers to the name of the
            account in the resource, not the one in MidPoint. Is there
            anyway I can refeer to the MidPoint account and get the
            "employeeType" values to compare them to a certain value,
            instead of using the resource account attributes for the
            condition?<br>
            <br>
          </div>
          Thanks a lot!<br>
          <br>
        </div>
        <blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px
          solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Mariano<br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Ivan Noris
Senior Identity Engineer
evolveum.com
</pre>
  </body>
</html>