示例#1
0
        /// <summary>
        /// Removes workflowActionType from cache
        /// </summary>
        /// <param name="id"></param>
        public static void Flush(int id)
        {
            var actionType = WorkflowActionTypeCache.Read(id);

            if (actionType != null && actionType.WorkflowFormId.HasValue)
            {
                WorkflowActionFormCache.Flush(actionType.WorkflowFormId.Value);
            }
            FlushCache(WorkflowActionTypeCache.CacheKey(id));
        }
示例#2
0
        /// <summary>
        /// Removes a WorkflowActionForm from cache.
        /// </summary>
        /// <param name="id">The identifier.</param>
        public new static void Remove(int id)
        {
            var actionType = Get(id);

            if (actionType != null && actionType.WorkflowFormId.HasValue)
            {
                WorkflowActionFormCache.Remove(actionType.WorkflowFormId.Value);
            }

            Remove(id.ToString());
        }
示例#3
0
        /// <summary>
        /// Removes workflowActionForm from cache
        /// </summary>
        /// <param name="id"></param>
        public static void Flush(int id)
        {
            var actionForm = WorkflowActionFormCache.Read(id);

            if (actionForm != null)
            {
                foreach (var formAttribute in actionForm.FormAttributes)
                {
                    WorkflowActionFormAttributeCache.Flush(formAttribute.Id);
                }
            }
            FlushCache(WorkflowActionFormCache.CacheKey(id));
        }
示例#4
0
 /// <summary>
 /// Reads the specified defined type model.
 /// </summary>
 /// <param name="workflowActionFormModel">The defined type model.</param>
 /// <param name="rockContext">The rock context.</param>
 /// <returns></returns>
 public static WorkflowActionFormCache Read(WorkflowActionForm workflowActionFormModel, RockContext rockContext = null)
 {
     return(GetOrAddExisting(WorkflowActionFormCache.CacheKey(workflowActionFormModel.Id),
                             () => LoadByModel(workflowActionFormModel)));
 }
示例#5
0
 /// <summary>
 /// Returns WorkflowActionForm object from cache.  If workflowActionForm does not already exist in cache, it
 /// will be read and added to cache
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="rockContext">The rock context.</param>
 /// <returns></returns>
 public static WorkflowActionFormCache Read(int id, RockContext rockContext = null)
 {
     return(GetOrAddExisting(WorkflowActionFormCache.CacheKey(id),
                             () => LoadById(id, rockContext)));
 }