[midPoint] Conditional Assignments

Samu Viitanen zamppa90 at hotmail.com
Tue Nov 24 18:17:35 CET 2015


Hello Ivan,
Thank you for your quick response. I will try this tomorrow on my solution, it looks like it could work. Other mappings from my template are working, so it's just this conditional that is giving me trouble. I set the organization attribute when I create focus users in midpoint via the Web Service Interface and it seems to be map correctly. It's just this one that was bugging me.
BR.Samu

To: midpoint at lists.evolveum.com
From: ivan.noris at evolveum.com
Date: Tue, 24 Nov 2015 16:28:19 +0100
Subject: Re: [midPoint] Conditional Assignments


  
    
  
  
    Hi Samu,

    

    although I'm not assigning resource account but a role instead, this
    is my working code:

    

       <mapping>

            <name>My Object Template: Assign Role XYZ</name>

            <authoritative>true</authoritative>

            <source>

                    <path>$user/employeeType</path>

            </source>

            <expression>

                    <assignmentTargetSearch>

                           
    <targetType>c:RoleType</targetType>

                           
    <oid>00000000-dc00-dc00-0004-000000000077</oid>

                    </assignmentTargetSearch>

            </expression>

            <target>

                    <path>assignment</path>

            </target>

            <condition>

                    <script>

                        <code>employeeType ==
    'employee'</code>

                    </script>  

            </condition>

        </mapping>

    

    Could you please the construction from the above - for your case
    probably you need to change c:RoleType to c:ResourceType...

    

    Some other questions:

    1) are other mappings from the same object template working? (To
    avoid problem of not using template at all...)

    2) how is the attribute organization set in your scenario?

    

    Best regards,

    Ivan

    

    On 11/24/2015 04:06 PM, Samu Viitanen
      wrote:

    
    
      
      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

      
      

      
      

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

    
    

    -- 
  Ing. Ivan Noris
  Senior Identity Management Engineer & IDM Architect
  evolveum.com                     evolveum.com/blog/
  ___________________________________________________
  "Semper Id(e)M Vix."

  


_______________________________________________
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/20151124/0825bc6d/attachment.htm>


More information about the midPoint mailing list