예제 #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 workflowActivityType from cache
        /// </summary>
        /// <param name="id"></param>
        public static void Flush(int id)
        {
            var activityType = WorkflowActivityTypeCache.Read(id);

            if (activityType != null)
            {
                foreach (var actionType in activityType.ActionTypes)
                {
                    WorkflowActionTypeCache.Flush(actionType.Id);
                }
            }
            FlushCache(WorkflowActivityTypeCache.CacheKey(id));
        }
예제 #3
0
        /// <summary>
        /// Removes a WorkflowActionForm from cache.
        /// </summary>
        /// <param name="id">The identifier.</param>
        public new static void Remove(int id)
        {
            var activityType = Get(id);

            if (activityType != null)
            {
                foreach (var actionType in activityType.ActionTypes)
                {
                    WorkflowActionTypeCache.Remove(actionType.Id);
                }
            }

            Remove(id.ToString());
        }
예제 #4
0
 /// <summary>
 /// Reads the specified defined type model.
 /// </summary>
 /// <param name="workflowActionTypeModel">The defined type model.</param>
 /// <param name="rockContext">The rock context.</param>
 /// <returns></returns>
 public static WorkflowActionTypeCache Read(WorkflowActionType workflowActionTypeModel, RockContext rockContext = null)
 {
     return(GetOrAddExisting(WorkflowActionTypeCache.CacheKey(workflowActionTypeModel.Id),
                             () => LoadByModel(workflowActionTypeModel)));
 }
예제 #5
0
 /// <summary>
 /// Returns WorkflowActionType object from cache.  If workflowActionType 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 WorkflowActionTypeCache Read(int id, RockContext rockContext = null)
 {
     return(GetOrAddExisting(WorkflowActionTypeCache.CacheKey(id),
                             () => LoadById(id, rockContext)));
 }