Prevent to start twice workflows for the same business object
I've created a new workflow to approve donation orders, I need that this workflow starts when someone create or change some donation order. So I've configured the start condition for CHANGED and CREATED events of BUS2032, as you can see in below image. But now I need to check at the start in CHANGED event if there is other workflow already started (that was not concluded) for the current order. I don't have any idea how to do this check, someone already faced or have some idea to solve this issue?
You can add a check function module on the event linkage in SWE2, in it check that the is no active workflow for the specific object, and if there is, raise an exception and the workflow process will not start again.
you can use the sap_wapi_workitems_to_object function module to check the relevant workflow.