[midPoint] Inbound Attribute Modification

Bill Mills bill.mills at keysight.com
Wed Apr 1 23:56:39 CEST 2020


Hello,

I am working on a CSV connector where the LOGIN attribute is similar to $focus/employeeNumber but it has a leading character in front of the employee numbers. For example "A00000001" or "N00000002". I want to remove the leading character if it is an "A" so I would end up with the following: "00000001" and "N00000002". I'm trying to do this so midPoint can correlate the users in the CSV connector file (e.g. LOGIN) with the HR provided employeeNumber.

I'm trying to create a groovy script to do this and came up with:

        <schemaHandling>
            <objectType id="6">
                <kind>account</kind>
                <intent>default</intent>
                <default>true</default>
                <objectClass>ri:AccountObjectClass</objectClass>
                <attribute id="7">
                    <c:ref>ri:LOGIN</c:ref>
                    <displayName>Login</displayName>
                    <tolerant>true</tolerant>
                    <exclusiveStrong>false</exclusiveStrong>
                    <inbound id="12">
                        <authoritative>false</authoritative>
                        <exclusive>false</exclusive>
                        <strength>weak</strength>
                        <expression>
                            <script xsi:type="c:ScriptExpressionEvaluatorType">
                                <code>
                                if (input.startsWith("A")) {
                                input.substring(1)
                                }
                                </code>
                            </script>
                        </expression>
                        <target>
                            <c:path>$focus/employeeNumber</c:path>
                        </target>
                    </inbound>
                </attribute>

As you can see, I have the code in <schemaHanding> and I've tried it in the <correlation> section but neither working for me. Can you assist me by correcting my <code> or tell me where I should place it in the connector configuration?

Thanks in advance,

Bill Mills
Keysight Technologies


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200401/5fad23d5/attachment.htm>


More information about the midPoint mailing list