<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:#4472C4;
        position:relative;
        top:0pt;
        mso-text-raise:0pt;
        letter-spacing:0pt;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#4472C4">Hi,<br>
<br>
I have the following attribute in my shadows (EmployeeId, Aliases):<br>
<br>
I am trying to map the employeeId against the user employeeNumber which works OK and the aliases (which is a multivalued field against the user emailAddress). Whenever I try to give the aliases to match against the emailAddress I get the following error that
 I can’t compare emailAddress against more than 1 item. Any ideas how can I compare all the fields inside the multivalued field against the emailAddress?¿<br>
<br>
<br>
<img width="1559" height="513" style="width:16.2395in;height:5.3437in" id="_x0000_i1026" src="cid:image002.png@01D81120.A37EA000"><br>
<br>
<br>
here you may find the resource xml:<br>
<br>
<br>
<br>
<?xml version="1.0" encoding="UTF-8"?><br>
<br>
<resource oid="6a23afee-0426-4c52-85d4-7223cc4829c8"<br>
          xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"<br>
          xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"<br>
          xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"<br>
          xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"<br>
          xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"<br>
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"<br>
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br>
          xmlns:icfc="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3"<br>
          xmlns:cap="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3"><br>
<br>
<br>
    <connectorRef type="ConnectorType"><br>
        <filter><br>
            <q:equal><br>
                <q:path>c:connectorType</q:path><br>
                <q:value>ingrammicro.com.connector.csv.cmp.CsvConnector</q:value><br>
            </q:equal><br>
        </filter><br>
    </connectorRef><br>
<br>
    <br>
<br>
    <schemaHandling><br>
        <objectType><br>
            <kind>account</kind><br>
            <intent>default</intent><br>
            <displayName>Default Account</displayName><br>
            <objectClass>ri:AccountObjectClass</objectClass><br>
            <default>true</default><br>
            <multiplicity><br>
                <maxOccurs>unbounded</maxOccurs><br>
            </multiplicity><br>
<br>
            <attribute><br>
            <c:ref xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">ri:UserPrincipalName</c:ref><br>
<br>
            </attribute><br>
<br>
            <attribute><br>
                <c:ref xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">ri:EmployeeId</c:ref><br>
<br>
            </attribute><br>
<br>
            <attribute><br>
                <c:ref xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">ri:Aliases</c:ref><br>
                <limitations><br>
                    <minOccurs>0</minOccurs><br>
                    <maxOccurs>unbounded</maxOccurs><br>
                </limitations><br>
                <inbound><br>
                    <target><br>
                        <c:path>$focus/extension/emailAlias</c:path><br>
                    </target><br>
                </inbound><br>
            </attribute><br>
            <attribute><br>
                <c:ref xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">ri:AccountEnabled</c:ref><br>
            </attribute><br>
        </objectType><br>
    </schemaHandling><br>
<br>
    <synchronization><br>
        <objectSynchronizationSorter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="c:ObjectSynchronizationSorterType"><br>
            <expression><br>
                <trace>false</trace><br>
                <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="c:ScriptExpressionEvaluatorType"><br>
                    <code><br>
                        import com.evolveum.midpoint.xml.ns._public.common.common_3.*;<br>
                        import javax.xml.namespace.QName;<br>
                        import com.evolveum.midpoint.prism.path.ItemPath;<br>
                        import com.evolveum.midpoint.schema.constants.SchemaConstants;<br>
                        import com.evolveum.midpoint.util.exception.ConfigurationException;<br>
                        import com.evolveum.midpoint.schema.util.ShadowUtil;<br>
<br>
                        //log.info("----------------------------- Entering in the  SynchronizationSorter ----------------")<br>
                       discriminator = new ObjectSynchronizationDiscriminatorType()<br>
<br>
                        discriminator.setKind(ShadowKindType.ACCOUNT)<br>
                        discriminator.setIntent("default")<br>
<br>
                        //log.info("----------------------------- Leaving the SynchronizationSorter ----------------")<br>
                        return discriminator<br>
                    </code><br>
                </script><br>
            </expression><br>
        </objectSynchronizationSorter><br>
<br>
        <objectSynchronization><br>
            <name>account</name><br>
            <objectClass>ri:AccountObjectClass</objectClass><br>
            <kind>account</kind><br>
            <intent>default</intent><br>
            <focusType>UserType</focusType><br>
            <enabled>true</enabled><br>
