|
|
@@ -283,6 +283,7 @@ namespace Learun.Workflow.Engine |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 获取下一节点 |
|
|
|
/// </summary> |
|
|
@@ -292,89 +293,169 @@ namespace Learun.Workflow.Engine |
|
|
|
public List<NWFNodeInfo> GetNextNodes(string nodeId, string code, List<NWFLineInfo> lineList, bool overFW = false) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
List<NWFNodeInfo> nextNodes = new List<NWFNodeInfo>(); |
|
|
|
// 找到与当前节点相连的线条 |
|
|
|
NWFLineInfo line = null; |
|
|
|
//如果lastNode 不为空,直接执行最后一条线的绑定方法 并终止任务 |
|
|
|
List<NWFLineInfo> lineList1 = new List<NWFLineInfo>(); |
|
|
|
if (overFW) |
|
|
|
{ |
|
|
|
line = wfScheme.lines.Last(); |
|
|
|
lineList1.Add(wfScheme.lines.Last()); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
List<NWFLineInfo> listLine = new List<NWFLineInfo>(); |
|
|
|
listLine = wfScheme.lines.Where(a => a.from == nodeId).ToList(); |
|
|
|
if (listLine.Count > 1) |
|
|
|
{ |
|
|
|
line = wfScheme.lines.FirstOrDefault(a => a.from == nodeId && a.agreeList == code); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
line = listLine.FirstOrDefault(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
lineList1 = wfScheme.lines; |
|
|
|
|
|
|
|
bool isOk = false; |
|
|
|
if (string.IsNullOrEmpty(line.strategy) || line.strategy == "1") |
|
|
|
{ |
|
|
|
isOk = true; |
|
|
|
} |
|
|
|
else |
|
|
|
|
|
|
|
// 找到与当前节点相连的线条 |
|
|
|
foreach (var line in lineList1) |
|
|
|
{ |
|
|
|
var codeList = line.agreeList.Split(','); |
|
|
|
foreach (string _code in codeList) |
|
|
|
if (line.from == nodeId) |
|
|
|
{ |
|
|
|
if (_code == code) |
|
|
|
bool isOk = false; |
|
|
|
if (string.IsNullOrEmpty(line.strategy) || line.strategy == "1") |
|
|
|
{ |
|
|
|
isOk = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (isOk) |
|
|
|
{ |
|
|
|
if (nodesMap.ContainsKey(line.to)) |
|
|
|
{ |
|
|
|
//如果lastNode 不为空,直接执行最后一条线的绑定方法 并终止任务 |
|
|
|
if (overFW) |
|
|
|
{ |
|
|
|
nextNodes.Add(endNode); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
nextNodes.Add(nodesMap[line.to]); |
|
|
|
} |
|
|
|
|
|
|
|
switch (line.operationType) |
|
|
|
{// 绑定的操作类型 |
|
|
|
case "sql": // sql 语句 |
|
|
|
if (!string.IsNullOrEmpty(line.dbId) && !string.IsNullOrEmpty(line.strSql)) |
|
|
|
{ |
|
|
|
lineList.Add(line); |
|
|
|
} |
|
|
|
break; |
|
|
|
case "interface": // interface 接口 |
|
|
|
if (!string.IsNullOrEmpty(line.strInterface)) |
|
|
|
{ |
|
|
|
lineList.Add(line); |
|
|
|
} |
|
|
|
break; |
|
|
|
case "ioc": // 依赖注入 |
|
|
|
if (!string.IsNullOrEmpty(line.iocName)) |
|
|
|
var codeList = line.agreeList.Split(','); |
|
|
|
foreach (string _code in codeList) |
|
|
|
{ |
|
|
|
if (_code == code) |
|
|
|
{ |
|
|
|
lineList.Add(line); |
|
|
|
isOk = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (isOk) |
|
|
|
{ |
|
|
|
if (nodesMap.ContainsKey(line.to)) |
|
|
|
{ |
|
|
|
nextNodes.Add(nodesMap[line.to]); |
|
|
|
|
|
|
|
switch (line.operationType) |
|
|
|
{// 绑定的操作类型 |
|
|
|
case "sql": // sql 语句 |
|
|
|
if (!string.IsNullOrEmpty(line.dbId) && !string.IsNullOrEmpty(line.strSql)) |
|
|
|
{ |
|
|
|
lineList.Add(line); |
|
|
|
} |
|
|
|
break; |
|
|
|
case "interface": // interface 接口 |
|
|
|
if (!string.IsNullOrEmpty(line.strInterface)) |
|
|
|
{ |
|
|
|
lineList.Add(line); |
|
|
|
} |
|
|
|
break; |
|
|
|
case "ioc": // 依赖注入 |
|
|
|
if (!string.IsNullOrEmpty(line.iocName)) |
|
|
|
{ |
|
|
|
lineList.Add(line); |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return nextNodes; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
///// <summary> |
|
|
|
///// 获取下一节点 |
|
|
|
///// </summary> |
|
|
|
///// <param name="nodeId">当前节点Id</param> |
|
|
|
///// <param name="code">节点操作码 agree 同意 disagree 不同意 lrtimeout 超时</param> |
|
|
|
///// <returns>节点信息列表</returns> |
|
|
|
//public List<NWFNodeInfo> GetNextNodes(string nodeId, string code, List<NWFLineInfo> lineList, bool overFW = false) |
|
|
|
//{ |
|
|
|
|
|
|
|
|
|
|
|
// List<NWFNodeInfo> nextNodes = new List<NWFNodeInfo>(); |
|
|
|
// // 找到与当前节点相连的线条 |
|
|
|
// NWFLineInfo line = null; |
|
|
|
// //如果lastNode 不为空,直接执行最后一条线的绑定方法 并终止任务 |
|
|
|
// if (overFW) |
|
|
|
// { |
|
|
|
// line = wfScheme.lines.Last(); |
|
|
|
// } |
|
|
|
// else |
|
|
|
// { |
|
|
|
// List<NWFLineInfo> listLine = new List<NWFLineInfo>(); |
|
|
|
// listLine = wfScheme.lines.Where(a => a.from == nodeId).ToList(); |
|
|
|
// if (listLine.Count > 1) |
|
|
|
// { |
|
|
|
// line = wfScheme.lines.FirstOrDefault(a => a.from == nodeId && a.agreeList == code); |
|
|
|
// } |
|
|
|
// else |
|
|
|
// { |
|
|
|
// line = listLine.FirstOrDefault(); |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// bool isOk = false; |
|
|
|
// if (string.IsNullOrEmpty(line.strategy) || line.strategy == "1") |
|
|
|
// { |
|
|
|
// isOk = true; |
|
|
|
// } |
|
|
|
// else |
|
|
|
// { |
|
|
|
// var codeList = line.agreeList.Split(','); |
|
|
|
// foreach (string _code in codeList) |
|
|
|
// { |
|
|
|
// if (_code == code) |
|
|
|
// { |
|
|
|
// isOk = true; |
|
|
|
// break; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// if (isOk) |
|
|
|
// { |
|
|
|
// if (nodesMap.ContainsKey(line.to)) |
|
|
|
// { |
|
|
|
// //如果lastNode 不为空,直接执行最后一条线的绑定方法 并终止任务 |
|
|
|
// if (overFW) |
|
|
|
// { |
|
|
|
// nextNodes.Add(endNode); |
|
|
|
// } |
|
|
|
// else |
|
|
|
// { |
|
|
|
// nextNodes.Add(nodesMap[line.to]); |
|
|
|
// } |
|
|
|
|
|
|
|
// switch (line.operationType) |
|
|
|
// {// 绑定的操作类型 |
|
|
|
// case "sql": // sql 语句 |
|
|
|
// if (!string.IsNullOrEmpty(line.dbId) && !string.IsNullOrEmpty(line.strSql)) |
|
|
|
// { |
|
|
|
// lineList.Add(line); |
|
|
|
// } |
|
|
|
// break; |
|
|
|
// case "interface": // interface 接口 |
|
|
|
// if (!string.IsNullOrEmpty(line.strInterface)) |
|
|
|
// { |
|
|
|
// lineList.Add(line); |
|
|
|
// } |
|
|
|
// break; |
|
|
|
// case "ioc": // 依赖注入 |
|
|
|
// if (!string.IsNullOrEmpty(line.iocName)) |
|
|
|
// { |
|
|
|
// lineList.Add(line); |
|
|
|
// } |
|
|
|
// break; |
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// return nextNodes; |
|
|
|
|
|
|
|
//} |
|
|
|
/// <summary> |
|
|
|
/// 获取上一节点列表 |
|
|
|
/// </summary> |
|
|
|