[midPoint] Idiot question concerning date/time handling

Collins, Kevin K.J.Collins at hw.ac.uk
Fri Apr 17 09:50:16 CEST 2020


Chris,


You're right. The <target>s are unnecessary! What devilish magic is this? How does it know which value is which? Does Midpoint come with its own supply of holy water or something like that to perform these miracles?


-Kev (somewhat astonished!)

________________________________
From: midPoint <midpoint-bounces at lists.evolveum.com> on behalf of Collins, Kevin <K.J.Collins at hw.ac.uk>
Sent: 17 April 2020 08:45
To: midPoint General Discussion <midpoint at lists.evolveum.com>; Pálos Gustáv <gustav.palos at gmail.com>
Subject: Re: [midPoint] Idiot question concerning date/time handling

Chris,


Thanks. I'll give that a try too.


-Kev

________________________________
From: midPoint <midpoint-bounces at lists.evolveum.com> on behalf of Chris Woods <chris at cmwoods.com>
Sent: 17 April 2020 08:42
To: midPoint General Discussion <midpoint at lists.evolveum.com>; Pálos Gustáv <gustav.palos at gmail.com>
Subject: Re: [midPoint] Idiot question concerning date/time handling

Hi,
In addition, I think the <target>s are unnecessary in the activation block as the target is implicit.

Regards,
Chris


Am 17. April 2020 08:53:32 schrieb Pálos Gustáv <gustav.palos at gmail.com>:

Hi Kevin,

yes you need to convert it, like this:
<expression>
  <script>
    <code>basic.parseDateTime("yyyy-MM-dd HH:mm:ss", "2020-04-17 07:00:00")</code>
  </script>
</expression>

Best regards,

Gustav


pi 17. 4. 2020 o 8:18 Collins, Kevin <K.J.Collins at hw.ac.uk<mailto:K.J.Collins at hw.ac.uk>> napísal(a):
Hi everyone,


I hope that everyone is well and coping with the new working patterns that many of us have had to adopt.

I have a question that may have been answered previously, but I can't find it.

The "source of truth" for user data is in a Postgresql table with start_date and end_date supplied. The columns for start_date and end_date are defined in the table as "timestamp without timezone" and take the form "yyyy-MM-dd HH:mm:ss", (example "2020-04-17 07:00:00").

I'm trying to set up activation for any users coming in from this data feed so that Midpoint knows when it's time to create, activate, suspend or archive the user account. I have got the MidPoint database table connector connecting to the database and can import some attributes. However, I can't get the start_date into validFrom and end_date into validTo.

=-=-=-=-=-=-=-=
<activation>
                    <validFrom>
                        <inbound>
                            <authoritative>true</authoritative>
                            <exclusive>false</exclusive>
                            <strength>normal</strength>
                            <source>
                                <c:path>$account/attributes/start_date</c:path>
                            </source>
                            <target>
                                <c:path>$focus/activation/validFrom</c:path>
                            </target>
                        </inbound>
                    </validFrom>
                    <validTo>
                        <inbound>
                            <authoritative>true</authoritative>
                            <exclusive>false</exclusive>
                            <strength>normal</strength>
                            <source>
                                <c:path>$account/attributes/end_date</c:path>
                            </source>
                            <target>
                                <c:path>$focus/activation/validTo</c:path>
                            </target>
                        </inbound>
                    </validTo>
                </activation>


=-=-=-=-=-=-=-=

(And I haven't got a clue - yet!! - as to how to determine the administrative status from these dates. I think that it should be "undefined" to allow Midpoint to make the decision).

Do I have to convert the dates from Postgresql's timestamp-without-timezone into something else?

Help would be appreciated with this PoC.

Stay safe, stay well !!


Regards,

-Kev_C


--
Kevin Collins,
Edinburgh,
Scotland, UK


________________________________

Founded in 1821, Heriot-Watt is a leader in ideas and solutions. With campuses and students across the entire globe we span the world, delivering innovation and educational excellence in business, engineering, design and the physical, social and life sciences. This email is generated from the Heriot-Watt University Group, which includes:

  1.  Heriot-Watt University, a Scottish charity registered under number SC000278
  2.  Heriot- Watt Services Limited (Oriam), Scotland's national performance centre for sport. Heriot-Watt Services Limited is a private limited company registered is Scotland with registered number SC271030 and registered office at Research & Enterprise Services Heriot-Watt University, Riccarton, Edinburgh, EH14 4AS.

The contents (including any attachments) are confidential. If you are not the intended recipient of this e-mail, any disclosure, copying, distribution or use of its contents is strictly prohibited, and you should please notify the sender immediately and then delete it (including any attachments) from your system.

_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com<mailto:midPoint at lists.evolveum.com>
https://lists.evolveum.com/mailman/listinfo/midpoint


--
s pozdravom

Gustáv Pálos
_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com<mailto:midPoint%40lists.evolveum.com>
https://lists.evolveum.com/mailman/listinfo/midpoint

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200417/83a36698/attachment.htm>


More information about the midPoint mailing list