First of all, many thanks for the excellent and clear unit test. This really helps a lot.
So:
- I changed the process slightly (while still showing the exception) to have an end event after the signal throw. It doesn't make sense for the currently called process instance, as you would have 2 times the user task 'use the file' active
- The problem is caused by having both the throw and the boundary event in the same transaction. Well technically, the boundary is destroyed and the signal is created. The problem is that this is done using the same executionEntity. Which is why the engine chokes on it. The good news is that we fixed this in version 6 (the test ran green directly), cause there we introduce an execution for the boundary event specifically. The bad news is that this is hard to fix on v5.
- There is a a more elegant workaround on v5 though is to make the signal throw async. That way, the boundary event will be destroyed in one transaction and the throw will happen in the next one.