[midPoint] inbound that returns only the first entry from a list

František Dvořák valtri at civ.zcu.cz
Fri Jul 22 18:45:06 CEST 2022


Hello,

you can try to use relativityMode:

<expression>
	<script>
		<relativityMode>absolute</relativityMode>
		<code>
			...
		</code>
	</script>
</expression>

Cheers,
  František

On Fri, 2022-07-22 at 08:52 +0000, Hsin-Fang Hsu via midPoint wrote:
> Hi,
>  
> In the resource, the attribute ri:mail is a list. In the inbound, I
> just want to take the first entry in the mail list and target it to
> emailAddress.
> How can I do this?
>  
> The code below simply results in the error:Attempt to add 2 values to
> a single-valued item emailAddress
> The input of the inbound attribute is always just one value instead
> of a list, so I cannot check if the input is a list.
>  
> <attribute>
>     <ref>ri:mail</ref>
>     <inbound>
>         <expression>
>             <script>
>                 <code>
>                     log.info("--input is:"+input)
>                    return input
>                 </code>
>             </script>
>         </expression>
>         <target>
>             <path>emailAddress</path>
>         </target>
>     </inbound>
> </attribute>
>  
>  
> Thank you very much for your help in advance!
>  
> Best regards,
> Hsin-Fang
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint



More information about the midPoint mailing list