/// <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)); }
/// <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)); }
/// <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()); }
/// <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))); }
/// <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))); }