<br>
            <correlation><br>
                <q:or><br>
                    <q:equal><br>
                        <q:matching>stringIgnoreCase</q:matching><br>
                        <q:path xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">c:employeeNumber</q:path><br>
                        <expression><br>
                            <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ScriptExpressionEvaluatorType"><br>
                                <code><br>
                                    def employeeId = basic.getAttributeValue(shadow, 'EmployeeId')<br>
                                    if(employeeId != null){<br>
                                        employeeId = employeeId.toString().trim()<br>
                                        log.info("EmployeeID: {}",employeeId)<br>
                                        log.info("EmployeeID length: {}",employeeId.length())<br>
                                        if(employeeId.length() != 6){<br>
                                            int count = 6 - employeeId.length()<br>
                                            int i = 0<br>
                                            if(count > 0){<br>
                                                boolean condition = count > i;<br>
                                                while(condition){<br>
                                                    employeeId = "0"+employeeId;<br>
                                                    i++;<br>
                                                    condition = count > i;<br>
                                                }<br>
                                            }<br>
                                        }<br>
                                        log.info("[CSO][AAD Corporate]{Correlation} The employeeId is {}",employeeId)<br>
                                        return employeeId<br>
                                    }else{<br>
                                        log.info("[CSO][AAD Corporate]{Correlation} The employeeId attribute is empty")<br>
                                        return "randomEmployeeIdDontExist"<br>
                                    }<br>
                                </code><br>
                            </script><br>
                        </expression><br>
                    </q:equal><br>
                    <q:equal><br>
                        <q:matching>stringIgnoreCase</q:matching><br>
                        <q:path xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">c:extension/emailAlias</q:path><br>
                        <expression><br>
                            <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ScriptExpressionEvaluatorType"><br>
                                <code><br>
                                    def aliases = basic.getAttributeValues(shadow, 'Aliases')<br>
                                    if(aliases != null){<br>
<br>
                                        log.info("[CSO][AAD Corporate]{Correlation} The aliases is {}",aliases)<br>
                                        return aliases<br>
                                    }else{<br>
                                        log.info("[CSO][AAD Corporate]{Correlation} The aliases attribute is empty")<br>
                                        return "randomAliasesIdDontExist"<br>
                                    }<br>
                                </code><br>
                            </script><br>
                        </expression><br>
                    </q:equal><br>
                    <q:equal><br>
                        <q:matching>stringIgnoreCase</q:matching><br>
                        <q:path xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">c:emailAddress</q:path><br>
                        <expression><br>
                            <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ScriptExpressionEvaluatorType"><br>
                                <code><br>
                                    def aliases = basic.getAttributeValues(shadow, 'Aliases')<br>
                                    if(aliases != null){<br>
<br>
                                        log.info("[CSO][AAD Corporate]{Correlation} The aliases is {}",aliases)<br>
                                        return aliases<br>
                                    }else{<br>
                                        log.info("[CSO][AAD Corporate]{Correlation} The aliases attribute is empty")<br>
                                        return "randomAliasesIdDontExist"<br>
                                    }<br>
                                </code><br>
                            </script><br>
                        </expression><br>
                    </q:equal><br>
<br>
                </q:or><br>
            </correlation><br>
<br>
            <reaction><br>
                <situation>linked</situation><br>
                <synchronize>true</synchronize><br>
            </reaction><br>
            <reaction><br>
                <situation>deleted</situation><br>
            </reaction><br>
            <reaction><br>
                <situation>unlinked</situation><br>
                <synchronize>true</synchronize><br>
                <action><br>
                    <handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#link</handlerUri><br>
                </action><br>
            </reaction><br>
            <reaction><br>
                <situation>unmatched</situation><br>
            </reaction><br>
        </objectSynchronization><br>
<br>
    </synchronization><br>
<br>
    <caching><br>
        <cachingStategy>passive</cachingStategy><br>
    </caching><br>
