/// <summary>
        /// 根据实例环节获取环节配置数据,再查看其是否为结束环节【根据实例环节编号间接判断是否为结束环节】
        /// </summary>
        /// <param name="strInstStepID">实例环节ID</param>
        /// <returns></returns>
        public bool IsEndStep(string strInstStepID)
        {
            TWfSettingTaskLogic logic  = new TWfSettingTaskLogic();
            TWfInstTaskDetailVo detail = Details(strInstStepID);

            return(logic.IsEndStep(detail.WF_ID, detail.WF_TASK_ID));
        }
    /// <summary>
    /// 获取工作流第一环节简称
    /// </summary>
    /// <param name="strWfID">工作流ID</param>
    /// <returns></returns>
    protected string getFirFlowName(string strWfID)
    {
        List <i3.ValueObject.Sys.WF.TWfSettingTaskVo> tempList = new i3.BusinessLogic.Sys.WF.TWfSettingTaskLogic().SelectByObjectListForSetp(new i3.ValueObject.Sys.WF.TWfSettingTaskVo()
        {
            WF_ID = strWfID
        });

        if (tempList.Count > 0)
        {
            return(tempList[0].TASK_CAPTION);
        }
        return("");
    }
        /// <summary>
        /// 创建实例流程(包括未处理的第一个环节)数据接口
        /// </summary>
        /// <param name="strWFID">流程代码</param>
        /// <param name="strObjectUser">目标处理人用户ID</param>
        /// <param name="strCreateUser">生成人员ID</param>
        /// <param name="strServiceCode">业务类型编码</param>
        /// <param name="strServiceName">业务类型名称</param>
        /// <returns></returns>
        public bool CreateInstWFAndFirstStep(string strWFID, string strObjectUser, string strCreateUser, string strServiceCode, string strServiceName)
        {
            TWfInstTaskDetailVo detail  = new TWfInstTaskDetailVo();
            TWfInstControlVo    control = new TWfInstControlVo();
            TWfSettingTaskVo    task    = new TWfSettingTaskLogic().GetFirstStep(strWFID);
            TWfSettingFlowVo    flow    = new TWfSettingFlowLogic().Details(new TWfSettingFlowVo()
            {
                WF_ID = strWFID
            });

            //如果不存在数据,则返回
            if (string.IsNullOrEmpty(task.ID) || string.IsNullOrEmpty(flow.ID))
            {
                return(false);
            }

            detail.ID                  = GetGUID();
            detail.INST_NOTE           = task.TASK_NOTE;
            detail.INST_TASK_CAPTION   = task.TASK_CAPTION;
            detail.INST_TASK_STARTTIME = GetDateTimeToStanString();
            detail.INST_TASK_STATE     = TWfCommDict.StepState.StateNormal;
            detail.OBJECT_USER         = strObjectUser;
            detail.SRC_USER            = strCreateUser;
            detail.WF_ID               = strWFID;
            detail.WF_INST_ID          = GetGUID();
            detail.WF_SERIAL_NO        = GetDateTimeToStringFor15();
            detail.WF_TASK_ID          = task.WF_TASK_ID;

            control.ID              = detail.WF_INST_ID;
            control.IS_SUB_FLOW     = "0";
            control.WF_CAPTION      = flow.WF_CAPTION;
            control.WF_ID           = strWFID;
            control.WF_INST_TASK_ID = detail.ID;
            control.WF_NOTE         = flow.WF_NOTE;
            control.WF_PRIORITY     = TWfCommDict.WfPriority.Priority_1;
            control.WF_SERIAL_NO    = detail.WF_SERIAL_NO;
            control.WF_SERVICE_CODE = strServiceCode;
            control.WF_SERVICE_NAME = strServiceName;
            control.WF_STARTTIME    = detail.INST_TASK_STARTTIME;
            control.WF_STATE        = TWfCommDict.WfState.StateNormal;
            control.WF_TASK_ID      = detail.WF_TASK_ID;

            bool bIsDetail  = this.Create(detail);
            bool bIsControl = new TWfInstControlLogic().Create(control);

            return(bIsDetail & bIsControl);
        }
예제 #4
0
        /// <summary>
        /// 是否是结束环节
        /// </summary>
        /// <param name="strWFID"></param>
        /// <param name="strStepID"></param>
        /// <returns></returns>
        public bool IsEndStep(string strWFID, string strStepID)
        {
            string strStep1 = new TWfSettingTaskLogic().Details(new TWfSettingTaskVo()
            {
                WF_TASK_ID = strStepID
            }).WF_TASK_ID;
            DataTable dt = new TWfSettingTaskLogic().SelectByTable(new TWfSettingTaskVo()
            {
                WF_ID = strWFID, SORT_FIELD = TWfSettingTaskVo.TASK_ORDER_FIELD, SORT_TYPE = " asc "
            });

            if (dt.Rows.Count > 0 && dt.Rows[dt.Rows.Count - 1][TWfSettingTaskVo.WF_TASK_ID_FIELD].ToString() == strStep1)
            {
                return(true);
            }
            return(false);
        }