protected internal override void UpdateSuspensionState(CommandContext commandContext, ISuspensionState suspensionState) { IExecutionManager executionManager = commandContext.ExecutionManager; ITaskManager taskManager = commandContext.TaskManager; IExternalTaskManager externalTaskManager = commandContext.ExternalTaskManager; if (!string.IsNullOrEmpty(ProcessInstanceId)) { executionManager.UpdateExecutionSuspensionStateByProcessInstanceId(ProcessInstanceId, suspensionState); taskManager.UpdateTaskSuspensionStateByProcessInstanceId(ProcessInstanceId, suspensionState); externalTaskManager.UpdateExternalTaskSuspensionStateByProcessInstanceId(ProcessInstanceId, suspensionState); } else if (!string.IsNullOrEmpty(ProcessDefinitionId)) { executionManager.UpdateExecutionSuspensionStateByProcessDefinitionId(ProcessDefinitionId, suspensionState); taskManager.UpdateTaskSuspensionStateByProcessDefinitionId(ProcessDefinitionId, suspensionState); externalTaskManager.UpdateExternalTaskSuspensionStateByProcessDefinitionId(ProcessDefinitionId, suspensionState); } else if (IsProcessDefinitionTenantIdSet) { executionManager.UpdateExecutionSuspensionStateByProcessDefinitionKeyAndTenantId(ProcessDefinitionKey, ProcessDefinitionTenantId, suspensionState); taskManager.UpdateTaskSuspensionStateByProcessDefinitionKeyAndTenantId(ProcessDefinitionKey, ProcessDefinitionTenantId, suspensionState); externalTaskManager.UpdateExternalTaskSuspensionStateByProcessDefinitionKeyAndTenantId(ProcessDefinitionKey, ProcessDefinitionTenantId, suspensionState); } else { executionManager.UpdateExecutionSuspensionStateByProcessDefinitionKey(ProcessDefinitionKey, suspensionState); taskManager.UpdateTaskSuspensionStateByProcessDefinitionKey(ProcessDefinitionKey, suspensionState); externalTaskManager.UpdateExternalTaskSuspensionStateByProcessDefinitionKey(ProcessDefinitionKey, suspensionState); } }
public Job(IExecutionManager execution_manager) { CommandQueue = new ConcurrentQueue <Command>(); _executionManager = execution_manager; Task.Factory.StartNew(Invoke, TaskCreationOptions.AttachedToParent); }
/// <summary> /// The execution manager instance for any discovery related operations inside of the test host. /// </summary> /// <returns>The execution manager.</returns> public IExecutionManager GetExecutionManager() { if (this.executionManager == null) { this.executionManager = new ExecutionManager(); } return(this.executionManager); }
/// <summary> /// Initializes a new instance of the <see cref="PackageExecutor"/> class. /// </summary> /// <param name="manager">Executor module manager.</param> /// <param name="scriptFactory">The communication scripts factory.</param> /// <param name="packageForwarder">The communication package forwarder.</param> /// <param name="mapperFactory">The mapper factory.</param> /// <param name="executionManager">The execution manager.</param> public PackageExecutor(ExecutorManager manager, IExecutingScriptsFactory scriptFactory, IPackageForwarder packageForwarder, IMapperFactory mapperFactory, IExecutionManager executionManager) : base(manager) { this.XmlList = new List <ICommunicationPackage>(); this.scriptFactory = scriptFactory; this.packageForwarder = packageForwarder; this.mapperFactory = mapperFactory; this.executionManager = executionManager; }
public AgentEngine(IExecutionManager executionManager) { _ExecutionManager = executionManager; _ExecutionManager.ExecuteCompleted += ExecutionManager_ExecuteCompleted; _ExecutionManager.ExecuteFailed += ExecutionManager_ExecuteFailed; _ExecutionManager.CommitCompleted += ExecutionManager_CommitCompleted; _ExecutionManager.CommitFailed += ExecutionManager_CommitFailed; _ExecutionManager.RollbackCompleted += ExecutionManager_RollbackCompleted; _ExecutionManager.RollbackFailed += ExecutionManager_RollbackFailed; }
public JobManager(IExecutionManager execution_manager) { _jobs = new List <Job>(); for (int i = 0; i < MAX_JOB_COUNT; i++) { _jobs.Add(new Job(execution_manager) { Id = i }); } }
public CompilerController( IMemoryCache cache, ICompilerManager manager, IPolishManager polishManager, IExecutionManager executionManager) { _cache = cache; _manager = manager; _polishManager = polishManager; _executionManager = executionManager; }
public EventSubscriptionManager(DbContext dbContex, ILoggerFactory loggerFactory, IJobManager jobManager, IDGenerator idGenerator, IExecutionManager executionManager, IRepository <ExecutionEntity, string> repositoryExecutionEntity) : base(dbContex, loggerFactory, idGenerator) { _jobManager = jobManager; _executionManager = executionManager; _repositoryExecutionEntity = repositoryExecutionEntity; }
public virtual object Execute(CommandContext commandContext) { var processInstanceId = Builder.ProcessInstanceId; IExecutionManager executionManager = commandContext.ExecutionManager; ExecutionEntity processInstance = executionManager.FindExecutionById(processInstanceId); CheckUpdateProcessInstance(processInstance, commandContext); processInstance.PreserveScope = true; var instructions = Builder.ModificationOperations; for (var i = 0; i < instructions.Count; i++) { var instruction = instructions[i]; Log.DebugModificationInstruction(processInstanceId, i + 1, instruction.Describe()); instruction.SkipCustomListeners = Builder.SkipCustomListeners; instruction.SkipIoMappings = Builder.SkipIoMappings; instruction.Execute(commandContext); } processInstance = executionManager.FindExecutionById(processInstanceId); if (!processInstance.HasChildren()) { if (processInstance.Activity == null) { // process instance was cancelled CheckDeleteProcessInstance(processInstance, commandContext); DeletePropagate(processInstance, "Cancellation due to process instance modification", Builder.SkipCustomListeners, Builder.SkipIoMappings); } else if (processInstance.IsEnded) { // process instance has ended regularly processInstance.PropagateEnd(); } } commandContext.OperationLogManager.LogProcessInstanceOperation(LogEntryOperation, processInstanceId, null, null, new List <PropertyChange>() { PropertyChange.EmptyChange }); return(null); }
public virtual IList <string> Execute(CommandContext commandContext) { EnsureUtil.EnsureNotNull("executionId", ExecutionId); // fetch execution IExecutionManager executionManager = commandContext.ExecutionManager; ExecutionEntity execution = executionManager.FindExecutionById(ExecutionId); EnsureUtil.EnsureNotNull("execution " + ExecutionId + " doesn't exist", "execution", execution); CheckGetActivityIds(execution, commandContext); // fetch active activities return(execution.FindActiveActivityIds()); }
public UserOperationLogManager( DbContext dbContex, IExecutionManager _processInstanceManager, IProcessDefinitionManager _processDefinitionManager, ILoggerFactory loggerFactory, IJobManager _jobManager, IJobDefinitionManager _jobDefinitionManager, ITaskManager _taskManager , IDGenerator idGenerator) : base(dbContex, loggerFactory, idGenerator) { processInstanceManager = _processInstanceManager; processDefinitionManager = _processDefinitionManager; jobManager = _jobManager; jobDefinitionManager = _jobDefinitionManager; taskManager = _taskManager; }
protected internal virtual void SendSignalToExecution(CommandContext commandContext, string signalName, string executionId) { IExecutionManager executionManager = commandContext.ExecutionManager; ExecutionEntity execution = executionManager.FindExecutionById(executionId); EnsureUtil.EnsureNotNull("Cannot find execution with id '" + executionId + "'", "execution", execution); IEventSubscriptionManager eventSubscriptionManager = commandContext.EventSubscriptionManager; IList <EventSubscriptionEntity> signalEvents = eventSubscriptionManager.FindSignalEventSubscriptionsByNameAndExecution(signalName, executionId); EnsureUtil.EnsureNotEmpty("Execution '" + executionId + "' has not subscribed to a signal event with name '" + signalName + "'.", ListExt.ConvertToIlist(signalEvents)); CheckAuthorizationOfCatchSignals(commandContext, signalEvents); NotifyExecutions(signalEvents); }
public DeploymentManager(DbContext dbContex, ILoggerFactory loggerFactory, IDGenerator idGenerator, IResourceManager resourceManager, IProcessDefinitionManager processDefinitionManager, IExecutionManager executionManager, IDecisionDefinitionManager decisionDefinitionManager, IHistoricJobLogManager historicJobLogManager, IHistoricDecisionInstanceManager historicDecisionInstanceManager ) : base(dbContex, loggerFactory, idGenerator) { _resourceManager = resourceManager; _processDefinitionManager = processDefinitionManager; _executionManager = executionManager; _historicJobLogManager = historicJobLogManager; _decisionDefinitionManager = decisionDefinitionManager; _historicDecisionInstanceManager = historicDecisionInstanceManager; }
//private readonly IEventSubscriptionManager _eventSubscriptionManager; public ProcessDefinitionManager(DbContext dbContex, ILoggerFactory loggerFactory, IDGenerator idGenerator, IHistoricIncidentManager historicIncidentManager, IHistoricIdentityLinkLogManager historicIdentityLinkLogManager, IHistoricJobLogManager historicJobLogManager, IJobManager jobManager, IJobDefinitionManager jobDefinitionManager, IIdentityLinkManager identityLinkManager, IExecutionManager executionManager) : base(dbContex, loggerFactory, idGenerator) { _historicIncidentManager = historicIncidentManager; _historicIdentityLinkLogManager = historicIdentityLinkLogManager; _historicJobLogManager = historicJobLogManager; _jobManager = jobManager; _jobDefinitionManager = jobDefinitionManager; _identityLinkManager = identityLinkManager; _execuutionManager = executionManager; //_eventSubscriptionManager = eventSubscriptionManager; }
public TestsController(IExecutionManager executionManager) { this.executionManager = executionManager; }
public UserExperienceBase(IExecutionManager executionManager) { ExecutionManager = executionManager; }
public HomeController(IExecutionManager executionManager) { this.executionManager = executionManager; }
public CustomerController(IExecutionManager executionManager, ICustomerDomainApiClient customerDomainApiClient) { this.executionManager = executionManager; this.customerDomainApiClient = customerDomainApiClient; }
public virtual object Execute(CommandContext commandContext) { var configuration = commandContext.ProcessEngineConfiguration; //check that the new process definition is just another version of the same //process definition that the process instance is using IExecutionManager executionManager = commandContext.ExecutionManager; ExecutionEntity processInstance = executionManager.FindExecutionById(_processInstanceId); if (processInstance == null) { throw new ProcessEngineException("No process instance found for id = '" + _processInstanceId + "'."); } else if (!processInstance.IsProcessInstanceExecution) { throw new ProcessEngineException("A process instance id is required, but the provided id " + "'" + _processInstanceId + "' " + "points to a child execution of process instance " + "'" + processInstance.ProcessInstanceId + "'. " + "Please invoke the " + this.GetType().Name + " with a root execution id."); } ProcessDefinitionImpl currentProcessDefinitionImpl = processInstance.ProcessDefinition; DeploymentCache deploymentCache = configuration.DeploymentCache; ProcessDefinitionEntity currentProcessDefinition; if (currentProcessDefinitionImpl is ProcessDefinitionEntity) { currentProcessDefinition = (ProcessDefinitionEntity)currentProcessDefinitionImpl; } else { currentProcessDefinition = deploymentCache.FindDeployedProcessDefinitionById(currentProcessDefinitionImpl.Id); } ProcessDefinitionEntity newProcessDefinition = deploymentCache.FindDeployedProcessDefinitionByKeyVersionAndTenantId(currentProcessDefinition.Key, _processDefinitionVersion, currentProcessDefinition.TenantId); ValidateAndSwitchVersionOfExecution(commandContext, processInstance, newProcessDefinition); IHistoryLevel historyLevel = configuration.HistoryLevel; if (historyLevel.IsHistoryEventProduced(HistoryEventTypes.ProcessInstanceUpdate, processInstance)) { HistoryEventProcessor.ProcessHistoryEvents(new HistoryEventCreatorAnonymousInnerClass(this, processInstance)); } // switch all sub-executions of the process instance to the new process definition version IList <ExecutionEntity> childExecutions = executionManager.FindExecutionsByProcessInstanceId(_processInstanceId); foreach (ExecutionEntity executionEntity in childExecutions) { ValidateAndSwitchVersionOfExecution(commandContext, executionEntity, newProcessDefinition); } // switch all jobs to the new process definition version IList <JobEntity> jobs = commandContext.JobManager.FindJobsByProcessInstanceId(_processInstanceId); IList <JobDefinitionEntity> currentJobDefinitions = commandContext.JobDefinitionManager.FindByProcessDefinitionId(currentProcessDefinition.Id); IList <JobDefinitionEntity> newVersionJobDefinitions = commandContext.JobDefinitionManager.FindByProcessDefinitionId(newProcessDefinition.Id); IDictionary <string, string> jobDefinitionMapping = GetJobDefinitionMapping(currentJobDefinitions, newVersionJobDefinitions); foreach (JobEntity jobEntity in jobs) { SwitchVersionOfJob(jobEntity, newProcessDefinition, jobDefinitionMapping); } // switch all incidents to the new process definition version IList <IncidentEntity> incidents = commandContext.IncidentManager.FindIncidentsByProcessInstance(_processInstanceId); foreach (IncidentEntity incidentEntity in incidents) { SwitchVersionOfIncident(commandContext, incidentEntity, newProcessDefinition); } // add an entry to the op log PropertyChange change = new PropertyChange("processDefinitionVersion", currentProcessDefinition.Version, _processDefinitionVersion); commandContext.OperationLogManager.LogProcessInstanceOperation(UserOperationLogEntryFields.OperationTypeModifyProcessInstance, _processInstanceId, null, null, new List <PropertyChange>() { change }); return(null); }
public LogicalUnitBase(IExecutionManager executionManager) { ExecutionManager = executionManager; }
private WfExecutionContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel, IExecutionManager executionManager) : base(sa, dataObj, theWorkspace, esbChannel) { _executionManager = executionManager; }
public void SetExecutionManager(IExecutionManager in_execution_manager) { ExecutionManager = in_execution_manager; }
/// <summary> /// Initializes a new instance of the <see cref="InProcessProxyexecutionManager"/> class. /// </summary> /// <param name="testHostManager"> /// The test Host Manager. /// </param> /// <param name="testHostManagerFactory"> /// Manager factory /// </param> public InProcessProxyExecutionManager(ITestRuntimeProvider testHostManager, ITestHostManagerFactory testHostManagerFactory) { this.testHostManager = testHostManager; this.testHostManagerFactory = testHostManagerFactory; this.executionManager = this.testHostManagerFactory.GetExecutionManager(); }