Ejemplo n.º 1
0
        public PSWorkflowRemoteActivityState(PSWorkflowInstanceStore store, Dictionary<string, Dictionary<int, Tuple<object, string>>> deserializedRemoteActivityState)
        {
            _store = store;
            
            if (deserializedRemoteActivityState == null) 
                throw new ArgumentNullException("deserializedRemoteActivityState");

            _remoteRunspaceIdCollection = deserializedRemoteActivityState;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Workflow instance constructor.
        /// </summary>
        /// <param name="runtime"></param>
        /// <param name="definition">The workflow definition.</param>
        /// <param name="metadata">The metadata which includes parameters etc.</param>
        /// <param name="pipelineInput">This is input coming from pipeline, which is added to the input stream.</param>
        /// <param name="job"></param>
        internal PSWorkflowApplicationInstance(
                                        PSWorkflowRuntime runtime, 
                                        PSWorkflowDefinition definition,
                                        PSWorkflowContext metadata,
                                        PSDataCollection<PSObject> pipelineInput,                                        
                                        PSWorkflowJob job)
        {
            Tracer.WriteMessage("Creating Workflow instance.");
            InitializePSWorkflowApplicationInstance(runtime);
            this._definition = definition;
            this._metadatas = metadata;
            this._streams = new PowerShellStreams<PSObject, PSObject>(pipelineInput);
            RegisterHandlersForDataAdding(_streams);
            this._timers = new PSWorkflowTimer(this);           
            this.creationMode = WorkflowInstanceCreationMode.Normal;

            _job = job;
            _stores = Runtime.Configuration.CreatePSWorkflowInstanceStore(this);

            this._remoteActivityState = new PSWorkflowRemoteActivityState(_stores);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// PSWorkflowRemoteActivityState constructor
 /// </summary>
 /// <param name="store"></param>
 internal PSWorkflowRemoteActivityState(PSWorkflowInstanceStore store)
 {
     _store = store;
     _remoteRunspaceIdCollection = new Dictionary<string, Dictionary<int, Tuple<object, string>>>();
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Workflow instance constructor for shutdown or crashed workflows.
        /// </summary>
        /// <param name="runtime"></param>
        /// <param name="instanceId"></param>
        internal PSWorkflowApplicationInstance(PSWorkflowRuntime runtime, PSWorkflowId instanceId)
        {
            Tracer.WriteMessage("Creating Workflow instance after crash and shutdown workflow.");
            InitializePSWorkflowApplicationInstance(runtime);
            this._definition = null;
            this._metadatas = null;
            this._streams = null;
            this._timers = null;
            this.id = instanceId.Guid;
            this.creationMode = WorkflowInstanceCreationMode.AfterCrashOrShutdown;

            _stores = Runtime.Configuration.CreatePSWorkflowInstanceStore(this);
            this._remoteActivityState = null;            
        }
Ejemplo n.º 5
0
		internal PSWorkflowApplicationInstance(PSWorkflowRuntime runtime, PSWorkflowId instanceId)
		{
			this.Tracer = PowerShellTraceSourceFactory.GetTraceSource();
			this.wfAppNeverLoaded = true;
			this.ReactivateSync = new object();
			if (runtime != null)
			{
				this.Tracer.WriteMessage("Creating Workflow instance after crash and shutdown workflow.");
				this._definition = null;
				this._metadatas = null;
				this._streams = null;
				this._timers = null;
				this.id = instanceId.Guid;
				this.creationMode = WorkflowInstanceCreationMode.AfterCrashOrShutdown;
				this.PersistAfterNextPSActivity = false;
				this.suspendAtNextCheckpoint = false;
				base.Runtime = runtime;
				this._stores = base.Runtime.Configuration.CreatePSWorkflowInstanceStore(this);
				this.asyncExecutionCollection = new Dictionary<string, PSActivityContext>();
				base.ForceDisableStartOrEndPersistence = false;
				return;
			}
			else
			{
				throw new ArgumentNullException("runtime");
			}
		}
Ejemplo n.º 6
0
		internal PSWorkflowApplicationInstance(PSWorkflowRuntime runtime, PSWorkflowDefinition definition, PSWorkflowContext metadata, PSDataCollection<PSObject> pipelineInput, PSWorkflowJob job)
		{
			this.Tracer = PowerShellTraceSourceFactory.GetTraceSource();
			this.wfAppNeverLoaded = true;
			this.ReactivateSync = new object();
			if (runtime != null)
			{
				this.Tracer.WriteMessage("Creating Workflow instance.");
				this._definition = definition;
				this._metadatas = metadata;
				this._streams = new PowerShellStreams<PSObject, PSObject>(pipelineInput);
				this.RegisterHandlersForDataAdding(this._streams);
				this._timers = new PSWorkflowTimer(this);
				this.creationMode = WorkflowInstanceCreationMode.Normal;
				this.PersistAfterNextPSActivity = false;
				this.suspendAtNextCheckpoint = false;
				this._job = job;
				base.Runtime = runtime;
				this._stores = base.Runtime.Configuration.CreatePSWorkflowInstanceStore(this);
				this.asyncExecutionCollection = new Dictionary<string, PSActivityContext>();
				base.ForceDisableStartOrEndPersistence = false;
				return;
			}
			else
			{
				throw new ArgumentNullException("runtime");
			}
		}
 // Constructor
 public SampleSqlIOParticipant(PSWorkflowInstanceStore stores)
     : base(false, false)
 {
     _stores = stores;
 }