Ejemplo n.º 1
0
        /// <summary>
        /// Deletes the timer start events for the given process definition.
        /// </summary>
        /// <param name="processDefinition"> the process definition </param>
        protected internal virtual void DeleteTimerStartEventsForProcessDefinition(IProcessDefinition processDefinition)
        {
            //throw new NotImplementedException();
            IList <JobEntity> timerStartJobs = _jobManager.FindJobsByConfiguration(TimerStartEventJobHandler.TYPE, processDefinition.Key, processDefinition.TenantId);

            ProcessDefinitionEntity latestVersion = this.FindLatestProcessDefinitionByKeyAndTenantId(processDefinition.Key, processDefinition.TenantId);

            //// delete timer start event jobs only if this is the latest version of the process definition.
            if (latestVersion != null && latestVersion.Id.Equals(processDefinition.Id))
            {
                foreach (IJob job in timerStartJobs)
                {
                    ((JobEntity)job).Delete();
                }
            }
        }
Ejemplo n.º 2
0
        public virtual void DeleteEventSubscription(EventSubscriptionEntity persistentObject)
        {
            Log.LogDebug("EFɾ³ý»º´æEventSubscriptionEntity,", "id:" + persistentObject.Id);
            Delete(persistentObject);
            if (persistentObject.IsSubscriptionForEventType(EventType.Signal))
            {
                CreatedSignalSubscriptions.Remove(persistentObject);
            }

            // if the event subscription has been triggered asynchronously but not yet executed
            IList <JobEntity> asyncJobs = _jobManager.FindJobsByConfiguration(ProcessEventJobHandler.TYPE, persistentObject.Id, persistentObject.TenantId);

            foreach (JobEntity asyncJob in asyncJobs)
            {
                asyncJob.Delete();
            }
        }