Avoid 2 microflow running at together at any time

1
having 2 microflows.  microflow 1 runs a task which requires to put objects in maintenance mode. this is run manually by user at any given time. microflow 2 , this run every 30 mins and removes all objects from maintenance. so when microflow 1 is running, microflow 2 should not remove those objects from maintenance.  is it possible ?
asked
1 answers
-1

Hi JP,

 

Yes, this is possible.

 

Create an entity and call it MaintenanceModeHelper and create an attribute of type boolean in it and name it as LockStatus or anything that you prefer.

 

When your microflow1 starts execution, change the value of the boolean attribute to True and mark it false when it is finishes execution. Make sure to commit the MaintenanceModeHelper Entity object on both changes.

 

Now, update the logic in your microflow2 to check is the LockStatus attribute, continue with the work it is supposed to do if it is False. If it is True, you can end the flow or maybe add logic to retry in a couple of seconds or minutes based on your requirement.

 

Hope this helps.

answered