<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body style="font-family:Arial;font-size:14px">
<p>I have configured the condition with input == null and midPoint generates correctly the value and update it into the database table, but it is not mapped into the employeeNumber attribute, I do not know why, it is null in midPoint while it has a value in the table, also, if I reconcile the user, the value in the database table remains intact, this behaviour is perfect, but I can not see this value in the midPoint user.<br>
<br>
On the other hand, I have seen the kind of values that midPoint generates with this expression, 8 alphanumeric characters. What I want is to generate an UUID, so I am trying to use the "uuidgen" Linux command, and I have tried this:</p>
<div><script xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"></div>
<div>   <code></div>
<div>      "uuidgen -x -r".execute()</div>
<div>   </code></div>
<div></script></div>
<p>But the error I get when I try to import a user is:<br>
<br>
<span style='color: rgb(51, 51, 51); font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif; background-color: rgb(255, 255, 255);'>Expected class java.lang.String type, but got class java.lang.ProcessImpl in expression in mapping in inbound expression for AFI_ID in resource:3a091f48-850c-4ee8-ae1c-eac5c264c41c(MIDPOINT.AFILIACIONES)(actor=user:00000000-0000-0000-0000-000000000002(administrator); input=null; resource=resource:3a091f48-850c-4ee8-ae1c-eac5c264c41c(MIDPOINT.AFILIACIONES); configuration=systemConfiguration:00000000-0000-0000-0000-000000000001(SystemConfiguration); focus (user)=user:null(null); projection (shadow, account)=shadow:e6452b1b-496a-429a-8d07-3452e5b6c1ee(34812812); operation=add; ) in expression in mapping in inbound expression for AFI_ID in resource:3a091f48-850c-4ee8-ae1c-eac5c264c41c(MIDPOINT.AFILIACIONES)<br>
<br>
Thanks.</span></p>
<p><br>
<a href="mailto:midpoint-request@lists.evolveum.com">midpoint-request@lists.evolveum.com</a> escribió:</p>
<blockquote style="border-left:2px solid blue;margin-left:2px;padding-left:12px;" type="cite">
<p><br>
------------------------------<br>
<br>
Message: 2<br>
Date: Wed, 16 Feb 2022 14:15:51 +0100<br>
From: Mercedes Oncina Deltell <<a href="mailto:moncina@um.es">moncina@um.es</a>><br>
To: <a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a><br>
Subject: [midPoint] Error in script condition during inbound mapping<br>
Message-ID: <<a href="mailto:224b64b9-93b8-28ed-815b-521651eedf23@um.es">224b64b9-93b8-28ed-815b-521651eedf23@um.es</a>><br>
Content-Type: text/plain; charset="utf-8"; Format="flowed"<br>
<br>
Hello again.<br>
<br>
I have learned a lot about midPoint during last week. Now, I have a new<br>
question.<br>
<br>
I want to import an attribute which could be null in the database table,<br>
it is mapped into the employeeNumber attribute of the user schema in<br>
midPoint. If it is null in the database, I want to random generate a<br>
value and map it into the attribute, but if it contains a value, I just<br>
only want to import it.<br>
<br>
As this employeeNumber should always have a value in midPoint, it is<br>
mapped out to the property AFI_ID in the database table. My objective<br>
is, if in database the value is null, midPoint will generate this value<br>
and then, update it to the database again.<br>
<br>
I have tried many configurations and (I think) I know where the problem<br>
is, in the script code of the condition of the inbound mapping:<br>
<br>
/<attribute id="30">//<br>
//*<ref>ri:AFI_ID</ref>*//<br>
//                <description>Identificador único, generado<br>
automáticamente</description>//<br>
//                <matchingRule<br>
xmlns:gen459="<a href="http://prism.evolveum.com/xml/ns/public/matching-rule-3" target="_blank">http://prism.evolveum.com/xml/ns/public/matching-rule-3</a>">gen459:default</matchingRule>//<br>
//                <tolerant>true</tolerant>//<br>
//<exclusiveStrong>false</exclusiveStrong>//<br>
/*/                <outbound>/*/<br>
//<authoritative>true</authoritative>//<br>
//<exclusive>false</exclusive>//<br>
//<strength>normal</strength>//<br>
//*<source>*/*/<br>
/**/<path>$focus/employeeNumber</path>/**/<br>
/**/                    </source>/**/<br>
/**/                </outbound>/*/<br>
//                <inbound id="49">//<br>
//<authoritative>true</authoritative>//<br>
//<exclusive>false</exclusive>//<br>
//<strength>normal</strength>//<br>
//*<expression>*/*/<br>
/**/                        <generate/>/**/<br>
/**/                    </expression>/*/<br>
//                    <target>//<br>
//<path>$focus/employeeNumber</path>//<br>
//                    </target>//<br>
//*<condition>*/*/<br>
/**/                        <script>/**/<br>
/**/                           <code>/**/<br>
/**/$projection/attributes/AFI_ID == null/**/<br>
/**/                           </code>/**/<br>
/**/                        </script>/**/<br>
/**/                    </condition>/*/<br>
//                </inbound>//<br>
//            </attribute>/<br>
<br>
But this configuration is not correct, maybe because it is not a Groovy<br>
expression, the error when I try to reconcile or import an user is:<br>
<br>
Groovy Evaluation Failed: No such property: $projection for class:<br>
condition_in_mapping_in_inbound_expression_for_AFI_ID_in_resource_3a091f48-850c-4ee8-ae1c-eac5c264c41c(MIDPOINT(actor=user:00000000-0000-0000-0000-000000000002(administrator);<br>
input=PPV(String:wB7TPNFn);<br>
resource=resource:3a091f48-850c-4ee8-ae1c-eac5c264c41c(MIDPOINT.AFILIACIONES);<br>
configuration=systemConfiguration:00000000-0000-0000-0000-000000000001(SystemConfiguration);<br>
focus (user)=user:null(null); projection (shadow,<br>
account)=shadow:4a56dbf2-93ab-4ae5-8b4d-3747f34711fe(34812808);<br>
operation=add; ) in condition in mapping in inbound expression for<br>
AFI_ID in<br>
resource:3a091f48-850c-4ee8-ae1c-eac5c264c41c(MIDPOINT.AFILIACIONES)<br>
<br>
Could anyone advice me about this kind of expressions?<br>
<br>
Thanks in advance.<br>
<br>
--<br>
Mercedes Oncina Deltell<br>
Servicio de Infraestructuras TICS<br>
ATICA - Universidad de Murcia<br>
Telf: +34 868881983<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://lists.evolveum.com/pipermail/midpoint/attachments/20220216/61772317/attachment-0001.htm" target="_blank">https://lists.evolveum.com/pipermail/midpoint/attachments/20220216/61772317/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Wed, 16 Feb 2022 17:18:49 +0000<br>
From: Paulo Fernandes de Souza Junior <<a href="mailto:PFSJ@senado.leg.br">PFSJ@senado.leg.br</a>><br>
To: midPoint General Discussion <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>><br>
Cc: Mercedes Oncina Deltell <<a href="mailto:moncina@um.es">moncina@um.es</a>><br>
Subject: Re: [midPoint] Error in script condition during inbound<br>
        mapping<br>
Message-ID: <<a href="mailto:1645031929533.1242@senado.leg.br">1645031929533.1242@senado.leg.br</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Use input == null in the condition.<br>
<br>
<br>
Paulo Fernandes de Souza Júnior<br>
NQPPPS<br>
Senado Federal - PRODASEN<br>
Fone: 61 3303.3924<br>
<br>
<br>
________________________________<br>
De: midPoint <<a href="mailto:midpoint-bounces@lists.evolveum.com">midpoint-bounces@lists.evolveum.com</a>> em nome de Mercedes Oncina Deltell via midPoint <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>><br>
Enviado: quarta-feira, 16 de fevereiro de 2022 10:15<br>
Para: <a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a><br>
Cc: Mercedes Oncina Deltell<br>
Assunto: [midPoint] Error in script condition during inbound mapping<br>
<br>
<br>
Hello again.<br>
<br>
I have learned a lot about midPoint during last week. Now, I have a new question.<br>
<br>
I want to import an attribute which could be null in the database table, it is mapped into the employeeNumber attribute of the user schema in midPoint. If it is null in the database, I want to random generate a value and map it into the attribute, but if it contains a value, I just only want to import it.<br>
<br>
As this employeeNumber should always have a value in midPoint, it is mapped out to the property AFI_ID in the database table. My objective is, if in database the value is null, midPoint will generate this value and then, update it to the database again.<br>
<br>
I have tried many configurations and (I think) I know where the problem is, in the script code of the condition of the inbound mapping:<br>
<br>
           <attribute id="30"><br>
               <ref>ri:AFI_ID</ref><br>
               <description>Identificador único, generado automáticamente</description><br>
               <matchingRule xmlns:gen459="<a href="http://prism.evolveum.com/xml/ns/public/matching-rule-3" target="_blank">http://prism.evolveum.com/xml/ns/public/matching-rule-3</a>"<<a href="http://prism.evolveum.com/xml/ns/public/matching-rule-3" target="_blank">http://prism.evolveum.com/xml/ns/public/matching-rule-3</a>>>gen459:default</matchingRule><br>
               <tolerant>true</tolerant><br>
               <exclusiveStrong>false</exclusiveStrong><br>
               <outbound><br>
                   <authoritative>true</authoritative><br>
                   <exclusive>false</exclusive><br>
                   <strength>normal</strength><br>
                   <source><br>
                       <path>$focus/employeeNumber</path><br>
                   </source><br>
               </outbound><br>
               <inbound id="49"><br>
                   <authoritative>true</authoritative><br>
                   <exclusive>false</exclusive><br>
                   <strength>normal</strength><br>
                   <expression><br>
                       <generate/><br>
                   </expression><br>
                   <target><br>
                       <path>$focus/employeeNumber</path><br>
                   </target><br>
                   <condition><br>
                       <script><br>
                          <code><br>
                             $projection/attributes/AFI_ID == null<br>
                          </code><br>
                       </script><br>
                   </condition><br>
               </inbound><br>
           </attribute><br>
<br>
But this configuration is not correct, maybe because it is not a Groovy expression, the error when I try to reconcile or import an user is:<br>
<br>
Groovy Evaluation Failed: No such property: $projection for class: condition_in_mapping_in_inbound_expression_for_AFI_ID_in_resource_3a091f48-850c-4ee8-ae1c-eac5c264c41c(MIDPOINT(actor=user:00000000-0000-0000-0000-000000000002(administrator); input=PPV(String:wB7TPNFn); resource=resource:3a091f48-850c-4ee8-ae1c-eac5c264c41c(MIDPOINT.AFILIACIONES); configuration=systemConfiguration:00000000-0000-0000-0000-000000000001(SystemConfiguration); focus (user)=user:null(null); projection (shadow, account)=shadow:4a56dbf2-93ab-4ae5-8b4d-3747f34711fe(34812808); operation=add; ) in condition in mapping in inbound expression for AFI_ID in resource:3a091f48-850c-4ee8-ae1c-eac5c264c41c(MIDPOINT.AFILIACIONES)<br>
<br>
Could anyone advice me about this kind of expressions?<br>
<br>
Thanks in advance.<br>
<br>
--<br>
Mercedes Oncina Deltell<br>
Servicio de Infraestructuras TICS<br>
ATICA - Universidad de Murcia<br>
Telf: +34 868881983<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://lists.evolveum.com/pipermail/midpoint/attachments/20220216/53f41c2a/attachment.htm" target="_blank">https://lists.evolveum.com/pipermail/midpoint/attachments/20220216/53f41c2a/attachment.htm</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
<br>
<br>
------------------------------<br>
<br>
End of midPoint Digest, Vol 118, Issue 34*****************************************</p>
</blockquote>
<p><br>
<br></p>
</body>
</html>