Class StateMachineTransitionBuilder<S,E>
java.lang.Object
org.springframework.statemachine.config.common.annotation.AbstractAnnotationBuilder<O>
org.springframework.statemachine.config.common.annotation.AbstractConfiguredAnnotationBuilder<TransitionsData<S,E>,StateMachineTransitionConfigurer<S,E>,StateMachineTransitionBuilder<S,E>>
org.springframework.statemachine.config.builders.StateMachineTransitionBuilder<S,E>
- Type Parameters:
S- the type of stateE- the type of event
- All Implemented Interfaces:
StateMachineTransitionConfigurer<S,,E> AnnotationBuilder<TransitionsData<S,E>>
public class StateMachineTransitionBuilder<S,E>
extends AbstractConfiguredAnnotationBuilder<TransitionsData<S,E>,StateMachineTransitionConfigurer<S,E>,StateMachineTransitionBuilder<S,E>>
implements StateMachineTransitionConfigurer<S,E>
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new state machine transition builder.StateMachineTransitionBuilder(ObjectPostProcessor<Object> objectPostProcessor) Instantiates a new state machine transition builder.StateMachineTransitionBuilder(ObjectPostProcessor<Object> objectPostProcessor, boolean allowConfigurersOfSameType) Instantiates a new state machine transition builder. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the choice.voidaddDefaultHistory(S source, S target) Adds the default history.voidAdds the entry.voidAdds the exit.voidAdds the fork.voidAdds the join.voidaddJunction(S source, List<JunctionData<S, E>> junctions) Adds the junction.voidaddTransition(S source, S target, S state, E event, Long period, Integer count, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> actions, Function<StateContext<S, E>, reactor.core.publisher.Mono<Boolean>> guard, TransitionKind kind, SecurityRule securityRule, String name) Adds the transition.protected TransitionsData<S,E> Subclasses must implement this method to build the object that is being returned.Gets a configurer for transition from a choice pseudostate.Gets a configurer for transition from an entrypoint pseudostate.withExit()Gets a configurer for transition from an exitpoint pseudostate.Gets a configurer for external transition.withFork()Gets a configurer for transition from a fork pseudostate.Gets a configurer for default history transition.Gets a configurer for internal transition.withJoin()Gets a configurer for transition from a join pseudostate.Gets a configurer for transition from a junction pseudostate.Gets a configurer for local transition.Methods inherited from class org.springframework.statemachine.config.common.annotation.AbstractConfiguredAnnotationBuilder
apply, beforeConfigureMains, beforeConfigurePosts, beforeInit, doBuild, getConfigurer, getConfigurers, getOrApply, getOrBuild, getSharedObject, getSharedObjects, objectPostProcessor, postProcess, removeConfigurer, removeConfigurers, setSharedObjectMethods inherited from class org.springframework.statemachine.config.common.annotation.AbstractAnnotationBuilder
build, getObject
-
Constructor Details
-
StateMachineTransitionBuilder
public StateMachineTransitionBuilder()Instantiates a new state machine transition builder. -
StateMachineTransitionBuilder
public StateMachineTransitionBuilder(ObjectPostProcessor<Object> objectPostProcessor, boolean allowConfigurersOfSameType) Instantiates a new state machine transition builder.- Parameters:
objectPostProcessor- the object post processorallowConfigurersOfSameType- the allow configurers of same type
-
StateMachineTransitionBuilder
Instantiates a new state machine transition builder.- Parameters:
objectPostProcessor- the object post processor
-
-
Method Details
-
performBuild
Description copied from class:AbstractConfiguredAnnotationBuilderSubclasses must implement this method to build the object that is being returned.- Specified by:
performBuildin classAbstractConfiguredAnnotationBuilder<TransitionsData<S,E>, StateMachineTransitionConfigurer<S, E>, StateMachineTransitionBuilder<S, E>> - Returns:
- Object build by this builder
- Throws:
Exception- if error occurred
-
withExternal
Description copied from interface:StateMachineTransitionConfigurerGets a configurer for external transition.- Specified by:
withExternalin interfaceStateMachineTransitionConfigurer<S,E> - Returns:
ExternalTransitionConfigurerfor chaining- Throws:
Exception- if configuration error happens- See Also:
-
withInternal
Description copied from interface:StateMachineTransitionConfigurerGets a configurer for internal transition. Internal transition is used when action needs to be executed without causing a state transition. With internal transition source and target state is always a same and it is identical with self-transition in the absence of state entry and exit actions.- Specified by:
withInternalin interfaceStateMachineTransitionConfigurer<S,E> - Returns:
InternalTransitionConfigurerfor chaining- Throws:
Exception- if configuration error happens
-
withLocal
Description copied from interface:StateMachineTransitionConfigurerGets a configurer for local transition. Local transition doesn’t cause exit and entry to source state if target state is a substate of a source state. Other way around, local transition doesn’t cause exit and entry to target state if target is a superstate of a source state.- Specified by:
withLocalin interfaceStateMachineTransitionConfigurer<S,E> - Returns:
LocalTransitionConfigurerfor chaining- Throws:
Exception- if configuration error happens
-
withChoice
Description copied from interface:StateMachineTransitionConfigurerGets a configurer for transition from a choice pseudostate.- Specified by:
withChoicein interfaceStateMachineTransitionConfigurer<S,E> - Returns:
ChoiceTransitionConfigurerfor chaining- Throws:
Exception- if configuration error happens
-
withJunction
Description copied from interface:StateMachineTransitionConfigurerGets a configurer for transition from a junction pseudostate.- Specified by:
withJunctionin interfaceStateMachineTransitionConfigurer<S,E> - Returns:
JunctionTransitionConfigurerfor chaining- Throws:
Exception- if configuration error happens
-
withFork
Description copied from interface:StateMachineTransitionConfigurerGets a configurer for transition from a fork pseudostate.- Specified by:
withForkin interfaceStateMachineTransitionConfigurer<S,E> - Returns:
ForkTransitionConfigurerfor chaining- Throws:
Exception- if configuration error happens
-
withJoin
Description copied from interface:StateMachineTransitionConfigurerGets a configurer for transition from a join pseudostate.- Specified by:
withJoinin interfaceStateMachineTransitionConfigurer<S,E> - Returns:
JoinTransitionConfigurerfor chaining- Throws:
Exception- if configuration error happens
-
withEntry
Description copied from interface:StateMachineTransitionConfigurerGets a configurer for transition from an entrypoint pseudostate.- Specified by:
withEntryin interfaceStateMachineTransitionConfigurer<S,E> - Returns:
EntryTransitionConfigurerfor chaining- Throws:
Exception- if configuration error happens
-
withExit
Description copied from interface:StateMachineTransitionConfigurerGets a configurer for transition from an exitpoint pseudostate.- Specified by:
withExitin interfaceStateMachineTransitionConfigurer<S,E> - Returns:
ExitTransitionConfigurerfor chaining- Throws:
Exception- if configuration error happens
-
withHistory
Description copied from interface:StateMachineTransitionConfigurerGets a configurer for default history transition.- Specified by:
withHistoryin interfaceStateMachineTransitionConfigurer<S,E> - Returns:
HistoryTransitionConfigurerfor chaining- Throws:
Exception- if configuration error happens
-
addTransition
public void addTransition(S source, S target, S state, E event, Long period, Integer count, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> actions, Function<StateContext<S, E>, reactor.core.publisher.Mono<Boolean>> guard, TransitionKind kind, SecurityRule securityRule, String name) Adds the transition.- Parameters:
source- the sourcetarget- the targetstate- the stateevent- the eventperiod- the periodcount- the countactions- the actionsguard- the guardkind- the kindsecurityRule- the security rulename- the name
-
addChoice
Adds the choice.- Parameters:
source- the sourcechoices- the choices
-
addJunction
Adds the junction.- Parameters:
source- the sourcejunctions- the junctions
-
addEntry
Adds the entry.- Parameters:
source- the sourcetarget- the target
-
addExit
Adds the exit.- Parameters:
source- the sourcetarget- the target
-
addFork
Adds the fork.- Parameters:
source- the sourcetargets- the targets
-
addJoin
Adds the join.- Parameters:
target- the targetsources- the sources
-
addDefaultHistory
Adds the default history.- Parameters:
source- the sourcetarget- the target
-