[midPoint] extension/property mapping in user template

Pavol Mederly mederly at evolveum.com
Wed Apr 8 16:43:15 CEST 2020


Hello Vladislavs,

just a quick try: your template mapping should be executed twice - once 
for "old" value of extension/adGroup and once for "new" value of it. So 
maybe what you see in the log is the first execution. Isn't there 
another execution, this time with the expected value?

Best regards,

Pavol Mederly
Software developer
evolveum.com

On 08/04/2020 16:34, Vladislavs Filipciks wrote:
> Hello.
>
> I'm having trouble mapping user extended schema property to another 
> extended schema property during user import from resource. The source 
> extension/property is always being null while object template is 
> processed.
> Probably I'm missing some additional config or something. Could any 
> one suggest/correct me? Config snips:
>
> Resource:
> <attribute>
> <ref>ri:memberOf</ref>
> <inbound>
> <expression>
> <script>
> <code>
>                         if(input != null){
>                             tmpdn = input;
>                             groupPath = tmpdn.substring(0, tmpdn.indexOf(",DC="));
>                             log.info("-- adGroup from resource schemaHandling " + groupPath );
>                             return groupPath;
>                         }
> </code>
> </script>
> </expression>
> <target>
> <path>extension/adGroup</path>
> </target>
> </inbound>
> </attribute>
>
> Extension schema:
>
> <xsd:complexTypename="UserExtensionType">
> <xsd:annotation>
> <xsd:appinfo>
> <a:extensionref="c:UserType"/>
> </xsd:appinfo>
> </xsd:annotation>
> <xsd:sequence>
>
> User template that is being used with sync:
>
> <mapping>
> <name>Ad Group name mapping</name>
> <source>
> <path>extension/adGroup</path>
> </source>
> <expression>
> <script>
> <code>
>                 log.info('+++++++++++++++++ adGroup from user template ' + adGroup);
>                 if ((groupName = adGroup.split(",CN=")[0].substring(3))){
>                 return groupName.trim();
>                 }
>                 groupName = adGroup.split(",OU=")[0].substring(3);
>                 log.info('++++++ gorupName from user template ' + groupName);
>                 return groupName.trim();
> </code>
> </script>
> </expression>
> <target>
> <path>extension/groupName</path>
> </target>
> </mapping>
>
> Log:
>
> 2020-04-08 17:31:28,495 [MODEL] [http-nio-8080-exec-4] INFO 
> (com.evolveum.midpoint.expression): -- adGroup from resource 
> schemaHandling CN=Midpoint Test Group,OU=Midpoint Test 
> OU,OU=CS_group_users
> 2020-04-08 17:31:28,496 [MODEL] [http-nio-8080-exec-4] INFO 
> (com.evolveum.midpoint.expression): -- adGroup from resource 
> schemaHandling CN=Domain Admins,CN=Users
> 2020-04-08 17:31:28,500 [MODEL] [http-nio-8080-exec-4] INFO 
> (com.evolveum.midpoint.expression): -- adOUContainer from resource 
> schemaHandling OU=Midpoint Test OU,OU=CS_group_users
> 2020-04-08 17:31:28,515 [MODEL] [http-nio-8080-exec-4] INFO 
> (com.evolveum.midpoint.expression): +++++++++++++++++ adGroup from 
> user template null
>
>
>
> *Vladislavs Fiļipčiks*
>
> +371 6784 7766
>
> *SIA “Corporate Solutions”*
>
> Pērnavas 43A-9, Rīga, LV-1009
>
> www.csolutions.lv <http://www.csolutions.lv/>
>
>
> Šis e-pasts un tā pielikumā esošie dokumenti var saturēt ierobežotas 
> pieejamības informāciju, cita starpā fizisko personu datus, kas 
> adresēta tikai tā saņēmējam un izmantojama tikai leģitīmiem mērķiem. 
> Ja esat saņēmis šo e-pastu kļūdas dēļ, vai nav pamatota mērķa 
> ierobežotas pieejamības informācijas, cita starpā fizisko personu 
> datu, apstrādei, Jums nav tiesību izmantot vai pārsūtīt šajā e-pastā 
> un tam pievienotajos dokumentos ietverto informāciju. Šādā gadījumā 
> nekavējoties neatgriezeniski izdzēsiet šo e-pastu.
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200408/88a1814b/attachment.htm>


More information about the midPoint mailing list