Class BaseTransitionAction<T extends StateEntity>
- Type Parameters:
T
- - the state entity
- All Implemented Interfaces:
STMTransitionAction<T>
STM
supports a default transition action. If an event is not mapped to an
STMTransitionAction
then the default transition action is invoked.
This class is a good candidate to act as the default transition action. It provides the following functionality:
It can provide a bridge to the OWIZ framework. If an OWIZ Command
is configured or an
OWIZ OrchExecutor
is configured in the metadata of the transition, then those are invoked.
It also supports if an OWIZ XML is specified. It instantiates the OrchExecutor based on the XML
and executes the OrchExecutor.
If an ActivityChecker
is injected into this command, then it can log all MANDATORY
and OPTIONAL activities. It can also check that all activities are completed if the transition
is of type COMPLETION_CHECKER.
It can invoke a default transition command if injected with an STMTransitionActionResolver
.
The resolver provides a component without it being specified as a componentName in the transition.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThis field needs to be set to enable activity management.private ApplicationContext
protected Map<String,
OrchExecutor<TransitionContext<T>>> private STMTransitionActionResolver
-
Constructor Summary
ConstructorsConstructorDescriptionBaseTransitionAction
(STMTransitionActionResolver stmTransitionActionResolver) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
doActivityManagement
(T entity, Object transitionParam, State startState, String eventId, Transition transition) final void
doTransition
(T entity, Object transitionParam, State startState, String eventId, State endState, STMInternalTransitionInvoker<?> stm, Transition transition) protected OrchExecutor<TransitionContext<T>>
obtainOrchExecutor
(String microActionsXml) protected void
processMicroactions
(String microActionsXml, TransitionContext<T> context) void
transition
(T entity, Object transitionParam, State startState, String eventId, State endState, STMInternalTransitionInvoker<?> stm, Transition transition)
-
Field Details
-
stmTransitionActionResolver
-
applicationContext
-
activityChecker
This field needs to be set to enable activity management. Else it defaults to doing nothing. -
orchMap
-
-
Constructor Details
-
BaseTransitionAction
public BaseTransitionAction() -
BaseTransitionAction
-
-
Method Details
-
doTransition
public final void doTransition(T entity, Object transitionParam, State startState, String eventId, State endState, STMInternalTransitionInvoker<?> stm, Transition transition) throws Exception - Specified by:
doTransition
in interfaceSTMTransitionAction<T extends StateEntity>
- Throws:
Exception
-
processMicroactions
protected void processMicroactions(String microActionsXml, TransitionContext<T> context) throws Exception - Throws:
Exception
-
obtainOrchExecutor
-
transition
public void transition(T entity, Object transitionParam, State startState, String eventId, State endState, STMInternalTransitionInvoker<?> stm, Transition transition) throws Exception - Throws:
Exception
-
doActivityManagement
private void doActivityManagement(T entity, Object transitionParam, State startState, String eventId, Transition transition)
-