<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello Petr,</p>
<p>sorry for the late answer, this message completely flew out of my
sight.</p>
<p>I think that the only possible way is to repeatedly call
midpoint.getObject method for each OID in order to get the name.</p>
<p>You could speed it up by setting "noFetch" option. <br>
</p>
<p>As for the object type (required for getObject method): you can
retrieve it from the targetRef, or set directly to
ObjectType.class - when retrieving the name only, it shouldn't be
a problem.</p>
<p>Beware of exception handling (object not found, security
violation, ...). I usually put OID instead of name in such cases.</p>
<p>In the future we perhaps should provide some method in midpoint
functions library to do that. Maybe you could log a jira.</p>
<p>Best regards,</p>
<p>Pavol<br>
</p>
<br>
<div class="moz-cite-prefix">On 14.06.2016 9:43, Petr Gašparík
wrote:<br>
</div>
<blockquote
cite="mid:CAFmDq453Rjj=vxYn_JWEZCcvC7xQTzjcg+r5++HoD1emuh1JYg@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,
<div>I am trying to list user roles in notification body.</div>
<div><br>
</div>
<div>so basically something like </div>
<div><br>
</div>
<div>
<div> allAssignments =
requestee.getAssignment();</div>
<div> allAssignments.each {</div>
<div> body +=
basic.stringify(it.getTargetRef()?.getOid()) + "\n";</div>
<div> };</div>
</div>
<div><br>
</div>
<div>but with names instead of oid.</div>
<div><br>
</div>
<div>What is best practice how to get that?</div>
<div><br>
</div>
<div>thank you in advance, </div>
<div>Petr Gašparík</div>
</div>
<div dir="ltr">-- <br>
</div>
<div data-smartmail="gmail_signature">
<div dir="ltr">--
<div>Petr G.</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>