<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello Petr,</p>
    <p>this information is available only during assignment evaluation,
      i.e. during Projector run. It is then serialized in the form of
      roleMembershipRef and related items. The information on the number
      of times any specific role was hit is obviously lost there.</p>
    <p>So... if you don't want to run Projector when running the report
      (I would suggest not :)) the only viable approach is to store this
      information in a dedicated extension item.</p>
    <p>You could create a mapping in object template (don't forget
      setting afterAssignments phase) that analyzes
      lensContext.evaluatedAssignmentTriple and prepares the necessary
      information for you. Don't forget about redundant role evaluation
      optimization. :) But if your paths are always differing in the
      first assignment (i.e. there are no two paths that have the same
      first assignment in the path) it could work. But it's ugly hacking
      that could break in any upcoming version of midPoint. We cannot
      commit to any stability here.<br>
    </p>
    <p>Or maybe... if you know all roles that induce "B" (i.e. A, C, D,
      X), why not simply counting assignments to these? The assumption
      is that validity and conditions are not blocking the inducement.</p>
    <p>Best regards,<br>
    </p>
    <pre class="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
    <div class="moz-cite-prefix">On 28/05/2020 11:57, Petr Gašparík -
      AMI Praha a.s. wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CABAspd1teqXr8TufqC9kJn2GLLBOhfQmVEDdt3-ktoPSvrZPfg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi,
        <div>I would like to get sample code to get all induced
          assignments, transitively.</div>
        <div>I need to do this in a report, so I need to do that in java
          collection.</div>
        <div><br>
        </div>
        <div>Final code I need to get to work is "how many time the
          identity has the role assigned indirectly"</div>
        <div>Like this:</div>
        <div>
          <ul>
            <li>User -> Role A -inducement-> Role B</li>
            <li>User -> Role C -inducement-> Role B  </li>
          </ul>
        </div>
        <div>Result:</div>
        <div>
          <ul>
            <li>User has Role B indirectly twice</li>
          </ul>
          <div>Thank you even for pointing me somewhere (useful) :)</div>
        </div>
        <div>
          <div>
            <div dir="ltr" data-smartmail="gmail_signature">
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <p><span
                                          style="font-family:Arial,sans-serif;font-size:10pt">--</span></p>
                                      <p><span
                                          style="font-family:Arial,sans-serif;font-size:10pt">best
                                          regards</span></p>
                                      <div
                                        style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13px">
                                        <p><strong>Petr Gašparík</strong><br>
                                          <span
                                            style="font-size:11px;color:rgb(128,128,128)">konzultant
                                            IT bezpečnosti</span></p>
                                      </div>
                                      <p
                                        style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px">gsm:
                                        [+420] 603 523 860<br>
                                        e‑mail: <a
                                          href="mailto:petr.gasparik@ami.cz"
                                          target="_blank"
                                          moz-do-not-send="true">petr.gasparik@ami.cz</a></p>
                                      <p
                                        style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px"><strong>AMI
                                          Praha a.s.</strong><br>
                                        Pláničkova 11, 162 00 Praha 6</p>
                                      <p
                                        style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px">tel.:
                                        [+420] 274 783 239 | web: <a
                                          href="https://www.ami.cz"
                                          target="_blank"
                                          moz-do-not-send="true">www.ami.cz</a></p>
                                      <p
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;margin-top:20px"><img
src="http://www.ami.cz/images/podpis/ami_logo.gif" alt="AMI Praha a.s."
                                          style="border:0px"
                                          moz-do-not-send="true"></p>
                                      <p
style="font-family:Arial,sans-serif;font-size:11px;color:rgb(170,170,170)">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.<br>
                                        <span style="font-size:6px"> </span><br>
                                        Tento e‑mail je určen výhradně
                                        pro potřeby jeho adresáta/ů
                                        a může obsahovat důvěrné
                                        nebo osobní<br>
                                        informace. Nejste‑li zamýšleným
                                        příjemcem, je zakázáno jakékoliv
                                        zveřejňování, zprostředkování<br>
                                        nebo jiné použití těchto
                                        informací. Pokud jste obdrželi
                                        e‑mail neoprávněně, informujte
                                        o tom prosím<br>
                                        odesílatele a vymažte neprodleně
                                        všechny kopie tohoto e‑mailu
                                        včetně všech jeho příloh.
                                        Nakládáním<br>
                                        s neoprávněně získanými
                                        informacemi se vystavujete
                                        riziku právního postihu.</p>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-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="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
  </body>
</html>