[midPoint] Problem with java script with dates

Andrea Picconi andrea.picconi at innovery.net
Tue Jan 5 15:51:50 CET 2021


Hi all,

we have a problem with an operation that should lead to outbound on an Oracle DB the furthest date in time between three dates that we have as values on MIDPOINT.
First example below just works if only one of the three (dates) attribute field is populated, when we have two fields populated it gives us an error:

<script xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3">
    <code>
        import java.text.SimpleDateFormat;
        import java.text.DateFormat;

        graceful = Date1;
        if (Date2 != null) {
            if (graceful == null || Date2 > graceful) {
            graceful = Date2; }
            }
        else if (Date3 != null) {
            if (graceful == null || Date3 > graceful) {
            graceful = Date3; }
            }
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
        return df.format(com.evolveum.midpoint.util.MiscUtil.asDate(graceful));
    </code>
</script>

Below, instead, the error when we try with two or more fields populated:

[cid:image003.png at 01D6E378.995CE130]

Any idea how to resolve it?

Thank you and regards,

Andrea Picconi
IAM (Identity Access Management)

[Innovery]
Skype: precons
T:  +39 06 51963439 (int. 196)

Strada Quattro Palazzina A6 c/o Centro Direzionale Milanofiori, 20057 Assago (MI).
www.innovery.net<http://www.innovery.net/> |  T: +39 06 519 63 439

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20210105/291d6ecd/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 47210 bytes
Desc: image003.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20210105/291d6ecd/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 8058 bytes
Desc: image004.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20210105/291d6ecd/attachment-0003.png>


More information about the midPoint mailing list