-
Bug Report
-
Resolution: Unresolved
-
L3 - Default
-
None
-
7.14.6, 7.15.0
-
None
-
None
Environment (Required on creation):
7.15.0 and 7.14.6 but should be reproducible with older versions as well.
Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):
When I throw a BPMN error from a script executed by an activity end listener the activity state written to ACT_HI_ACTINST.ACT_INST_STATE_ is incorrect (0 instead of 2; 0=default, 2=canceled). The state is updated correctly in Runtime and the process executes as expected. However, the updated state is never written to history.
Steps to reproduce (Required on creation):
- Throw BPMN error from end listener (see attached BPMN model)
- In Cockpit, history view shows an active token on the activity which was canceled
- DB table ACT_HI_ACTINST contains no END_TIME_, no DURATION_ and incorrect value for ACT_INST_STATE_ for canceled activity
Expected behavior (Required on creation):
- Activity state in history is correct (ACT_INST_STATE_ = 2)
- Cockpit shows a finished token instead of active for canceled activity
Root Cause (Required on prioritization):
The custom listener is invoked here. Throwing an exception here will cause other listeners to be skipped including the one that produces the history event. In addition, the activity instance is also not cancelled anymore (and therefore the history end listener is not inveokd) when the catching error event is triggered.
Solution Ideas (Optional):
Two options:
- The history for cancellation is written during the completion of the activity (i.e. after the BpmnError is thrown)
- When the error is propagated and caught, the activity instance is cancelled properly (and this way invokes the history end listener); this may require undoing the activity instance state after the listener fails; it also requires a solution to not get stuck in an infinite loop, i.e. the listener that threw the Bpmn error should not be triggered again
Hints (Optional):
This is the controller panel for Smart Panels app
- is related to
-
CAM-5399 I can throw a BpmnError from listeners
- Closed