[midPoint] csv to scriptedsql, some testing feedback

Jason Everling jeverling at bshp.edu
Tue Jan 31 17:29:17 CET 2017


Since the new scriptedsql resource will contain everyone and if a user is
not matched it will generate a midpoint account and then disable it.

We have a notification handler for modify success and new account
notification handler and with the new account notification I was able to
add a simple filter to it

basic.getExtensionPropertyValue(requestee, 'http://midpoint.bshp.edu/bshp',
'standing') == 'ACTIVE'

it works, without any notification sent.

What I did notice though, since it immediately disables the account after
it is created the 'modify' handler sends a notification because of the
status change. I was thinking of adding the below since I cannot use the
same filter above because we still want to send a notification when the
persons account gets disabled.

What I came up with, compare the createTimestamp of the user to the current
date, if they are equal then it does not send a notification.

               <code>
                    String createDateStr =
basic.formatDateTime("yyyy-MM-dd",
requestee?.getMetadata()?.getCreateTimestamp());
                    String currentDateStr =
basic.formatDateTime("yyyy-MM-dd", basic.currentDateTime());

createDateStr != currentDateStr &&
                    event.isRelatedToItem(new
com.evolveum.midpoint.prism.path.ItemPath("activation",
"administrativeStatus"))
                </code>

So the question, does the metadata portion of 'createTiemstamp' ever change
once the user is created in midpoint? I am assuming no, only the
'modifyTimestamp' .

On another note, I cannot believe I put this snippet together alone by
looking through the javadocs for date functions..

Thanks!
JASON
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170131/ca710598/attachment.htm>


More information about the midPoint mailing list