From 9d6acd49e860741b0991d7194dcc34ec27ed9ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=A4=20=E6=A2=81?= Date: Fri, 2 Dec 2022 21:15:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=B8=AD=E9=80=94=E6=8B=92?= =?UTF-8?q?=E7=BB=9D=EF=BC=8C=E6=89=A7=E8=A1=8C=E8=B0=83=E7=94=A8=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E4=B8=AA=E7=BA=BF=E6=AE=B5=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Learun.Workflow.Engine/NWFEngine.cs | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Workflow/Learun.Workflow.Engine/NWFEngine.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Workflow/Learun.Workflow.Engine/NWFEngine.cs index c7e83e0b7..4cff1c7ae 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Workflow/Learun.Workflow.Engine/NWFEngine.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Workflow/Learun.Workflow.Engine/NWFEngine.cs @@ -294,15 +294,40 @@ namespace Learun.Workflow.Engine List nextNodes = new List(); //如果lastNode 不为空,直接执行最后一条线的绑定方法 并终止任务 - List lineList1=new List(); + List lineList1 = new List(); if (overFW) { - lineList1.Add(wfScheme.lines.Last()); + //20221202 liangkun + //修改判断最后线段方法,之前直接获取last线段有问题 + //设计器并非所有情况都会把最后一条线段放在last位置 + //判断last节点是否是end节点之前的线 + //先获取所节点 + var allnodes = wfScheme.nodes; + //查找结束节点 + var endnode = allnodes.Find(m => m.type == "endround"); + //查到结束节点 + if (endnode != null) + { + //使用结束节点的id到线条集合内查找,查询到to结束节点的线条本身并赋值 + //to结束节点的线,即是最后的线条,一般绑定事件都会在此线段上 + var endline = wfScheme.lines.Find(m => m.to == endnode.id); + if (endline != null) + { + lineList1.Add(endline); + } + else + { + lineList1.Add(wfScheme.lines.Last()); + } + } + else//未查到结束节点,直接赋值最后的线条 + { + lineList1.Add(wfScheme.lines.Last()); + } } else { lineList1 = wfScheme.lines; - } // 找到与当前节点相连的线条 @@ -358,6 +383,15 @@ namespace Learun.Workflow.Engine } } } + //20221202 liangkun 配合以上代码添加结束节点以及线段并返回 + else + { + if (overFW) + { + lineList.Add(line); + nextNodes.Add(nodesMap[line.to]); + } + } } return nextNodes;