Class StmBodyTypeSelector
java.lang.Object
org.chenile.workflow.service.stmcmds.StmBodyTypeSelector
- All Implemented Interfaces:
Command<ChenileExchange>
Selects the body type of the
ChenileExchange based on the event Id passed
This should be used as the body type selector for the StateEntityServiceImpl.process(org.chenile.stm.StateEntity, String, Object)
method. Will work with all subclasses.
Assumptions:- Second parameter for the process method will be mapped to a header parameter called "eventId".
- The body type has been defined in the stm in a states/event-information section. eventId must be mapped to meta attribute called "meta-bodyType"
- Author:
- Raja Shankar Kolluru
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String, StmBodyTypeSelector.EventData> private final STMActionsInfoProviderprivate STMTransitionActionResolver -
Constructor Summary
ConstructorsConstructorDescriptionStmBodyTypeSelector(STMActionsInfoProvider stmActionsInfoProvider) StmBodyTypeSelector(STMActionsInfoProvider stmActionsInfoProvider, STMTransitionActionResolver stmTransitionActionResolver) -
Method Summary
Modifier and TypeMethodDescriptionprivate tools.jackson.core.type.TypeReference<?> checkIfPayloadTypeCanBeDerived(String eventId) This method works only if the eventID is the same as the name of the STMTransitionAction in the bean factory.voidexecute(ChenileExchange exchange) tools.jackson.core.type.TypeReference<?> getPayloadBodyType(String eventId) void
-
Field Details
-
stmTransitionActionResolver
-
stmActionsInfoProvider
-
configs
-
-
Constructor Details
-
StmBodyTypeSelector
-
StmBodyTypeSelector
public StmBodyTypeSelector(STMActionsInfoProvider stmActionsInfoProvider, STMTransitionActionResolver stmTransitionActionResolver)
-
-
Method Details
-
storeBodyTypeSelector
public void storeBodyTypeSelector() -
execute
- Specified by:
executein interfaceCommand<ChenileExchange>- Throws:
Exception
-
getPayloadBodyType
public tools.jackson.core.type.TypeReference<?> getPayloadBodyType(String eventId) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
checkIfPayloadTypeCanBeDerived
This method works only if the eventID is the same as the name of the STMTransitionAction in the bean factory. It only works if the STMTransitionAction extendsAbstractSTMTransitionAction. It computes the body type from the second argument of theAbstractSTMTransitionAction.transitionTo(StateEntityType, PayloadType, State, String, State, STMInternalTransitionInvoker, Transition)method that was overridden by the transition action. -
getConfigs
-