Ejemplo n.º 1
0
        public string GetNodeExtData(Aim.WorkFlow.Task task)
        {
            string contents = "";

            Aim.WorkFlow.WorkflowInstance temp = Aim.WorkFlow.WorkflowInstance.Find(task.WorkflowInstanceID);
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(temp.XAML);
            XmlElement          root      = doc.DocumentElement;
            string              nameSpace = root.NamespaceURI;
            XmlNamespaceManager nsmgr     = new XmlNamespaceManager(doc.NameTable);

            nsmgr.AddNamespace("ns", nameSpace);
            nsmgr.AddNamespace("x", "http://schemas.microsoft.com/winfx/2006/xaml");
            nsmgr.AddNamespace("bwa", "clr-namespace:BPM.WF.Activities;assembly=BPM.WF");

            string  current     = "ApprovalNode Name=\"" + task.ApprovalNodeName + "\"";
            XmlNode currentNode = root.SelectSingleNode("//*[contains(@ApprovalNodeConfig,'" + current + "')]", nsmgr);

            if (currentNode != null)//直接路由
            {
                string      config = System.Web.HttpUtility.HtmlDecode(currentNode.Attributes["ApprovalNodeConfig"].InnerXml);
                XmlDocument docC   = new XmlDocument();
                docC.LoadXml(config);
                if (docC.DocumentElement.Attributes["ExtData"] != null)
                {
                    return(docC.DocumentElement.Attributes["ExtData"].InnerText.ToString());
                }
            }
            return(contents);
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Aim.WorkFlow.Task ent = null;
            switch (this.RequestAction)
            {
            case RequestActionEnum.Delete:
                ent = this.GetTargetData <Aim.WorkFlow.Task>();
                ent.Delete();
                this.SetMessage("删除成功!");
                break;

            default:
                if (RequestActionString == "batchdelete")
                {
                    IList <object> idList = RequestData.GetList <object>("IdList");

                    if (idList != null && idList.Count > 0)
                    {
                        SysWorkFlowTask.DoBatchDelete(idList.ToArray());
                    }
                }
                else
                {
                    SearchCriterion.SetSearch("EFormName", this.RequestData["FormId"].ToString(), SearchModeEnum.Like);
                    //SearchCriterion.SetOrder("CreatedTime", true);
                    //SearchCriterion.SetOrder("FinishTime", true);
                    ents = Aim.WorkFlow.TaskRule.FindAll(SearchCriterion).OrderBy(ens => !ens.FinishTime.HasValue ? DateTime.Now : ens.FinishTime).OrderBy(ens => ens.CreatedTime).ToArray();
                    this.PageState.Add("SysWorkFlowTaskList", ents);
                }
                break;
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.RequestActionString.ToLower())
            {
            case "submittask":
                Aim.WorkFlow.WinService.Task task = Aim.WorkFlow.WorkFlow.ServiceClient.GetTaskByTaskId(this.RequestData["TaskId"].ToString());
                if (task.Status == 0)
                {
                    Aim.WorkFlow.WorkFlow.SubmitTask("", task.WorkflowInstanceID, task.BookmarkName, GetApprovalResult(task));
                }
                PageState.Add("message", "提交成功!");
                break;

            case "checkstate":
                //检查如果有后续任务未提交,则设置状态为已提交.
                Aim.WorkFlow.Task taskpre = Aim.WorkFlow.Task.Find(this.RequestData["TaskId"].ToString());
                if (taskpre.Status == 0 && DataHelper.QueryDataTable("select * from Task where WorkFlowInstanceId='" + taskpre.WorkflowInstanceID + "' and ApprovalNodeName<>'" + taskpre.ApprovalNodeName + "' and CreatedTime>'" + taskpre.CreatedTime + "' and Status=0").Rows.Count > 0)
                {
                    taskpre.Status = 4;
                    taskpre.Save();
                }
                break;

            case "savetask":
                Aim.WorkFlow.Task tas = Aim.WorkFlow.Task.Find(this.RequestData["TaskId"].ToString());
                tas.FinishTime = DateTime.Now;
                tas.Status     = 4;
                tas.Save();
                break;

            default:
                if (this.RequestData["TaskId"] != null && !string.IsNullOrEmpty(this.RequestData["TaskId"].ToString()))
                {
                    Aim.WorkFlow.Task fTask = Aim.WorkFlow.Task.Find(this.RequestData["TaskId"].ToString());
                    if (!fTask.UpdatedTime.HasValue)
                    {
                        fTask.UpdatedTime = DateTime.Now;
                        fTask.Save();
                    }
                    //捕获节点扩展信息配置,如已阅,加签,并行等信息
                    this.PageState.Add("ExtData", GetNodeExtData(fTask));
                    Aim.WorkFlow.WorkflowInstance instance = WorkflowInstance.Find(fTask.WorkflowInstanceID);
                    this.PageState.Add("InstanceId", fTask.WorkflowInstanceID);
                    this.PageState.Add("TemplateId", instance.WorkflowTemplateID);
                    FlowInstanceId = instance.ID;
                    FormUrl        = instance.RelateUrl;
                    FlowDefineId   = instance.WorkflowTemplateID;
                    Title          = fTask.WorkFlowName + "->" + fTask.ApprovalNodeName;
                    Aim.WorkFlow.Task[] tasks = Aim.WorkFlow.Task.FindAllByProperty("CreatedTime", "WorkflowInstanceID", fTask.WorkflowInstanceID);
                    this.PageState.Add("Tasks", JsonHelper.GetJsonString(tasks));
                    this.PageState.Add("Task", fTask);
                }
                break;
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.RequestActionString.ToLower())
            {
            case "getusers":
                GetNextUsers(this.RequestData["TemplateId"].ToString(), this.RequestData["FlowInstanceId"].ToString(), this.RequestData["Name"].ToString(), this.RequestData["CurrentName"].ToString());
                break;

            case "getbackusers":
                Aim.WorkFlow.Task[] tks = Aim.WorkFlow.Task.FindAllByProperties(Aim.WorkFlow.Task.Prop_WorkflowInstanceID, this.RequestData["FlowInstanceId"].ToString(), Aim.WorkFlow.Task.Prop_ApprovalNodeName, this.RequestData["TaskName"].ToString());
                if (tks != null && tks.Length == 1)    //打回情况一个人的时候有效,多人的话,还是从之前配置里取
                {
                    this.PageState.Add("NextUserIds", tks[0].OwnerId);
                    this.PageState.Add("NextUserNames", tks[0].Owner);
                }
                break;

            default:
                Aim.WorkFlow.Task fTask = null;
                if (this.RequestData["FormId"] != null)
                {
                    Aim.WorkFlow.WorkflowInstance wf = WorkflowInstance.FindAllByProperties(WorkflowInstance.Prop_RelateId, this.RequestData["FormId"].ToString())[0];
                    fTask = Aim.WorkFlow.Task.FindAllByProperties(Aim.WorkFlow.Task.Prop_WorkflowInstanceID, wf.ID).Where(Ent => Ent.Ext1 != "Branch").ToArray()[0];
                }
                else
                {
                    fTask = Aim.WorkFlow.Task.Find(this.RequestData["TaskId"].ToString());
                }

                /*if (fTask.Ext1 == "Branch")
                 * {
                 *  Response.Redirect("FreeTask.aspx?op=r&Type=Branch&TaskId=" + this.RequestData["TaskId"].ToString());
                 * }*/
                /*if (!fTask.UpdatedTime.HasValue)
                 * {
                 *  try
                 *  {
                 *      DataTable dt = DataHelper.QueryDataTable("select FactDeptName,FactDeptId from View_SysUserGroupFact where UserId='" + this.UserInfo.UserID + "' and FactDeptName is not null ");
                 *      if (dt.Rows.Count > 0)
                 *      {
                 *          fTask.DeptId = dt.Rows[0]["FactDeptId"].ToString();
                 *          fTask.DeptName = dt.Rows[0]["FactDeptName"].ToString();
                 *      }
                 *  }
                 *  catch { }
                 *  fTask.UpdatedTime = DateTime.Now;
                 *  fTask.Save();
                 * }*/
                Aim.WorkFlow.WorkflowInstance instance = WorkflowInstance.Find(fTask.WorkflowInstanceID);
                this.PageState.Add("InstanceId", fTask.WorkflowInstanceID);
                this.PageState.Add("TemplateId", instance.WorkflowTemplateID);
                FlowInstanceId = instance.ID;
                FormUrl        = instance.RelateUrl;
                FlowDefineId   = instance.WorkflowTemplateID;
                Title          = fTask.WorkFlowName;//+ "->" + fTask.ApprovalNodeName;
                XmlSerializer xs = new XmlSerializer(typeof(TaskContext));
                if (!string.IsNullOrEmpty(fTask.Context))
                {
                    StringReader sr      = new StringReader(fTask.Context);
                    TaskContext  content = xs.Deserialize(sr) as TaskContext;
                    if (content.SwitchRules.Length > 0)
                    {
                        TaskContextSwitchRuleNextAction[] arrs = content.SwitchRules[0].NextActions;
                        string comboxdataText = "['{0}','{1}'],";
                        if (arrs.Length > 0)
                        {
                            int first = 0;
                            foreach (TaskContextSwitchRuleNextAction ar in arrs)
                            {
                                //GetNextRoute(currentNode, nsmgr, ar.Name)
                                NextStep += string.Format(comboxdataText, ar.Name, ar.Name);
                                if (first == 0)
                                {
                                    GetNextUsers(instance.WorkflowTemplateID, fTask.WorkflowInstanceID, ar.Name, fTask.ApprovalNodeName);
                                }
                                first++;
                            }
                        }
                        else
                        {
                            NextStep += string.Format("['','{0}'],", "结束");
                        }
                    }
                    else
                    {
                        NextStep += string.Format("['','{0}'],", "结束");
                    }
                }
                else
                {
                    NextStep += string.Format("['','{0}'],", "结束");
                }
                NextStep = NextStep.TrimEnd(',');
                Aim.WorkFlow.Task[] tasks = Aim.WorkFlow.Task.FindAll(Expression.Eq("WorkflowInstanceID", fTask.WorkflowInstanceID)).OrderBy(ens => !ens.FinishTime.HasValue ? DateTime.Now : ens.FinishTime).OrderBy(ens => ens.CreatedTime).ToArray();
                this.PageState.Add("Tasks", JsonHelper.GetJsonString(tasks));
                this.PageState.Add("Task", fTask);
                break;
            }
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.RequestActionString.ToLower())
            {
            case "submittask":
                Aim.WorkFlow.WFService.Task task = Aim.WorkFlow.WorkFlow.ServiceClient.GetTaskByTaskId(this.RequestData["TaskId"].ToString());
                Aim.WorkFlow.WorkFlow.SubmitTask("", task.WorkflowInstanceID, task.BookmarkName, GetApprovalResult(task));
                PageState.Add("message", "提交成功!");
                break;

            case "savetask":
                Aim.WorkFlow.Task tas = Aim.WorkFlow.Task.Find(this.RequestData["TaskId"].ToString());
                tas.Description = this.RequestData["Opinion"].ToString();
                tas.SaveAndFlush();
                break;

            case "getusers":
                GetNextUsers(this.RequestData["TemplateId"].ToString(), this.RequestData["FlowInstanceId"].ToString(), this.RequestData["Name"].ToString(), this.RequestData["CurrentName"].ToString());
                break;

            case "getbackusers":
                Aim.WorkFlow.Task[] tks = Aim.WorkFlow.Task.FindAllByProperties(Aim.WorkFlow.Task.Prop_WorkflowInstanceID, this.RequestData["FlowInstanceId"].ToString(), Aim.WorkFlow.Task.Prop_ApprovalNodeName, this.RequestData["TaskName"].ToString());
                if (tks != null && tks.Length == 1)    //打回情况一个人的时候有效,多人的话,还是从之前配置里取
                {
                    this.PageState.Add("NextUserIds", tks[0].OwnerId);
                    this.PageState.Add("NextUserNames", tks[0].Owner);
                }
                break;

            default:
                if (this.RequestData["TaskId"] != null && !string.IsNullOrEmpty(this.RequestData["TaskId"].ToString()))
                {
                    Aim.WorkFlow.Task             fTask    = Aim.WorkFlow.Task.Find(this.RequestData["TaskId"].ToString());
                    Aim.WorkFlow.WorkflowInstance instance = WorkflowInstance.Find(fTask.WorkflowInstanceID);
                    this.PageState.Add("InstanceId", fTask.WorkflowInstanceID);
                    this.PageState.Add("TemplateId", instance.WorkflowTemplateID);
                    FlowInstanceId = instance.ID;
                    FormUrl        = instance.RelateUrl;
                    FlowDefineId   = instance.WorkflowTemplateID;
                    Title          = fTask.WorkFlowName + "->" + fTask.ApprovalNodeName;
                    XmlSerializer xs = new XmlSerializer(typeof(TaskContext));
                    if (!string.IsNullOrEmpty(fTask.Context))
                    {
                        /*Aim.WorkFlow.WorkflowTemplate temp = Aim.WorkFlow.WorkflowTemplate.Find(instance.WorkflowTemplateID);
                         * XmlDocument doc = new XmlDocument();
                         * doc.LoadXml(temp.XAML);
                         * XmlElement root = doc.DocumentElement;
                         * string nameSpace = root.NamespaceURI;
                         * XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
                         * nsmgr.AddNamespace("ns", nameSpace);
                         * nsmgr.AddNamespace("x", "http://schemas.microsoft.com/winfx/2006/xaml");
                         * nsmgr.AddNamespace("bwa", "clr-namespace:BPM.WF.Activities;assembly=BPM.WF");
                         * XmlNode currentNode = root.SelectSingleNode("//*[contains(@ApprovalNodeConfig,'" + fTask.ApprovalNodeName + "')]", nsmgr);*/
                        StringReader sr      = new StringReader(fTask.Context);
                        TaskContext  content = xs.Deserialize(sr) as TaskContext;
                        if (content.SwitchRules.Length > 0)
                        {
                            TaskContextSwitchRuleNextAction[] arrs = content.SwitchRules[0].NextActions;
                            string comboxdataText = "['{0}','{1}'],";
                            if (arrs.Length > 0)
                            {
                                int first = 0;
                                foreach (TaskContextSwitchRuleNextAction ar in arrs)
                                {
                                    //GetNextRoute(currentNode, nsmgr, ar.Name)
                                    NextStep += string.Format(comboxdataText, ar.Name, ar.Name);
                                    if (first == 0)
                                    {
                                        GetNextUsers(instance.WorkflowTemplateID, fTask.WorkflowInstanceID, ar.Name, fTask.ApprovalNodeName);
                                    }
                                    first++;
                                }
                            }
                            else
                            {
                                NextStep += string.Format("['','{0}'],", "结束");
                            }
                        }
                        else
                        {
                            NextStep += string.Format("['','{0}'],", "结束");
                        }
                    }
                    else
                    {
                        NextStep += string.Format("['','{0}'],", "结束");
                    }
                    NextStep = NextStep.TrimEnd(',');
                    Aim.WorkFlow.Task[] tasks = Aim.WorkFlow.Task.FindAllByProperty("CreatedTime", "WorkflowInstanceID", fTask.WorkflowInstanceID);
                    this.PageState.Add("Tasks", JsonHelper.GetJsonString(tasks));
                    this.PageState.Add("Task", fTask);
                }
                break;
            }
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Aim.WorkFlow.Task ent = null;
            switch (this.RequestAction)
            {
            case RequestActionEnum.Delete:
                ent = this.GetTargetData <Aim.WorkFlow.Task>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                break;

            default:
                if (RequestActionString == "batchdelete")
                {
                    IList <object> idList = RequestData.GetList <object>("IdList");

                    if (idList != null && idList.Count > 0)
                    {
                        Aim.WorkFlow.Task.DoBatchDelete(idList.ToArray());
                    }
                }
                else if (this.RequestActionString.ToLower() == "startflow")
                {
                    //启动流程

                    /*string key = "FirstFlow";
                     * //表单路径,后面加上参数传入
                     * string formUrl = "/EPC/PrjBasic/PrjBasicEdit.aspx?op=u";
                     * Aim.WorkFlow.WorkFlow.StartWorkFlow("", formUrl, "流程的标题", key, this.UserInfo.UserID, this.UserInfo.Name);*/
                    Aim.WorkFlow.WorkflowTemplate ne = Aim.WorkFlow.WorkflowTemplate.FindAllByProperty("Code", "audit")[0];
                    //启动流程
                    string key = "audit";
                    //表单路径,后面加上参数传入
                    string formUrl = "/EPC/PrjBasic/PrjBasicEdit.aspx?op=u";
                    Aim.WorkFlow.WorkFlow.StartWorkFlow(ne.ID, formUrl, ne.TemplateName, key, this.UserInfo.UserID, this.UserInfo.Name);
                    PageState.Add("message", "启动成功");
                }
                else
                {
                    SearchCriterion.SetSearch("Status", int.Parse(this.RequestData["Status"].ToString()));
                    SearchCriterion.SetSearch("OwnerId", this.UserInfo.UserID);
                    SearchCriterion.SetOrder("CreatedTime", false);
                    string dateFlag = this.RequestData["Date"] == null ? "3" : this.RequestData["Date"].ToString();
                    switch (dateFlag)
                    {
                    case "3":
                        SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddDays(-3), SearchModeEnum.GreaterThanEqual);
                        break;

                    case "7":
                        SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddDays(-7), SearchModeEnum.GreaterThanEqual);
                        break;

                    case "14":
                        SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddDays(-14), SearchModeEnum.GreaterThanEqual);
                        break;

                    case "30":
                        SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddMonths(-1), SearchModeEnum.GreaterThanEqual);
                        break;

                    case "31":
                        SearchCriterion.SetSearch("CreatedTime", DateTime.Now.AddMonths(-1), SearchModeEnum.LessThanEqual);
                        break;
                    }
                    ents = Aim.WorkFlow.TaskRule.FindAll(SearchCriterion);
                    this.PageState.Add("SysWorkFlowTaskList", ents);
                }
                break;
            }
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.RequestActionString.ToLower())
            {
            case "submittask":
                Aim.WorkFlow.WinService.Task task = Aim.WorkFlow.WorkFlow.ServiceClient.GetTaskByTaskId(this.RequestData["TaskId"].ToString());
                if (task.Status == 0)
                {
                    Aim.WorkFlow.WorkFlow.SubmitTask("", task.WorkflowInstanceID, task.BookmarkName, GetApprovalResult(task));
                }
                PageState.Add("message", "提交成功!");
                break;

            case "submitaddtask":
                Aim.WorkFlow.Task taskOld    = Aim.WorkFlow.Task.Find(this.RequestData["TaskId"].ToString());
                string            userIds    = this.RequestData.Get <string>("UserIds");
                string            userNames  = this.RequestData.Get <string>("UserNames");
                string[]          userIdss   = userIds.Split(',');
                string[]          userNamess = userNames.Split(',');
                for (int i = 0; i < userIdss.Length; i++)
                {
                    if (userIdss[i].Trim() == "")
                    {
                        continue;
                    }
                    Aim.WorkFlow.Task taskNew = new Aim.WorkFlow.Task();
                    DataHelper.MergeData <Aim.WorkFlow.Task>(taskNew, taskOld);
                    taskNew.Owner            = userNamess[i];
                    taskNew.OwnerId          = userIdss[i];
                    taskNew.Ext1             = "Branch";
                    taskNew.Ext2             = taskOld.ID;
                    taskNew.CreatedTime      = DateTime.Now;
                    taskNew.UpdatedTime      = DateTime.Now;
                    taskNew.ApprovalNodeName = taskNew.ApprovalNodeName + "[分发]";
                    taskNew.Create();
                }
                PageState.Add("message", "分发成功!");
                break;

            case "savetask":
                Aim.WorkFlow.Task tas = Aim.WorkFlow.Task.Find(this.RequestData["TaskId"].ToString());
                tas.Description = this.RequestData["Opinion"].ToString();
                tas.SaveAndFlush();
                break;

            case "getusers":
                GetNextUsers(this.RequestData["TemplateId"].ToString(), this.RequestData["FlowInstanceId"].ToString(), this.RequestData["Name"].ToString(), this.RequestData["CurrentName"].ToString());
                break;

            case "getbackusers":
                Aim.WorkFlow.Task[] tks = Aim.WorkFlow.Task.FindAllByProperties(Aim.WorkFlow.Task.Prop_WorkflowInstanceID, this.RequestData["FlowInstanceId"].ToString(), Aim.WorkFlow.Task.Prop_ApprovalNodeName, this.RequestData["TaskName"].ToString());
                if (tks != null && tks.Length == 1)    //打回情况一个人的时候有效,多人的话,还是从之前配置里取
                {
                    this.PageState.Add("NextUserIds", tks[0].OwnerId);
                    this.PageState.Add("NextUserNames", tks[0].Owner);
                }
                break;

            case "checkstate":
                //检查如果有后续任务未提交,则设置状态为已提交.
                Aim.WorkFlow.Task taskpre = Aim.WorkFlow.Task.Find(this.RequestData["TaskId"].ToString());
                if (taskpre.Status == 0 && DataHelper.QueryDataTable("select * from Task where WorkFlowInstanceId='" + taskpre.WorkflowInstanceID + "' and ApprovalNodeName<>'" + taskpre.ApprovalNodeName + "' and CreatedTime>'" + taskpre.CreatedTime + "' and Status=0").Rows.Count > 0)
                {
                    taskpre.Status = 4;
                    taskpre.Save();
                }
                break;

            default:
                if (this.RequestData["TaskId"] != null && !string.IsNullOrEmpty(this.RequestData["TaskId"].ToString()))
                {
                    Aim.WorkFlow.Task fTask = Aim.WorkFlow.Task.Find(this.RequestData["TaskId"].ToString());
                    if (!fTask.UpdatedTime.HasValue)
                    {
                        fTask.UpdatedTime = DateTime.Now;
                        fTask.Save();
                    }
                    if (fTask.Ext1 == "Branch")
                    {
                        Response.Redirect("FreeTask.aspx?Type=Branch&TaskId=" + this.RequestData["TaskId"].ToString());
                    }
                    if (fTask.Flag == "Add")
                    {
                        fTask.ApprovalNodeName = fTask.Ext1;
                    }
                    //捕获节点扩展信息配置,如已阅,加签,并行等信息
                    this.PageState.Add("ExtData", GetNodeExtData(fTask));
                    Aim.WorkFlow.WorkflowInstance instance = WorkflowInstance.Find(fTask.WorkflowInstanceID);
                    this.PageState.Add("InstanceId", fTask.WorkflowInstanceID);
                    this.PageState.Add("TemplateId", instance.WorkflowTemplateID);
                    FlowInstanceId = instance.ID;
                    FormUrl        = instance.RelateUrl;
                    FlowDefineId   = instance.WorkflowTemplateID;
                    Title          = fTask.WorkFlowName + "->" + fTask.ApprovalNodeName;
                    XmlSerializer xs = new XmlSerializer(typeof(TaskContext));
                    if (!string.IsNullOrEmpty(fTask.Context))
                    {
                        /*Aim.WorkFlow.WorkflowTemplate temp = Aim.WorkFlow.WorkflowTemplate.Find(instance.WorkflowTemplateID);
                         * XmlDocument doc = new XmlDocument();
                         * doc.LoadXml(temp.XAML);
                         * XmlElement root = doc.DocumentElement;
                         * string nameSpace = root.NamespaceURI;
                         * XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
                         * nsmgr.AddNamespace("ns", nameSpace);
                         * nsmgr.AddNamespace("x", "http://schemas.microsoft.com/winfx/2006/xaml");
                         * nsmgr.AddNamespace("bwa", "clr-namespace:BPM.WF.Activities;assembly=BPM.WF");
                         * XmlNode currentNode = root.SelectSingleNode("//*[contains(@ApprovalNodeConfig,'" + fTask.ApprovalNodeName + "')]", nsmgr);*/
                        StringReader sr      = new StringReader(fTask.Context);
                        TaskContext  content = xs.Deserialize(sr) as TaskContext;
                        if (content.SwitchRules.Length > 0)
                        {
                            TaskContextSwitchRuleNextAction[] arrs = content.SwitchRules[0].NextActions;
                            string comboxdataText = "['{0}','{1}'],";
                            if (arrs.Length > 0)
                            {
                                int first = 0;
                                foreach (TaskContextSwitchRuleNextAction ar in arrs)
                                {
                                    //GetNextRoute(currentNode, nsmgr, ar.Name)
                                    NextStep += string.Format(comboxdataText, ar.Name, ar.Name);
                                    if (first == 0)
                                    {
                                        GetNextUsers(instance.WorkflowTemplateID, fTask.WorkflowInstanceID, ar.Name, fTask.ApprovalNodeName);
                                    }
                                    first++;
                                }
                            }
                            else
                            {
                                NextStep += string.Format("['','{0}'],", "结束");
                            }
                        }
                        else
                        {
                            NextStep += string.Format("['','{0}'],", "结束");
                        }
                    }
                    else
                    {
                        NextStep += string.Format("['','{0}'],", "结束");
                    }
                    NextStep = NextStep.TrimEnd(',');
                    Aim.WorkFlow.Task[] tasks = Aim.WorkFlow.Task.FindAllByProperty("CreatedTime", "WorkflowInstanceID", fTask.WorkflowInstanceID).OrderBy(ens => !ens.FinishTime.HasValue ? DateTime.Now : ens.FinishTime).OrderBy(ens => ens.CreatedTime).ToArray();
                    this.PageState.Add("Tasks", JsonHelper.GetJsonString(tasks));
                    this.PageState.Add("Task", fTask);
                }
                break;
            }
        }