Skip to content

Commit b269d69

Browse files
committed
Merge branch 'dev-1.21.0' into dev-1.21.0-hadoop3
# Conflicts: # docs/1.21.0/requirements/工作流分支节点_需求.md
2 parents 6e947c5 + dc1cbf2 commit b269d69

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

dss-orchestrator/orchestrators/dss-workflow/dss-flow-execution-server/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/resolver/FlowDependencyResolverImpl.scala

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package com.webank.wedatasphere.dss.flow.execution.entrance.resolver
1919
import java.util
2020

2121
import com.webank.wedatasphere.dss.flow.execution.entrance.FlowContext
22+
import com.webank.wedatasphere.dss.flow.execution.entrance.enums.ExecuteStrategyEnum
2223
import com.webank.wedatasphere.dss.flow.execution.entrance.job.FlowEntranceJob
2324
import com.webank.wedatasphere.dss.flow.execution.entrance.utils.BranchExpressionUtils
2425
import com.webank.wedatasphere.dss.workflow.core.entity.WorkflowNode
@@ -38,6 +39,10 @@ class FlowDependencyResolverImpl extends FlowDependencyResolver with Logging {
3839
val nodes = flowContext.getPendingNodes.toMap.values.map(_.getNode)
3940
val workflowNodesById = flow.getWorkflowNodes.map(node => node.getId -> node).toMap
4041
val workflowEdges = flow.getWorkflowNodeEdges.map(_.getDSSEdge)
42+
val executeStrategy = Option(flowJob.getParams)
43+
.map(_.get("executeStrategy"))
44+
.map(_.toString)
45+
.orNull
4146

4247
def incomingEdges(node: WorkflowNode) = workflowEdges.filter(_.getTarget == node.getId)
4348

@@ -59,26 +64,31 @@ class FlowDependencyResolverImpl extends FlowDependencyResolver with Logging {
5964
workflowNodesById.get(edge.getSource).exists { sourceNode =>
6065
BranchExpressionUtils.isBranchNode(sourceNode) &&
6166
flowContext.isNodeCompleted(sourceNode.getName) &&
62-
flowJob.hasBranchSelection(sourceNode.getId) &&
63-
!flowJob.isBranchTargetSelected(sourceNode.getId, node.getId)
67+
(flowContext.isNodeSkipped(sourceNode.getName) ||
68+
!flowJob.hasBranchSelection(sourceNode.getId) ||
69+
!flowJob.isBranchTargetSelected(sourceNode.getId, node.getId))
6470
}
6571
}
6672
}
6773

6874
def shouldSkip(node: WorkflowNode): Boolean = {
69-
shouldSkipByBranch(node) || areAllParentsSkipped(node)
75+
shouldSkipByBranch(node) ||
76+
(!ExecuteStrategyEnum.IS_SELECTED_EXECUTE.getValue.equalsIgnoreCase(executeStrategy) && areAllParentsSkipped(node))
7077
}
7178

7279
def isBranchRouteMatched(node: WorkflowNode): Boolean = {
7380
incomingEdges(node).forall { edge =>
7481
workflowNodesById.get(edge.getSource) match {
7582
case Some(sourceNode) if BranchExpressionUtils.isBranchNode(sourceNode) =>
76-
flowJob.hasBranchSelection(sourceNode.getId) && flowJob.isBranchTargetSelected(sourceNode.getId, node.getId)
83+
flowContext.isNodeSucceed(sourceNode.getName) &&
84+
flowJob.hasBranchSelection(sourceNode.getId) &&
85+
flowJob.isBranchTargetSelected(sourceNode.getId, node.getId)
7786
case _ => true
7887
}
7988
}
8089
}
8190

91+
8292
nodes.foreach { node =>
8393
val nodeName = node.getName
8494
def isCanExecutable: Boolean = {
@@ -104,4 +114,3 @@ class FlowDependencyResolverImpl extends FlowDependencyResolver with Logging {
104114
info(s"${flowJob.getId} Finished to get executable node(${flowContext.getScheduledNodes.size()})")
105115
}
106116
}
107-

dss-orchestrator/orchestrators/dss-workflow/dss-flow-execution-server/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/utils/BranchExpressionUtils.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,9 @@ object BranchExpressionUtils extends Logging {
189189
operator match {
190190
case "==" => left == right
191191
case "!=" => left != right
192-
case ">" => left > right
193-
case "<" => left < right
194-
case ">=" => left >= right
195-
case "<=" => left <= right
192+
case ">" | "<" | ">=" | "<=" =>
193+
warn(s"Branch numeric comparison requires numeric operands: left=$left, operator=$operator, right=$right")
194+
false
196195
}
197196
}
198197
}

0 commit comments

Comments
 (0)