Best way to stop 2 microflows running at the same time
I have 2 scheduled events, A and B. I want to make sure A never runs at the same time as B (B gets preference). A is scheduled to run every 5 min, and B is scheduled for every 30 min. Adding both these microflows to the async java action solves the problem, but because A runs every 5 minutes, it's scheduling too many task throughout the day, which causes delays on other microflows. I also tried creating a scheduled event helper entity, which I set at the start of B, and then do numerous checks in A for this entity. What I am observing is even though I change and commit the entity in B, when it is retrieved in A the boolean still returns false. So you can't use one data object in 2 seperate microflows? I assume this is to protect errors in the database? Or am I doing something wrong? Any help would be appreciated :-)
As all commits will be effectatued at the end of the microflow process A might not know that B is running.
I can think of 2 ways to solve this issue:
Process B acquires a lock and releases it and process A waits for this lock to be free (set on some general object for the scheduler).
If the time schedule is fixed, you already know in advance when B kicks in and you simply dont run A at this time