You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered the following problem on spring-statemachine version 3.2.0.
We have the following configuration:
@Configuration
@EnableStateMachine
public class TicketStateMachineConfiguration {
@Bean
public StateMachineService<TicketStatus, TicketTrigger> stateMachineService(
StateMachineFactory<TicketStatus, TicketTrigger> stateMachineFactory,
StateMachinePersist<TicketStatus, TicketTrigger, String> stateMachinePersister) {
return new DefaultStateMachineService<>(stateMachineFactory, stateMachinePersister);
}
@Configuration
@EnableStateMachineFactory
public static class TicketStateMachine extends StateMachineConfigurerAdapter<TicketStatus, TicketTrigger> {
@Autowired
private Collection<TicketStateConfiguration> stateConfigurations;
@Autowired
private StateMachineRuntimePersister<TicketStatus, TicketTrigger, String> runtimePersister;
@Override
public void configure(StateMachineConfigurationConfigurer<TicketStatus, TicketTrigger> config) throws Exception {
config.withConfiguration().regionExecutionPolicy(RegionExecutionPolicy.PARALLEL);
config.withPersistence().runtimePersister(runtimePersister);
}
@Override
public void configure(StateMachineStateConfigurer<TicketStatus, TicketTrigger> states) throws Exception {
states.withStates()
.initial(TicketStatus.LAUNCHING)
.choice(...
...
.states(EnumSet.allOf(TicketStatus.class));
for (TicketStateConfiguration stateConfiguration : stateConfigurations) {
stateConfiguration.configure(states);
}
}
@Override
public void configure(StateMachineTransitionConfigurer<TicketStatus, TicketTrigger> transitions) throws Exception {
for (TicketStateConfiguration stateConfiguration : stateConfigurations) {
stateConfiguration.configure(transitions);
}
}
}
}
From the service we are trying to do: StateMachine<S, E> stateMachine = stateMachineService.acquireStateMachine(id);
When providing an id that contains special regex characters like: "stateMachineService.acquireStateMachine("${ticketId}"), the state machine instance get blocked and is completely unusable. PatternSyntaxException are logged from the StateMachineObjectSupport methods but no exception is thrown and we are not able to get a response from acquireStateMachine method.
I tried to acquire the stateMachine and then manually start the machine, but I'm not able to get the errors from startup and not able to treat this scenario.
We're also getting this on 4.0.0. Using UUID's as state machine identifier. It complains about dash, since it's interpreted as regex special character: java.util.regex.PatternSyntaxException: Illegal character range near index 10 [6b7d358e-de78-4c80-ad8f-af33a2f3da09|15] ^ at java.base/java.util.regex.Pattern.error(Pattern.java:2028) at java.base/java.util.regex.Pattern.range(Pattern.java:2820) at java.base/java.util.regex.Pattern.clazz(Pattern.java:2708) at java.base/java.util.regex.Pattern.sequence(Pattern.java:2139) at java.base/java.util.regex.Pattern.expr(Pattern.java:2069) at java.base/java.util.regex.Pattern.compile(Pattern.java:1783) at java.base/java.util.regex.Pattern.<init>(Pattern.java:1430) at java.base/java.util.regex.Pattern.compile(Pattern.java:1069) at java.base/java.lang.String.replaceFirst(String.java:2898) at org.springframework.statemachine.processor.StateMachineHandlerCallHelper.getCacheEntries(StateMachineHandlerCallHelper.java:356) ...
Hi,
I've encountered the following problem on spring-statemachine version 3.2.0.
We have the following configuration:
From the service we are trying to do:
StateMachine<S, E> stateMachine = stateMachineService.acquireStateMachine(id);
When providing an id that contains special regex characters like: "stateMachineService.acquireStateMachine("${ticketId}"), the state machine instance get blocked and is completely unusable. PatternSyntaxException are logged from the StateMachineObjectSupport methods but no exception is thrown and we are not able to get a response from acquireStateMachine method.
I tried to acquire the stateMachine and then manually start the machine, but I'm not able to get the errors from startup and not able to treat this scenario.
I'll attach the debug logs for this issue:
logs_state-machine.txt
The text was updated successfully, but these errors were encountered: