<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Pavol,<br>
    unfortunately, this code does not remove user assignment from org
    (adding user to org works well).<br>
    <br>
    Regards<br>
    Roman<br>
    <div class="moz-signature">
      <title></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <p> </p>
      <table style="border-collapse:collapse;">
        <tbody>
          <tr>
            <td colspan="2" style="font-family:Arial, sans-serif;
              font-size:11px; color:#000000; vertical-align:bottom;">
              <p> <span style="font-size:14px; font-weight:bold;">Roman
                  Pudil</span><br>
                solution architect<br>
                <br>
                gsm: [+420] 775 663 666<br>
                e-mail: <a href="mailto:roman.pudil@ami.cz">roman.pudil@ami.cz</a>
              </p>
            </td>
            <td style="border-right:1px solid #cccccc;">   </td>
            <td>   </td>
            <td style="font-family:Arial, sans-serif; font-size:11px;
              color:#000000; vertical-align:bottom;">
              <p> AMI Praha a.s.<br>
                Pláničkova 11<br>
                162 00 Praha 6<br>
                tel./fax: [+420] 274 783 239<br>
                web: <a href="http://www.ami.cz">www.ami.cz</a> </p>
            </td>
            <td style="border-right:1px solid #cccccc;">   </td>
            <td>   </td>
            <td style="font-family:Arial, sans-serif; font-size:11px;
              color:#000000;">
              <p> <img src="cid:part3.02000407.06050806@ami.cz"
                  alt="AMI Praha a.s." title="AMI Praha a.s."> </p>
            </td>
          </tr>
          <tr>
            <td colspan="8"><br>
              <a
href="http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management"><img
                  src="cid:part4.08020504.07090708@ami.cz" alt=""></a></td>
          </tr>
          <tr>
            <td colspan="8" style="font-family:Arial, sans-serif;
              font-size:11px; color:#808080;"> <br>
              Textem tohoto e-mailu podepisující neslibuje uzavřít ani
              neuzavírá za společnost AMI Praha a.s.<br>
              jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena,
              musí mít výhradně písemnou formu.</td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="moz-cite-prefix">Dne 1.7.2015 v 15:09 Pavol Mederly
      napsal(a):<br>
    </div>
    <blockquote cite="mid:5593E694.8050401@evolveum.com" type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      <div class="moz-cite-prefix">Hello Roman,<br>
        <br>
        maybe I don't understand your question completely, but for me it
        works. This is a sample template that is able to add as well as
        remove Org assignment to/from a user based on his
        organizationalUnit attribute value:<br>
        <tt><br>
        </tt><tt> </tt>
        <div class="moz-text-html" lang="x-unicode">
          <div dir="ltr"><tt>   <mapping></tt><tt><br>
            </tt><tt>      <source></tt><tt><br>
            </tt><tt>        
              <c:path>$user/organizationalUnit</c:path></tt><tt><br>
            </tt><tt>      </source></tt><tt><br>
            </tt><tt>      <expression></tt><tt><br>
            </tt><tt>         <assignmentTargetSearch></tt><tt><br>
            </tt><tt>           
              <targetType>OrgType</targetType></tt><tt><br>
            </tt><tt>            <filter></tt><tt><br>
            </tt><tt>               <q:equal></tt><tt><br>
            </tt><tt>                 
              <q:path>c:name</q:path></tt><tt><br>
            </tt><tt>                  <expression></tt><tt><br>
            </tt><tt>                     <script></tt><tt><br>
            </tt><tt>                        <code></tt><tt><br>
            </tt><tt>                           log.info</tt><tt>('looking

              for {}', organizationalUnit)</tt><tt><br>
            </tt><tt>                           return
              organizationalUnit</tt><tt><br>
            </tt><tt>                        </code></tt><tt><br>
            </tt><tt>                     </script></tt><tt><br>
            </tt><tt>                  </expression></tt><tt><br>
            </tt><tt>               </q:equal></tt><tt><br>
            </tt><tt>            </filter></tt><tt><br>
            </tt><tt>         </assignmentTargetSearch></tt><tt><br>
            </tt><tt>      </expression></tt><tt><br>
            </tt><tt>      <target></tt><tt><br>
            </tt><tt>         <c:path>assignment</c:path></tt><tt><br>
            </tt><tt>      </target></tt><tt><br>
            </tt><tt>   </mapping></tt><br>
          </div>
        </div>
        <br>
        Best regards,<br>
        Pavol<br>
        <br>
      </div>
      <blockquote cite="mid:5591432F.30104@ami.cz" type="cite">
        <meta http-equiv="content-type" content="text/html;
          charset=utf-8">
        Hi all,<br>
        how to remove user from organization based on attribute value?<br>
        User add to org in mapping template object works great (I am
        using assignmentTargetSearch). How to remove user?<br>
        <br>
        Thanks!<br>
        R. Pudil<br>
        <div class="moz-signature">-- <br>
          <title></title>
          <meta http-equiv="Content-Type" content="text/html;
            charset=utf-8">
          <p> </p>
          <table style="border-collapse:collapse;">
            <tbody>
              <tr>
                <td colspan="2" style="font-family:Arial, sans-serif;
                  font-size:11px; color:#000000; vertical-align:bottom;">
                  <p> <span style="font-size:14px; font-weight:bold;">Roman


                      Pudil</span><br>
                    solution architect<br>
                    <br>
                    gsm: [+420] 775 663 666<br>
                    e-mail: <a moz-do-not-send="true"
                      href="mailto:roman.pudil@ami.cz">roman.pudil@ami.cz</a>
                  </p>
                </td>
                <td style="border-right:1px solid #cccccc;">   </td>
                <td>   </td>
                <td style="font-family:Arial, sans-serif;
                  font-size:11px; color:#000000; vertical-align:bottom;">
                  <p> AMI Praha a.s.<br>
                    Pláničkova 11<br>
                    162 00 Praha 6<br>
                    tel./fax: [+420] 274 783 239<br>
                    web: <a moz-do-not-send="true"
                      href="http://www.ami.cz">www.ami.cz</a> </p>
                </td>
                <td style="border-right:1px solid #cccccc;">   </td>
                <td>   </td>
                <td style="font-family:Arial, sans-serif;
                  font-size:11px; color:#000000;">
                  <p> <img src="cid:part8.07000506.04080201@ami.cz"
                      alt="AMI Praha a.s." title="AMI Praha a.s."> </p>
                </td>
              </tr>
              <tr>
                <td colspan="8"><br>
                  <a moz-do-not-send="true"
href="http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management"><img
                      src="cid:part9.00010500.03060601@ami.cz" alt=""></a></td>
              </tr>
              <tr>
                <td colspan="8" style="font-family:Arial, sans-serif;
                  font-size:11px; color:#808080;"> <br>
                  Textem tohoto e-mailu podepisující neslibuje uzavřít
                  ani neuzavírá za společnost AMI Praha a.s.<br>
                  jakoukoliv smlouvu. Každá smlouva, pokud bude
                  uzavřena, musí mít výhradně písemnou formu.</td>
              </tr>
            </tbody>
          </table>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
midPoint mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
      </blockquote>
      <br>
      <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>
  </body>
</html>