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>
- Author:
- Janne Valkealahti
-
Constructor Summary
ConstructorDescriptionInstantiates 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 TypeMethodDescriptionvoid
Adds the choice.void
addDefaultHistory
(S source, S target) Adds the default history.void
Adds the entry.void
Adds the exit.void
Adds the fork.void
Adds the join.void
addJunction
(S source, List<JunctionData<S, E>> junctions) Adds the junction.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.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, setSharedObject
Methods 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:AbstractConfiguredAnnotationBuilder
Subclasses must implement this method to build the object that is being returned.- Specified by:
performBuild
in 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:StateMachineTransitionConfigurer
Gets a configurer for external transition.- Specified by:
withExternal
in interfaceStateMachineTransitionConfigurer<S,
E> - Returns:
ExternalTransitionConfigurer
for chaining- Throws:
Exception
- if configuration error happens- See Also:
-
withInternal
Description copied from interface:StateMachineTransitionConfigurer
Gets 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:
withInternal
in interfaceStateMachineTransitionConfigurer<S,
E> - Returns:
InternalTransitionConfigurer
for chaining- Throws:
Exception
- if configuration error happens
-
withLocal
Description copied from interface:StateMachineTransitionConfigurer
Gets 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:
withLocal
in interfaceStateMachineTransitionConfigurer<S,
E> - Returns:
LocalTransitionConfigurer
for chaining- Throws:
Exception
- if configuration error happens
-
withChoice
Description copied from interface:StateMachineTransitionConfigurer
Gets a configurer for transition from a choice pseudostate.- Specified by:
withChoice
in interfaceStateMachineTransitionConfigurer<S,
E> - Returns:
ChoiceTransitionConfigurer
for chaining- Throws:
Exception
- if configuration error happens
-
withJunction
Description copied from interface:StateMachineTransitionConfigurer
Gets a configurer for transition from a junction pseudostate.- Specified by:
withJunction
in interfaceStateMachineTransitionConfigurer<S,
E> - Returns:
JunctionTransitionConfigurer
for chaining- Throws:
Exception
- if configuration error happens
-
withFork
Description copied from interface:StateMachineTransitionConfigurer
Gets a configurer for transition from a fork pseudostate.- Specified by:
withFork
in interfaceStateMachineTransitionConfigurer<S,
E> - Returns:
ForkTransitionConfigurer
for chaining- Throws:
Exception
- if configuration error happens
-
withJoin
Description copied from interface:StateMachineTransitionConfigurer
Gets a configurer for transition from a join pseudostate.- Specified by:
withJoin
in interfaceStateMachineTransitionConfigurer<S,
E> - Returns:
JoinTransitionConfigurer
for chaining- Throws:
Exception
- if configuration error happens
-
withEntry
Description copied from interface:StateMachineTransitionConfigurer
Gets a configurer for transition from an entrypoint pseudostate.- Specified by:
withEntry
in interfaceStateMachineTransitionConfigurer<S,
E> - Returns:
EntryTransitionConfigurer
for chaining- Throws:
Exception
- if configuration error happens
-
withExit
Description copied from interface:StateMachineTransitionConfigurer
Gets a configurer for transition from an exitpoint pseudostate.- Specified by:
withExit
in interfaceStateMachineTransitionConfigurer<S,
E> - Returns:
ExitTransitionConfigurer
for chaining- Throws:
Exception
- if configuration error happens
-
withHistory
Description copied from interface:StateMachineTransitionConfigurer
Gets a configurer for default history transition.- Specified by:
withHistory
in interfaceStateMachineTransitionConfigurer<S,
E> - Returns:
HistoryTransitionConfigurer
for 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
-