<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hello Shelly,<br>
      <br>
      it took me some time to look at this.<br>
      <br>
      The problem is with outdated wiki documentation - I apologize for
      that. I've updated it, see <a
        href="https://wiki.evolveum.com/display/midPoint/Some+examples">https://wiki.evolveum.com/display/midPoint/Some+examples</a>.
      Basically, you have to change <b>user -> object</b> and that's
      it.<br>
      <br>
      Please note, however, that in order to recognize user as a Org
      manager, it is necessary to have the following defined for him
      (taken from samples/org/org-monkey-island-simple.xml):<br>
      <br>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <b><parentOrgRef oid="00000000-8888-6666-0000-100000000001"
        type="c:OrgType" relation="org:manager"
        xmlns:org='<a class="moz-txt-link-freetext" href="http://midpoint.evolveum.com/xml/ns/public/common/org-3'/">http://midpoint.evolveum.com/xml/ns/public/common/org-3'/</a>></b><br>
      <br>
      And, if a user has no managers, the role assignment will be
      automatically approved, as described on the wiki page. (There was
      a bug related to automatic approvals that prevented them from
      being applied succesfully. It's been fixed yesterday in the master
      branch: <a
href="https://github.com/Evolveum/midpoint/commit/c96f38b0262da8cfb3861379d10b7af44a1ba2fe">https://github.com/Evolveum/midpoint/commit/c96f38b0262da8cfb3861379d10b7af44a1ba2fe</a>.)<br>
      <br>
      Best regards,<br>
      Pavol<br>
      <br>
    </div>
    <blockquote cite="mid:1415027418763.93968@ilantus.com" type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} p
        {margin-top:0;
        margin-bottom:0}
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:"Segoe UI"}
@font-face
        {font-family:Consolas}
@font-face
        {font-family:"Trebuchet MS"}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black}
span.HTMLPreformattedChar
        {font-family:Consolas;
        color:black}
span.EmailStyle21
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}--></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
        <p><br>
        </p>
        <div style="color: rgb(33, 33, 33);"><br>
          <div>Hi ,<br>
            <br>
            Request you to provide help on this issue. Attached is the
            role scipt and also the logs for the reference.<br>
            <br>
            Regards,<br>
            Shelly<br>
            <div class="moz-cite-prefix"><br>
            </div>
            <blockquote type="cite">
              <div style="color:rgb(33,33,33)"><br>
                <div>
                  <div style="font-family:times new roman,new
                    york,times,serif; font-size:12pt; color:#000000">
                    <div><br>
                    </div>
                    <hr id="zwchr">
                    <blockquote style="border-left:2px solid #1010FF;
                      margin-left:5px; padding-left:5px; color:#000;
                      font-weight:normal; font-style:normal;
                      text-decoration:none;
                      font-family:Helvetica,Arial,sans-serif;
                      font-size:12pt">
                      <br>
                      <div><br>
                      </div>
                      <style style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:"Segoe UI"}
@font-face
        {font-family:Consolas}
@font-face
        {font-family:"Trebuchet MS"}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black}
span.HTMLPreformattedChar
        {font-family:Consolas;
        color:black}
