/// <summary>
        /// 未认领的任务
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="topsize">返回的的记录条数</param>
        /// <returns>未认领的任务列表</returns>
        public DataTable ClaimWorkTask(UserInfo userInfo, string userId, int topsize)
        {
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_ClaimWorkTask);
            var dataTable = new DataTable(WorkTaskInstanceTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                dataTable   = manager.ClaimWorkTask(userId, topsize);
            });
            return(dataTable);
        }
        /// <summary>
        /// 我异常终止的任务个数
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户id</param>
        /// <returns>我异常终止的任务数</returns>
        public int GetAbnormalTaskCount(UserInfo userInfo, string userId)
        {
            int returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_GetAbnormalTaskCount);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                returnValue = manager.GetAbnormalTaskCount(userId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 设定流程实例异常终止
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowInsId">实例实例id</param>
        /// <param name="userId">用户id</param>
        /// <param name="msg">信息</param>
        /// <returns></returns>
        public string SetAbnormal(UserInfo userInfo, string workflowInsId, string userId, string msg)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_SetAbnormal);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                returnValue = manager.SetAbnormal(workflowInsId, userId, msg);
            });
            return(returnValue);
        }
        /// <summary>
        /// 加载退回原因
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowinsid">工作流程实例Id</param>
        /// <returns>退回原因列表</returns>
        public DataTable GetWorkFlowBack(UserInfo userInfo, string workflowinsid)
        {
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_GetWorkFlowBack);
            var dataTable = new DataTable(WorkTaskInstanceTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                dataTable   = manager.GetWorkflowback(workflowinsid);
            });
            return(dataTable);
        }
        /// <summary>
        /// 设定流程实例的当前位置
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowInsId">工作流程实例Id</param>
        /// <param name="nowtaskId"></param>
        /// <returns></returns>
        public int SetCurrTaskId(UserInfo userInfo, string workflowInsId, string nowtaskId)
        {
            int returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_SetCurrTaskId);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.SetCurrTaskId(workflowInsId, nowtaskId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 创建工作流实例
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">流程实例实体</param>
        /// <returns>主键</returns>
        public string CreateWorkFlowInstance(UserInfo userInfo, WorkFlowInstanceEntity entity)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_CreateWorkFlowInstance);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.Create(entity);
            });
            return(returnValue);
        }
        /// <summary>
        /// 未认领的任务(分页方式)
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="search">查询</param>
        /// <param name="recordCount">记录数</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页显示</param>
        /// <param name="order">排序</param>
        /// <returns>未认领的任务列表</returns>
        public DataTable GetUnClaimedTaskByPage(UserInfo userInfo, string userId, string search, out int recordCount, int pageIndex = 0, int pageSize = 100, string order = null)
        {
            var parameter     = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable     = new DataTable(WorkTaskInstanceTable.TableName);
            int myrecordCount = 0;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                dataTable   = manager.GetUnClaimedTaskByPage(userId, search, out myrecordCount, pageIndex, pageSize, order);
            });
            recordCount = myrecordCount;
            return(dataTable);
        }
        /// <summary>
        /// 我参与的任务
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="recordCount">记录数</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页显示</param>
        /// <param name="flag">标志,默认为"All”</param>
        /// <param name="search">条件表达式</param>
        /// <returns>我参与的任务列表</returns>
        public DataTable WorkFlowAllTaskByPage(UserInfo userInfo, string userId, out int recordCount, int pageIndex = 0, int pageSize = 100, string flag = "All", string search = "")
        {
            var parameter     = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_WorkFlowAllTaskByPage);
            var dataTable     = new DataTable(WorkTaskInstanceTable.TableName);
            int myrecordCount = 0;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                dataTable   = manager.WorkFlowAllTaskByPage(userId, out myrecordCount, pageIndex, pageSize, flag, search);
            });
            recordCount = myrecordCount;
            return(dataTable);
        }
        /// <summary>
        /// 创建所有符合条件的任务实例
        /// </summary>
        /// <param name="userId">处理人Id</param>
        /// <param name="workFlowId">工作流模板id</param>
        /// <param name="workTaskId">当前任务Id</param>
        /// <param name="workFlowInstanceId">工作流实例Id</param>
        /// <param name="workTaskInstanceId">原任务实例Id</param>
        /// <param name="operatorInstanceId">处理者实例Id</param>
        /// <param name="commandName">命令</param>
        /// <returns>
        /// 000002:没有配置后续任务
        /// 000000:操作成功
        /// </returns>
        public string CreateNextTaskInstance(string userId, string workFlowId, string workTaskId, string workFlowInstanceId, string workTaskInstanceId, string operatorInstanceId, string commandName)
        {
            var userName = new PiUserManager(DbFactoryProvider.GetProvider(SystemInfo.RDIFrameworkDbType, SystemInfo.RDIFrameworkDbConectionString), this.UserInfo).GetEntity(userId).UserName;

            var dt = GetLineEndTasks(workFlowId, workTaskId, commandName);

            if (dt != null && dt.Rows.Count > 0)
            {
                var condition        = "";                  //条件
                var priority         = "";                  //优先级,只执行优先级最高的分支,如果优先级相同 那么同时执行。
                var endTaskId        = "";                  //后续任务节点Id
                var endoperRule      = "";                  //新任务处理者策略
                var startoperRule    = "";                  //当前任务处理者策略
                var taskType         = "";                  //节点类型
                var endTaskTypeAndOr = "";                  //控制节点专用,表示and/or
                var operParam        = new OperParameter(); //创建处理者参数

                #region 配置了后续节点
                var l = dt.Rows.Count;
                var branchPriority = dt.Rows[0]["PRIORITY"].ToString();//优先级
                //遍历满足条件的所有任务节点
                for (var i = 0; i < l; i++)
                {
                    var dr = dt.Rows[i];
                    condition            = dr["CONDITION"].ToString();
                    priority             = dr["PRIORITY"].ToString();
                    endTaskId            = dr["ENDTASKID"].ToString();
                    endoperRule          = dr["ENDOPERRULE"].ToString();
                    startoperRule        = dr["STARTOPERRULE"].ToString();
                    taskType             = dr["ENDTASKTYPEID"].ToString();
                    endTaskTypeAndOr     = dr["ENDTASKTYPEANDOR"].ToString();
                    operParam.OperRule   = endoperRule;
                    operParam.IsJumpSelf = Convert.ToBoolean(dr["ISJUMPSELF"]);
                    if (priority != branchPriority)
                    {
                        break;                                                                                          //只执行优先级最高的分支
                    }
                    if (ExpressPass(userId, workFlowId, workTaskId, workFlowInstanceId, workTaskInstanceId, condition)) //满足条件的任务节点
                    {
                        switch (taskType)
                        {
                        case "2":    //结束节点
                        {
                            #region 结束节点
                            //产生一个结束节点的实例
                            var newEndTaskId   = BusinessLogic.NewGuid();      //新任务处理者实例Id
                            var endWorktaskIns = new WorkTaskInstanceEntity
                            {
                                WorkFlowId     = workFlowId,
                                WorkTaskId     = endTaskId,
                                WorkFlowInsId  = workFlowInstanceId,
                                WorkTaskInsId  = newEndTaskId,
                                PreviousTaskId = workTaskInstanceId,
                                TaskInsCaption = new WorkTaskManager(this.DBProvider, this.UserInfo).GetTaskCaption(endTaskId),
                                Status         = "2"//结束节点不需要再处理,但此处不能为3,设置结束实例会修改该值=3
                            };
                            new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).Create(endWorktaskIns);

                            //设置处理者实例正常结束
                            new OperatorInstanceManager(this.DBProvider, this.UserInfo).SetOperatorInstanceOver(userId, operatorInstanceId);
                            //设置任务实例正常结束
                            new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetWorkTaskInstanceOver(userName, workTaskInstanceId);
                            new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetWorkTaskInstanceOver(userName, newEndTaskId);        //结束节点实例 结束
                            //设置流程实例正常结束
                            new WorkFlowInstanceManager(this.DBProvider, this.UserInfo).SetWorkflowInstanceOver(workFlowInstanceId);
                            //设定流程实例的当前位置
                            new WorkFlowInstanceManager(this.DBProvider, this.UserInfo).SetCurrTaskId(workFlowInstanceId, endTaskId);
                            new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetSuccessMsg(WorkFlowConst.WorkflowOverMsg, workTaskInstanceId);        //结束节点单独处理,任务提交给谁了
                            //检查是否子流程调用
                            DataTable operInfo = new WorkFlowInstanceManager(this.DBProvider, this.UserInfo).GetWorkflowInstance(workFlowInstanceId);
                            if (operInfo != null && operInfo.Rows.Count > 0)
                            {
                                var isSubWorkflow     = false;    //是否是子流程调用
                                var mainWorkflowInsId = "";
                                var mainWorktaskId    = "";
                                var mainWorkflowId    = "";
                                var mainWorktaskInsId = "";
                                isSubWorkflow     = BusinessLogic.ConvertIntToBoolean(operInfo.Rows[0][WorkFlowInstanceTable.FieldIsSubWorkflow]);
                                mainWorkflowInsId = operInfo.Rows[0][WorkFlowInstanceTable.FieldMainWorkflowInsId].ToString();  //主流程实例Id
                                mainWorktaskId    = operInfo.Rows[0][WorkFlowInstanceTable.FieldMainWorktaskId].ToString();     //子流程节点模板Id
                                mainWorkflowId    = operInfo.Rows[0][WorkFlowInstanceTable.FieldMainWorkflowId].ToString();     //主流程模板Id
                                mainWorktaskInsId = operInfo.Rows[0][WorkFlowInstanceTable.FieldMainWorktaskInsId].ToString();  //主任务实例Id,进入子节点前的任务节点实例
                                if (isSubWorkflow)
                                {
                                    //创建一个子流程节点实例痕迹,表示子流程节点处理完成
                                    var newTaskId        = BusinessLogic.NewGuid(); //新任务处理者实例Id
                                    var workTaskInstance = new WorkTaskInstanceEntity {
                                        WorkFlowId     = mainWorkflowId,
                                        WorkTaskId     = mainWorktaskId,
                                        WorkFlowInsId  = mainWorkflowInsId,
                                        WorkTaskInsId  = newTaskId,
                                        PreviousTaskId = mainWorktaskInsId,
                                        TaskInsCaption = "子流程",
                                        Status         = "3"
                                    };
                                    new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).Create(workTaskInstance);
                                    var result = CreateNextTaskInstance(userId, mainWorkflowId, mainWorktaskId, mainWorkflowInsId, newTaskId, operatorInstanceId, "提交");
                                    if (result != WorkFlowConst.SuccessCode)
                                    {
                                        return(result);
                                    }
                                }
                            }
                            #endregion
                            break;
                        }

                        case "3":
                        {
                            #region 交互节点
                            switch (endoperRule)
                            {
                            case "1":
                            {
                                //创建一个任务实例
                                var newTaskId        = BusinessLogic.NewGuid();     //新任务处理者实例Id
                                var workTaskInstance = new WorkTaskInstanceEntity
                                {
                                    WorkFlowId     = workFlowId,
                                    WorkTaskId     = endTaskId,
                                    WorkFlowInsId  = workFlowInstanceId,
                                    WorkTaskInsId  = newTaskId,
                                    PreviousTaskId = workTaskInstanceId,
                                    TaskInsCaption = new WorkTaskManager(this.DBProvider, this.UserInfo).GetTaskCaption(endTaskId),
                                    Status         = "1"
                                };
                                new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).Create(workTaskInstance);
                                //创建多个处理人
                                var result = CreateOperInstance(userId, workTaskInstanceId, workTaskId, workFlowId, endTaskId, workFlowInstanceId, newTaskId, operParam);            //创建处理者实例
                                if (result != WorkFlowConst.SuccessCode)
                                {
                                    return(result);
                                }
                            }
                            break;

                            case "2":
                            {
                                //创建任务实例和处理人
                                var result = CreateOperInstance(userId, workTaskInstanceId, workTaskId, workFlowId, endTaskId, workFlowInstanceId, workTaskInstanceId, operParam);
                                if (result != WorkFlowConst.SuccessCode)
                                {
                                    return(result);
                                }
                            }
                            break;
                            }

                            //设置处理者实例正常结束
                            new OperatorInstanceManager(this.DBProvider, this.UserInfo).SetOperatorInstanceOver(userId, operatorInstanceId);
                            //设置任务实例正常结束
                            new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetWorkTaskInstanceOver(userName, workTaskInstanceId);
                            //设定流程实例的当前位置
                            new WorkFlowInstanceManager(this.DBProvider, this.UserInfo).SetCurrTaskId(workFlowInstanceId, endTaskId);
                            //设定任务实例成功提交信息
                            new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetSuccessMsg(WorkFlowConst.SuccessMsg, workTaskInstanceId);
                            #endregion
                            break;
                        }

                        case "4":    //控制节点
                        {
                            #region 控制节点
                            //设置处理者实例正常结束
                            new OperatorInstanceManager(this.DBProvider, this.UserInfo).SetOperatorInstanceOver(userId, operatorInstanceId);
                            //设置任务实例正常结束
                            new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetWorkTaskInstanceOver(userName, workTaskInstanceId);
                            //设定流程实例的当前位置
                            new WorkFlowInstanceManager(this.DBProvider, this.UserInfo).SetCurrTaskId(workFlowInstanceId, endTaskId);
                            //设定任务实例成功提交信息
                            new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetSuccessMsg(WorkFlowConst.SuccessMsg, workTaskInstanceId);
                            //******start检查判断节点前面的所以节点的任务实例是否都完成


                            //取控制节点前端所以节点,进行逐个判断
                            var dtstart = GetLineStartTasks(workFlowId, endTaskId);
                            var allPass = true;        //全部通过
                            foreach (DataRow dr1 in dtstart.Rows)
                            {
                                var taskId = dr1["STARTTASKID"].ToString();
                                if (endTaskTypeAndOr == WorkConst.Command_Or)                                  //or分支
                                {
                                    if (IsPassJudge(workFlowId, workFlowInstanceId, taskId, endTaskTypeAndOr)) //判断每个节点实例是否完成
                                    {
                                        allPass = true;
                                        break;        //如果有一个通过即可。
                                    }
                                    allPass = false;
                                }
                                else                                                                            //and分支
                                {
                                    if (!IsPassJudge(workFlowId, workFlowInstanceId, taskId, endTaskTypeAndOr)) //判断每个节点实例是否完成
                                    {
                                        allPass = false;
                                        break;        //如果有一个未完成的,不产生新的实例,流程等待。
                                    }
                                }
                            }

                            //********end检查判断节点前面的所以节点的任务实例结束

                            //如果判断节点前面的流程实例全部完成,自动进行递归,创建下一任务实例。
                            if (allPass)
                            {
                                //创建一个判断节点实例
                                var newTaskId        = BusinessLogic.NewGuid(); //新任务处理者实例Id
                                var workTaskInstance = new WorkTaskInstanceEntity
                                {
                                    WorkFlowId     = workFlowId,
                                    WorkTaskId     = endTaskId,
                                    WorkFlowInsId  = workFlowInstanceId,
                                    WorkTaskInsId  = newTaskId,
                                    PreviousTaskId = workTaskInstanceId,
                                    TaskInsCaption = endTaskTypeAndOr,
                                    Status         = "3"
                                };
                                new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).Create(workTaskInstance);
                                var result = CreateNextTaskInstance(userId, workFlowId, endTaskId, workFlowInstanceId, newTaskId, operatorInstanceId, "提交");
                                if (result != WorkFlowConst.SuccessCode)
                                {
                                    return(result);
                                }
                            }
                            #endregion
                            break;
                        }

                        case "5":    //查看节点
                        {
                            #region 查看节点
                            switch (endoperRule)
                            {
                            case "1":
                            {
                                //创建一个任务实例
                                var newTaskId        = BusinessLogic.NewGuid();     //新任务处理者实例Id
                                var workTaskInstance = new WorkTaskInstanceEntity
                                {
                                    WorkFlowId     = workFlowId,
                                    WorkTaskId     = endTaskId,
                                    WorkFlowInsId  = workFlowInstanceId,
                                    WorkTaskInsId  = newTaskId,
                                    PreviousTaskId = workTaskInstanceId,
                                    TaskInsCaption = new WorkTaskManager(this.DBProvider, this.UserInfo).GetTaskCaption(endTaskId),
                                    Status         = "1"
                                };
                                new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).Create(workTaskInstance);

                                //创建多个处理人
                                var result = CreateOperInstance(userId, workTaskInstanceId, workTaskId, workFlowId, endTaskId, workFlowInstanceId, newTaskId, operParam);            //创建任务实例
                                if (result != WorkFlowConst.SuccessCode)
                                {
                                    return(result);
                                }
                            }
                            break;

                            case "2":
                            {
                                //创建任务实例和处理人

                                var result = CreateOperInstance(userId, workTaskInstanceId, workTaskId, workFlowId, endTaskId, workFlowInstanceId, workTaskInstanceId, operParam);
                                if (result != WorkFlowConst.SuccessCode)
                                {
                                    return(result);
                                }
                            }
                            break;
                            }
                            //设置处理者实例正常结束
                            new OperatorInstanceManager(this.DBProvider, this.UserInfo).SetOperatorInstanceOver(userId, operatorInstanceId);
                            //设置任务实例正常结束
                            new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetWorkTaskInstanceOver(userName, workTaskInstanceId);
                            //设定流程实例的当前位置
                            new WorkFlowInstanceManager(this.DBProvider, this.UserInfo).SetCurrTaskId(workFlowInstanceId, endTaskId);
                            //设定任务实例成功提交信息
                            new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetSuccessMsg(WorkFlowConst.SuccessMsg, workTaskInstanceId);
                            #endregion
                            break;
                        }

                        case "6":    //子流程节点
                        {
                            #region 子流程节点
                            var subWf = new SubWorkFlowManager(this.DBProvider, this.UserInfo).GetSubWorkflowTable(workFlowId, endTaskId);
                            if (subWf != null && subWf.Rows.Count > 0)
                            {
                                var subWorkflowId      = subWf.Rows[0][SubWorkFlowTable.FieldSubWorkFlowId].ToString();
                                var subStartTaskId     = subWf.Rows[0][SubWorkFlowTable.FieldSubStartTaskId].ToString();
                                var subWorkflowCaption = subWf.Rows[0][SubWorkFlowTable.FieldSubWorkFlowCaption].ToString();
                                //*******进入子流程
                                var wfruntime = new WorkFlowRuntime
                                {
                                    UserId             = userId,
                                    WorkFlowId         = subWorkflowId,
                                    WorkTaskId         = subStartTaskId,
                                    WorkFlowInstanceId = BusinessLogic.NewGuid(),
                                    WorkTaskInstanceId = BusinessLogic.NewGuid(),
                                    IsSubWorkflow      = true,
                                    MainWorkflowId     = workFlowId,
                                    MainWorkflowInsId  = workFlowInstanceId,
                                    MainWorktaskId     = endTaskId,
                                    MainWorktaskInsId  = workTaskInstanceId,       //记录进入子流程之前的任务实例
                                    WorkFlowNo         = "subWorkflow",
                                    CommandName        = "提交",
                                    WorkflowInsCaption = subWorkflowCaption,
                                    IsDraft            = true//开始节点需要交互,草稿状态,暂不提交
                                };
                                wfruntime.Start();
                                //设置处理者实例正常结束
                                new OperatorInstanceManager(this.DBProvider, this.UserInfo).SetOperatorInstanceOver(userId, operatorInstanceId);
                                //设置任务实例正常结束
                                new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetWorkTaskInstanceOver(userName, workTaskInstanceId);
                                //设定流程实例的当前位置
                                new WorkFlowInstanceManager(this.DBProvider, this.UserInfo).SetCurrTaskId(workFlowInstanceId, endTaskId);
                                //设定任务实例成功提交信息
                                new WorkTaskInstanceManager(this.DBProvider, this.UserInfo).SetSuccessMsg(WorkFlowConst.SuccessMsg, workTaskInstanceId);
                            }
                            #endregion
                            break;
                        }
                        }
                    }
                }
                #endregion
            }
            else
            {   //未配置后续节点
                return(WorkFlowConst.NoFoundTaskCode);
            }
            return(WorkFlowConst.SuccessCode);
        }