Details
-
Improvement
-
Status: Closed
-
High
-
Resolution: Fixed
-
None
-
None
Description
SCXMLExecutor currently doesn't handle runtime exceptions which might be thrown during the execution of specific SCXML tasks, actions or otherwise.
Exception to this is the handling of SCXMLExpressionException but any other exception during execution simply falls out of the SCXMLExecutor.
In addition, if any error (or catched SCXMLExpressionException) is encountered, this is logged through the ErrorReporter, however there is no (provided) way to detect such errors afterwards.
To be sure the SCXML execution ran through without errors, some kind of extended/intercepted handling of the ErrorReporter must be provided, which records such errors so that afterwards they (or at least the first) can be accessed and further processing be done on.
The proposed SCXMLExecutor wrapper should catch any exception from the underlying SCXMLExecutor, and at least mark its state to something like invalidState which can be 'queried' afterwards.
In addition, for all the #go, #reset, #triggerEvent and #triggerEvents methods, convenient boolean #tryGo, #tryReset, etc. methods should be provided which do not throw any exception but return true if no Exception AND no Error occurred.
In case these #try methods return false, a #getExecutionException() and #getExecutionError() (first error) method can be used to retrieve them.
Note: the wrapper does not / should not extend SCXMLExecutor itself, but merely provide a wrapper as well as still provide access to the underlying SCXMLExecutor (#getSCXMLExecutor) so its other methods like #getCurrentStatus() etc. still can be accessed without duplicating these on the wrapper class.