/// <summary> /// 获取流程导航 /// </summary> /// <param name="BusinessID"></param> /// <returns></returns> public List <NavigatActivity1> GetProcessIntance(WorkflowContext p) { List <NavigatActivity1> listna = new List <NavigatActivity1>(); if (BPF.Workflow.Client.WFClientSDK.Exist(BusinessID)) { try { NavigatActivity1 na1 = null; Dictionary <string, BPF.Workflow.Object.Node> list = new Dictionary <string, Node>(); string strNextNodeID = p.ProcessInstance.StartNodeID; foreach (var p1 in p.NodeInstanceList) { if (!string.IsNullOrEmpty(strNextNodeID)) { var CurrentNode = p.NodeInstanceList[strNextNodeID]; list.Add(strNextNodeID, CurrentNode); strNextNodeID = CurrentNode.NextNodeID; } } foreach (var p1 in list) { if (string.IsNullOrEmpty(p1.Value.ParentNodeID)) { na1 = new NavigatActivity1(); na1.ActivityID = p1.Value.NodeID; na1.ActivityName = p1.Value.NodeName; //na1.ActivityType = (ActivityType)p1.Value.NodeType; //na1.RunningStatus = (WFRunningStatus)(p1.Value.Status > 1 ? 3 : p1.Value.Status); List <ClientOpinion1> listclientOp = new List <ClientOpinion1>(); listclientOp.Add(new ClientOpinion1() { CreateDate = p1.Value.FinishDateTime }); na1.Opinions = listclientOp; List <NavigatCandidate1> listnc = new List <NavigatCandidate1>(); var lstNode = p.NodeInstanceList.Where(s => s.Value.ParentNodeID == p1.Value.NodeID); if (lstNode.Count() > 0) { foreach (var itme in lstNode) { listnc.Add(new NavigatCandidate1() { Id = itme.Value.User.UserID, Name = itme.Value.User.UserName, Title = itme.Value.User.UserJobName, DeptName = itme.Value.User.UserOrgPathName, Completed = itme.Value.Status == 2 ? true : false }); } } else { listnc.Add(new NavigatCandidate1() { Id = p1.Value.User.UserID, Name = p1.Value.User.UserName, Title = p1.Value.User.UserJobName, DeptName = p1.Value.User.UserOrgPathName, Completed = p1.Value.Status == 2 ? true : false }); } na1.Candidates = listnc; listna.Add(na1); } } } catch (Exception ex) { Common.ScheduleService.Log.Instance.Error("合并流程获取流程导航出错!,错误信息:" + ex.ToString()); } } return(listna); }
public List <NavigatActivity1> GetProcessIntance(string BusinessID, UserInfo UserLonginID) { var p = BPF.Workflow.Client.WFClientSDK.GetProcess(null, BusinessID, UserLonginID); List <NavigatActivity1> listna = new List <NavigatActivity1>(); NavigatActivity1 na1 = null; Dictionary <string, BPF.Workflow.Object.Node> list = new Dictionary <string, Node>(); string strNextNodeID = p.ProcessInstance.StartNodeID; foreach (var p1 in p.NodeInstanceList) { if (!string.IsNullOrEmpty(strNextNodeID)) { var CurrentNode = p.NodeInstanceList[strNextNodeID]; list.Add(strNextNodeID, CurrentNode); strNextNodeID = CurrentNode.NextNodeID; } } foreach (var p1 in list) { if (string.IsNullOrEmpty(p1.Value.ParentNodeID)) { na1 = new NavigatActivity1(); na1.ActivityID = p1.Value.NodeID; na1.ActivityName = p1.Value.NodeName; na1.ActivityType = p1.Value.NodeType; na1.RunningStatus = (p1.Value.Status > 1 ? 3 : p1.Value.Status); List <ClientOpinion1> listclientOp = new List <ClientOpinion1>(); listclientOp.Add(new ClientOpinion1() { CreateDate = p1.Value.FinishDateTime }); na1.Opinions = listclientOp; List <NavigatCandidate1> listnc = new List <NavigatCandidate1>(); var lstNode = p.NodeInstanceList.Where(s => s.Value.ParentNodeID == p1.Value.NodeID); if (lstNode.Count() > 0) { foreach (var itme in lstNode) { listnc.Add(new NavigatCandidate1() { Id = itme.Value.User.UserID, Name = itme.Value.User.UserName, Title = itme.Value.User.UserJobName, DeptName = itme.Value.User.UserOrgPathName, Completed = itme.Value.Status == 2 ? true : false }); } } else { listnc.Add(new NavigatCandidate1() { Id = p1.Value.User.UserID, Name = p1.Value.User.UserName, Title = p1.Value.User.UserJobName, DeptName = p1.Value.User.UserOrgPathName, Completed = p1.Value.Status == 2 ? true : false }); } na1.Candidates = listnc; listna.Add(na1); } } return(listna); }