//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: @Override public Void execute(final org.camunda.bpm.engine.impl.interceptor.CommandContext commandContext) public override Void execute(CommandContext commandContext) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.Collection<String> processInstanceIds = collectProcessInstanceIds(); ICollection <string> processInstanceIds = collectProcessInstanceIds(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.List<AbstractProcessInstanceModificationCommand> instructions = builder.getInstructions(); IList <AbstractProcessInstanceModificationCommand> instructions = builder.Instructions; ensureNotEmpty(typeof(BadUserRequestException), "Restart instructions cannot be empty", "instructions", instructions); ensureNotEmpty(typeof(BadUserRequestException), "Process instance ids cannot be empty", "Process instance ids", processInstanceIds); ensureNotContainsNull(typeof(BadUserRequestException), "Process instance ids cannot be null", "Process instance ids", processInstanceIds); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity processDefinition = getProcessDefinition(commandContext, builder.getProcessDefinitionId()); ProcessDefinitionEntity processDefinition = getProcessDefinition(commandContext, builder.ProcessDefinitionId); ensureNotNull("Process definition cannot be found", "processDefinition", processDefinition); checkAuthorization(commandContext, processDefinition); if (writeUserOperationLog) { writeUserOperationLog(commandContext, processDefinition, processInstanceIds.Count, false); } //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final String processDefinitionId = builder.getProcessDefinitionId(); string processDefinitionId = builder.ProcessDefinitionId; ThreadStart runnable = () => { foreach (string processInstanceId in processInstanceIds) { HistoricProcessInstance historicProcessInstance = getHistoricProcessInstance(commandContext, processInstanceId); ensureNotNull(typeof(BadUserRequestException), "Historic process instance cannot be found", "historicProcessInstanceId", historicProcessInstance); ensureHistoricProcessInstanceNotActive(historicProcessInstance); ensureSameProcessDefinition(historicProcessInstance, processDefinitionId); ProcessInstantiationBuilderImpl instantiationBuilder = getProcessInstantiationBuilder(commandExecutor, processDefinitionId); applyProperties(instantiationBuilder, processDefinition, historicProcessInstance); ProcessInstanceModificationBuilderImpl modificationBuilder = instantiationBuilder.ModificationBuilder; modificationBuilder.ModificationOperations = instructions; VariableMap variables = collectVariables(commandContext, historicProcessInstance); instantiationBuilder.Variables = variables; instantiationBuilder.execute(builder.SkipCustomListeners, builder.SkipIoMappings); } }; ProcessApplicationContextUtil.doContextSwitch(runnable, processDefinition); return(null); }
//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) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.camunda.bpm.engine.impl.persistence.entity.JobEntity job = commandContext.getJobManager().findJobById(jobId); JobEntity job = commandContext.JobManager.findJobById(jobId); ensureNotNull(typeof(NotFoundException), "No job found with id '" + jobId + "'", "job", job); // allow timer jobs only checkJobType(job); foreach (CommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers) { checker.checkUpdateJob(job); } // prepare recalculation //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl timerDeclaration = findTimerDeclaration(commandContext, job); TimerDeclarationImpl timerDeclaration = findTimerDeclaration(commandContext, job); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.camunda.bpm.engine.impl.persistence.entity.TimerEntity timer = (org.camunda.bpm.engine.impl.persistence.entity.TimerEntity) job; TimerEntity timer = (TimerEntity)job; DateTime oldDuedate = job.Duedate; ThreadStart runnable = () => { timerDeclaration.resolveAndSetDuedate(timer.Execution, timer, creationDateBased); }; // run recalculation in correct context ProcessDefinitionEntity contextDefinition = commandContext.ProcessEngineConfiguration.DeploymentCache.findDeployedProcessDefinitionById(job.ProcessDefinitionId); ProcessApplicationContextUtil.doContextSwitch(runnable, contextDefinition); // log operation IList <PropertyChange> propertyChanges = new List <PropertyChange>(); propertyChanges.Add(new PropertyChange("duedate", oldDuedate, job.Duedate)); propertyChanges.Add(new PropertyChange("creationDateBased", null, creationDateBased)); commandContext.OperationLogManager.logJobOperation(org.camunda.bpm.engine.history.UserOperationLogEntry_Fields.OPERATION_TYPE_RECALC_DUEDATE, jobId, job.JobDefinitionId, job.ProcessInstanceId, job.ProcessDefinitionId, job.ProcessDefinitionKey, propertyChanges); return(null); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: protected <T> void executeInContext(final Runnable runnable, org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity contextDefinition) protected internal virtual void executeInContext <T>(ThreadStart runnable, ProcessDefinitionEntity contextDefinition) { ProcessApplicationContextUtil.doContextSwitch(runnable, contextDefinition); }