Example #1
0
        public virtual void insertJob(JobEntity job)
        {
            job.CreateTime = ClockUtil.CurrentTime;

            DbEntityManager.insert(job);
            HistoricJobLogManager.fireJobCreatedEvent(job);
        }
Example #2
0
        public virtual void deleteJob(JobEntity job, bool fireDeleteEvent)
        {
            DbEntityManager.delete(job);

            if (fireDeleteEvent)
            {
                HistoricJobLogManager.fireJobDeletedEvent(job);
            }
        }
Example #3
0
        /// <summary>
        /// Cascades the deletion of a process definition to the history, deletes the history.
        /// </summary>
        /// <param name="processDefinitionId"> the process definition id </param>
        protected internal virtual void cascadeDeleteHistoryForProcessDefinition(string processDefinitionId)
        {
            // remove historic incidents which are not referenced to a process instance
            HistoricIncidentManager.deleteHistoricIncidentsByProcessDefinitionId(processDefinitionId);

            // remove historic identity links which are not reference to a process instance
            HistoricIdentityLinkManager.deleteHistoricIdentityLinksLogByProcessDefinitionId(processDefinitionId);

            // remove historic job log entries not related to a process instance
            HistoricJobLogManager.deleteHistoricJobLogsByProcessDefinitionId(processDefinitionId);
        }
Example #4
0
 public HistoryEventCreatorAnonymousInnerClass4(HistoricJobLogManager outerInstance, Job job)
 {
     this.outerInstance = outerInstance;
     this.job           = job;
 }
Example #5
0
 public HistoryEventCreatorAnonymousInnerClass2(HistoricJobLogManager outerInstance, Job job, Exception exception)
 {
     this.outerInstance = outerInstance;
     this.job           = job;
     this.exception     = exception;
 }
Example #6
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void deleteDeployment(String deploymentId, final boolean cascade, final boolean skipCustomListeners, boolean skipIoMappings)
        public virtual void deleteDeployment(string deploymentId, bool cascade, bool skipCustomListeners, bool skipIoMappings)
        {
            IList <ProcessDefinition> processDefinitions = ProcessDefinitionManager.findProcessDefinitionsByDeploymentId(deploymentId);

            if (cascade)
            {
                // *NOTE*:
                // The process instances of ALL process definitions must be
                // deleted, before every process definition can be deleted!
                //
                // On deletion of all process instances, the task listeners will
                // be deleted as well. Deletion of tasks and listeners needs
                // the redeployment of deployments, which can cause to problems if
                // is done sequential with deletion of process definition.
                //
                // For example:
                // Deployment contains two process definiton. First process definition
                // and instances will be removed, also cleared from the cache.
                // Second process definition will be removed and his instances.
                // Deletion of instances will cause redeployment this deploys again
                // first into the cache. Only the second will be removed from cache and
                // first remains in the cache after the deletion process.
                //
                // Thats why we have to clear up all instances at first, after that
                // we can cleanly remove the process definitions.
                foreach (ProcessDefinition processDefinition in processDefinitions)
                {
                    string processDefinitionId = processDefinition.Id;
                    ProcessInstanceManager.deleteProcessInstancesByProcessDefinition(processDefinitionId, "deleted deployment", true, skipCustomListeners, skipIoMappings);
                }
                // delete historic job logs (for example for timer start event jobs)
                HistoricJobLogManager.deleteHistoricJobLogsByDeploymentId(deploymentId);
            }


            foreach (ProcessDefinition processDefinition in processDefinitions)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String processDefinitionId = processDefinition.getId();
                string processDefinitionId = processDefinition.Id;
                // Process definition cascade true deletes the history and
                // process instances if instances flag is set as well to true.
                // Problem as described above, redeployes the deployment.
                // Represents no problem if only one process definition is deleted
                // in a transaction! We have to set the instances flag to false.
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.engine.impl.interceptor.CommandContext commandContext = org.camunda.bpm.engine.impl.context.Context.getCommandContext();
                CommandContext commandContext = Context.CommandContext;
                commandContext.runWithoutAuthorization(new CallableAnonymousInnerClass(this, cascade, skipCustomListeners, processDefinitionId, commandContext));
            }

            deleteCaseDeployment(deploymentId, cascade);

            deleteDecisionDeployment(deploymentId, cascade);
            deleteDecisionRequirementDeployment(deploymentId);

            ResourceManager.deleteResourcesByDeploymentId(deploymentId);

            deleteAuthorizations(Resources.DEPLOYMENT, deploymentId);
            DbEntityManager.delete(typeof(DeploymentEntity), "deleteDeployment", deploymentId);
        }