Beispiel #1
0
        protected internal virtual void createUserOperationLog(DeploymentBuilderImpl deploymentBuilder, Deployment deployment, CommandContext commandContext)
        {
            UserOperationLogManager logManager = commandContext.OperationLogManager;

            IList <PropertyChange> properties = new List <PropertyChange>();

            PropertyChange filterDuplicate = new PropertyChange("duplicateFilterEnabled", null, deploymentBuilder.DuplicateFilterEnabled);

            properties.Add(filterDuplicate);

            if (deploymentBuilder.DuplicateFilterEnabled)
            {
                PropertyChange deployChangedOnly = new PropertyChange("deployChangedOnly", null, deploymentBuilder.DeployChangedOnly);
                properties.Add(deployChangedOnly);
            }

            logManager.logDeploymentOperation(org.camunda.bpm.engine.history.UserOperationLogEntry_Fields.OPERATION_TYPE_CREATE, deployment.Id, properties);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public Void execute(final org.camunda.bpm.engine.impl.interceptor.CommandContext commandContext)
        public virtual Void execute(CommandContext commandContext)
        {
            ensureNotNull("deploymentId", deploymentId);

            foreach (CommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                checker.checkDeleteDeployment(deploymentId);
            }

            UserOperationLogManager logManager      = commandContext.OperationLogManager;
            IList <PropertyChange>  propertyChanges = Arrays.asList(new PropertyChange("cascade", null, cascade));

            logManager.logDeploymentOperation(org.camunda.bpm.engine.history.UserOperationLogEntry_Fields.OPERATION_TYPE_DELETE, deploymentId, propertyChanges);

            commandContext.DeploymentManager.deleteDeployment(deploymentId, cascade, skipCustomListeners, skipIoMappings);

            ProcessApplicationReference processApplicationReference = Context.ProcessEngineConfiguration.ProcessApplicationManager.getProcessApplicationForDeployment(deploymentId);

            DeleteDeploymentFailListener listener = new DeleteDeploymentFailListener(deploymentId, processApplicationReference, Context.ProcessEngineConfiguration.CommandExecutorTxRequiresNew);

            try
            {
                commandContext.runWithoutAuthorization(new CallableAnonymousInnerClass(this, commandContext));
            }
            finally
            {
                try
                {
                    commandContext.TransactionContext.addTransactionListener(TransactionState.ROLLED_BACK, listener);
                }
                catch (Exception)
                {
                    TX_LOG.debugTransactionOperation("Could not register transaction synchronization. Probably the TX has already been rolled back by application code.");
                    listener.execute(commandContext);
                }
            }


            return(null);
        }
Beispiel #3
0
        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);
                    }
                }
            }
        }
Beispiel #4
0
        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);
        }