当进程处于运行状态时,我可以注入进程参数吗



这个问题可能很傻,但我有这样的要求。如果上述问题无法解决,则需要更改方法。请帮忙。提前谢谢。

是的,这是可能的,但IMO将是一种更好的方法,为您期望在流程中拥有的东西设置占位符。如果你能在用例上详细说明一点,我们可以给你一个更好的方法。

您可以使用setVariable方法向流程实例添加一个新变量。之前,您必须将流程实例强制转换为WorkflowProcessInstanceImpl类。

org.kie.api.runtime.process.ProcessInstance processInstance = ...
WorkflowProcessInstanceImpl processInstanceImpl = (WorkflowProcessInstanceImpl) processInstance;
processInstanceImpl.setVariable("newVar", "newVal");

相关内容

最新更新