[midPoint] Receive value of parentOrg attribute in mapping

Jason Everling jeverling at bshp.edu
Thu May 9 19:47:17 CEST 2019


Using that mapping sample I sent as an example, make a small change

This below

(org1 ? ',ou=' + org1?.name : '') +
(org2 ? ',ou=' + org2?.name : '') +

would become the below, update it with the below and change the extension
attribute to yours, of course, this is a sample and you might need to move
it around but the code is the same to get the extension value

(org1 ? ',ou=' + basic.getPropertyValue(org1, 'extension/yourAttribute') :
'') +
(org2 ? ',ou=' + basic.getPropertyValue(org2, 'extension/yourAttribute') :
'') +




On Wed, May 8, 2019 at 12:11 PM Vladislavs Filipciks <
vladislavs.filipciks at csolutions.lv> wrote:

> Sorry, I meant parentOrg's extension attribute. Probably that should be in
> expression, like in example it's possible to address parentOrg´s name "
> org1.name".
>
> Отправлено с телефона Huawei
>
> -------- Исходное сообщение --------
> Тема: Re: [midPoint] Receive value of parentOrg attribute in mapping
> От: Jason Everling
> Кому: midPoint General Discussion
> Копия:
>
>
> yes, just add it as a <source>
>
> *<source>*
> * <path>extension/your:attribute</path>*
> *</source>*
>
>
>
> On Wed, May 8, 2019 at 9:49 AM Vladislavs Filipciks <
> vladislavs.filipciks at csolutions.lv> wrote:
>
>> 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 <
>> 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>
>>>             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
>>> midPoint at lists.evolveum.com
>>> http://lists.evolveum.com/mailman/listinfo/midpoint
>>>
>>
>> _______________________________________________
>> midPoint mailing list
>> midPoint at lists.evolveum.com
>> http://lists.evolveum.com/mailman/listinfo/midpoint
>> _______________________________________________
>> midPoint mailing list
>> midPoint at lists.evolveum.com
>> 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/20190509/a7436fcf/attachment.htm>


More information about the midPoint mailing list