예제 #1
0
        public virtual object execute(CommandContext commandContext)
        {
            EnsureUtil.ensureNotNull(typeof(BadUserRequestException), "Historic batch id must not be null", "historic batch id", batchId);

            HistoricBatchEntity historicBatch = commandContext.HistoricBatchManager.findHistoricBatchById(batchId);

            EnsureUtil.ensureNotNull(typeof(BadUserRequestException), "Historic batch for id '" + batchId + "' cannot be found", "historic batch", historicBatch);

            checkAccess(commandContext, historicBatch);

            writeUserOperationLog(commandContext);

            historicBatch.delete();

            return(null);
        }
예제 #2
0
        public virtual Void execute(CommandContext commandContext)
        {
            EnsureUtil.ensureNotNull("job id must not be null", "jobId", jobId);

            JobEntity job = commandContext.JobManager.findJobById(jobId);

            EnsureUtil.ensureNotNull(typeof(NotFoundException), "No job found with id '" + jobId + "'", "job", job);

            foreach (CommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                checker.checkUpdateJob(job);
            }

            long currentPriority = job.Priority;

            job.Priority = priority;

            createOpLogEntry(commandContext, currentPriority, job);

            return(null);
        }
예제 #3
0
        public override Void execute(CommandContext commandContext)
        {
            validateInput();

            ExternalTaskEntity externalTask = commandContext.ExternalTaskManager.findExternalTaskById(externalTaskId);

            EnsureUtil.ensureNotNull(typeof(NotFoundException), "Cannot find external task with id " + externalTaskId, "externalTask", externalTask);

            if (!workerId.Equals(externalTask.WorkerId))
            {
                throw new BadUserRequestException(ErrorMessageOnWrongWorkerAccess + "'. It is locked by worker '" + externalTask.WorkerId + "'.");
            }

            foreach (CommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                checker.checkUpdateProcessInstanceById(externalTask.ProcessInstanceId);
            }

            execute(externalTask);

            return(null);
        }
예제 #4
0
        public virtual Void execute(CommandContext commandContext)
        {
            JobEntity job = Job;

            if (Context.JobExecutorContext == null)
            {
                EnsureUtil.ensureNotNull("Job with id " + jobId + " does not exist", "job", job);
            }
            else if (Context.JobExecutorContext != null && job == null)
            {
                // CAM-1842
                // Job was acquired but does not exist anymore. This is not a problem.
                // It usually means that the job has been deleted after it was acquired which can happen if the
                // the activity instance corresponding to the job is cancelled.
                LOG.debugAcquiredJobNotFound(jobId);
                return(null);
            }

            job.unlock();

            return(null);
        }
예제 #5
0
 public GetDeployedTaskFormCmd(string taskId)
 {
     EnsureUtil.ensureNotNull(typeof(BadUserRequestException), "Task id cannot be null", "taskId", taskId);
     this.taskId = taskId;
 }
예제 #6
0
 /// <summary>
 /// Validates the current input of the command.
 /// </summary>
 protected internal override void validateInput()
 {
     EnsureUtil.ensureNotNull("workerId", workerId);
 }
예제 #7
0
 protected internal virtual void execute(ExternalTaskEntity externalTask)
 {
     EnsureUtil.ensureGreaterThanOrEqual(typeof(BadUserRequestException), "Cannot extend a lock that expired", "lockExpirationTime", externalTask.LockExpirationTime.Ticks, ClockUtil.CurrentTime.Ticks);
     externalTask.extendLock(newLockTime);
 }
예제 #8
0
 public ExtendLockOnExternalTaskCmd(string externalTaskId, string workerId, long newLockTime) : base(externalTaskId, workerId)
 {
     EnsureUtil.ensurePositive(typeof(BadUserRequestException), "lockTime", newLockTime);
     this.newLockTime = newLockTime;
 }
예제 #9
0
	  public ResolveIncidentCmd(string incidentId)
	  {
		EnsureUtil.ensureNotNull(typeof(BadUserRequestException), "", "incidentId", incidentId);
		this.incidentId = incidentId;
	  }
예제 #10
0
 public GetDeployedStartFormCmd(string processDefinitionId)
 {
     EnsureUtil.ensureNotNull(typeof(BadUserRequestException), "Process definition id cannot be null", "processDefinitionId", processDefinitionId);
     this.processDefinitionId = processDefinitionId;
 }
예제 #11
0
 protected internal override void validateInput()
 {
     base.validateInput();
     EnsureUtil.ensureGreaterThanOrEqual("retries", retries, 0);
     EnsureUtil.ensureGreaterThanOrEqual("retryDuration", retryDuration, 0);
 }