[midPoint] Can't generate unique username while importing from resource
Алексей Ващенков
a.vashchenkov at solarsecurity.ru
Tue May 12 10:25:52 CEST 2015
Hello. I've configuared resource with next syncronization block.
<synchronization>
<objectSynchronization>
<name>Sync account</name>
<objectClass xmlns:qn835="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">qn835:AccountObjectClass</objectClass>
<kind>account</kind>
<focusType>UserType</focusType>
<enabled>true</enabled>
<reconcile>true</reconcile>
<opportunistic>false</opportunistic>
<reaction>
<name>Add user</name>
<situation>unmatched</situation>
<synchronize>true</synchronize>
<reconcile>false</reconcile>
<action>
<name>Add user</name>
<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#addFocus</handlerUri>
<order>before</order>
<objectTemplateRef oid="4e7290dd-2fd3-4559-a6bc-aeae11da608c"/>
</action>
</reaction>
<reaction>
<name>Synchronize</name>
<situation>linked</situation>
<synchronize>true</synchronize>
<reconcile>false</reconcile>
</reaction>
</objectSynchronization>
</synchronization>
And I have next template object
<objectTemplate xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
oid="c0c010c0-d34d-b33f-f00d-777222222334"
version="19">
<name>Инициализация пользователя</name>
<description>
</description>
<metadata>
<createTimestamp>2015-05-08T12:08:08.644+03:00</createTimestamp>
<creatorRef oid="00000000-0000-0000-0000-000000000002" type="UserType"><!-- administrator --></creatorRef>
<createChannel>http://midpoint.evolveum.com/xml/ns/public/model/channels-3#objectImport</createChannel>
</metadata>
<iteration>
<maxIterations>9999</maxIterations>
</iteration>
<mapping>
<source>
<name>familyName</name>
<c:path xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">$focus/familyName</c:path>
</source>
<source>
<name>givenName</name>
<c:path xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">$user/givenName</c:path>
</source>
<source>
<name>additionalName</name>
<c:path xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">$user/additionalName</c:path>
</source>
<expression>
<script>
<code>import com.evolveum.midpoint.common.policy.StringPolicyUtils;
StringPolicyUtils.transliterateFullName(givenName, familyName, additionalName) +iteration
</code>
</script>
</expression>
<target>
<c:path xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">$user/name</c:path>
</target>
</mapping>
</objectTemplate>
If I use order set to before, then I have givenName, familyName, additionalName all are null. If I set order to after, then I have warning Correlation rule for resource 'resource:f01e18f2-3d14-4c25-bea0-268c209f1091(???????????? ? HR)' doesn't contain query, returning empty list of users.
How can I properly configure generating username?
More information about the midPoint
mailing list