I think this is what you are currently trying is:
Issue with such diagram is that the Exclusive gateway (Gateway2) will let the process continue without aborting existing task (Exclusive gateway doesn’t do any check nor implement any logic). So you can end up in a situation where two instances of “Step C” are executed.
The solution I would suggest is to move the part with the gateway to a sub process that will finish with “terminate end event”. Compare to “end event” the main difference is that, once reach, such event terminate the process immediately killing all remaining tasks. So such design should cover your needs:
Can you open another question that focus on this error about exchange of document between parent and sub-process?
Also in order to be able to help, can you share full log file content and the process you are using? You can use on online file sharing solution such as Dropbox or Google Drive.
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.