Class AbstractSTMTransitionAction<StateEntityType extends StateEntity, PayloadType>
java.lang.Object
org.chenile.workflow.service.stmcmds.AbstractSTMTransitionAction<StateEntityType, PayloadType>
- All Implemented Interfaces:
STMTransitionAction<StateEntityType>
- Direct Known Subclasses:
ActivateAction, BaseProcessAction, DefaultSTMTransitionAction, DoneSuccessfullyAction, SecondSTMTransitionAction, SplitDoneAction, StatusUpdateAction, SubProcessDoneSuccessfullyAction
public abstract class AbstractSTMTransitionAction<StateEntityType extends StateEntity, PayloadType>
extends Object
implements STMTransitionAction<StateEntityType>
STMTransitionAction uses Object as a payload type. Hence it is
impossible to infer the precise Payload type from the implementation of STMTransition Action. This class
serves as a bridge for sub-classes to enforce a Paylaod Type. By extending this class, sub-classes
declare the precise Payload Type that they expect.
Without this class. Payload type had to be declared in the STM configuration. The blue print
for STM assumes that all STM Transition Actions extend this class. This action is instantiated in
spring using a convention that allows it to be discovered by STMTransitionActionResolver.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) MultipleCommandsRegistry<StateEntityType, PayloadType> -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSTMTransitionAction(MultipleCommandsRegistry<StateEntityType, PayloadType> multipleCommandsRegistry) -
Method Summary
Modifier and TypeMethodDescriptionfinal voiddoTransition(StateEntityType stateEntity, Object transitionParam, State startState, String eventId, State endState, STMInternalTransitionInvoker<?> stm, Transition transition) abstract voidtransitionTo(StateEntityType stateEntity, PayloadType transitionParam, State startState, String eventId, State endState, STMInternalTransitionInvoker<?> stm, Transition transition) Implement this method to start using your expected payload type.
-
Field Details
-
multipleCommandsRegistry
MultipleCommandsRegistry<StateEntityType extends StateEntity, PayloadType> multipleCommandsRegistry
-
-
Constructor Details
-
AbstractSTMTransitionAction
public AbstractSTMTransitionAction() -
AbstractSTMTransitionAction
public AbstractSTMTransitionAction(MultipleCommandsRegistry<StateEntityType, PayloadType> multipleCommandsRegistry)
-
-
Method Details
-
doTransition
public final void doTransition(StateEntityType stateEntity, Object transitionParam, State startState, String eventId, State endState, STMInternalTransitionInvoker<?> stm, Transition transition) throws Exception - Specified by:
doTransitionin interfaceSTMTransitionAction<StateEntityType extends StateEntity>- Throws:
Exception
-
transitionTo
public abstract void transitionTo(StateEntityType stateEntity, PayloadType transitionParam, State startState, String eventId, State endState, STMInternalTransitionInvoker<?> stm, Transition transition) throws Exception Implement this method to start using your expected payload type.- Parameters:
stateEntity- the state entity that has been passed to STMtransitionParam- The transition param with the correct payload typestartState- state at which the event occurredeventId- the event that happenedendState- the end statestm- this is for invoking other STMstransition- the definition of the entire transition in the STM configuration- Throws:
Exception- if an exception occurs.
-