Commit c28ca2d87f4e871d64560a21badb7f3215b00eb0
1 parent
7925af99
review:【bpm 工作流】子流程不通过的情况
Showing
1 changed file
with
5 additions
and
2 deletions
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java
| @@ -951,7 +951,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -951,7 +951,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 951 | status); | 951 | status); |
| 952 | } | 952 | } |
| 953 | 953 | ||
| 954 | - // 1.3 如果子流程拒绝, 设置其父流程也为拒绝状态且结束父流程 | 954 | + // 1.3 如果子流程拒绝,设置其父流程也为拒绝状态,且结束父流程 |
| 955 | + // 相关问题链接:https://t.zsxq.com/kZhyb | ||
| 955 | if (Objects.equals(status, BpmProcessInstanceStatusEnum.REJECT.getStatus()) | 956 | if (Objects.equals(status, BpmProcessInstanceStatusEnum.REJECT.getStatus()) |
| 956 | && StrUtil.isNotBlank(instance.getSuperExecutionId())) { | 957 | && StrUtil.isNotBlank(instance.getSuperExecutionId())) { |
| 957 | // 1.3.1 获取父流程实例 并标记为不通过 | 958 | // 1.3.1 获取父流程实例 并标记为不通过 |
| @@ -961,6 +962,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -961,6 +962,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 961 | 962 | ||
| 962 | // 1.3.2 结束父流程。需要在子流程结束事务提交后执行 | 963 | // 1.3.2 结束父流程。需要在子流程结束事务提交后执行 |
| 963 | TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { | 964 | TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { |
| 965 | + | ||
| 964 | @Override | 966 | @Override |
| 965 | public void afterCompletion(int transactionStatus) { | 967 | public void afterCompletion(int transactionStatus) { |
| 966 | // 回滚情况,直接返回 | 968 | // 回滚情况,直接返回 |
| @@ -1020,7 +1022,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -1020,7 +1022,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 1020 | runtimeService.setProcessInstanceName(instance.getProcessInstanceId(), name); | 1022 | runtimeService.setProcessInstanceName(instance.getProcessInstanceId(), name); |
| 1021 | } | 1023 | } |
| 1022 | 1024 | ||
| 1023 | - // 流程前置通知:需要在流程启动后(事务提交后)。variables 已设置。或者放在 PROCESS_STARTED 事件中处理,先放这里。 | 1025 | + // 流程前置通知:需要在流程启动后(事务提交后),保证 variables 已设置 |
| 1026 | + // 相关问题链接:https://t.zsxq.com/DF7Kq | ||
| 1024 | if (ObjUtil.isNull(processDefinitionInfo.getProcessBeforeTriggerSetting())) { | 1027 | if (ObjUtil.isNull(processDefinitionInfo.getProcessBeforeTriggerSetting())) { |
| 1025 | return; | 1028 | return; |
| 1026 | } | 1029 | } |