Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 Flowable 6 的新手,当我调用 Context.getCommandContext() 时,在某些情况下它返回一个空对象。
我的问题是具有命令上下文需要哪些条件?在我的情况下,如果它为空,我可以手动添加一个。如果是,该怎么做?
该ContextAPI 是一个内部 Flowable API,建议用户不要使用该 API。
Context
您不应手动添加由 Flowable 命令上下文执行处理的上下文。
在 a 中调用您的逻辑时Command,Context.getCommandContext()将不为空。
Command
Context.getCommandContext()
我建议做类似的事情:
managementService.executeCommand(commandContext -> { // Do something with the commandContext here }