<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Ilija,<br>
      <br>
      back from the vacation. <br>
      <br>
      Created Org "wheel" with two users: admin1, admin2 (both having
      Superuser role, not to bother with security).<br>
      Created role "testrole" where approver == wheel.<br>
      Attempted to create "testuser" with assigned "testrole".<br>
      <br>
      Work item was created, where candidate is wheel (org).<br>
      <br>
      <img src="cid:part1.08070404.09090805@evolveum.com" alt=""><br>
      After logging in as "admin1" - no "My work items", but one "Work
      items claimable by me":<br>
      <br>
      <img src="cid:part2.07000809.07050702@evolveum.com" alt=""><br>
      <br>
      It can be claimed and released back, or directly processed.<br>
      <br>
      Implementation is such that this Activiti Task is created like
      this - see the second row:<br>
      <br>
      <img src="cid:part3.09090806.04020201@evolveum.com" alt=""><br>
      <br>
      I.e. its candidate group is in the form of "org:oid" where oid is
      the midPoint OID of the "wheel" org.<br>
      <br>
      For implementation, see e.g.<br>
      -
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      PrepareApprover.execute (called from ItemApproval BPMN process) -
      maps approverRef of type Role or Org  to "role:oid" or "org:oid"
      Activiti candidate group names<br>
        - and then see
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      ItemApproval BPMN process, userTask
      id="loopLevels.loopApprovers.approve.withGroups" (lines 123-131)<br>
      - WorkItemProvider.
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      createQueryForTasksRelatedToUser (searching for work items)<br>
      <br>
      Hope this helps,<br>
      Pavol<br>
      <br>
      On 22. 7. 2015 9:15, Дорофеев Илья wrote:<br>
    </div>
    <blockquote
      cite="mid:F82253638486D44DABA51EC404D48AF38861D6@EX-MB1.solar.local"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Pavol,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Thanks
            for the answer. I am sorry but the assignment to members of
            an org. unit didn’t work either. None of the members of the
            org. unit are offered a work item. I looked through the code
            and didn’t find any mentions of mapping between midPoint and
            Activiti groups. So, when an Activiti task is assigned to a
            candidate group org:c96bf133-10f6-4ed0-9c88-cb3c69bb27ec,
            the Activiti engine doesn’t really know the actual users of
            the group, and the task is basically assigned to no one.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Could
            you show me that piece of code responsible for this behavior
            in case I’m wrong?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Ilya<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span
                  style="mso-fareast-language:RU" lang="EN-US">From:</span></b><span
                style="mso-fareast-language:RU" lang="EN-US"> midPoint
                [<a class="moz-txt-link-freetext" href="mailto:midpoint-bounces@lists.evolveum.com">mailto:midpoint-bounces@lists.evolveum.com</a>]
                <b>On Behalf Of </b>P</span><span
                style="mso-fareast-language:RU">avol Mederly<br>
                <b>Sent:</b> Tuesday, July 21, 2015 4:44 PM<br>
                <b>To:</b> midPoint General Discussion<br>
                <b>Subject:</b> Re: [midPoint] Assign approval work item
                to role<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <div>
            <p class="MsoNormal"><span style="color:black">Ilya,</span><span
style="font-size:12.0pt;color:black;mso-fareast-language:RU"><o:p></o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black">I've
                implemented this quite a long ago, so I'm having a
                little trouble remembering the current status. ;)<o:p></o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black">But as
                described here: <a moz-do-not-send="true"
href="https://wiki.evolveum.com/display/midPoint/Current+status+and+future+plans:">https://wiki.evolveum.com/display/midPoint/Current+status+and+future+plans:</a><o:p></o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><em><span
style="font-family:"Calibri","sans-serif";color:black">#7:
                  Ability to define approver not as an individual only,
                  but also as a member of an org. unit; allowing to
                  claim/release a work item. Currently this feature is
                  limited to "direct" members, i.e. not to members of
                  subordinate org. units. (Temporarily, it is possible
                  to use a role as an approver as well, but this also
                  applies only to users that have directly assigned this
                  role - and perhaps support for this will be dropped in
                  the future, see the following <a
                    moz-do-not-send="true"
                    href="https://wiki.evolveum.com/display/midPoint/Roles+and+Orgs">
                    discussion on roles and orgs</a>.)</span></em><span
                style="color:black"><o:p></o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black">So, the
                assignment to members of an org. unit works, but in a
                special mode: each of the members is offered the work
                item. (I.e. not assigned directly.) He/she may claim it,
                and work on it.
                <o:p></o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black">As written
                above, I would suggest not using roles for this, but
                org. units instead. (Note that org. unit is a very
                general term. It may well correspond to an arbitrary
                group of people.)<o:p></o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black">Hope this
                helps,<o:p></o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black">Pavol<o:p></o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
          </div>
          <div class="MsoNormal" style="text-align:center"
            align="center"><span style="color:black">
              <hr id="zwchr" align="center" size="2" width="100%">
            </span></div>
          <div>
            <p class="MsoNormal"><b><span
