167 references to Controller
System.Activities (88)
System\Activities\Hosting\WorkflowInstance.cs (7)
320if (this.Controller.TrackingEnabled) 322this.Controller.Track(new WorkflowInstanceUpdatedRecord(this.Id, this.WorkflowDefinition.DisplayName, originalDefinitionIdentity, this.executor.WorkflowIdentity)); 525return this.Controller.BeginFlushTrackingRecords(ActivityDefaults.TrackingTimeout, callback, state); 530this.Controller.EndFlushTrackingRecords(result); 651if (!this.Controller.IsPersistable) 676if (this.Controller.IsPersistable) 724if (this.Controller.TrackingEnabled)
System\Activities\WorkflowApplication.cs (81)
419this.Controller.RequestPause(); 643localInstanceState = this.Controller.State; 750this.Controller.Run(); 761ActivityInstanceState completionState = this.Controller.GetCompletionState(out dummyOutputs, out terminationException); 821this.Controller.Abort(reason); 843this.Controller.Abort(reason); 882this.Controller.Abort(reason); 900if (this.Controller.HasPendingTrackingRecords || this.Aborted != null) 918if (this.Controller.HasPendingTrackingRecords) 922IAsyncResult result = this.Controller.BeginFlushTrackingRecords(ActivityDefaults.TrackingTimeout, Fx.ThunkCallback(new AsyncCallback(OnAbortTrackingComplete)), reason); 926this.Controller.EndFlushTrackingRecords(result); 959this.Controller.EndFlushTrackingRecords(result); 1051this.Controller.FlushTrackingRecords(timeoutHelper.RemainingTime()); 1061this.Controller.Terminate(reason); 1110this.Controller.ScheduleCancel(); 1146this.Controller.FlushTrackingRecords(timeoutHelper.RemainingTime()); 1235instance.Controller.Run(); 1272if (instance.Controller.State == WorkflowInstanceState.Aborted) 1274completionException = new WorkflowApplicationAbortedException(SR.DefaultAbortReason, instance.Controller.GetAbortReason()); 1278Fx.Assert(instance.Controller.State == WorkflowInstanceState.Complete, "We should only get here when we are completed."); 1280instance.Controller.GetCompletionState(out outputs, out completionException); 1340this.Controller.FlushTrackingRecords(timeoutHelper.RemainingTime()); 2267if (this.Controller.TrackingEnabled) 2271this.Controller.Track(new WorkflowInstanceRecord(this.Id, this.WorkflowDefinition.DisplayName, WorkflowInstanceStates.Deleted, this.DefinitionIdentity)); 2275this.Controller.Track(new WorkflowInstanceRecord(this.Id, this.WorkflowDefinition.DisplayName, WorkflowInstanceStates.Unloaded, this.DefinitionIdentity)); 2279this.Controller.Track(new WorkflowInstanceRecord(this.Id, this.WorkflowDefinition.DisplayName, WorkflowInstanceStates.Persisted, this.DefinitionIdentity)); 2301this.Controller.FlushTrackingRecords(timeoutHelper.RemainingTime()); 2463return this.Controller.GetBookmarks(); 2485return this.Controller.GetBookmarks(); 2613this.Controller.FlushTrackingRecords(timeoutHelper.RemainingTime()); 2695BookmarkResumptionResult result = this.Controller.ScheduleBookmarkResumption(bookmark, value); 2755if (this.Controller.State != WorkflowInstanceState.Complete) 2757this.Controller.Abort(); 2826if (this.Controller.State == WorkflowInstanceState.Complete) 2914this.Controller.GetCompletionState(out completionException); 3004if (this.Controller.State != WorkflowInstanceState.Complete) 3159if (this.instance.Controller.State == WorkflowInstanceState.Aborted) 3161this.completionException = new WorkflowApplicationAbortedException(SR.DefaultAbortReason, this.instance.Controller.GetAbortReason()); 3165Fx.Assert(this.instance.Controller.State == WorkflowInstanceState.Complete, "We should only get here when we are completed."); 3167this.instance.Controller.GetCompletionState(out this.outputs, out this.completionException); 3390if (this.instance.Controller.HasPendingTrackingRecords) 3392IAsyncResult result = this.instance.Controller.BeginFlushTrackingRecords(this.timeoutHelper.RemainingTime(), PrepareAsyncCompletion(trackingCompleteCallback), this); 3417thisPtr.instance.Controller.EndFlushTrackingRecords(result); 3476Fx.Assert(this.instance.Controller.IsPersistable, "The runtime won't schedule this work item unless we've passed the guard"); 3586if (this.operation == PersistenceOperation.Unload && this.instance.Controller.State == WorkflowInstanceState.Complete) 3655if (this.instance.Controller.HasPendingTrackingRecords) 3671IAsyncResult result = this.instance.Controller.BeginFlushTrackingRecords(flushTrackingRecordsTimeout, PrepareAsyncCompletion(trackingCompleteCallback), this); 3681thisPtr.instance.Controller.EndFlushTrackingRecords(result); 3991if (this.instance.Controller.HasPendingTrackingRecords) 3993IAsyncResult trackingResult = this.instance.Controller.BeginFlushTrackingRecords(this.timeoutHelper.RemainingTime(), trackingCompleteCallback, this); 3997this.instance.Controller.EndFlushTrackingRecords(trackingResult); 4064thisPtr.instance.Controller.EndFlushTrackingRecords(result); 4964if (instance.Controller.TrackingEnabled) 4966instance.Controller.Track(new WorkflowInstanceRecord(instance.Id, instance.WorkflowDefinition.DisplayName, WorkflowInstanceStates.Idle, instance.DefinitionIdentity)); 4969result = instance.Controller.BeginFlushTrackingRecords(ActivityDefaults.TrackingTimeout, EventFrameCallback, instance.EventData); 4984application.Controller.EndFlushTrackingRecords(lastResult); 4991if (application.Controller.IsPersistable && application.persistenceManager != null) 5101if (instance.Controller.HasPendingTrackingRecords) 5104result = instance.Controller.BeginFlushTrackingRecords(ActivityDefaults.TrackingTimeout, EventFrameCallback, instance.EventData); 5119instance.Controller.EndFlushTrackingRecords(lastResult); 5124ActivityInstanceState completionState = instance.Controller.GetCompletionState(out outputs, out completionException); 5169Fx.Assert(instance.Controller.IsPersistable, "Should not be in a No Persist Zone once the instance is complete."); 5229if (instance.Controller.HasPendingTrackingRecords) 5235result = instance.Controller.BeginFlushTrackingRecords(ActivityDefaults.TrackingTimeout, EventFrameCallback, instance.EventData); 5255instance.Controller.EndFlushTrackingRecords(lastResult); 5293instance.Controller.ScheduleCancel(); 5464return instance.Controller.State == WorkflowInstanceState.Idle || instance.Controller.State == WorkflowInstanceState.Complete; 5477return (this.ActionId != instance.actionCount && instance.Controller.State == WorkflowInstanceState.Idle) || instance.Controller.State == WorkflowInstanceState.Complete; 5485if (!instance.Controller.IsPersistable && instance.Controller.State != WorkflowInstanceState.Complete) 5487instance.Controller.PauseWhenPersistable(); 5842data[WorkflowNamespace.Bookmarks] = new InstanceValue(instance.Controller.GetBookmarks(), InstanceValueOptions.WriteOnly | InstanceValueOptions.Optional); 5845foreach (KeyValuePair<string, LocationInfo> mappedVariable in instance.Controller.GetMappedVariables()) 5850Fx.AssertAndThrow(instance.Controller.State != WorkflowInstanceState.Aborted, "Cannot generate data for an aborted instance."); 5851if (instance.Controller.State != WorkflowInstanceState.Complete) 5853data[WorkflowNamespace.Workflow] = new InstanceValue(instance.Controller.PrepareForSerialization()); 5854data[WorkflowNamespace.Status] = new InstanceValue(instance.Controller.State == WorkflowInstanceState.Idle ? "Idle" : "Executing", InstanceValueOptions.WriteOnly); 5858data[WorkflowNamespace.Workflow] = new InstanceValue(instance.Controller.PrepareForSerialization(), InstanceValueOptions.Optional); 5862ActivityInstanceState completionState = instance.Controller.GetCompletionState(out outputs, out completionException);
System.ServiceModel.Activities (79)
System\ServiceModel\Activities\Dispatcher\WorkflowServiceInstance.cs (79)
255return this.Controller.State == WorkflowInstanceState.Idle; 263return this.Controller.State == WorkflowInstanceState.Complete && !this.hasRaisedCompleted; 524this.Controller.RequestPause(); 591this.Controller.RequestPause(); 835if (this.Controller.State == WorkflowInstanceState.Complete) 841this.Controller.Run(); 910this.Controller.Abort(reason); 916this.Controller.Abort(); 940this.Controller.Abort(reason); 946this.Controller.Abort(); 1034this.Controller.Abort(abortInstanceState.Reason); 1040this.Controller.Abort(); 1078if (isUpdateFailure || this.Controller.HasPendingTrackingRecords) 1086this.Controller.EndFlushTrackingRecords(result); 1230if (this.Controller.HasPendingTrackingRecords) 1232IAsyncResult result = this.Controller.BeginFlushTrackingRecords(this.trackTimeout, TrackCompleteDoneCallback, this); 1236this.Controller.EndFlushTrackingRecords(result); 1272else if (this.Controller.State == WorkflowInstanceState.Aborted) 1274Exception abortReason = this.Controller.GetAbortReason(); 1283if (this.Controller.TrackingEnabled) 1285this.Controller.Track(new WorkflowInstanceRecord(this.Id, this.WorkflowDefinition.DisplayName, WorkflowInstanceStates.Idle, this.DefinitionIdentity)); 1286IAsyncResult result = this.Controller.BeginFlushTrackingRecords(this.trackTimeout, TrackIdleDoneCallback, this); 1290this.Controller.EndFlushTrackingRecords(result); 1343thisPtr.Controller.EndFlushTrackingRecords(result); 1375thisPtr.Controller.EndFlushTrackingRecords(result); 1404if (this.Controller.HasPendingTrackingRecords) 1406IAsyncResult result = this.Controller.BeginFlushTrackingRecords(this.trackTimeout, TrackUnhandledExceptionDoneCallback, data); 1410this.Controller.EndFlushTrackingRecords(result); 1454thisPtr.Controller.EndFlushTrackingRecords(result); 1496this.completionState = this.Controller.GetCompletionState(out this.workflowOutputs, out this.terminationException); 1501if (this.Controller.TrackingEnabled) 1505this.Controller.Track(new WorkflowInstanceRecord(this.Id, this.WorkflowDefinition.DisplayName, WorkflowInstanceStates.Deleted, this.DefinitionIdentity)); 1510this.Controller.Track(new WorkflowInstanceRecord(this.Id, this.WorkflowDefinition.DisplayName, WorkflowInstanceStates.Unloaded, this.DefinitionIdentity)); 1515this.Controller.Track(new WorkflowInstanceRecord(this.Id, this.WorkflowDefinition.DisplayName, WorkflowInstanceStates.Persisted, this.DefinitionIdentity)); 1523data[WorkflowNamespace.Bookmarks] = new InstanceValue(Controller.GetBookmarks(), InstanceValueOptions.WriteOnly | InstanceValueOptions.Optional); 1526foreach (KeyValuePair<string, LocationInfo> mappedVariable in Controller.GetMappedVariables()) 1531Fx.AssertAndThrow(Controller.State != WorkflowInstanceState.Aborted, "Cannot generate data for an aborted service instance."); 1532if (Controller.State != WorkflowInstanceState.Complete) 1534data[WorkflowNamespace.Workflow] = new InstanceValue(Controller.PrepareForSerialization()); 1541data[WorkflowNamespace.Status] = new InstanceValue(Controller.State == WorkflowInstanceState.Idle ? "Idle" : "Executing", InstanceValueOptions.WriteOnly); 1545data[WorkflowNamespace.Workflow] = new InstanceValue(Controller.PrepareForSerialization(), InstanceValueOptions.Optional); 1581return new UnloadOrPersistAsyncResult(this, this.Controller.State == WorkflowInstanceState.Complete ? PersistenceOperation.Delete : PersistenceOperation.Save, false, isTry, 1592return this.Controller.BeginFlushTrackingRecords(this.trackTimeout, callback, state); 1597this.Controller.EndFlushTrackingRecords(result); 1649result = this.Controller.ScheduleBookmarkResumption(bookmark, value); 1653result = this.Controller.ScheduleBookmarkResumption(bookmark, value, bookmarkScope); 1730if (this.Controller.State != WorkflowInstanceState.Complete) 1732this.Controller.Abort(); 1754if (this.checkCanPersistWaiters != null && this.checkCanPersistWaiters.Count > 0 && this.Controller.IsPersistable) 1949if (this.Controller.State != WorkflowInstanceState.Complete) 2168this.persistenceContext.Bookmarks = this.Controller.GetBookmarks(); 3233if (this.instance.Controller.HasPendingTrackingRecords) 3237IAsyncResult result = this.instance.Controller.BeginFlushTrackingRecords(this.instance.trackTimeout, PrepareAsyncCompletion(handleEndTrack), this); 3247thisPtr.instance.Controller.EndFlushTrackingRecords(result); 3381this.isCompletionTransactionRequired = this.isUnloaded && instance.Controller.State == WorkflowInstanceState.Complete && 3417Fx.Assert(this.instance.Controller.IsPersistable, "The runtime won't schedule this work item unless we've passed the guard"); 3495if (this.instance.Controller.IsPersistable) 3609if (this.operation == PersistenceOperation.Unload && this.instance.Controller.State == WorkflowInstanceState.Complete) 3733if (this.instance.Controller.HasPendingTrackingRecords) 3735IAsyncResult result = this.instance.Controller.BeginFlushTrackingRecords(this.instance.trackTimeout, PrepareInnerAsyncCompletion(trackingCompleteCallback), this); 3748thisPtr.instance.Controller.EndFlushTrackingRecords(result); 3926if (this.isUnloaded && this.instance.Controller.State == WorkflowInstanceState.Complete && this.instance.creationContext != null) 4198if (this.instance.state != State.Aborted && this.instance.Controller.HasPendingTrackingRecords) 4205IAsyncResult result = this.instance.Controller.BeginFlushTrackingRecords(this.instance.trackTimeout, PrepareAsyncCompletion(handleEndTrack), this); 4224thisPtr.instance.Controller.EndFlushTrackingRecords(result); 4290this.Instance.Controller.Terminate(reason); 4401if (!this.shouldTrackAbort && this.Instance.Controller.TrackingEnabled) 4403this.Instance.Controller.Track(new WorkflowInstanceRecord(this.Instance.Id, this.Instance.WorkflowDefinition.DisplayName, WorkflowInstanceStates.Unloaded, this.Instance.DefinitionIdentity)); 4494if (this.Instance.Controller.TrackingEnabled) 4496this.Instance.Controller.Track(new WorkflowInstanceSuspendedRecord(this.Instance.Id, this.Instance.WorkflowDefinition.DisplayName, data.reason.Message, this.Instance.DefinitionIdentity)); 4542this.Instance.Controller.ScheduleCancel(); 4700if (thisPtr.parent.Instance.Controller.TrackingEnabled) 4702thisPtr.parent.Instance.Controller.Track(new WorkflowInstanceSuspendedRecord(thisPtr.parent.Instance.Id, thisPtr.parent.Instance.WorkflowDefinition.DisplayName, thisPtr.parent.reason, thisPtr.parent.Instance.DefinitionIdentity)); 4720thisPtr.parent.Instance.Controller.RequestPause(); 4761if (this.Instance.Controller.TrackingEnabled) 4763this.Instance.Controller.Track(new WorkflowInstanceRecord(this.Instance.Id, this.Instance.WorkflowDefinition.DisplayName, WorkflowInstanceStates.Unsuspended, this.Instance.DefinitionIdentity)); 4912if (this.instance.state == State.Active && this.instance.Controller.State == WorkflowInstanceState.Runnable) 5009if (this.instance.Controller.IsPersistable) 5014this.instance.Controller.PauseWhenPersistable();