public override Void execute(CommandContext commandContext) { ICollection <string> processInstanceIds = collectProcessInstanceIds(); EnsureUtil.ensureNotEmpty(typeof(BadUserRequestException), "No process instance ids given", "Process Instance ids", processInstanceIds); EnsureUtil.ensureNotContainsNull(typeof(BadUserRequestException), "Cannot be null.", "Process Instance ids", processInstanceIds); writeUserOperationLog(commandContext, processInstanceIds.Count, false); UpdateProcessInstanceSuspensionStateBuilderImpl suspensionStateBuilder = new UpdateProcessInstanceSuspensionStateBuilderImpl(commandExecutor); if (suspending) { // suspending foreach (string processInstanceId in processInstanceIds) { suspensionStateBuilder.byProcessInstanceId(processInstanceId).suspend(); } } else { // activating foreach (string processInstanceId in processInstanceIds) { suspensionStateBuilder.byProcessInstanceId(processInstanceId).activate(); } } return(null); }
public SetJobsRetriesCmd(IList <string> jobIds, int retries) { EnsureUtil.ensureNotEmpty("Job ID's", jobIds); EnsureUtil.ensureGreaterThanOrEqual("Retries count", retries, 0); this.jobIds = jobIds; this.retries = retries; }
public override Void execute(CommandContext commandContext) { IList <string> collectedIds = collectExternalTaskIds(); EnsureUtil.ensureNotEmpty(typeof(BadUserRequestException), "externalTaskIds", collectedIds); int retries = builder.Retries; writeUserOperationLog(commandContext, retries, collectedIds.Count, false); foreach (string externalTaskId in collectedIds) { (new SetExternalTaskRetriesCmd(externalTaskId, retries, false)).execute(commandContext); } return(null); }
public override Batch execute(CommandContext commandContext) { ICollection <string> processInstanceIds = collectProcessInstanceIds(); EnsureUtil.ensureNotEmpty(typeof(BadUserRequestException), "No process instance ids given", "process Instance Ids", processInstanceIds); EnsureUtil.ensureNotContainsNull(typeof(BadUserRequestException), "Cannot be null.", "Process Instance ids", processInstanceIds); checkAuthorizations(commandContext); writeUserOperationLog(commandContext, processInstanceIds.Count, true); BatchEntity batch = createBatch(commandContext, processInstanceIds); batch.createSeedJobDefinition(); batch.createMonitorJobDefinition(); batch.createBatchJobDefinition(); batch.fireHistoricStartEvent(); batch.createSeedJob(); return(batch); }
protected internal virtual ICollection <string> collectProcessInstanceIds() { ISet <string> collectedProcessInstanceIds = new HashSet <string>(); IList <string> processInstanceIds = builder.ProcessInstanceIds; if (processInstanceIds != null) { collectedProcessInstanceIds.addAll(processInstanceIds); } //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.camunda.bpm.engine.impl.HistoricProcessInstanceQueryImpl historicProcessInstanceQuery = (org.camunda.bpm.engine.impl.HistoricProcessInstanceQueryImpl) builder.getHistoricProcessInstanceQuery(); HistoricProcessInstanceQueryImpl historicProcessInstanceQuery = (HistoricProcessInstanceQueryImpl)builder.HistoricProcessInstanceQuery; if (historicProcessInstanceQuery != null) { collectedProcessInstanceIds.addAll(historicProcessInstanceQuery.listIds()); } EnsureUtil.ensureNotEmpty(typeof(BadUserRequestException), "processInstanceIds", collectedProcessInstanceIds); return(collectedProcessInstanceIds); }