Sfoglia il codice sorgente

流程修改,模板数据支持受业务代码控制

yzc 1 anno fa
parent
commit
1cb68fe2b4

+ 5 - 2
hx-flow/src/main/java/com/fjhx/flow/service/flow/impl/FlowProcessServiceImpl.java

@@ -143,7 +143,10 @@ public class FlowProcessServiceImpl implements FlowProcessService {
         // 执行开始流程方法
         Long businessId;
         try {
-            businessId = flowDelegate.start(flowId, dto.getData());
+            JSONObject startData = dto.getData();
+            businessId = flowDelegate.start(flowId, startData);
+            //重新赋值模板templateMap
+            templateMap = flowDelegate.initTemplateMap(startData, dto.getData());
         } catch (Exception e) {
             log.error("开始节点方法异常", e);
             throw new ServiceException("开始节点方法异常:" + e.getMessage());
@@ -205,7 +208,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
     @DSTransactional
     @Override
     public FlowResult jump(JumpDto dto) {
-        if(ObjectUtil.isNotEmpty(dto.getData())) {
+        if (ObjectUtil.isNotEmpty(dto.getData())) {
             flowExampleService.update(q -> q.eq(FlowExample::getId, dto.getFlowId()).set(FlowExample::getStartData, dto.getData().toJSONString()));
         }