Beispiel #1
0
        /// <summary>
        ///  更新流程实例 审核节点用
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="dbbaseId"></param>
        /// <param name="processInstanceEntity"></param>
        /// <param name="processSchemeEntity"></param>
        /// <param name="processOperationHistoryEntity"></param>
        /// <param name="delegateRecordEntityList"></param>
        /// <param name="processTransitionHistoryEntity"></param>
        /// <returns></returns>
        public int SaveProcess(string sql, string dbbaseId, WFProcessInstance processInstanceEntity, WFProcessScheme processSchemeEntity, WFProcessOperationHistory processOperationHistoryEntity, WFProcessTransitionHistory processTransitionHistoryEntity = null)
        {
            try
            {
                processInstanceEntity.Modify(processInstanceEntity.Id);
                _unitWork.Update(processSchemeEntity);
                _unitWork.Update(processInstanceEntity);

                processOperationHistoryEntity.ProcessId = processInstanceEntity.Id;
                _unitWork.Add(processOperationHistoryEntity);

                if (processTransitionHistoryEntity != null)
                {
                    processTransitionHistoryEntity.ProcessId = processInstanceEntity.Id;
                    _unitWork.Add(processTransitionHistoryEntity);
                }

                //if (!string.IsNullOrEmpty(dbbaseId) && !string.IsNullOrEmpty(sql))//测试环境不允许执行sql语句
                //{
                //    DataBaseLinkEntity dataBaseLinkEntity = dataBaseLinkService.GetEntity(dbbaseId);//获取
                //    this.BaseRepository(dataBaseLinkEntity.DbConnection).ExecuteBySql(sql.Replace("{0}", processInstanceEntity.Id));
                //}
                _unitWork.Save();
                return(1);
            }
            catch
            {
                throw;
            }
        }
Beispiel #2
0
        /// <summary>
        /// 存储工作流实例进程(编辑草稿用)
        /// </summary>
        /// <param name="processInstanceEntity"></param>
        /// <param name="processSchemeEntity"></param>
        /// <param name="wfOperationHistoryEntity"></param>
        /// <returns></returns>
        public int SaveProcess(Guid processId, WFProcessInstance processInstanceEntity, WFProcessScheme processSchemeEntity, WFProcessOperationHistory wfOperationHistoryEntity = null)
        {
            try
            {
                if (Guid.Empty == (processInstanceEntity.Id))
                {
                    _unitWork.Add(processSchemeEntity);

                    processInstanceEntity.Create();
                    processInstanceEntity.Id = processId;
                    processInstanceEntity.ProcessSchemeId = processSchemeEntity.Id;
                    _unitWork.Add(processInstanceEntity);
                }
                else
                {
                    processInstanceEntity.Modify(processId);
                    _unitWork.Update(processInstanceEntity);

                    processSchemeEntity.Modify(processInstanceEntity.ProcessSchemeId);
                    _unitWork.Update(processSchemeEntity);
                }
                if (wfOperationHistoryEntity != null)
                {
                    wfOperationHistoryEntity.ProcessId = processId;
                    _unitWork.Add(wfOperationHistoryEntity);
                }
                _unitWork.Save();
                return(1);
            }
            catch
            {
                throw;
            }
        }
Beispiel #3
0
        /// <summary>
        /// 存储工作流实例进程(审核驳回重新提交)
        /// </summary>
        /// <param name="processInstanceEntity"></param>
        /// <param name="processSchemeEntity"></param>
        /// <param name="processOperationHistoryEntity"></param>
        /// <param name="processTransitionHistoryEntity"></param>
        /// <returns></returns>
        public int SaveProcess(WFProcessInstance processInstanceEntity, WFProcessScheme processSchemeEntity,
                               WFProcessOperationHistory processOperationHistoryEntity, WFProcessTransitionHistory processTransitionHistoryEntity = null)
        {
            try
            {
                processInstanceEntity.Modify(processInstanceEntity.Id);
                _unitWork.Update(processSchemeEntity);
                _unitWork.Update(processInstanceEntity);

                processOperationHistoryEntity.ProcessId = processInstanceEntity.Id;
                _unitWork.Add(processOperationHistoryEntity);

                if (processTransitionHistoryEntity != null)
                {
                    processTransitionHistoryEntity.ProcessId = processInstanceEntity.Id;
                    _unitWork.Add(processTransitionHistoryEntity);
                }

                _unitWork.Save();
                return(1);
            }
            catch
            {
                throw;
            }
        }
Beispiel #4
0
        /// <summary>
        /// 存储工作流实例进程(创建实例进程)
        /// </summary>
        /// <param name="wfRuntimeModel"></param>
        /// <param name="processInstanceEntity"></param>
        /// <param name="processSchemeEntity"></param>
        /// <param name="processOperationHistoryEntity"></param>
        /// <param name="delegateRecordEntity"></param>
        /// <returns></returns>
        public int SaveProcess(WF_RuntimeModel wfRuntimeModel, WFProcessInstance processInstanceEntity, WFProcessScheme processSchemeEntity, WFProcessOperationHistory processOperationHistoryEntity, WFProcessTransitionHistory processTransitionHistoryEntity)
        {
            try
            {
                if (Guid.Empty == (processInstanceEntity.Id))
                {
                    processSchemeEntity.Create();
                    _unitWork.Add(processSchemeEntity);

                    processInstanceEntity.Create();
                    processInstanceEntity.Id = Guid.Parse(wfRuntimeModel.processId);
                    processInstanceEntity.ProcessSchemeId = processSchemeEntity.Id;
                    _unitWork.Add(processInstanceEntity);
                }
                else
                {
                    processInstanceEntity.Modify(processInstanceEntity.Id);
                    _unitWork.Update(processSchemeEntity);
                    _unitWork.Update(processInstanceEntity);
                }
                processOperationHistoryEntity.ProcessId = processInstanceEntity.Id;
                _unitWork.Add(processOperationHistoryEntity);

                if (processTransitionHistoryEntity != null)
                {
                    processTransitionHistoryEntity.ProcessId = processInstanceEntity.Id;
                    _unitWork.Add(processTransitionHistoryEntity);
                }

                _unitWork.Save();
                return(1);
            }
            catch
            {
                throw;
            }
        }