Class AbstractSTMTransitionAction<StateEntityType extends StateEntity,PayloadType>
java.lang.Object
org.chenile.workflow.service.stmcmds.AbstractSTMTransitionAction<StateEntityType,PayloadType>
- Type Parameters:
StateEntityType
- the sub-type of the state entityPayloadType
- the type of payload
- All Implemented Interfaces:
STMTransitionAction<StateEntityType>
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
doTransition
(StateEntityType stateEntity, Object transitionParam, State startState, String eventId, State endState, STMInternalTransitionInvoker<?> stm, Transition transition) abstract void
transitionTo
(StateEntityType stateEntity, PayloadType transitionParam, State startState, String eventId, State endState, STMInternalTransitionInvoker<?> stm, Transition transition) Implement this method to start using your expected payload type.
-
Constructor Details
-
AbstractSTMTransitionAction
public AbstractSTMTransitionAction()
-
-
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:
doTransition
in 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.
-