[midPoint] Idiot question concerning date/time handling

Collins, Kevin K.J.Collins at hw.ac.uk
Fri Apr 17 10:11:05 CEST 2020


Davy,


Doh!! Obvious now that you come to explain it. Forgive me for being a bit dim-witted today.


-Kev

> On 17 Apr 2020, at 09:08, Davy Priem <davy.priem at vives.be> wrote:
> 
> Hi,
> 
> It’s because the date is contstructed withing the <validFrom> element, so it’s not necessary to specify it twice as a target.
> 
> For you question concerning Administrative Status. Effective Status is automatically calculated based on Administrative Status and ValidTo/ValidFrom. Plz see https://wiki.evolveum.com/display/midPoint/Activation <https://wiki.evolveum.com/display/midPoint/Activation>.
> 
> Best regards,
> Davy
> 
>> Op 17 apr. 2020, om 09:50 heeft Collins, Kevin <K.J.Collins at hw.ac.uk <mailto:K.J.Collins at hw.ac.uk>> het volgende geschreven:
>> 
>> 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 <mailto:midpoint-bounces at lists.evolveum.com>> on behalf of Collins, Kevin <K.J.Collins at hw.ac.uk <mailto:K.J.Collins at hw.ac.uk>>
>> Sent: 17 April 2020 08:45
>> To: midPoint General Discussion <midpoint at lists.evolveum.com <mailto:midpoint at lists.evolveum.com>>; Pálos Gustáv <gustav.palos at gmail.com <mailto: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 <mailto:midpoint-bounces at lists.evolveum.com>> on behalf of Chris Woods <chris at cmwoods.com <mailto:chris at cmwoods.com>>
>> Sent: 17 April 2020 08:42
>> To: midPoint General Discussion <midpoint at lists.evolveum.com <mailto:midpoint at lists.evolveum.com>>; Pálos Gustáv <gustav.palos at gmail.com <mailto: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 <mailto: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:
>>> Heriot-Watt University, a Scottish charity registered under number SC000278
>>> 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 <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 <https://lists.evolveum.com/mailman/listinfo/midpoint>
>> 
>> _______________________________________________
>> midPoint mailing list
>> midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>> https://lists.evolveum.com/mailman/listinfo/midpoint <https://lists.evolveum.com/mailman/listinfo/midpoint>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.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/0cba108e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Message signed with OpenPGP
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200417/0cba108e/attachment.sig>


More information about the midPoint mailing list