Greetings guys, I have a requirement that has to do with field service and I've met a really strange situation.
My client wants a .doc file to generate and attached to a bookable resource booking every time that its field "booking's status" turns to "Completed". For that I used a workflow with a SetWordTemplate action, and it works great. The status turns to "Completed" and voila a single .doc file is generated and attaches to the booking. Perfect.
Now, I have to say that besides that workflow, the field "booking status" update triggers a (synchronous) plugin as well. Moreover we have several plugins running on updates of different fields of the booking other than the status (let's say that one of them is the field "Return Time"). When the user fills the "Return Time" field with a value, sets the booking status to "completed" and saves the entity, two plugins are running on the background. It takes some time but they do their work as planned. However, to my unwelcome surprise, when they complete, there are several identical.doc files attached to the booking. The worfklow is supposed to run only once though, and it seems the delay of the plugins run have caused the flow to run multiple times. Now if I update only the "Return Time" field and save, then update the booking status to complete and save, only one .doc is generated. Any idea why is this happening and how I can face it?
PS: The plugins do not update the field booking status somewhere, there's no loop.