<div dir="ltr">Hello Ivan,<div><br></div><div>Indeed that was one of the points of failure - we mapped the icfs name attribute to the name attribute on midpoint, and UID attribute to the attribute we desired to map as inbound from our database. This solved the problem from the midPoint perspective.</div><div><br></div><div>Something else worth commenting, when the SQL call is performed in Groovy, do not use '{' and '}' as enclosure tokens for the DML statement as this seems to break the syntax. (This is at least valid for the sql.call method).</div><div><br></div><div>Thanks,</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><font face="arial, helvetica, sans-serif"><b>Rodrigo Yanis.</b><br><img src="http://www.identicum.com/img/favicon.ico">Identicum S.A.<br></font>Jorge Newbery 3226<br>Tel: +54 (11) 4824-9971<font face="arial, helvetica, sans-serif"><br><a href="mailto:ryanis@identicum.com" target="_blank"><font color="#0b5394">ryanis@identicum.com</font></a><br><a href="http://www.identicum.com/" target="_blank"><font color="#0b5394">www.identicum.com</font></a></font></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2016-08-31 5:32 GMT-03:00 Ivan Noris <span dir="ltr"><<a href="mailto:ivan.noris@evolveum.com" target="_blank">ivan.noris@evolveum.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<p>Rodrigo,</p>
<p>a wild guess: your outbound mappings in the resource are not
setting the mandatory attributes, i.e. icfs:name, when adding new
account. Could this be the case?<br>
</p>
Ivan<div><div class="h5"><br>
<br>
<div>On 08/30/2016 09:48 PM, Rodrigo Yanis
wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">Hello everyone,
<div><br>
</div>
<div>I'm currently trying to perform a call on a stored
procedure in my Oracle DB through a SQLScript resource. The
use case is as follows:</div>
<div>1. The resource is assigned to the user X</div>
<div>2. Resource performs a call to a stored procedure on the
database, sending one of the user attributes as a parameter
for the stored procedure to do its magic</div>
<div>3. Stored procedure outputs a value, and its written into a
different attribute on my midPoint user.</div>
<div><br>
</div>
<div>I've tried to do this by modifying the CreateScript in the
midPoint examples, here:</div>
<div><a href="https://github.com/Evolveum/midpoint/blob/master/samples/resources/scriptedsql/CreateScript.groovy" target="_blank">https://github.com/Evolveum/<wbr>midpoint/blob/master/samples/<wbr>resources/scriptedsql/<wbr>CreateScript.groovy</a><br>
</div>
<div><br>
</div>
<div>The script I've come up with is the following:</div>
<div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="1"><a href="http://log.info" target="_blank">log.info</a>("Entering
"+action+" Script");<br>
def sql = new Sql(connection);<br>
try {<br>
sql.call("{? = call STORED_PROCEDURE(?,
?)}",[Sql.VARCHAR, attributes?.get("pidm")?.get(<wbr>0),
Sql.VARCHAR])<br>
{<br>
alias -> return alias<br>
};<br>
}<br>
catch(all) {<br>
log.error("Exception in Stored Procedure
execution");<br>
}<br>
return "errorInCall";</font></blockquote>
</div>
<div>Stored procedure logic is out of the scope of this case.</div>
<div><br>
</div>
<div>I've configured the resource so it maps the "pidm"
attribute i'm requesting in my script to the user attribute in
midPoint. I've also mapped "alias" as an inbound attribute to
my attribute in midPoint.</div>
<div><br>
</div>
<div>Does this scenario make any sense to you? Is this being
approached correctly? Is there a way to perform a "set
attribute" on the script itself?</div>
<div><br>
</div>
<div>Right now I'm getting the following error in step 1. of the
use case I described:</div>
<div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="1">Error
executing changes for (account (default) on
<a>resource:e1054471-b559-4f13-<wbr>bc32-aec273c51e46(Banner</a>
Personas)): Couldn't add object. Schema violation: Schema
violation during processing shadow: shadow: null
(OID:null): Attempt to add shadow without any attributes:
shadow:null(null)<br>
</font><font size="1">com.evolveum.midpoint.util.<wbr>exception.SchemaException:
Couldn't add object. Schema violation: Schema violation
during processing shadow: shadow: null (OID:null): Attempt
to add shadow without any attributes: shadow:null(null)</font></blockquote>
<div><br>
</div>
<div>Thanks in advance,</div>
</div>
<div>
<div>
<div data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr"><br>
</div>
<div dir="ltr"><font face="arial,
helvetica, sans-serif"><b>Rodrigo
Yanis.</b><br>
<img src="http://www.identicum.com/img/favicon.ico">Identicum
S.A.<br>
</font>Jorge Newbery 3226<br>
Tel: +54 (11) 4824-9971<font face="arial, helvetica, sans-serif"><br>
<a href="mailto:ryanis@identicum.com" target="_blank"><font color="#0b5394">ryanis@identicum.com</font></a><br>
<a href="http://www.identicum.com/" target="_blank"><font color="#0b5394">www.identicum.com</font></a></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>______________________________<wbr>_________________
midPoint mailing list
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<pre cols="72">--
Ivan Noris
Senior Identity Engineer
<a href="http://evolveum.com" target="_blank">evolveum.com</a>
</pre>
</font></span></div>
<br>______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br></div>