[midPoint] Iterations

Jan Kaspar Caspi at seznam.cz
Tue Nov 7 07:56:15 CET 2017


Hi All,



last time I tryed to import soem users from CSV file. Gustav helped me to 
solve some things.




Now i am trying to prevent existence same login / email address. There is a 
lot of examples




But it do not work for me. What I am doing wrong? 




Template used for sync of users:





<objectTemplate xmlns="http://midpoint.evolveum.com/xml/ns/public/common/
common-3"

                xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"

                xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/
common-3"

                xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"

                xmlns:org="http://midpoint.evolveum.com/xml/ns/public/
common/org-3"

                xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/
connector/icf-1/resource-schema-3"

                xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/
resource/instance-3"

                oid="c0c010c0-d34d-b33f-f00d-777333333333"

                version="18">

   <name>User Template</name>

   <metadata>

      <createTimestamp>2017-11-07T02:04:12.135+01:00</createTimestamp>

      <creatorRef oid="00000000-0000-0000-0000-000000000002"

                  relation="org:default"

                  type="c:UserType"><!-- administrator --></creatorRef>

      <createChannel>http://midpoint.evolveum.com/xml/ns/public/model/
channels-3#objectImport</createChannel>

   </metadata>

   <iteration>

      <maxIterations>999</maxIterations>

      <tokenExpression>

         <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                 xsi:type="c:ScriptExpressionEvaluatorType">

            <code>

                if (iteration == 0) {

                    return "";

                } else {

                    return sprintf("%03d", iteration);

                }

                </code>

         </script>

      </tokenExpression>

   </iteration>

   <mapping>

      <description>

                Property mapping.

                Defines how properties of user object are set up.

                This specific definition sets a full name as a concatenation

                of givenName and familyName.

            </description>

      <strength>weak</strength>

      <source>

         <c:path>$user/givenName</c:path>

      </source>

      <source>

         <c:path>$user/familyName</c:path>

      </source>

      <expression>

         <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                 xsi:type="c:ScriptExpressionEvaluatorType">

            <language>http://midpoint.evolveum.com/xml/ns/public/expression/
language#Groovy</language>

            <code>

                        givenName + ' ' + familyName

                    </code>

         </script>

      </expression>

      <target>

         <c:path>$user/fullName</c:path>

      </target>

   </mapping>

   <mapping>

      <description>

                Property mapping.

                Defines how properties of user object are set up.

                This specific definition sets a full name as a concatenation

                of givenName and familyName.

            </description>

      <strength>weak</strength>

      <source>

         <c:path>$user/givenName</c:path>

      </source>

      <source>

         <c:path>$user/familyName</c:path>

      </source>

      <expression>

         <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                 xsi:type="c:ScriptExpressionEvaluatorType">

            <language>http://midpoint.evolveum.com/xml/ns/public/expression/
language#Groovy</language>

            <code>

                        givenName + '.' + familyName + '@hell.cz'

                    </code>

         </script>

      </expression>

      <target>

         <c:path>$user/emailAddress</c:path>

      </target>

   </mapping>

</objectTemplate>





It looks like iterationToken do not have any value (is NULL) but values in 
CSV files are created to make a conflict for user 07 and 08.





guid,username,firstname,lastname,disabled,password

01,user01,Firstname,Lastname,false,secret

02,user02,Test,Lastname,false,secret

03,user03,jan,kaspar,false,secret

04,Test,FirstTest,LastTest,false,secret

05,test05,F5,E5,false,secret

06,test06,F5,F5,false,secret

07,test07,F7,F7,false,secret

08,test08,F7,F7,false,secret





What I am missing? 




Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20171107/e0f19bf0/attachment.htm>


More information about the midPoint mailing list