<br>
    <capabilities><br>
        <configured><br>
            <cap:activation><br>
                <cap:status><br>
                    <cap:attribute>ri:AccountEnabled</cap:attribute><br>
                    <cap:enableValue>True</cap:enableValue><br>
                    <cap:disableValue>False</cap:disableValue><br>
                </cap:status><br>
            </cap:activation><br>
            <cap:create><br>
                <cap:enabled>false</cap:enabled><br>
            </cap:create><br>
            <cap:update><br>
                <cap:enabled>false</cap:enabled><br>
            </cap:update><br>
            <cap:delete><br>
                <cap:enabled>false</cap:enabled><br>
            </cap:delete><br>
            <cap:credentials><br>
                <cap:enabled>false</cap:enabled><br>
            </cap:credentials><br>
            <cap:liveSync><br>
                <cap:enabled>false</cap:enabled><br>
            </cap:liveSync><br>
            <cap:script><br>
                <cap:enabled>false</cap:enabled><br>
            </cap:script><br>
        </configured><br>
    </capabilities><br>
<br>
<br>
<br>
<br>
<br>
</resource><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#4472C4">Santiago Sañudo Martínez<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#4472C4">Cloud Security Operations
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#4472C4">Plaza de Manuel Llano, Santander, Spain, 39011<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#4472C4"><img width="144" height="31" style="width:1.5in;height:.3229in" id="Picture_x0020_2" src="cid:image001.jpg@01D81120.37EDD9F0"></span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#4472C4"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#4472C4"><a href="http://bit.ly/IngramTwitter"><span style="color:#4472C4">Twitter</span></a> | <a href="http://bit.ly/IngramLinkedIN"><span style="color:#4472C4">LinkedIn</span></a> | <a href="http://bit.ly/IngramFacebook"><span style="color:#4472C4">Facebook</span></a> | <a href="http://bit.ly/IngramYouTube"><span style="color:#4472C4">YouTube</span></a>  <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#4472C4">This email may contain material that is confidential, and proprietary to Ingram Micro and subsidiaries, for the sole use of the intended recipient. Any review,
 reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p><span style="font-family: Calibri; font-size: xx-small;"><br>
La información contenida en este mensaje es confidencial. En caso de que reciba este mensaje por error le rogamos lo comunique a la mayor brevedad al emisor y proceda a su eliminación definitiva, absteniéndose de copiar, almacenar o difundir su contenido. De
 acuerdo con lo establecido en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal y en el Reglamento de Desarrollo 1720/2007, los datos personales que facilite a través de la dirección de correo indicada serán incorporados a un fichero titularidad
 de INGRAM MICRO, S.L.U., con domicilio en C/ Antonio Machado, 78-80 1ª y 2ª pl. Business Park ( 08840-Viladecans). Mediante el envío de sus datos, Ud. otorga su consentimiento expreso a INGRAM MICRO, S.L.U, para el tratamiento de sus datos, con la finalidad
 de atender a su consulta y/o mantener la relación profesional, comercial, y/o contractual que en su caso establezca con INGRAM MICRO, S.L.U. Puede ejercitar sus derechos de acceso, rectificación, cancelación y oposición notificándolo por escrito a la dirección
 del remitente, o a la siguiente dirección de correo nuevascuentas@ingrammicro.es. De acuerdo con la Ley 34/2002, de Servicios de la Sociedad de la Información y de Comercio Electrónico, Vd. podrá oponerse en cualquier momento al tratamiento de sus datos con
 fines promocionales notificándonoslo por escrito a la dirección de correo mencionada.<br>
.................................................................................................................................................................................................................................................<br>
The information contained in this message is confidential. If you receive this message by error please notify it as soon as possible to the sender and proceed to their final elimination by not copy, store or distribute its content. In accordance of what is
 stated in the Law 15/1999, of Data Personal Protection and Regulation Rule 1720/2007, the personal data provided through the email address you entered will be included in a file owned by INGRAM MICRO, SLU, located at C/ Antonio Machado, 78-80 1ª y 2ª pl. Business
 Park ( 08840-Viladecans). By submitting your data, you expressly give your consent to INGRAM MICRO, SLU, to the treatment of your data, in order to answer to your questions and / or keep the professional, commercial relationship  and / or contractual set with
 INGRAM MICRO, SLU You can exercise your rights of access, rectification, cancellation and opposition by giving written notification to the sender address or to  the following email:  nuevascuentas@ingrammicro.es. According to Law 34/2002, of the Information
 Society and Electronic Commerce, you may object at any time to your data treatment for promotional purposes by notifying us in writing to the email address above.<br>
<span style="color: #ffffff;">[Ingram_2818e5de]</span></span></p>
</body>
</html>