コード例 #1
0
        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);
            }
        }
コード例 #2
0
        public Job(IExecutionManager execution_manager)
        {
            CommandQueue      = new ConcurrentQueue <Command>();
            _executionManager = execution_manager;

            Task.Factory.StartNew(Invoke, TaskCreationOptions.AttachedToParent);
        }
コード例 #3
0
ファイル: TestHostManagerFactory.cs プロジェクト: tmds/vstest
        /// <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);
        }
コード例 #4
0
 /// <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;
 }
コード例 #5
0
ファイル: AgentEngine.cs プロジェクト: CHAOS-ApS/Octopus
		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;
		}
コード例 #6
0
 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
         });
     }
 }
コード例 #7
0
 public CompilerController(
     IMemoryCache cache,
     ICompilerManager manager,
     IPolishManager polishManager,
     IExecutionManager executionManager)
 {
     _cache            = cache;
     _manager          = manager;
     _polishManager    = polishManager;
     _executionManager = executionManager;
 }
コード例 #8
0
        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;
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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());
        }
コード例 #11
0
 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;
 }
コード例 #12
0
        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);
        }
コード例 #13
0
 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;
 }
コード例 #14
0
        //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;
        }
コード例 #15
0
 public TestsController(IExecutionManager executionManager)
 {
     this.executionManager = executionManager;
 }
コード例 #16
0
 public UserExperienceBase(IExecutionManager executionManager)
 {
     ExecutionManager = executionManager;
 }
コード例 #17
0
ファイル: HomeController.cs プロジェクト: Churchill57/WebUXv4
 public HomeController(IExecutionManager executionManager)
 {
     this.executionManager = executionManager;
 }
コード例 #18
0
 public CustomerController(IExecutionManager executionManager, ICustomerDomainApiClient customerDomainApiClient)
 {
     this.executionManager        = executionManager;
     this.customerDomainApiClient = customerDomainApiClient;
 }
コード例 #19
0
        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);
        }
コード例 #20
0
 public LogicalUnitBase(IExecutionManager executionManager)
 {
     ExecutionManager = executionManager;
 }
コード例 #21
0
 private WfExecutionContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel, IExecutionManager executionManager)
     : base(sa, dataObj, theWorkspace, esbChannel)
 {
     _executionManager = executionManager;
 }
コード例 #22
0
 public void SetExecutionManager(IExecutionManager in_execution_manager)
 {
     ExecutionManager = in_execution_manager;
 }
コード例 #23
0
 /// <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();
 }