SbloodyS commented on code in PR #11734:
URL: https://github.com/apache/dolphinscheduler/pull/11734#discussion_r962416968


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/DependentProcessDefinition.java:
##########
@@ -60,14 +60,14 @@ public class DependentProcessDefinition {
      * get dependent cycle
      * @return CycleEnum
      */
-    public CycleEnum getDependentCycle() {
+    public CycleEnum getDependentCycle(long processDefinitionCode) {
         DependentParameters dependentParameters = 
this.getDependentParameters();
         List<DependentTaskModel> dependentTaskModelList = 
dependentParameters.getDependTaskList();
 
         for (DependentTaskModel dependentTaskModel : dependentTaskModelList) {
             List<DependentItem> dependentItemList = 
dependentTaskModel.getDependItemList();
             for (DependentItem dependentItem : dependentItemList) {
-                if (this.getProcessDefinitionCode() == 
dependentItem.getDefinitionCode()) {
+                if (processDefinitionCode == 
dependentItem.getDefinitionCode()) {

Review Comment:
   Why did you change this?



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java:
##########
@@ -891,7 +891,13 @@ protected int 
createComplementDependentCommand(List<Schedule> schedules, Command
 
         dependentCommand.setTaskDependType(TaskDependType.TASK_POST);
         for (DependentProcessDefinition dependentProcessDefinition : 
dependentProcessDefinitionList) {
-            
dependentCommand.setProcessDefinitionCode(dependentProcessDefinition.getProcessDefinitionCode());
+            long processDefinitionCode = 
dependentProcessDefinition.getProcessDefinitionCode();
+
+            // get dependent downstream version
+            ProcessDefinition processDefinition = 
processDefinitionMapper.queryByCode(processDefinitionCode);
+            
dependentCommand.setProcessDefinitionVersion(processDefinition.getVersion());

Review Comment:
   I think it's better query the processDefinitionVersion through 
`org/apache/dolphinscheduler/dao/mapper/WorkFlowLineageMapper.xml:148`. So that 
we can  reduce the database query.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to