[midPoint] generating username with condition, code not right?
Jason Everling
jeverling at bshp.edu
Tue Jul 28 18:02:42 CEST 2015
Ok thanks, so I updated it and removed tmpAdditionalName and just used
additionalName I get this now, fields look to be null. It is using the
script with condition without but in CSV the user has a additionalName
Internal Error: Synchronization error:
com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
groovy.lang.MissingPropertyException: No such property: name for class:
Script31 expression in mapping 'Generate Email Address without
additionalName' in objectTemplate:10000000-0000-0000-0000-000000000203(User
Template 3)(tmpFamilyName=null; additionalName=null; tmpGivenName=null; )
in expression in mapping 'Generate Email Address without additionalName' in
objectTemplate:10000000-0000-0000-0000-000000000203(User Template 3)
On Tue, Jul 28, 2015 at 10:33 AM, Ivan Noris <ivan.noris at evolveum.com>
wrote:
> Hi Jason,
>
> a wild shot for now..
>
> Try to use tmpAdditionalName in the condition as well.
>
> Or, do not use tmpAdditionalName at all (use additionalName everywhere in
> your expressions):
>
> <source>
> <!-- <name>tmpAdditionalName</name> -->
> <path>additionalName</path>
> </source>
>
> Regards,
> Ivan
>
>
> On 07/28/2015 05:24 PM, Jason Everling wrote:
>
> I have modified my username generation based on condition additionalName
> (middle initial) in our case so that it uses the middle initial if present,
>
> I have 2 one with condition and one without or null
>
> Can you take a look at the below template mappings for me.
>
> It does not seems to work, I get
>
> groovy.lang.MissingPropertyException: No such property: additionalName
> for class: Script24 condition in mapping 'Generate Username without
> additionalName'
>
> <mapping>
> <name>Generate Username without additionalName</name>
> <source>
> <name>tmpGivenName</name>
> <path>givenName</path>
> </source>
> <source>
> <name>tmpAdditionalName</name>
> <path>additionalName</path>
> </source>
> <source>
> <name>tmpFamilyName</name>
> <path>familyName</path>
> </source>
> <expression>
> <script>
> <code>
> tmpGivenNameInitial = basic.stringify(tmpGivenName)?.size() > 0 ?
> (basic.stringify(tmpGivenName)).substring(0,2) : ''
>
> if (iteration == 0) {
> if (basic.stringify(tmpFamilyName).size() < 12) {
> basic.norm(basic.stringify(tmpGivenNameInitial + tmpFamilyName))
> }
> else {
> basic.norm(basic.stringify(tmpGivenNameInitial) +
> basic.stringify(tmpFamilyName)?.substring(0, 12))
> }
> }
> else {
> if (basic.stringify(tmpFamilyName).size() < 11) {
> basic.norm(basic.stringify(tmpGivenNameInitial + tmpFamilyName)) +
> iterationToken
> }
> else {
> basic.norm(basic.stringify(tmpGivenNameInitial +
> tmpFamilyName?.substring(0, 11))) + iterationToken
>
> }
> }
> </code>
> </script>
> </expression>
> <target>
> <path>name</path>
> </target>
> <condition>
> <script>
> <code>additionalName == null</code>
> </script>
> </condition>
> </mapping>
>
> <mapping>
> <name>Generate Username with additionalName</name>
> <source>
> <name>tmpGivenName</name>
> <path>givenName</path>
> </source>
> <source>
> <name>tmpAdditionalName</name>
> <path>additionalName</path>
> </source>
> <source>
> <name>tmpFamilyName</name>
> <path>familyName</path>
> </source>
> <expression>
> <script>
> <code>
> tmpGivenNameInitial = basic.stringify(tmpGivenName)?.size() > 0 ?
> (basic.stringify(tmpGivenName)).substring(0,1) : ''
>
> if (iteration == 0) {
> if (basic.stringify(tmpFamilyName).size() < 12) {
> basic.norm(basic.stringify(tmpGivenNameInitial + tmpAdditionalName +
> tmpFamilyName))
> }
> else {
> basic.norm(basic.stringify(tmpGivenNameInitial + tmpAdditionalName) +
> basic.stringify(tmpFamilyName)?.substring(0, 12))
> }
> }
> else {
> if (basic.stringify(tmpFamilyName).size() < 11) {
> basic.norm(basic.stringify(tmpGivenNameInitial + tmpAdditionalName +
> tmpFamilyName)) + iterationToken
> }
> else {
> basic.norm(basic.stringify(tmpGivenNameInitial + tmpAdditionalName +
> tmpFamilyName?.substring(0, 11))) + iterationToken
> }
> }
> </code>
> </script>
> </expression>
> <target>
> <path>name</path>
> </target>
> <condition>
> <script>
> <code>additionalName != null</code>
> </script>
> </condition>
> </mapping>
>
> --
> JASON
>
>
>
> CONFIDENTIALITY NOTICE:
> 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.
>
>
> _______________________________________________
> midPoint mailing listmidPoint at lists.evolveum.comhttp://lists.evolveum.com/mailman/listinfo/midpoint
>
>
> --
> Ing. Ivan Noris
> Senior Identity Management Engineer & IDM Architect
> evolveum.com evolveum.com/blog/
> ___________________________________________________
> "Semper Id(e)M Vix."
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
--
JASON
--
CONFIDENTIALITY NOTICE:
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20150728/6460080d/attachment.htm>
More information about the midPoint
mailing list