<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 Fabio,<br>
<br>
the problem is that you've put your script to <b>ri:title</b>
attribute. So (I think) that as an input you get the value of this
attribute, which is a string. The <source> declaration is
not appropriate here.<br>
<br>
If you want to process ri:groups attribute, please put this
mapping under <b>ri:groups</b> attribute.<br>
Also, use <b><relativityMode>absolute</relativityMode></b>
(as a child of <script>) in order to get all the values of
ri:groups at once.<br>
Remove the <source> part and refer to the input variable
(now called gruppi) simply as <b>input</b>.<br>
<br>
Hope this helps,<br>
Pavol<br>
<br>
</div>
<blockquote cite="mid:2CDAB07C-46FF-4E0B-962B-20649AD477D5@nsr.it"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div style="font-family: -apple-system-font; line-height: 16px;"
class="">
<div class="">Hi,</div>
<div class="">I have an Active Directory resource and I need to
reconcile users. In populating a virtual user attribute I need
to check if the corresponding AD account has a particular
group assigned. This is a snippet of the resource xml:</div>
</div>
<div style="font-family: -apple-system-font; line-height: 16px;"
class=""><br class="">
</div>
<div style="font-family: -apple-system-font; line-height: 16px;"
class="">
<div class=""> <attribute></div>
<div class="">
<c:ref>ri:title</c:ref></div>
<div class="">
<displayName>Gruppi</displayName></div>
<div class=""> <inbound></div>
<div class=""> <source></div>
<div class="">
<name>gruppi</name></div>
<div class="">
<path>$shadow/attributes/groups</path></div>
<div class=""> </source>
</div>
<div class=""> <expression></div>
<div class=""> <script></div>
<div class=""> <code></div>
<div class=""> def isdirettore =
false</div>
<div class=""> def n =
gruppi.size()</div>
<div class=""> for (def i = 0; i
< n; i++) {</div>
<div class=""> def gruppo =
gruppi.get(i)</div>
<div class=""> if (it =~
/^CN=.*_DIV.._DIR.*$/) {</div>
<div class="">
isdirettore = true</div>
<div class=""> }</div>
<div class=""> }</div>
<div class=""> isdirettore</div>
<div class=""> </code></div>
<div class=""> </script></div>
<div class=""> </expression></div>
<div class=""> <target></div>
<div class="">
<path>$user/extension/mise:organizzazione</path></div>
<div class=""> </target></div>
<div class=""> </inbound></div>
<div class=""> </attribute></div>
</div>
<div style="font-family: -apple-system-font; line-height: 16px;"
class=""><br class="">
</div>
<div style="font-family: -apple-system-font; line-height: 16px;"
class="">I need to loop on assigned AD groups and I need to
check the string format of each group using a regular
expression. The problem is that in the variable named “gruppi” I
have only a string and not an array or List. Do you have any
ideas?</div>
<div class=""><br class="">
</div>
<div class="">Thanks and regards.</div>
<div class=""><br class="">
</div>
<div class=""> Fabio</div>
<div class=""><br class="">
</div>
<div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap:
break-word; -webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space;" class="">
<div class=""><font class="" size="1"><span class=""
style="font-family: 'Lucida Sans'; color: rgb(17,
52, 80); orphans: 2; widows: 2;">--</span><br
class="" style="orphans: 2; widows: 2; color:
rgb(17, 52, 80);">
<span class="" style="font-family: 'Lucida Sans';
color: rgb(17, 52, 80); orphans: 2; widows: 2;">Fabio
Contessi <<a moz-do-not-send="true"
href="mailto:f.contessi@nsr.it" class="">f.contessi@nsr.it</a></span><span
class="" style="font-family: 'Lucida Sans'; color:
rgb(17, 52, 80); orphans: 2; widows: 2;">></span><br
class="" style="orphans: 2; widows: 2; color:
rgb(17, 52, 80);">
<br class="" style="orphans: 2; widows: 2; color:
rgb(17, 52, 80);">
<span class="" style="orphans: 2; widows: 2;"><font
class="" color="#015494" face="LucidaSans-Demi">nova
systems roma / nsr</font></span></font></div>
<div class=""><br class="">
</div>
</div>
</div>
</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>