10-28-2016 05:46 AM
02-24-2017 06:19 PM
You mention you dont want to use a try/catch block because you would have to change all your code, but even if you create a custom event type, you will need to change your code to throw such an event.
To be perfectly honest, the best approach is to wrap your script code in a try/catch block and throw a BpmnError. You can then catch this with a boundary error catch event and handle any roll back. using this approach, you can also take advantage of compensation events although it sounds as though your use case is relatively simple.
However, if you must dispatch a custom event, take a look at the ActivitiEventDispatcherTest.java test case.
This demonstrates how to dispatch a custom ActivitiEvent.
Also, the EventListenersConfigurationTest.java test case demonstrates how to build a listener for CUSTOM ActivitiEvent's.
Cheers,
Greg
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.