Handling undefined events and exceptions in Event Based Workflow
If you try to give an event when there is no transition, Event Based Workflow will throw an
io.toro.fluxengine.exception.runtime.UndefinedEventException. If you'd like to respond to events that are not
declared, you could create a transition with the $else event. This is useful when you have a dynamic value for
$fluxEvent.
Event Based Workflow also allows the catching of exceptions that may occur when a state's action is invoked.
To do this, create a transition with $exception.
Having this event provides the transition with an
additional input called $fluxException, a GloopModel of reference
io.toro.fluxengine.exception.runtime.Event Based WorkflowRuntimeException, that provides the details of the thrown exception.
In particular, these are its properties:
message- aStringthat contains the exception messagetype- aStringthat contains the simple class name of the exceptionclassName- aStringthat contains the class name of the exceptionrealException- anObjectthat contains the actual exceptionfluxStackTrace- aGloopModelarray of state and transition calls
fluxStackTrace contains an array of stacktrace elements that describes which states and transitions were invoked
from the start of a Event Based Workflow execution until the exception was thrown. A Event Based Workflow stacktrace element consists of the following
properties:
fluxName- name of the Event Based Workflow servicestateName- name of the invoked statetransition- event of the transition,nullif the stacktrace element pertains to a state invocationstateIndex- index of the state on the Event Based Workflow definition