[midPoint] Receive value of parentOrg attribute in mapping

Vladislavs Filipciks vladislavs.filipciks at csolutions.lv
Wed May 8 16:49:24 CEST 2019


Oh, didn't notice it:) Thanks a lot. 
Maybe it's also possible to directly address Org's extension attribute? 



From: "Jason Everling" <jeverling at bshp.edu> 
To: "midpoint" <midpoint at lists.evolveum.com> 
Sent: Wednesday, 8 May, 2019 16:39:20 
Subject: Re: [midPoint] Receive value of parentOrg attribute in mapping 

within the mapping playground there is a full example, 

<mapping> 
<source> 
<path>parentOrgRef</path> 
</source> 
<source> 
<path>name</path> 
</source> 
<expression> 
<script> 
<code> 
org1 = parentOrgRef != null ? midpoint.getOrgByOid(parentOrgRef?.oid) : null 
org2 = org1?.parentOrgRef ? midpoint.getOrgByOid(org1?.parentOrgRef.get(0).oid) : null 
org3 = org2?.parentOrgRef ? midpoint.getOrgByOid(org2?.parentOrgRef.get(0).oid) : null 

'uid=' + name + 
(org1 ? ',ou=' + org1?.name : '') + 
(org2 ? ',ou=' + org2?.name : '') + 
(org3 ? ',ou=' + org3?.name : '') + ',dc=example,dc=com' 
</code> 
</script> 
</expression> 
<target> 
<path>description</path> 
</target> 
</mapping> 





On Wed, May 8, 2019 at 3:15 AM Vladislavs Filipciks < [ mailto:vladislavs.filipciks at csolutions.lv | vladislavs.filipciks at csolutions.lv ] > wrote: 



Hello. 

I have Organization Structure in MidPoint, so each new child created in tree will have assignment of parent Org. 
Is it possible to get data from parent Org attribute to use in mapping? 
Currently each Org has extension attribute adOUPath that refers to OU path in AD ( OU=Org1,OU=Org2,OU=Org3 etc.). 
When new child is created, I want to take parentOrg's adOUPath value and map it to child's attribute. 

What I already tried is: 
<mapping> 
<strength>weak</strength> 
<name>Org OU path from assignment mapping</name> 
<source> 
<path>$focus/focusAssignment/extension/adOUPath</path> 
</source> 
<source> 
<path>$focus/name</path> 
</source> 
<expression> 
<script> 
<code> 
[ http://log.info/ | log.info ] ("adOUPath is " + adOUPath); 
if(adOUPath!=null){ 
newPath = "OU=" + name + "," + adOUPath; 
return newPath; 
} 
</code> 
</script> 
</expression> 
<target> 
<path>$focus/extension/adOUPath</path> 
</target> 
</mapping> 

In part of 
<source> 
<path>$focus/focusAssignment/extension/adOUPath</path> 
</source> 
I have tried different variables: assignment[0], immediateAssignment, immediateRole and all result in null 

Thanks in advance. 

_______________________________________________ 
midPoint mailing list 
[ mailto:midPoint at lists.evolveum.com | midPoint at lists.evolveum.com ] 
[ http://lists.evolveum.com/mailman/listinfo/midpoint | http://lists.evolveum.com/mailman/listinfo/midpoint ] 




_______________________________________________ 
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/20190508/f3ae70a3/attachment.htm>


More information about the midPoint mailing list