protected internal virtual void deleteProcessDefinitions(ProcessDefinitionGroup group) { ProcessDefinitionEntity newLatestProcessDefinition = findNewLatestProcessDefinition(group); CommandContext commandContext = Context.CommandContext; UserOperationLogManager userOperationLogManager = commandContext.OperationLogManager; ProcessDefinitionManager definitionManager = commandContext.ProcessDefinitionManager; IList <ProcessDefinitionEntity> processDefinitions = group.processDefinitions; foreach (ProcessDefinitionEntity processDefinition in processDefinitions) { string processDefinitionId = processDefinition.Id; if (writeUserOperationLog) { userOperationLogManager.logProcessDefinitionOperation(org.camunda.bpm.engine.history.UserOperationLogEntry_Fields.OPERATION_TYPE_DELETE, processDefinitionId, processDefinition.Key, new PropertyChange("cascade", false, cascadeToHistory)); } definitionManager.deleteProcessDefinition(processDefinition, processDefinitionId, cascadeToHistory, cascadeToInstances, skipCustomListeners, skipIoMappings); } if (newLatestProcessDefinition != null) { ProcessEngineConfigurationImpl configuration = Context.ProcessEngineConfiguration; DeploymentCache deploymentCache = configuration.DeploymentCache; newLatestProcessDefinition = deploymentCache.resolveProcessDefinition(newLatestProcessDefinition); IList <Deployer> deployers = configuration.Deployers; foreach (Deployer deployer in deployers) { if (deployer is BpmnDeployer) { ((BpmnDeployer)deployer).addEventSubscriptions(newLatestProcessDefinition); } } } }
protected internal virtual void deleteProcessDefinitionCmd(CommandContext commandContext, string processDefinitionId, bool cascade, bool skipCustomListeners, bool skipIoMappings) { ensureNotNull("processDefinitionId", processDefinitionId); ProcessDefinition processDefinition = commandContext.ProcessDefinitionManager.findLatestProcessDefinitionById(processDefinitionId); ensureNotNull(typeof(NotFoundException), "No process definition found with id '" + processDefinitionId + "'", "processDefinition", processDefinition); IList <CommandChecker> commandCheckers = commandContext.ProcessEngineConfiguration.CommandCheckers; foreach (CommandChecker checker in commandCheckers) { checker.checkDeleteProcessDefinitionById(processDefinitionId); } UserOperationLogManager userOperationLogManager = commandContext.OperationLogManager; userOperationLogManager.logProcessDefinitionOperation(org.camunda.bpm.engine.history.UserOperationLogEntry_Fields.OPERATION_TYPE_DELETE, processDefinitionId, processDefinition.Key, new PropertyChange("cascade", false, cascade)); ProcessDefinitionManager definitionManager = commandContext.ProcessDefinitionManager; definitionManager.deleteProcessDefinition(processDefinition, processDefinitionId, cascade, cascade, skipCustomListeners, skipIoMappings); }