How to create a change object activity after some time as an automation?

0
I have a reservation platform application and I want a person's reservation to be deleted after a certain period of time, example reservation set to begin at 2 PM and duration being 2 hours at 4 PM it should "free up" a spot and also delete that reservation.   I have looked into the scheduled events,microflow timer and the workflow but cannot get any of them to work like I want since I have two entities connected, my Reservation and ChargingStation entities since they are connected when a reservation on a charging station ends that reservation should be deleted and the availability of that charger should be increased.    I have looked into having a microflow check every minute for example if the endTime < currentTime but cannot get it to run since there are two entities...   Any ideas?  This is crucial to the functionality of my app as later I want to set up a progress bar which would also countdown   Thanks :)
asked
2 answers
0

I think using a scheduled event is probably the best approach.

 

I would precalculate the expiry datetime and store this in the Reservation entity. In the scheduled event just search for any Reservation that has gone past the expiry date time. I assume you have an association between the two entities, so retrieve the ChargingStation, increment the count and commit, then delete the Reservation.

 

I hope this helps. Good luck.

answered
0

image.pngThis is how my CheckFinishedReservations microflow looks like with two parameters, in my domain model reservation and charging station are connected

image.png

answered