0

我是 Flowable 6 的新手,当我调用 Context.getCommandContext() 时,在某些情况下它返回一个空对象。

我的问题是具有命令上下文需要哪些条件?在我的情况下,如果它为空,我可以手动添加一个。如果是,该怎么做?

4

1 回答 1

0

ContextAPI 是一个内部 Flowable API,建议用户不要使用该 API。

您不应手动添加由 Flowable 命令上下文执行处理的上下文。

在 a 中调用您的逻辑时CommandContext.getCommandContext()将不为空。

我建议做类似的事情:

managementService.executeCommand(commandContext -> {

    // Do something with the commandContext here

}
于 2021-08-24T12:18:11.020 回答