<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Jason,<br>
<br>
a wild shot for now..<br>
<br>
Try to use tmpAdditionalName in the condition as well.<br>
<br>
Or, do not use tmpAdditionalName at all (use additionalName
everywhere in your expressions):<br>
<br>
<source><br>
<!-- <name>tmpAdditionalName</name> --><br>
<path>additionalName</path><br>
</source><br>
<br>
Regards,<br>
Ivan<br>
<br>
<div class="moz-cite-prefix">On 07/28/2015 05:24 PM, Jason Everling
wrote:<br>
</div>
<blockquote
cite="mid:CAFkZXY53w=QdChcTbVbr_q9UjLAX-_SuHWc49CNTJwjb4G+5wg@mail.gmail.com"
type="cite">
<div dir="ltr">I have modified my username generation based on
condition additionalName (middle initial) in our case so that it
uses the middle initial if present,
<div><br>
</div>
<div>I have 2 one with condition and one without or null</div>
<div><br>
</div>
<div>Can you take a look at the below template mappings for me.</div>
<div><br>
</div>
<div>It does not seems to work, I get </div>
<div><br>
</div>
<div>groovy.lang.MissingPropertyException: No such property:
additionalName for class: Script24 condition in mapping
'Generate Username without additionalName'</div>
<div><br>
</div>
<div>
<div> <mapping></div>
<div> <name>Generate Username without
additionalName</name></div>
<div> <source></div>
<div> <name>tmpGivenName</name></div>
<div> <path>givenName</path></div>
<div> </source></div>
<div> <source></div>
<div> <name>tmpAdditionalName</name></div>
<div> <path>additionalName</path></div>
<div> </source></div>
<div> <source></div>
<div> <name>tmpFamilyName</name></div>
<div> <path>familyName</path></div>
<div> </source></div>
<div> <expression></div>
<div> <script></div>
<div> <code></div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>tmpGivenNameInitial
= basic.stringify(tmpGivenName)?.size() > 0 ? </div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>(basic.stringify(tmpGivenName)).substring(0,2)
: ''</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if
(iteration == 0) {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if
(basic.stringify(tmpFamilyName).size() < 12) {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>basic.norm(basic.stringify(tmpGivenNameInitial
+ tmpFamilyName))</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>else
{</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>basic.norm(basic.stringify(tmpGivenNameInitial)
+ basic.stringify(tmpFamilyName)?.substring(0, 12))</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>else
{</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if
(basic.stringify(tmpFamilyName).size() < 11) {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>basic.norm(basic.stringify(tmpGivenNameInitial
+ tmpFamilyName)) + iterationToken</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>else
{</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>basic.norm(basic.stringify(tmpGivenNameInitial
+ tmpFamilyName?.substring(0, 11))) + iterationToken</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div> </code><span class="Apple-tab-span"
style="white-space:pre"> </span></div>
<div> </script></div>
<div> </expression></div>
<div> <target></div>
<div> <path>name</path></div>
<div> </target></div>
<div> <condition></div>
<div> <script></div>
<div> <code>additionalName ==
null</code></div>
<div> </script></div>
<div> </condition></div>
<div> </mapping></div>
<div><br>
</div>
<div> <mapping></div>
<div> <name>Generate Username with
additionalName</name></div>
<div> <source></div>
<div> <name>tmpGivenName</name></div>
<div> <path>givenName</path></div>
<div> </source></div>
<div> <source></div>
<div> <name>tmpAdditionalName</name></div>
<div> <path>additionalName</path></div>
<div> </source></div>
<div> <source></div>
<div> <name>tmpFamilyName</name></div>
<div> <path>familyName</path></div>
<div> </source></div>
<div> <expression></div>
<div> <script></div>
<div> <code></div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>tmpGivenNameInitial
= basic.stringify(tmpGivenName)?.size() > 0 ? </div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>(basic.stringify(tmpGivenName)).substring(0,1)
: ''</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if
(iteration == 0) {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if
(basic.stringify(tmpFamilyName).size() < 12) {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>basic.norm(basic.stringify(tmpGivenNameInitial
+ tmpAdditionalName + tmpFamilyName))</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>else
{</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>basic.norm(basic.stringify(tmpGivenNameInitial
+ tmpAdditionalName) +
basic.stringify(tmpFamilyName)?.substring(0, 12))</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>else
{</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if
(basic.stringify(tmpFamilyName).size() < 11) {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>basic.norm(basic.stringify(tmpGivenNameInitial
+ tmpAdditionalName + tmpFamilyName)) + iterationToken</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>else
{</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>basic.norm(basic.stringify(tmpGivenNameInitial
+ tmpAdditionalName + tmpFamilyName?.substring(0, 11))) +
iterationToken</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div> </code><span class="Apple-tab-span"
style="white-space:pre"> </span></div>
<div> </script></div>
<div> </expression></div>
<div> <target></div>
<div> <path>name</path></div>
<div> </target></div>
<div> <condition></div>
<div> <script></div>
<div> <code>additionalName !=
null</code></div>
<div> </script></div>
<div> </condition></div>
<div> </mapping></div>
</div>
<div>
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div dir="ltr">JASON</div>
</div>
</div>
</div>
<br>
<font size="2"><br>
<br>
CONFIDENTIALITY NOTICE:<br>
This e-mail together with any attachments is proprietary and
confidential; intended for only the recipient(s) named above and
may contain information that is privileged. You should not
retain, copy or use this e-mail or any attachments for any
purpose, or disclose all or any part of the contents to any
person. Any views or opinions expressed in this e-mail are those
of the author and do not represent those of the Baptist School
of Health Professions. If you have received this e-mail in
error, or are not the named recipient(s), you are hereby
notified that any review, dissemination, distribution or copying
of this communication is prohibited by the sender and to do so
might constitute a violation of the Electronic Communications
Privacy Act, 18 U.S.C. section 2510-2521. Please immediately
notify the sender and delete this e-mail and any attachments
from your computer. </font><br>
<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>
<pre class="moz-signature" cols="72">--
Ing. Ivan Noris
Senior Identity Management Engineer & IDM Architect
evolveum.com evolveum.com/blog/
___________________________________________________
"Semper Id(e)M Vix."
</pre>
</body>
</html>