[midPoint] Parent Org Assignment

Dieter Plassmann midpoint at virginweb.de
Mon Oct 29 18:57:22 CET 2018


Dear MidPoint community,
I’m trying to assign a SubOrg (department) to a ParentOrg (businessunit).
Businessunits and departments are successfully imported from an HR database based on the scriptedsql sample. Departments have an attribute (extension) orgParent (schema see ref 4. attached) with the businessunit they belong to.
Unfortunately I could not manage to assign the department to the business unit hierarchically during import task.

I have tried the following 3 different ways :

1. Using an Org Template (see attached ref 1)
Actually nothing happens here. Perhaps I need to tell midpoint to use the template to creating the department OrgType. But I could not figure out how?

2. Extending the department object type definition with an inbound mapping including an assignmentTargetSearch (see attached ref 2)
This works in the sense that I see the assignment in the “edit organisation” tab of the department, but graphically it is not shown in the org tree in hierarchically.

3. Extending the department object type definition with an inbound mapping including an static targetRef OID. (see attached ref 3)
This works as expected, but is not what I want to achieve, since I would like to obtain this dynamically from the HR database.

I’m looking forward, if someone can give me a hint to put me back on the right track. Right now I’m lost again.

Thanks a lot in advance

Dieter


ref 1. Org Template
<name>Org Template</name>
    
    <mapping>
    	<name>Link org parent</name>
    	<authoritative>true</authoritative>
		<strength>strong</strength>
    	<source>
    		<c:path>$focus/extension/orgParent</c:path>
    	</source>
    	<source>
    		<path>orgType</path>
    	</source>
    	<expression>
            <assignmentTargetSearch>
            	<targetType>c:OrgType</targetType>
        		  <filter>
					     <q:equal>
						    <q:path>c:name</q:path>
						    <expression>
							   <path>$orgParent</path>
						    </expression>
					     </q:equal>
				      </filter>
            </assignmentTargetSearch>    	
    	</expression>
    	<target>
    		<c:path>$focus/assignment</c:path>
    	</target>
    	<condition>
    		<script>
    			<c:code>orgParent != null</c:code>
    		</script>
    	</condition>
    </mapping>
  
</objectTemplate>




ref 2. object type definition with assignmentTargetSearch

<objectType>
	<kind>entitlement</kind>
	<intent>department</intent>
	<default>false</default>
	<displayName>Department</displayName>
	<objectClass>ri:CustomDepartmentObjectClass</objectClass>
	<attribute>
		<ref>icfs:uid</ref>
		<displayName>Entry UUID</displayName>
		<limitations>
                        <access>
                            <read>true</read>
                        </access>
		</limitations>
	</attribute>
	<attribute>
		<ref>icfs:name</ref>
		<displayName>Department</displayName>
			<inbound>
				<target>
					<path>$focus/name</path>
				</target>
			</inbound>
	</attribute>
	<attribute>
		<ref>ri:businessunit</ref>
		<displayName>orgParent</displayName>
			<inbound>
				<target>
					<path>$focus/extension/orgParent</path>
				</target>
			</inbound>
			<inbound>
				<source>
					<c:path>$focus/extension/orgParent</c:path>
				</source>
				<expression>
					<assignmentTargetSearch>
            						<targetType>c:OrgType</targetType>
        		  						<filter>
					     					<q:equal>
						    					<q:path>c:name</q:path>
						    					<q:matching>polyStringNorm</q:matching>
						    					<expression>
							   						<path>$orgParent</path>
						    					</expression>
					     					</q:equal>
				     					</filter>
					</assignmentTargetSearch>    	
				</expression>
				<target>
					<path>$focus/assignment</path>
				</target>
			</inbound>
	</attribute>
	<activation>
		<administrativeStatus>
			<outbound/>
			<inbound/>
		</administrativeStatus>
	</activation>
</objectType>

ref 3. object type definition with static assigning an targetRef oid

<objectType>
	<kind>entitlement</kind>
	<intent>department</intent>
	<default>false</default>
	<displayName>Department</displayName>
	<objectClass>ri:CustomDepartmentObjectClass</objectClass>
	<attribute>
		<ref>icfs:uid</ref>
		<displayName>Entry UUID</displayName>
		<limitations>
                        <access>
                            <read>true</read>
                        </access>
		</limitations>
	</attribute>
	<attribute>
		<ref>icfs:name</ref>
		<displayName>Department</displayName>
			<inbound>
				<target>
					<path>$focus/name</path>
				</target>
			</inbound>
	</attribute>
	<attribute>
		<ref>ri:businessunit</ref>
		<displayName>orgParent</displayName>
			<inbound>
				<target>
					<path>$focus/extension/orgParent</path>
				</target>
			</inbound>
			<inbound>
				<expression>
					<value>
						<targetRef oid="company9-3107-11e2-964e-100000000000" type="c:OrgType"/>
					</value>    	
				</expression>
				<target>
					<path>$focus/assignment</path>
				</target>
			</inbound>
	</attribute>
	<activation>
		<administrativeStatus>
			<outbound/>
			<inbound/>
		</administrativeStatus>
	</activation>
</objectType>


ref 4.

<xsd:schema elementFormDefault="qualified"
            targetNamespace="http://midpoint.evolveum.com/xml/ns/story/orgsync/ext"
            xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
            xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">



    <xsd:complexType name="OrgTypeExtensionType">
        <xsd:annotation>
            <xsd:appinfo>
                <a:extension ref="c:OrgType"/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="ParentOrgId" type="xsd:string" minOccurs="0">
            	<xsd:annotation>
            		<xsd:appinfo>
            			<a:indexed>false</a:indexed>
            		</xsd:appinfo>
            	</xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    

    
</xsd:schema>




More information about the midPoint mailing list