span.EmailStyle21
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
-->
</style>
                      <p>Hi Pavol,</p>
                      <p><br>
                      </p>
                      <p>I  have increased the log level.</p>
                      <p>Attached is the log file for reference and also
                        the SensitiveRole3 script which I am trying to
                        assign to the user.<br>
                      </p>
                      <p>The error I am receiving in the  logs is :</p>
                      <p><br>
                      </p>
                      <p><strong>groovy.lang.MissingPropertyException:
                          No such property: user for class: Script7
                          (new) approverExpression</strong><br>
                        <strong>com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
                          groovy.lang.MissingPropertyException: No such
                          property: user for class: Script7 (new)
                          approverExpression</strong><br>
                            at
                        com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:124)
                        ~[model-common-3.0.jar:na]<br>
                            at
                        com.evolveum.midpoint.model.common.expression.script.ScriptExpression.evaluate(ScriptExpression.java:108)
                        ~[model-common-3.0.jar:na]<br>
                            at
                        com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluator.transformSingleValue(ScriptExpressionEvaluator.java:58)
                        [model-common-3.0.jar:na]<br>
                            at
                        com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator.evaluateScriptExpression(AbstractValueTransformationExpressionEvaluator.java:276)
                        [model-common-3.0.jar:na]</p>
                      <p><br>
                      </p>
                      <p><br>
                      </p>
                      <p><br>
                      </p>
                      <p>Looks like we need to define this user
                         variable which I am using in the script of
                        SensitiveRole3. But not sure how to exactly
                        define that.</p>
                      <p><br>
                      </p>
                      <p>Please provide your inputs for the same.</p>
                      <p><br>
                      </p>
                      <p><br>
                      </p>
                      <p>Regards,</p>
                      <p>Shelly<br>
                      </p>
                      <div style="color:rgb(33,33,33)">
                        <hr style="display:inline-block; width:98%">
                        <div id="divRplyFwdMsg" dir="ltr"><span
                            color="#000000" face="Calibri, sans-serif"
                            style="font-size:11pt; color:#000000;
                            font-family:Calibri,sans-serif"><b>From:</b>
                            Sai Chandra<br>
                            <b>Sent:</b> 09 October 2014 21:41<br>
                            <b>To:</b> Shelly Piplani<br>
                            <b>Subject:</b> RE: [Midpoint-dev] Issues in
                            creating approval workflow</span>
                          <div> </div>
                        </div>
                        <div>
                          <div class="WordSection1">
                            <p class="MsoNormal"><span
                                style="font-size:11.0pt;
                                font-family:"Calibri","sans-serif";
                                color:#1F497D"> </span></p>
                            <p class="MsoNormal"><span
                                style="font-size:11.0pt;
                                font-family:"Calibri","sans-serif";
                                color:#1F497D"> </span></p>
                            <div>
                              <p class="MsoNormal"><span
                                  style="font-size:11.0pt;
                                  font-family:"Calibri","sans-serif";
                                  color:#2E4692">Thanks and Regards</span></p>
                              <p class="MsoNormal"><span
                                  style="font-size:11.0pt;
                                  font-family:"Calibri","sans-serif";
                                  color:#2E4692">Saichandra.T</span><span
                                  style=""></span></p>
                            </div>
                            <p class="MsoNormal"><span
                                style="font-size:11.0pt;
                                font-family:"Calibri","sans-serif";
                                color:#1F497D"> </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="font-size:11.0pt;
                                      font-family:"Calibri","sans-serif";
                                      color:windowtext" lang="EN-US">From:</span></b><span
                                    style="font-size:11.0pt;
                                    font-family:"Calibri","sans-serif";
                                    color:windowtext" lang="EN-US">
                                    midPoint-dev [<a
                                      moz-do-not-send="true"
                                      class="moz-txt-link-freetext"
                                      href="mailto:midpoint-dev-bounces@lists.evolveum.com">mailto:midpoint-dev-bounces@lists.evolveum.com</a>]
                                    <b>On Behalf Of </b>Pavol Mederly<br>
                                    <b>Sent:</b> 09 October 2014 14:12<br>
                                    <b>To:</b> <a
                                      moz-do-not-send="true"
                                      class="moz-txt-link-abbreviated"
                                      href="mailto:midpoint-dev@lists.evolveum.com">
                                      midpoint-dev@lists.evolveum.com</a><br>
                                    <b>Subject:</b> Re: [Midpoint-dev]
                                    Issues in creating approval workflow</span></p>
                              </div>
                            </div>
                            <p class="MsoNormal"> </p>
                            <div>
                              <p class="MsoNormal">Shelly,<br>
                                <br>
                                you (and I as well) need the stack trace
                                for the error you've mentioned. Stack
                                traces are written to the log if the
                                logging is at DEBUG or TRACE levels.<br>
                                So, set you debug level to TRACE for
                                Workflow module, try again, and post the
                                log here.<br>
                                <br>
                                Best regards,<br>
                                Pavol <br>
                                <br>
                                On 8. 10. 2014 17:37, Shelly Piplani
                                wrote:</p>
                            </div>
                            <blockquote style="margin-top:5.0pt;
                              margin-bottom:5.0pt">
                              <p>Hi ,</p>
                              <p> </p>
                              <p>I am trying to create approval
                                workflow. Ihave created a manager for an
                                Organisation Unit and created a
                                role called SensitiveRole3 as given in
                                the following link:</p>
                              <p> </p>
                              <p><a moz-do-not-send="true"
