[midPoint] Autoassignment Roles in Midpoint 4.0

Forest Crowley fbc216 at lehigh.edu
Mon Mar 30 16:19:05 CEST 2020


Paulo,

We had the same trouble. Currently to use autoassignments you need to get
rid of all <source> in the autoassign mapping and inside the condition
check the type of the focus being evaluated by the mapping.

import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType
if ( !(focus instanceof UserType) ) { return false }

Then you can get what you would have sourced directly from the focal object.

e.g.
// Standard UserType fields
givenName = focus.givenName
// UserType extensions (This may not be the best way but it's what worked
for us)
unixUid = focus.extension?.getAny()?.find {element ->
element.getLocalName() == "unixUid"}

Ultimately this solution felt too kludgy for us and we ended up giving up
on role autoassignments in favor of assigning them in object templates.

Best,

Forest


On Mon, Mar 30, 2020 at 8:39 AM Paulo Fernandes de Souza Junior <
PFSJ at senado.leg.br> wrote:

> Dear All,
> I'm having trouble with Autoassignment Roles in our upgrade to Midpoint 4.
> Some objects like archetypes and object collections, and roles are being
> evaluated when imported or modified by autoassignment role causing erros
> like:
>
> ERROR [com.evolveum.midpoint.init.InitialDataImport] (main) Couldn't
> import objectCollection:00000000-0000-0000-0001-000000000002(Modification
> audit records) from file 300-object-collection-audit-modifications.xml: .
> com.evolveum.midpoint.util.exception.SchemaException: Cannot find
> definition of a subitem title of ObjectDeltaObject(null +
> ObjectDelta(ObjectCollectionType:00000000-0000-0000-0001-000000000002,ADD:
> objectCollection:00000000-0000-0000-0001-000000000002(Modification audit
> records)) =
> objectCollection:00000000-0000-0000-0001-000000000002(Modification audit
> records))
>
> I found this two links, related with this problem:
>
>   https://lists.evolveum.com/pipermail/midpoint/2019-May/005520.html
>
>   https://jira.evolveum.com/browse/MID-5497
>
> Given this, is Autoassigment roles usable in Midpoint 4, or do I have to
> use another solution like object templates to auto  assign?​
>
>
> thanks in advance,
>
>
> *Paulo Fernandes de Souza Júnior*
>
> *NQPPPS *Senado Federal - PRODASEN
> Fone: 61 3303.3924
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint
>


-- 
Forest B. Crowley
Information Security
Lehigh University
610-758-3838
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200330/22cc7949/attachment.htm>


More information about the midPoint mailing list