<div dir="ltr"><div>Hi,</div><div><br></div><div>you can use attribute objectClass instead of intent like this:</div><div><br></div><div>switch (objectClass) {<br>    case ObjectClass.ACCOUNT_NAME:<br>        //TODO<br>        break;<br>    case "AccountApplication2":<br>          //TODO<br>        break;<br>    case "AccountApplication3":<br>          //TODO<br>        break;<br>    default:<br>        throw new ConnectorException("Unknown object class $objectClass");<br>} <br></div><div><br></div><div>Best regards,</div><div><br></div><div>Gustav</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ut 18. 2. 2020 o 15:58 Loïc Schamber <<a href="mailto:lschamber@serial.ch">lschamber@serial.ch</a>> napísal(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="FR-CH">
<div class="gmail-m_-3105518300543881645WordSection1">
<p class="MsoNormal">Hi everyone,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="EN-GB">I am currently deploying midpoint and I am using the ”ConnId com.evolveum.polygon.connector.scripted.sql.ScriptedSQLConnector v2.1“<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I have to manage account for multiple custom application, but all those applications use on the same database to manage accounts.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">So I have a table called USER_ACCOUNTS where the key composed of two fields : the name of the user and the name of the application. This table also have multiple other fields to store user data (Phone number, mail, ..)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">If an user have multiple account, he will be inserted multiple time in this table with different applications names.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">What I was planning to do is to use multiple account intents to allow an user having multiple account on the ScriptedSQL resource.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">As the APP name is a field the database  table I also managed it as a schema attribute (app_name) and the outbound mapping of this attribute was the AppName. (Which is the same as the intent name)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">It is working for the CreateScript.groovy as I get all the required attributes  to create the user but I have a problem with the Update and Delete scripts:
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">In the delete script, no user attributes are given except the user uid and in the update script, only the attributes that need to be updated are passed to the script. So I cannot retrieve the application name from the
 attribute (Which I did in the create script).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">In the same way, I don’t seems to be able to retrieve the intent on the scripts, so I can not use it either.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Is there a way to retrieve intent on the ScriptedSQL scripts, so I can use it to manage different account type in groovy scripts?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I also cannot use the DatabaseTable connector because I need to update multiple tables on the database when inserting an user.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I will add that I am not the one in charge of the database architecture and I am not able to change it.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thanks for your help,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="3" valign="top" style="padding:0cm">
<p class="MsoNormal"><b><span lang="EN-GB" style="font-size:10pt;font-family:Tahoma,sans-serif;color:rgb(226,45,54)">Loïc Schamber</span></b><span lang="EN-GB">
</span><span lang="EN-GB" style="font-size:10pt;font-family:Tahoma,sans-serif;color:rgb(145,145,145)"> | Junior IT Consultant<br>
 </span><span lang="EN-GB"> <u></u><u></u></span></p>
</td>
</tr>
<tr>
<td width="188" valign="top" style="width:141pt;border-top:none;border-bottom:none;border-left:none;border-right:1.5pt solid rgb(226,45,54);padding:0cm">
<p class="MsoNormal"><a href="https://www.serial.ch/" target="_blank"><span style="color:blue;text-decoration:none"><img border="0" width="193" height="69" style="width: 2.0104in; height: 0.7187in;" id="gmail-m_-3105518300543881645_x0000_i1028" src="cid:1705c5479bc4cff311" alt="logo"></span></a><span><u></u><u></u></span></p>
</td>
<td width="10" style="width:7.5pt;padding:0cm">
<p class="MsoNormal"><span> <u></u><u></u></span></p>
</td>
<td width="497" valign="top" style="width:372.75pt;padding:0cm">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Tahoma,sans-serif;color:rgb(226,45,54)"><a href="mailto:lschamber@serial.ch" target="_blank"><span style="color:rgb(226,45,54)">lschamber@serial.ch</span></a>
 |  <a href="tel:+41%2022%20555%2027%2069" target="_blank"><span style="color:rgb(145,145,145)">+41 22 555 27 69</span></a>
<br>
</span><span style="font-size:9pt;font-family:Tahoma,sans-serif;color:rgb(145,145,145)">Chemin du Pré-Fleuri 5 – CH 1228 Plan-les-Ouates
<u></u><u></u></span></p>
</td>
</tr>
<tr>
<td valign="bottom" style="border-top:none;border-bottom:none;border-left:none;border-right:1.5pt solid rgb(226,45,54);padding:0cm">
<p class="MsoNormal"><a href="https://www.linkedin.com/company/redcactus-by-positivethinkingcompany" target="_blank"><span style="color:blue;text-decoration:none"><img border="0" width="19" height="19" style="width: 0.1979in; height: 0.1979in;" id="gmail-m_-3105518300543881645_x0000_i1027" src="cid:1705c5479bd5b16b22" alt="LinkedIn"></span></a><span> 
</span><a href="https://www.instagram.com/positivethinkingcompany" target="_blank"><span style="color:blue;text-decoration:none"><img border="0" width="19" height="19" style="width: 0.1979in; height: 0.1979in;" id="gmail-m_-3105518300543881645_x0000_i1026" src="cid:1705c5479bd692e333" alt="Instagram"></span></a><span><u></u><u></u></span></p>
</td>
<td valign="bottom" style="padding:0cm"></td>
<td valign="bottom" style="padding:0cm">
<p class="MsoNormal"><span><a href="http://www.serial.ch" target="_blank"><b><span lang="EN-GB" style="font-size:9pt;font-family:Tahoma,sans-serif;color:rgb(226,45,54)">Redcactus by SERIAL
</span></b><span lang="EN-GB" style="font-size:9pt;font-family:Tahoma,sans-serif;color:rgb(226,45,54)">www.serial.ch</span></a></span><span lang="EN-GB"><br>
</span><span><a href="http://www.positivethinking.co" target="_blank"><span lang="EN-GB" style="font-size:9pt;font-family:Tahoma,sans-serif;color:rgb(145,145,145)">www.positivethinking.co</span></a></span><span lang="EN-GB"><br>
</span><span lang="EN-GB" style="font-size:3.5pt;font-family:Tahoma,sans-serif;color:rgb(145,145,145)"> </span><span lang="EN-GB"><u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
<div class="MsoNormal" align="center" style="text-align:center"><span>
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal"><b><span lang="EN-GB" style="font-size:8pt;font-family:Roboto;color:rgb(226,45,54)">Help save paper, do you really need to print this email?</span></b><span lang="EN-GB"><br>
</span><i><span lang="EN-GB" style="font-size:8pt;font-family:Roboto;color:black">The content of this email and any attachments are confidential and are intended solely for the person and/or company to whom they are addressed. The
 information may also be legally privileged. No employee or agent is authorized to conclude any binding agreement on behalf of SERIAL with another party by email without express written confirmation. If you have received this email in error, any use, reproduction
 or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by return E-mail and delete this message, its attachments and all copies from your system. Internet communications cannot
 be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions.
</span></i><i><span style="font-size:8pt;font-family:Roboto;color:black">Thank you for your cooperation.<br>
 </span></i><u></u><u></u></p>
</div>
</div>

_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">s pozdravom<div><br></div><div>Gustáv Pálos</div></div></div>