You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/01/17 05:04:12 UTC

[incubator-dolphinscheduler] branch dev updated: [FIX-4247][Api]Fixed the problem that the global parameters are not updated after the workflow instance click rerun

This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new fff06bf  [FIX-4247][Api]Fixed the problem that the global parameters are not updated after the workflow instance click rerun
fff06bf is described below

commit fff06bf8b615f6ed92772d9e67a59f7e799f0e66
Author: zt-1997 <41...@users.noreply.github.com>
AuthorDate: Sun Jan 17 13:04:00 2021 +0800

    [FIX-4247][Api]Fixed the problem that the global parameters are not updated after the workflow instance click rerun
    
    Co-authored-by: zt-1997 <“18841012545@163.com”>
---
 .../org/apache/dolphinscheduler/service/process/ProcessService.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
index aa70ed2..9501e7f 100644
--- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
+++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
@@ -687,6 +687,12 @@ public class ProcessService {
                 processInstance = generateNewProcessInstance(processDefinition, command, cmdParam);
             } else {
                 processInstance = this.findProcessInstanceDetailById(processInstanceId);
+                // Recalculate global parameters after rerun.
+                processInstance.setGlobalParams(ParameterUtils.curingGlobalParams(
+                    processDefinition.getGlobalParamMap(),
+                    processDefinition.getGlobalParamList(),
+                    getCommandTypeIfComplement(processInstance, command),
+                    processInstance.getScheduleTime()));
             }
             processDefinition = processDefineMapper.selectById(processInstance.getProcessDefinitionId());
             processInstance.setProcessDefinition(processDefinition);