Example #1
0
        public IExecutionContext CreateChild(Guid recordId, string displayName, string refName, Variables taskVariables = null)
        {
            Trace.Entering();

            var child = new ExecutionContext();

            child.Initialize(HostContext);
            child.Features                 = Features;
            child.Variables                = Variables;
            child.Endpoints                = Endpoints;
            child.SecureFiles              = SecureFiles;
            child.TaskVariables            = taskVariables;
            child._cancellationTokenSource = new CancellationTokenSource();
            child.WriteDebug               = WriteDebug;
            child._parentExecutionContext  = this;
            child.PrependPath              = PrependPath;
            child.Container                = Container;

            child.InitializeTimelineRecord(_mainTimelineId, recordId, _record.Id, ExecutionContextType.Task, displayName, refName, ++_childTimelineRecordOrder);

            child._logger = HostContext.CreateService <IPagingLogger>();
            child._logger.Setup(_mainTimelineId, recordId);

            return(child);
        }
Example #2
0
        public IExecutionContext CreateChild(Guid recordId, string displayName, string refName, Variables taskVariables = null, bool outputForward = false)
        {
            Trace.Entering();

            var child = new ExecutionContext();

            child.Initialize(HostContext);
            child.Features                 = Features;
            child.Variables                = Variables;
            child.Endpoints                = Endpoints;
            child.Repositories             = Repositories;
            child.JobSettings              = JobSettings;
            child.SecureFiles              = SecureFiles;
            child.TaskVariables            = taskVariables;
            child._cancellationTokenSource = new CancellationTokenSource();
            child.WriteDebug               = WriteDebug;
            child._parentExecutionContext  = this;
            child.PrependPath              = PrependPath;
            child.Containers               = Containers;
            child.SidecarContainers        = SidecarContainers;
            child._outputForward           = outputForward;
            child._defaultStepTarget       = _defaultStepTarget;
            child._currentStepTarget       = _currentStepTarget;

            child.InitializeTimelineRecord(_mainTimelineId, recordId, _record.Id, ExecutionContextType.Task, displayName, refName, ++_childTimelineRecordOrder);

            child._logger = HostContext.CreateService <IPagingLogger>();
            child._logger.Setup(_mainTimelineId, recordId);

            return(child);
        }
Example #3
0
        public IExecutionContext CreateChild(Guid recordId, string name, Variables taskVariables = null)
        {
            Trace.Entering();

            var child = new ExecutionContext();

            child.Initialize(HostContext);
            child.Features                 = Features;
            child.Variables                = Variables;
            child.Endpoints                = Endpoints;
            child.SecureFiles              = SecureFiles;
            child.TaskVariables            = taskVariables;
            child._cancellationTokenSource = new CancellationTokenSource();
            child.WriteDebug               = WriteDebug;
            child._parentExecutionContext  = this;

            // the job timeline record is at order 1.
            child.InitializeTimelineRecord(_mainTimelineId, recordId, _record.Id, ExecutionContextType.Task, name, _childExecutionContextCount + 2);

            child._logger = HostContext.CreateService <IPagingLogger>();
            child._logger.Setup(_mainTimelineId, recordId);

            _childExecutionContextCount++;
            return(child);
        }
        public IExecutionContext CreateChild(Guid recordId, string name)
        {
            Trace.Entering();

            var child = new ExecutionContext();

            child.Initialize(HostContext);
            child.Variables               = Variables;
            child.Endpoints               = Endpoints;
            child.CancellationToken       = CancellationTokenSource.CreateLinkedTokenSource(CancellationToken).Token;
            child.WriteDebug              = WriteDebug;
            child._parentExecutionContext = this;

            // the job timeline record is at order 1.
            child.InitializeTimelineRecord(_mainTimelineId, recordId, _record.Id, ExecutionContextType.Task, name, _childExecutionContextCount + 2);

            _childExecutionContextCount++;
            return(child);
        }
Example #5
0
        public IExecutionContext CreateChild(Guid recordId, string name, TimeSpan timeout)
        {
            Trace.Entering();

            var child = new ExecutionContext();
            child.Initialize(HostContext);
            child.Variables = Variables;
            child.Endpoints = Endpoints;
            child._timeoutTokenSource = new CancellationTokenSource();
            child.CancellationToken = CancellationTokenSource.CreateLinkedTokenSource(CancellationToken, child._timeoutTokenSource.Token).Token;
            child.WriteDebug = WriteDebug;
            child._parentExecutionContext = this;
            child._timeout = timeout;

            // the job timeline record is at order 1.
            child.InitializeTimelineRecord(_mainTimelineId, recordId, _record.Id, ExecutionContextType.Task, name, _childExecutionContextCount + 2);

            _childExecutionContextCount++;
            return child;
        }