似乎这样做会使id为空
# before reset, this will log the id set when state machine was created using stateMachineFactory.getStateMachine(stateMachineId)
log.info(String.format("Before reset, current state: %s, id: %s", stateMachine.getState().getId().toString(), stateMachine.getId()));
# resetting the state machine
stateMachine.getStateMachineAccessor().doWithAllRegions(access -> access
.resetStateMachine(new DefaultStateMachineContext<>(correctState, null, null, null)));
# after reset, this will log id as null
log.info(String.format("After reset, state: %s, id: %s", stateMachine.getState().getId().toString(), stateMachine.getId()));
有没有办法保存或重新设置id?
1条答案
按热度按时间s2j5cfk01#
我发现defaultstatemachinecontext构造函数还有一个签名:
所以,这对我有用!