Closed facelezzzz closed 3 years ago
StateMachineConfiguration.getInstance().setIdProvider(...) you can refer to org.squirrelframework.foundation.fsm.UntypedStateMachineTest#testStateMachineConfiguration
Thanks for your response
I know that there is StateMachineConfiguration.getInstance().setIdProvider(...),but i need a hook to set id manually rather than set id provider manually.
When a state machine created, I want:
builder.newStateMachine(TaskFSMStates.CREATED).setId("32893719287");//of course setId is not present now
Shortly, I want to attach a business id to the state machine after creation.
It's possible passing StateMachineConfiguration
into builder.newStateMachine()
method.
Something like:
final StateMachineConfiguration configuration = StateMachineConfiguration.create();
configuration.setIdProvider(() -> "32893719287");
BUILDER.newStateMachine(State.INIT, configuration, new Object[0]);
I want to order a special id for a state machine
In AbstractStateMachine.class
data.write().identifier(configuration.getIdProvider().get());
but there is no way set it manually.Id provider is only invoked by no-arg method