href="https://github.com/Evolveum/midpoint/blob/master/samples/roles/sensitive-role-3.xml"
                                  id="lnk326088" target="_blank">https://github.com/Evolveum/midpoint/blob/master/samples/roles/sensitive-role-3.xml</a><br>
                              </p>
                              <div
                                id="LPBorder_GT_14127821207310.9406176249366788"
                                style="margin-top:15.0pt;
                                margin-bottom:15.0pt">
                                <table class="MsoNormalTable"
                                  style="width:80.0%; background:white;
                                  border-top:solid #CCCCCC 1.0pt;
                                  border-left:none; border-bottom:solid
                                  #CCCCCC 1.0pt; border-right:none"
                                  cellpadding="0" border="1" width="80%">
                                  <tbody>
                                    <tr>
                                      <td style="width:105.0pt;
                                        border:none; padding:.75pt .75pt
                                        .75pt .75pt" valign="top"
                                        width="140">
                                        <div
                                          id="LPImageContainer_14127821207310.8193391653218552"
                                          style="margin-top:9.0pt;
                                          background-color:rgb(255,255,255);
                                          display:table">
                                          <p class="MsoNormal"><a
                                              moz-do-not-send="true"
href="https://github.com/Evolveum/midpoint/blob/master/samples/roles/sensitive-role-3.xml"
                                              target="_blank"><span
                                                style="text-decoration:none"><img
                                                  moz-do-not-send="true"
                                                  id="_x0000_i1025"
src="imap://pavol%2Emederly%40gmail%2Ecom@imap.googlemail.com:993/fetch%3EUID%3E/%5BGmail%5D/Rozp%26AO0-san%26AOk-%20spr%26AOE-vy%3E486?v=2&s=400"
                                                  border="0"
                                                  height="140"
                                                  width="140"></span></a><br>
                                          </p>
                                        </div>
                                      </td>
                                      <td style="border:none;
                                        padding:.75pt .75pt .75pt .75pt"
                                        valign="top">
                                        <div
                                          id="LPTitle_14127821207310.6602242669053672"
                                          style="margin-left:10.5pt;
                                          margin-top:6.0pt;
                                          margin-right:10.5pt">
                                          <p class="MsoNormal"><span
                                              style="font-size:16.0pt">midpoint/sensitive-role-3.xml
                                              at master ·
                                              Evolveum/midpoint · GitHub</span></p>
                                        </div>
                                        <div
                                          id="LPDescription_14127821207310.40828855970468614"
                                          style="margin-left:10.5pt;
                                          margin-top:6.0pt;
                                          margin-right:10.5pt">
                                          <p class="MsoNormal"><span
                                              style="">midpoint -
                                              MidPoint Identity Manager</span></p>
                                        </div>
                                        <div
                                          id="LPUrlContainer_14127821207310.33754568390969064"
                                          style="margin-left:10.5pt;
                                          margin-top:6.0pt;
                                          margin-right:10.5pt;
                                          margin-bottom:7.5pt;
                                          text-overflow:ellipsis;
                                          overflow:hidden">
                                          <p class="MsoNormal"><a
                                              moz-do-not-send="true"
