|
|
@ -86,25 +86,22 @@ public class V320DolphinSchedulerUpgrader implements DolphinSchedulerUpgrader { |
|
|
|
if (CollectionUtils.isEmpty(needUpdateWorkflowInstance)) { |
|
|
|
if (CollectionUtils.isEmpty(needUpdateWorkflowInstance)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
for (ProcessInstance processInstance : needUpdateWorkflowInstance) { |
|
|
|
needUpdateWorkflowInstance.parallelStream() |
|
|
|
ProcessDefinitionLog processDefinitionLog = processDefinitionLogMapper.queryByDefinitionCodeAndVersion( |
|
|
|
.forEach(processInstance -> { |
|
|
|
processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion()); |
|
|
|
ProcessDefinitionLog processDefinitionLog = |
|
|
|
if (processDefinitionLog != null) { |
|
|
|
processDefinitionLogMapper.queryByDefinitionCodeAndVersion( |
|
|
|
processInstance.setProjectCode(processDefinitionLog.getProjectCode()); |
|
|
|
processInstance.getProcessDefinitionCode(), |
|
|
|
processInstance.setTenantCode(tenantMap.get(processDefinitionLog.getTenantId())); |
|
|
|
processInstance.getProcessDefinitionVersion()); |
|
|
|
processInstance.setExecutorName(userMap.get(processInstance.getExecutorId())); |
|
|
|
if (processDefinitionLog != null) { |
|
|
|
} else { |
|
|
|
processInstance.setProjectCode(processDefinitionLog.getProjectCode()); |
|
|
|
processInstance.setProjectCode(-1L); |
|
|
|
processInstance.setTenantCode(tenantMap.get(processDefinitionLog.getTenantId())); |
|
|
|
} |
|
|
|
processInstance.setExecutorName(userMap.get(processInstance.getExecutorId())); |
|
|
|
processInstanceMapper.updateById(processInstance); |
|
|
|
} else { |
|
|
|
} |
|
|
|
processInstance.setProjectCode(-1L); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
processInstanceMapper.updateById(processInstance); |
|
|
|
|
|
|
|
}); |
|
|
|
log.info("Success upgrade workflow instance, current batch size: {}", needUpdateWorkflowInstance.size()); |
|
|
|
log.info("Success upgrade workflow instance, current batch size: {}", needUpdateWorkflowInstance.size()); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
Thread.sleep(1000L); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
log.error("Upgrade workflow instance error", e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -118,24 +115,20 @@ public class V320DolphinSchedulerUpgrader implements DolphinSchedulerUpgrader { |
|
|
|
if (CollectionUtils.isEmpty(taskInstances)) { |
|
|
|
if (CollectionUtils.isEmpty(taskInstances)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
for (TaskInstance taskInstance : taskInstances) { |
|
|
|
taskInstances.parallelStream() |
|
|
|
ProcessInstance processInstance = processInstanceMapper.selectById(taskInstance.getProcessInstanceId()); |
|
|
|
.forEach(taskInstance -> { |
|
|
|
if (processInstance == null) { |
|
|
|
ProcessInstance processInstance = |
|
|
|
taskInstance.setProjectCode(-1L); |
|
|
|
processInstanceMapper.selectById(taskInstance.getProcessInstanceId()); |
|
|
|
} else { |
|
|
|
if (processInstance == null) { |
|
|
|
taskInstance.setProjectCode(processInstance.getProjectCode()); |
|
|
|
taskInstance.setProjectCode(-1L); |
|
|
|
taskInstance.setProcessInstanceName(processInstance.getName()); |
|
|
|
} else { |
|
|
|
taskInstance.setExecutorName(processInstance.getExecutorName()); |
|
|
|
taskInstance.setProjectCode(processInstance.getProjectCode()); |
|
|
|
} |
|
|
|
taskInstance.setProcessInstanceName(processInstance.getName()); |
|
|
|
taskInstanceMapper.updateById(taskInstance); |
|
|
|
taskInstance.setExecutorName(processInstance.getExecutorName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
taskInstanceMapper.updateById(taskInstance); |
|
|
|
|
|
|
|
}); |
|
|
|
log.info("Success upgrade task instance, current batch size: {}", taskInstances.size()); |
|
|
|
log.info("Success upgrade task instance, current batch size: {}", taskInstances.size()); |
|
|
|
try { |
|
|
|
|
|
|
|
Thread.sleep(1000L); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
log.error("Upgrade task instance error", e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|