[midPoint] Conditional Assignments

Samu Viitanen zamppa90 at hotmail.com
Tue Nov 24 16:06:36 CET 2015


Hello,

I am having trouble finding a solution on how to create conditional assignments in an Object Template. I have an Object Template and I would like to see if the Focus user's attribute "organization" matches to a specific string before creating my assignment. See mapping below

   <mapping>
      <source>
         <c:path>organization</c:path>
      </source>
      <expression>
         <value>
            <targetRef oid="resource-oid-123-456" type="c:ResourceType"/>
         </value>
      </expression>
      <target>
         <c:path>assignment</c:path>
      </target>
      <condition>
         <script>
            <description>
                Create a condition to see that the organization matches
            </description>
            <code>organization == 'org'</code>
         </script>
      </condition>
   </mapping>

This is the point where I am stuck. I figured that the example above is somewhat correct, but the condition is still never true even though I know my focus user's organization is 'org'. I am not very familiar with expressions and conditions yet. I tried to find the answer in Wiki, but didn't find a related example. I also looked into the live demo's Object Template, where a similar thing is done, but it did not help me here.

Best Regards
Samu Viitanen
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20151124/661c09cf/attachment.htm>


More information about the midPoint mailing list