Hi Vadym,
This is not possible other than the way you describe. The reason is that before any listeners for the boundary events are executed, the activity instance it is attached to in case of a cancelling boundary event is already cancelled including removal of the execution. For a non-interrupting event, the execution still exists, yet there is no currently no way to identify it unambiguously. What's the use case you need it for?
Cheers,
Thorben