Example #1
0
 public virtual void checkDeleteHistoricTaskInstance(HistoricTaskInstanceEntity task)
 {
     if (task != null && !TenantManager.isAuthenticatedTenant(task.TenantId))
     {
         throw LOG.exceptionCommandWithUnauthorizedTenant("delete the historic task instance '" + task.Id + "'");
     }
 }
Example #2
0
            public Void execute(CommandContext commandContext)
            {
                HistoricTaskInstanceEntity historicTaskInstanceEntity = (HistoricTaskInstanceEntity)outerInstance.historyService.createHistoricTaskInstanceQuery().singleResult();

                commandContext.DbEntityManager.delete(historicTaskInstanceEntity);

                return(null);
            }
Example #3
0
        // delete permission ////////////////////////////////////////

        public virtual void checkDeleteHistoricTaskInstance(HistoricTaskInstanceEntity task)
        {
            // deleting unexisting historic task instance should be silently ignored
            // see javaDoc HistoryService.deleteHistoricTaskInstance
            if (task != null)
            {
                if (!string.ReferenceEquals(task.ProcessDefinitionKey, null))
                {
                    AuthorizationManager.checkAuthorization(DELETE_HISTORY, PROCESS_DEFINITION, task.ProcessDefinitionKey);
                }
            }
        }
Example #4
0
        public virtual object execute(CommandContext commandContext)
        {
            ensureNotNull("taskId", taskId);

            HistoricTaskInstanceEntity task = commandContext.HistoricTaskInstanceManager.findHistoricTaskInstanceById(taskId);

            foreach (CommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                checker.checkDeleteHistoricTaskInstance(task);
            }

            writeUserOperationLog(commandContext, task);

            commandContext.HistoricTaskInstanceManager.deleteHistoricTaskInstanceById(taskId);

            return(null);
        }
Example #5
0
        protected internal virtual void writeUserOperationLog(CommandContext commandContext, HistoricTaskInstanceEntity historicTask)
        {
            IList <PropertyChange> propertyChanges = new List <PropertyChange>();

            propertyChanges.Add(new PropertyChange("nrOfInstances", null, 1));
            propertyChanges.Add(new PropertyChange("async", null, false));

            commandContext.OperationLogManager.logTaskOperations(org.camunda.bpm.engine.history.UserOperationLogEntry_Fields.OPERATION_TYPE_DELETE_HISTORY, historicTask, propertyChanges);
        }