[midPoint] Trouble with correlation expression

Wojciech Staszewski wojciech.staszewski at diagnostyka.pl
Fri Nov 3 11:48:30 CET 2017


Hello!

I need a little tip about correlation expression.
In every example user (focus) attribute, eg. "name" is compared
to a resource attribute, eg. icfs:name. Every scripting I found is on the resource side.

I need to do it vice versa, that means compare some resource attribute
with scripting on user attributes (first letter of givenName + familyName).
Additionaly the "lab" attribute in the resource must match some static text (for different intents).

I made something like this, but it doesn't work:

<q:and xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3">
   <q:equal>
      <q:path>declare namespace ri='http://midpoint.evolveum.com/xml/ns/public/resource/instance-3'; $account/attributes/ri:lab</q:path>
      <expression>
         <value>STATIC LAB NAME</value>
      </expression>
   </q:equal>
   <q:equal>
      <q:matching>polyStringNorm</q:matching>
      <q:path>$account/attributes/icfs:name</q:path>
      <expression>
	<script>
	 <code>
           user.getGivenName().take(1) + user.getFamilyName();
         </code>
	</script>
      </expression>
   </q:equal>
</q:and>

What is wrong with this expression?
Thanks!
WS



More information about the midPoint mailing list