Exemplo n.º 1
0
 /// <summary>
 /// 保存流程实例
 /// </summary>
 /// <param name="keyValue">主键</param>
 /// <param name="entity">实体</param>
 public void SaveEntity(string keyValue, WfProcessInstanceEntity entity)
 {
     try
     {
         if (string.IsNullOrEmpty(keyValue))
         {
             entity.Create();
             this.BaseRepository().Insert(entity);
         }
         else
         {
             entity.Modify(keyValue);
             this.BaseRepository().Update(entity);
         }
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 保存流程实例
 /// </summary>
 /// <param name="keyValue">主键</param>
 /// <param name="entity">实体</param>
 public void SaveEntity(string keyValue, WfProcessInstanceEntity entity)
 {
     try
     {
         cache.Remove(cacheKey + keyValue, CacheId.workflow);
         wfProcessService.SaveEntity(keyValue, entity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowBusinessException(ex);
         }
     }
 }
Exemplo n.º 3
0
        private string cacheKey = "ayma_adms_wfprocess_";// +实例主键
        #endregion

        #region 获取数据
        /// <summary>
        /// 获取流程实例
        /// </summary>
        /// <param name="keyValue">主键</param>
        /// <returns></returns>
        public WfProcessInstanceEntity GetEntity(string keyValue)
        {
            try
            {
                WfProcessInstanceEntity entity = cache.Read <WfProcessInstanceEntity>(cacheKey + keyValue, CacheId.workflow);
                if (entity == null)
                {
                    entity = wfProcessService.GetEntity(keyValue);
                    cache.Write <WfProcessInstanceEntity>(cacheKey + keyValue, entity, CacheId.workflow);
                }
                return(entity);
            }
            catch (Exception ex)
            {
                if (ex is ExceptionEx)
                {
                    throw;
                }
                else
                {
                    throw ExceptionEx.ThrowBusinessException(ex);
                }
            }
        }