href="https://github.com/Evolveum/midpoint/blob/master/samples/roles/sensitive-role-3.xml"
                                              target="_blank"><span
                                                style="font-size:8.5pt">Read
                                                more...</span></a><br>
                                          </p>
                                        </div>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                              </div>
                              <p> </p>
                              <p> However, I have removed the  following
                                from the role:</p>
                              <p> </p>
                              <table class="MsoNormalTable mceItemTable"
                                cellpadding="0" border="0">
                                <tbody>
                                  <tr>
                                    <td id="LC31" style="padding:.75pt
                                      .75pt .75pt .75pt">
                                      <p class="MsoNormal"><span
                                          class="nt"><automaticallyApproved></span></p>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td id="LC32" style="padding:.75pt
                                      .75pt .75pt .75pt">
                                      <p class="MsoNormal"><span
                                          class="nt"><description></span>If
                                        the user works in F0006 (Scumm
                                        Bar), the assignment of this
                                        role is automatically approved
                                        for him.<span class="nt"></description></span></p>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td id="LC33" style="padding:.75pt
                                      .75pt .75pt .75pt">
                                      <p class="MsoNormal"><span
                                          class="nt"><script></span></p>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td id="LC34" style="padding:.75pt
                                      .75pt .75pt .75pt">
                                      <p class="MsoNormal"><span
                                          class="nt"><code></span>midpoint.isMemberOf(user,
midpoint.getOrgByName("F0006").getOid())<span class="nt"></code></span></p>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td id="LC35" style="padding:.75pt
                                      .75pt .75pt .75pt">
                                      <p class="MsoNormal"><span
                                          class="nt"></script></span></p>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td id="LC36" style="padding:.75pt
                                      .75pt .75pt .75pt">
                                      <p class="MsoNormal"
                                        style="margin-bottom:12.0pt"><span
                                          class="nt"></automaticallyApproved></span><br>
                                        <br>
                                        <br>
                                        <span class="nt">After assigning
                                          that Organisation unit to the
                                          user, I am trying to assign
                                          SensitiveRole3 to this user.</span><br>
                                        <span class="nt">I am getting
                                          the following error in idm
                                          logs:</span><br>
                                        <br>
                                        <br>
                                        <span class="nt">2014-10-08
                                          20:53:21,861 [MODEL]
                                          [http-8008-5] ERROR
                                          (com.evolveum.midpoint.wf.impl.jobs.JobController):
                                          Couldn't send a request to
                                          start a process instance to
                                          workflow management system,
                                          reason: Couldn't evaluate
                                          approvers expressions</span><br>
                                        <span class="nt">2014-10-08
                                          20:53:21,910 [MODEL]
                                          [http-8008-5] ERROR
                                          (com.evolveum.midpoint.wf.impl.processors.primary.PrimaryChangeProcessor):
                                          Workflow process(es) could not
                                          be started, reason: Workflow
                                          process instance creation
                                          could not be requested.</span><br>
                                        <br>
                                        <span class="nt">Please provide
                                          your inputs on this.</span><br>
                                        <br>
                                        <span class="nt">Regards,</span><br>
                                        <span class="nt">Shelly</span><br>
                                        <br>
                                      </p>
                                    </td>
                                  </tr>
                                </tbody>
                              </table>
                              <p> </p>
                              <p class="MsoNormal">This message contains
                                information that may be privileged or
                                confidential and is the property of
                                ILANTUS Technologies. It is intended
                                only for the person to whom it is
                                addressed. If you are not the intended
                                recipient, you are not authorized to
                                read, print, retain, copy, disseminate,
                                distribute, or use this message or any
                                part thereof. If you receive this
                                message in error, please notify the
                                sender immediately and delete all copies
                                of this message.
                                <br>
                                <br>
                                <br>
                              </p>
                              <pre>_______________________________________________</pre>
                              <pre>midPoint-dev mailing list</pre>
                              <pre><a moz-do-not-send="true" href="mailto:midPoint-dev@lists.evolveum.com" target="_blank">midPoint-dev@lists.evolveum.com</a>
</pre>
                              <pre><a moz-do-not-send="true" href="http://lists.evolveum.com/mailman/listinfo/midpoint-dev" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint-dev</a>