style="font-family:"Helvetica","sans-serif";color:black"
                  lang="EN-US">From:
                </span></b><span
style="font-family:"Helvetica","sans-serif";color:black"
                lang="EN-US">"</span><span
style="font-family:"Helvetica","sans-serif";color:black">Дорофеев</span><span
style="font-family:"Helvetica","sans-serif";color:black">
              </span><span
style="font-family:"Helvetica","sans-serif";color:black">Илья</span><span
style="font-family:"Helvetica","sans-serif";color:black"
                lang="EN-US">" <</span><span
style="font-family:"Helvetica","sans-serif";color:black"><a
                  moz-do-not-send="true"
                  href="mailto:i.dorofeev@solarsecurity.ru"><span
                    lang="EN-US">i.dorofeev@solarsecurity.ru</span></a></span><span
style="font-family:"Helvetica","sans-serif";color:black"
                lang="EN-US">><br>
                <b>To: </b>"midPoint General Discussion" <</span><span
style="font-family:"Helvetica","sans-serif";color:black"><a
                  moz-do-not-send="true"
                  href="mailto:midpoint@lists.evolveum.com"><span
                    lang="EN-US">midpoint@lists.evolveum.com</span></a></span><span
style="font-family:"Helvetica","sans-serif";color:black"
                lang="EN-US">><br>
                <b>Sent: </b>Tuesday, July 21, 2015 12:24:56 PM<br>
                <b>Subject: </b>[midPoint] Assign approval work item to
                role<o:p></o:p></span></p>
            <div>
              <p class="MsoNormal"><span
style="font-family:"Helvetica","sans-serif";color:black"
                  lang="EN-US"><o:p> </o:p></span></p>
            </div>
            <p class="MsoNormal"><span style="color:black" lang="EN-US">Hi,</span><span
                style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span style="color:black" lang="EN-US"> </span><span
                style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span style="color:black" lang="EN-US">I
                have just come across a problem of assigning approval
                work item to a role.</span><span style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span style="color:black" lang="EN-US"> </span><span
                style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span style="color:black" lang="EN-US"><role></span><span
                style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span style="color:black" lang="EN-US">  
                <approverRef
                oid="1ae3ab25-188f-4685-a073-fe522c55e057"
                type="c:RoleType"><!-- resource_owner
                --></approverRef></span><span
                style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span style="color:black" lang="EN-US"></role></span><span
                style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span style="color:black" lang="EN-US"> </span><span
                style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span style="color:black" lang="EN-US">I
                expected that the created workitem(s) would be assigned
                to all the users included in the ‘resource_owner’ role.
                Is this not implemented yet?</span><span
                style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span style="color:black" lang="EN-US"> </span><span
                style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span
                style="color:black;mso-fareast-language:RU" lang="EN-US">Regards,
                Ilya</span><span style="color:black"><o:p></o:p></span></p>
            <p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
            <p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Helvetica","sans-serif";color:black;mso-fareast-language:RU"><br>
              </span><span
style="font-size:12.0pt;font-family:"Helvetica","sans-serif";color:black;mso-fareast-language:RU"
                lang="EN-US">_______________________________________________<br>
                midPoint mailing list<br>
              </span><span
style="font-size:12.0pt;font-family:"Helvetica","sans-serif";color:black;mso-fareast-language:RU"><a
                  moz-do-not-send="true"
                  href="mailto:midPoint@lists.evolveum.com"><span
                    lang="EN-US">midPoint@lists.evolveum.com</span></a></span><span
style="font-size:12.0pt;font-family:"Helvetica","sans-serif";color:black;mso-fareast-language:RU"
                lang="EN-US"><br>
              </span><span
style="font-size:12.0pt;font-family:"Helvetica","sans-serif";color:black;mso-fareast-language:RU"><a
                  moz-do-not-send="true"
                  href="http://lists.evolveum.com/mailman/listinfo/midpoint"><span
                    lang="EN-US">http://lists.evolveum.com/mailman/listinfo/midpoint</span></a></span><span
style="font-size:12.0pt;font-family:"Helvetica","sans-serif";color:black;mso-fareast-language:RU"
                lang="EN-US"><o:p></o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span
                style="font-size:12.0pt;font-family:"Times New
                Roman","serif";color:black;mso-fareast-language:RU"
                lang="EN-US"><o:p> </o:p></span></p>
          </div>
        </div>
      </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>
  </body>
</html>