Open chinthakadd opened 12 months ago
use case: since I created two state machines (order and transaction) in the same spring package, I think it's reasonable to store two state machines under the same DB with different collection names.
correct me if there is a better way to implement under such scenario.
@ZhongceXie thank you for the comment. Yes that is a valid use-case IMO. In our case, our organization follows a standard convention of naming collection which differs from the MongoDbRepositoryStateMachine
style naming. So we would like to have the flexibility to customize the name.
It seems that
MongoDbRepositoryStateMachine
Document Entity has a hard-coded collection name. This makes it difficult for consumers who has different collection naming conventions to make it configurable.Can we provide SPEL/ Spring Configuration or Java Config based support to override the default collection names?
https://github.com/spring-projects/spring-statemachine/blob/1b2a868ab52d16646eea40071bc1ea8526cd9e0c/spring-statemachine-data/mongodb/src/main/java/org/springframework/statemachine/data/mongodb/MongoDbRepositoryStateMachine.java#L28