</pre>
                            </blockquote>
                            <p class="MsoNormal"><br>
                              This message contains information that may
                              be privileged or confidential and is the
                              property of ILANTUS Technologies. It is
                              intended only for the person to whom it is
                              addressed. If you are not the intended
                              recipient, you are not authorized to read,
                              print, retain, copy, disseminate,
                              distribute, or use this message or any
                              part thereof. If you receive this message
                              in error, please notify the sender
                              immediately and delete all copies of this
                              message.
                            </p>
                          </div>
                          This message contains information that may be
                          privileged or confidential and is the property
                          of ILANTUS Technologies. It is intended only
                          for the person to whom it is addressed. If you
                          are not the intended recipient, you are not
                          authorized to read, print, retain, copy,
                          disseminate, distribute, or use this message
                          or any part thereof. If you receive this
                          message in error, please notify the sender
                          immediately and delete all copies of this
                          message.
                        </div>
                      </div>
                      This message contains information that may be
                      privileged or confidential and is the property of
                      ILANTUS Technologies. It is intended only for the
                      person to whom it is addressed. If you are not the
                      intended recipient, you are not authorized to
                      read, print, retain, copy, disseminate,
                      distribute, or use this message or any part
                      thereof. If you receive this message in error,
                      please notify the sender immediately and delete
                      all copies of this message.
                      <br>
                      _______________________________________________<br>
                      midPoint-dev mailing list<br>
                      <a moz-do-not-send="true"
                        class="moz-txt-link-abbreviated"
                        href="mailto:midPoint-dev@lists.evolveum.com">midPoint-dev@lists.evolveum.com</a><br>
                      <a moz-do-not-send="true"
                        class="moz-txt-link-freetext"
                        href="http://lists.evolveum.com/mailman/listinfo/midpoint-dev">http://lists.evolveum.com/mailman/listinfo/midpoint-dev</a><br>
                    </blockquote>
                    <div><br>
                      <br>
                    </div>
                    <div><br>
                    </div>
                    <div>-- <br>
                    </div>
                    <div><span name="x"></span>  Ing. Ivan Noris<br>
                        Senior Identity Management Engineer<br>
                        evolveum.com<br>
                        ___________________________________________<br>
                                 "Idem per idem - semper idem Vix."<span
                        name="x"></span><br>
                    </div>
                  </div>
                  This message contains information that may be
                  privileged or confidential and is the property of
                  ILANTUS Technologies. It is intended only for the
                  person to whom it is addressed. If you are not the
                  intended recipient, you are not authorized to read,
                  print, retain, copy, disseminate, distribute, or use
                  this message or any part thereof. If you receive this
                  message in error, please notify the sender immediately
                  and delete all copies of this message.
                </div>
              </div>
              This message contains information that may be privileged
              or confidential and is the property of ILANTUS
              Technologies. It is intended only for the person to whom
              it is addressed. If you are not the intended recipient,
              you are not authorized to read, print, retain, copy,
              disseminate, distribute, or use this message or any part
              thereof. If you receive this message in error, please
              notify the sender immediately and delete all copies of
              this message.
            </blockquote>
            <br>
            <pre class="moz-signature" cols="72">-- 
  Ing. Ivan Noris
  Senior Identity Management Engineer
  evolveum.com
  ___________________________________________
           "Idem per idem - semper idem Vix."
</pre>
            This message contains information that may be privileged or
            confidential and is the property of ILANTUS Technologies. It
            is intended only for the person to whom it is addressed. If
            you are not the intended recipient, you are not authorized
            to read, print, retain, copy, disseminate, distribute, or
            use this message or any part thereof. If you receive this
            message in error, please notify the sender immediately and
            delete all copies of this message.
          </div>
        </div>
      </div>
      This message contains information that may be privileged or
      confidential and is the property of ILANTUS Technologies. It is
      intended only for the person to whom it is addressed. If you are
      not the intended recipient, you are not authorized to read, print,
      retain, copy, disseminate, distribute, or use this message or any
      part thereof. If you receive this message in error, please notify
      the sender immediately and delete all copies of this message.
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
midPoint-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint-dev@lists.evolveum.com">midPoint-dev@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint-dev">http://lists.evolveum.com/mailman/listinfo/midpoint-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>