public interface FlowExecutionListener
flow
executions
.
An 'observer' that is very aspect like, allowing you to insert 'cross cutting' behavior at well-defined points within one or more well-defined flow execution lifecycles.
For example, one custom listener may apply security checks at the flow execution level, preventing a flow from starting or a state from entering if the current user does not have the necessary permissions. Another listener may track flow execution navigation history to support bread crumbs. Another may perform auditing, or setup and tear down connections to a transactional resource.
Note that flow execution listeners are registered with a flow execution when that execution is created by a
factory
or restored by a
FlowExecutionRepository
. Typically a listener will not be
registered with a flow execution at runtime, when the flow execution is already active.
FlowDefinition
,
StateDefinition
,
FlowExecution
,
RequestContext
,
Event
Modifier and Type | Method and Description |
---|---|
default void |
eventSignaled(RequestContext context,
Event event)
Called when an event is signaled in the current state, but prior to any state transition.
|
default void |
exceptionThrown(RequestContext context,
FlowExecutionException exception)
Called when an exception is thrown during a flow execution, before the exception is handled by any registered
handler . |
default void |
paused(RequestContext context)
Called when a flow execution is paused, for instance when it is waiting for user input (after event processing).
|
default void |
requestProcessed(RequestContext context)
Called when a client request has completed processing.
|
default void |
requestSubmitted(RequestContext context)
Called when any client request is submitted to manipulate this flow execution.
|
default void |
resuming(RequestContext context)
Called after a flow execution is successfully reactivated after pause (but before event processing).
|
default void |
sessionCreating(RequestContext context,
FlowDefinition definition)
Called to indicate a new flow definition session is about to be created.
|
default void |
sessionEnded(RequestContext context,
FlowSession session,
java.lang.String outcome,
AttributeMap<?> output)
Called when a flow execution session ends.
|
default void |
sessionEnding(RequestContext context,
FlowSession session,
java.lang.String outcome,
MutableAttributeMap<?> output)
Called when the active flow execution session has been asked to end but before it has ended.
|
default void |
sessionStarted(RequestContext context,
FlowSession session)
Called after a new flow session has started.
|
default void |
sessionStarting(RequestContext context,
FlowSession session,
MutableAttributeMap<?> input)
Called after a new flow session has been created but before it starts.
|
default void |
stateEntered(RequestContext context,
StateDefinition previousState,
StateDefinition state)
Called when a state transitions, after the transition occurred.
|
default void |
stateEntering(RequestContext context,
StateDefinition state)
Called when a state transitions, after the transition is matched but before the transition occurs.
|
default void |
transitionExecuting(RequestContext context,
TransitionDefinition transition)
Called when a transition is matched but before the transition occurs.
|
default void |
viewRendered(RequestContext context,
View view,
StateDefinition viewState)
Called after a view has completed rendering.
|
default void |
viewRendering(RequestContext context,
View view,
StateDefinition viewState)
Called when a view is about to render in a view-state, before any render actions are executed.
|
default void requestSubmitted(RequestContext context)
context
- the current flow request contextdefault void requestProcessed(RequestContext context)
context
- the source of the eventdefault void sessionCreating(RequestContext context, FlowDefinition definition)
context
- the current flow request contextdefinition
- the flow for which a new session is startingdefault void sessionStarting(RequestContext context, FlowSession session, MutableAttributeMap<?> input)
context
- the current flow request contextsession
- the session that was createdinput
- a mutable input map - attributes placed in this map are eligible for input mapping by the flow
definition at startupdefault void sessionStarted(RequestContext context, FlowSession session)
context
- the current flow request contextsession
- the session that was starteddefault void eventSignaled(RequestContext context, Event event)
context
- the current flow request contextevent
- the event that occurreddefault void transitionExecuting(RequestContext context, TransitionDefinition transition)
context
- the current flow request contexttransition
- the proposed transitiondefault void stateEntering(RequestContext context, StateDefinition state) throws EnterStateVetoException
context
- the current flow request contextstate
- the proposed state to transition toEnterStateVetoException
- when entering the state is not alloweddefault void stateEntered(RequestContext context, StateDefinition previousState, StateDefinition state)
context
- the current flow request contextpreviousState
- from state of the transitionstate
- to state of the transitiondefault void viewRendering(RequestContext context, View view, StateDefinition viewState)
context
- the current flow request contextview
- the view that is about to renderviewState
- the current view statedefault void viewRendered(RequestContext context, View view, StateDefinition viewState)
context
- the current flow request contextview
- the view that renderedviewState
- the current view statedefault void paused(RequestContext context)
context
- the current flow request contextdefault void resuming(RequestContext context)
context
- the current flow request contextdefault void sessionEnding(RequestContext context, FlowSession session, java.lang.String outcome, MutableAttributeMap<?> output)
context
- the current flow request contextsession
- the current active session that is endingoutcome
- the outcome reached by the ending session, generally the id of the terminating end-stateoutput
- the flow output produced by the ending session, this map may be modified by this listener to affect
the output returneddefault void sessionEnded(RequestContext context, FlowSession session, java.lang.String outcome, AttributeMap<?> output)
context
- the current flow request contextsession
- ending flow sessionoutcome
- the outcome reached by the ended session, generally the id of the terminating end-stateoutput
- the flow output returned by the ending sessiondefault void exceptionThrown(RequestContext context, FlowExecutionException exception)
handler
.context
- the current flow request contextexception
- the exception that occurred