[midPoint] Setting approverExpression to roles

Pavol Mederly mederly at evolveum.com
Tue Oct 25 11:42:09 CEST 2016


Hello Aivo,


it's because approverExpression is a multi-valued property. Changed 
focusMapping just says "add the following value". It does not say 
"remove all the other values".


It is possible that it could be set up to be non-tolerant (I don't have 
exact details in my head). But maybe much simpler is to user 
<approvalSchema> (that can contain approverExpressions) -> that one is 
single-valued, so a new value will overwrite old ones.


At least I think so.


Best regards,

Pavol Mederly
Software developer
evolveum.com

On 25.10.2016 10:39, Aivo Kuhlberg wrote:
>
> Hi again,
> One thing I noticed with focusMappings is that when I edit the 
> focusmappings content in my metarole and then run "Recompute all 
> members" of this metarole and look at the content of member roles then 
> I see both old (before change) and changed focusMappings content. Is 
> that a bug or intended behavior?
>
> Below is an example after I changed description to "New description". 
> You can see that there is now 2 approverExpression sections in role:
>
> ...
>
>    <assignment id="1">
>       <targetRef oid="8e8db1f5-6841-4774-a2df-c71b64c6a5b2" 
> type="c:RoleType"><!-- metarole-managerapproves --></targetRef>
>    </assignment>
>    <activation>
> <effectiveStatus>enabled</effectiveStatus>
> <enableTimestamp>2016-10-25T11:16:02.180+03:00</enableTimestamp>
>    </activation>
>    <iteration>0</iteration>
>    <iterationToken/>
>    <roleMembershipRef oid="8e8db1f5-6841-4774-a2df-c71b64c6a5b2" 
> type="c:RoleType"><!-- metarole-managerapproves --></roleMembershipRef>
>    <requestable>true</requestable>
>    <approverExpression>
>       <description>Get user's managers (except the user 
> itself)</description>
>       <script>
> <code>midpoint.getManagersOidsExceptUser(object)</code>
>       </script>
>    </approverExpression>
>    <approverExpression>
>       <description>New description</description>
>       <script>
> <code>midpoint.getManagersOidsExceptUser(object)</code>
>       </script>
>    </approverExpression>
> </role>
> Regards,
> Aivo Kuhlberg
>
> ------------------------------------------------------------------------
> *Saatja:* Aivo Kuhlberg
> *Saadetud:* 24. oktoober 2016 17:18
> *Adressaat:* midpoint
> *Teema:* Setting approverExpression to roles
>
> Thanks Pavol and Radovan for helping me.
> Based on Pavol's link I succeeded to make it work with following metarole:
> <role 
> xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" 
> oid="8e8db1f5-6841-4774-a2df-c71b64c6a5b2">
> <name>metarole-managerapproves</name>
> <inducement id="1">
> <focusMappings>
> <mapping>
> <strength>strong</strength>
> <expression>
> <value>
> <description>Get user's managers (except the user itself)</description>
> <script>
> <code>midpoint.getManagersOidsExceptUser(object)</code>
> </script>
> </value>
> </expression>
> <target>
> <path>approverExpression</path>
> </target>
> </mapping>
> </focusMappings>
> </inducement>
> </role>
>
> Best Regards,
> Aivo Kuhlberg
>
>
> ------------------------------------------------------------------------
> Käesolev e-kiri võib sisaldada asutusesiseseks kasutamiseks 
> tunnistatud teavet.
> This e-mail may contain information which is classified for official use.
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20161025/14af933d/attachment.htm>


More information about the midPoint mailing list