我正在使用StateMachine
实例的池列表(目前仅限于一个)并且正在切换statemachine
正在使用的上下文 - 但是永远不会更新,当我尝试坚持时StateMachine ID
,我最终会覆盖我在数据库中的内容。statemachine
有关以下内容以及问题的更多信息。
我的问题是为什么在使用空上下文(即尝试创建新上下文)调用resetStateMachine
(in AbstractStateMachine.java
) 时,这不会清除机器的当前 id(我理解为什么UUID
会保留 - 这是机器独有的)但 id 与上下文也是,不是吗?如果上下文不为空,它会尝试从stateMachineContext
相关来源的摘录:
如果上下文为空:
log.info("Got null context, resetting to initial state and clearing extended state");
this.currentState = this.initialState;
this.extendedState.getVariables().clear();
如果上下文不为空:
this.setId(stateMachineContext.getId());
当我稍后调用 persist.restore 来拉回状态机上下文时,这意味着我有一个旧的 id 并最终覆盖而不是使用新的 id 来持久化。
这是使用当前发布的版本 1.2.5.RELEASE