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;