Commit 128f61a1edcfbcaeb0249d2628f5ccdb3146a265
1 parent
df2ef43f
fix: [BPM 工作流] 流程前置通知,需要放在流程启动后
Showing
1 changed file
with
8 additions
and
8 deletions
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java
| ... | ... | @@ -996,17 +996,17 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 996 | 996 | if (ObjUtil.notEqual(instance.getName(), name)) { |
| 997 | 997 | runtimeService.setProcessInstanceName(instance.getProcessInstanceId(), name); |
| 998 | 998 | } |
| 999 | + | |
| 1000 | + // 流程前置通知:需要在流程启动后(事务提交后)。variables 已设置。或者放在 PROCESS_STARTED 事件中处理,先放这里。 | |
| 1001 | + if (ObjUtil.isNull(processDefinitionInfo.getProcessBeforeTriggerSetting())) { | |
| 1002 | + return; | |
| 1003 | + } | |
| 1004 | + BpmModelMetaInfoVO.HttpRequestSetting setting = processDefinitionInfo.getProcessBeforeTriggerSetting(); | |
| 1005 | + BpmHttpRequestUtils.executeBpmHttpRequest(instance, | |
| 1006 | + setting.getUrl(), setting.getHeader(), setting.getBody(), true, setting.getResponse()); | |
| 999 | 1007 | } |
| 1000 | 1008 | |
| 1001 | 1009 | }); |
| 1002 | - | |
| 1003 | - // 流程前置通知 | |
| 1004 | - if (ObjUtil.isNull(processDefinitionInfo.getProcessBeforeTriggerSetting())) { | |
| 1005 | - return; | |
| 1006 | - } | |
| 1007 | - BpmModelMetaInfoVO.HttpRequestSetting setting = processDefinitionInfo.getProcessBeforeTriggerSetting(); | |
| 1008 | - BpmHttpRequestUtils.executeBpmHttpRequest(instance, | |
| 1009 | - setting.getUrl(), setting.getHeader(), setting.getBody(), true, setting.getResponse()); | |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | } | ... | ... |