Advertisement
Guest User

Untitled

a guest
Dec 20th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.00 KB | None | 0 0
  1. <mapping>
  2.     <name>PERS User Assignment Mapping</name>
  3.     <strength>strong</strength>
  4.     <expression>
  5.         <script>
  6.             <code>
  7.                 import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;
  8.                 import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;
  9.                 import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType;
  10.                 import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;
  11.                 import java.util.*;
  12.  
  13.                 <!-- Get role -->
  14.                 role = midpoint.searchObjectByName(RoleType.class, "role_account_pers");
  15.  
  16.                 if(role != null)
  17.                     {
  18.                     roleOrt = new ObjectReferenceType();
  19.                     roleOrt.setOid(role.getOid());
  20.                     roleOrt.setType(RoleType.COMPLEX_TYPE);
  21.  
  22.                     <!-- build assignment -->
  23.                     AssignmentType assignment = new AssignmentType();
  24.                     assignment.asPrismContainerValue()
  25.                     assignment.setTargetRef(roleOrt);
  26.  
  27.                     return assignment
  28.                 }
  29.             </code>
  30.         </script>
  31.     </expression>
  32.     <target>
  33.     <path>assignment</path>
  34.     </target>
  35. </mapping>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement