Long running delete objects.

0
Hello, I have a microflow that at one point deletes roughly 6k objects,  this object is associated to 6 other entities, rules in the Domain Model dictate that it delete these as well. This microflow delete action is hanging for quite a few minutes (local – havent tested Mx Cloud yet)   What can I do to alleviate some of this long running?
asked
3 answers
1

With these kinds of amounts and in general in bulk actions it's best to clean up the objects from bottom up instead of relying on the delete behaviour. It will probably finish, or your runtime will run out of memory. Just wait it out and remodel your microflow for a next time.

 

answered
1

You could look at using a queue – using the Queue or ProcessQueue modules in the App Store. This could be used to move the deleting to the background allowing your initial microflow to return quickly.

answered
1

A possible solution could be a boolean (e.g. ToDelete)  on your first level childs (or parent) to indicate they should be deleted/not considdered. Toggle the boolean of that object(parent) or the first level children that need to be removed, and make small adjustments on your top level parent to not take that data in considderation anymore.

Newly created object will have that boolean to false so those are the ones that should be used in your logic and ofcourse their childs as well.

This way of working gives you the oppertunity to delete the marked data that should be deleted with a scheduled event if you like.

answered