[midPoint] midPoint Digest, Vol 145, Issue 7

Maxwell, Gary Maxwell_G at fortlewis.edu
Fri May 10 21:39:40 CEST 2024


Thank You Ivan for pointing me in the right direction.

It explains why the expression and condition are evaluated twice. This leads me to the next question. 
The source for my variable is a $focus user attribute  and the target is the same $focus user attribute. Therefore I set the output attribute depending upon the input variable.  The script sees the correct input variable the first time it runs however sees the new value on the second time it runs. 

Is there a way to access the Midpoint user attribute  value that only reflects the initial value before it is changed?

I hope this makes sense.
-Gary

 

-----Original Message-----
From: midPoint <midpoint-bounces at lists.evolveum.com> On Behalf Of midpoint-request at lists.evolveum.com
Sent: Thursday, May 9, 2024 4:00 AM
To: midpoint at lists.evolveum.com
Subject: midPoint Digest, Vol 145, Issue 7

Send midPoint mailing list submissions to
	midpoint at lists.evolveum.com

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.evolveum.com/mailman/listinfo/midpoint
or, via email, send a message with subject or body 'help' to
	midpoint-request at lists.evolveum.com

You can reach the person managing the list at
	midpoint-owner at lists.evolveum.com

When replying, please edit your Subject line so it is more specific than "Re: Contents of midPoint digest..."


Today's Topics:

   1. Why does script in schemaHandling execute twice? (Maxwell, Gary)
   2. Re: Why does script in schemaHandling execute twice? (Ivan Noris)


----------------------------------------------------------------------

Message: 1
Date: Wed, 8 May 2024 22:21:23 +0000
From: "Maxwell, Gary" <Maxwell_G at fortlewis.edu>
To: "midpoint at lists.evolveum.com" <midpoint at lists.evolveum.com>
Subject: [midPoint] Why does script in schemaHandling execute twice?
Message-ID:
	<DM6PR03MB4523A119FF0BB05B763BB3A095E52 at DM6PR03MB4523.namprd03.prod.outlook.com>
	
Content-Type: text/plain; charset="utf-8"

Can someone tell me why the following script executes twice? The first execution uses the existing isActive value, the second time uses the value I changed it to.

<resource>
<schemaHandling>
<objectType>
<attribute>
<inbound>
<source>
         <name>isActive</name>
         <path>$focus/extension/isActive</path>
 </source>
<expression>
<script>.
<code>
	If (isActive == true)
		return false
</code>
</script>
</expression>
<target>
	<path>extension/isActive</path>
</target>
</inbound>
</attribute>
</objectType>
</schemaHandling>
</resource>
  

------------------------------

Message: 2
Date: Thu, 9 May 2024 09:55:56 +0200
From: Ivan Noris <ivan.noris at evolveum.com>
To: midpoint at lists.evolveum.com
Subject: Re: [midPoint] Why does script in schemaHandling execute
	twice?
Message-ID: <13e88d3c-c867-433f-a859-3f8fde6cea33 at evolveum.com>
Content-Type: text/plain; charset=UTF-8; format=flowed

Hi,

please refer to
https://docs.evolveum.com/midpoint/reference/support-4.8/expressions/mappings/#why-are-the-expressions-and-conditions-evaluated-several-times

Best regards,

Ivan

On 9. 5. 2024 0:21, Maxwell, Gary via midPoint wrote:
> Can someone tell me why the following script executes twice? The first execution uses the existing isActive value, the second time uses the value I changed it to.
>
> <resource>
> <schemaHandling>
> <objectType>
> <attribute>
> <inbound>
> <source>
>           <name>isActive</name>
>           <path>$focus/extension/isActive</path>
>   </source>
> <expression>
> <script>.
> <code>
> 	If (isActive == true)
> 		return false
> </code>
> </script>
> </expression>
> <target>
> 	<path>extension/isActive</path>
> </target>
> </inbound>
> </attribute>
> </objectType>
> </schemaHandling>
> </resource>
>    
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint

--
Ivan Noris
Expert Identity Engineer
evolveum.com



------------------------------

Subject: Digest Footer

_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com
https://lists.evolveum.com/mailman/listinfo/midpoint


------------------------------

End of midPoint Digest, Vol 145, Issue 7
****************************************


More information about the midPoint mailing list