|
18 | 18 | <summary>
|
19 | 19 | <see cref="T:System.Activities.Hosting.WorkflowInstance" /> is a lightweight, per-instance runtime for executing a workflow program. It can be constructed to create a new workflow instance or from existing instance state. The APIs that <see cref="T:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl" /> exposes are the minimal set of runtime controls from which higher level operations can be implemented. This API set represents the entire breadth of functionality of the runtime. <see cref="T:System.Activities.Hosting.WorkflowInstance" /> is an abstract class and relies on a host's implementation of its abstract methods in order to provide host functionality such as synchronization, persistence, tracking, and extensions.</summary>
|
20 | 20 | <remarks>
|
21 |
| - <format type="text/markdown"><![CDATA[ |
22 |
| - |
23 |
| -## Remarks |
24 |
| - <xref:System.Activities.Hosting.WorkflowInstance> is single threaded and assumes that the host synchronizes all access to it. An attempt to call multiple APIs simultaneously will result in an <xref:System.InvalidOperationException> being thrown. |
25 |
| - |
26 |
| - Internally, a <xref:System.Activities.Hosting.WorkflowInstance> has two states: Running and Paused. The only way to cause the runtime to transition from paused to running is to call <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.Run%2A>. All actions (except Pause) can only be taken while the runtime is Paused. The runtime will become spontaneously Paused in the following situations: |
27 |
| - |
28 |
| -- An error fatal to the runtime has occurred. The host will be signaled through <xref:System.Activities.Hosting.WorkflowInstance.OnRequestAbort%2A> (which does not signal a transition to Paused) and then notified through <xref:System.Activities.Hosting.WorkflowInstance.OnNotifyPaused%2A>. |
29 |
| - |
30 |
| -- An exception in the workflow was uncaught and escaped the root. The host will be notified through the <xref:System.Activities.Hosting.WorkflowInstance.OnNotifyUnhandledException%2A> method. |
31 |
| - |
32 |
| -- The scheduler has run out of work items and is now <xref:System.Activities.Hosting.WorkflowInstanceState.Idle>. The host will be notified through the <xref:System.Activities.Hosting.WorkflowInstance.OnNotifyPaused%2A> method. Note that the scheduler could have run out of work items because the instance is idle or because the instance is complete. The <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.State%2A> value of the <xref:System.Activities.Hosting.WorkflowInstance.Controller%2A> property can be used to differentiate between the two. |
33 |
| - |
34 |
| - The host can request a change from Running to Paused by calling the <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.RequestPause%2A> or <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.PauseWhenPersistable%2A> methods of the <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl> instance returned by the <xref:System.Activities.Hosting.WorkflowInstance.Controller%2A> property. This request should not be considered to have a specific response meaning that the host should not attempt to correlate an OnNotify* or <xref:System.Activities.Hosting.WorkflowInstance.OnRequestAbort%2A> with a specific call to pause. In response to a pause request, the runtime may transition to Paused and call <xref:System.Activities.Hosting.WorkflowInstance.OnNotifyPaused%2A> while the scheduler still has pending work items. The <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.State%2A> value of the <xref:System.Activities.Hosting.WorkflowInstance.Controller%2A> property can be used to determine whether the scheduler has no more work or was interrupted by a request to pause. |
35 |
| - |
36 |
| - The <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.RequestPause%2A> method of the <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl> instance returned by the <xref:System.Activities.Hosting.WorkflowInstance.Controller%2A> property is the only method which can be called while the <xref:System.Activities.Hosting.WorkflowInstance> is in the Running state. All other methods will throw an <xref:System.InvalidOperationException> if called.Given the rules for how <xref:System.Activities.Hosting.WorkflowInstance> transitions from one state to another, the public notion of Running and Paused can be defined as follows: |
37 |
| - |
38 |
| -- Running - The state between a call to <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.Run%2A> and the next WorkflowInstance.OnNotify*. |
39 |
| - |
40 |
| -- Paused - The state between the last WorkflowInstance.OnNotify* and the next call to <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.Run%2A>. |
41 |
| - |
| 21 | + <format type="text/markdown"><![CDATA[ |
| 22 | +
|
| 23 | +## Remarks |
| 24 | + <xref:System.Activities.Hosting.WorkflowInstance> is single threaded and assumes that the host synchronizes all access to it. An attempt to call multiple APIs simultaneously will result in an <xref:System.InvalidOperationException> being thrown. |
| 25 | +
|
| 26 | + Internally, a <xref:System.Activities.Hosting.WorkflowInstance> has two states: Running and Paused. The only way to cause the runtime to transition from paused to running is to call <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.Run%2A>. All actions (except Pause) can only be taken while the runtime is Paused. The runtime will become spontaneously Paused in the following situations: |
| 27 | +
|
| 28 | +- An error fatal to the runtime has occurred. The host will be signaled through <xref:System.Activities.Hosting.WorkflowInstance.OnRequestAbort%2A> (which does not signal a transition to Paused) and then notified through <xref:System.Activities.Hosting.WorkflowInstance.OnNotifyPaused%2A>. |
| 29 | +
|
| 30 | +- An exception in the workflow was uncaught and escaped the root. The host will be notified through the <xref:System.Activities.Hosting.WorkflowInstance.OnNotifyUnhandledException%2A> method. |
| 31 | +
|
| 32 | +- The scheduler has run out of work items and is now <xref:System.Activities.Hosting.WorkflowInstanceState.Idle>. The host will be notified through the <xref:System.Activities.Hosting.WorkflowInstance.OnNotifyPaused%2A> method. Note that the scheduler could have run out of work items because the instance is idle or because the instance is complete. The <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.State%2A> value of the <xref:System.Activities.Hosting.WorkflowInstance.Controller%2A> property can be used to differentiate between the two. |
| 33 | +
|
| 34 | + The host can request a change from Running to Paused by calling the <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.RequestPause%2A> or <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.PauseWhenPersistable%2A> methods of the <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl> instance returned by the <xref:System.Activities.Hosting.WorkflowInstance.Controller%2A> property. This request should not be considered to have a specific response meaning that the host should not attempt to correlate an OnNotify* or <xref:System.Activities.Hosting.WorkflowInstance.OnRequestAbort%2A> with a specific call to pause. In response to a pause request, the runtime may transition to Paused and call <xref:System.Activities.Hosting.WorkflowInstance.OnNotifyPaused%2A> while the scheduler still has pending work items. The <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.State%2A> value of the <xref:System.Activities.Hosting.WorkflowInstance.Controller%2A> property can be used to determine whether the scheduler has no more work or was interrupted by a request to pause. |
| 35 | +
|
| 36 | + The <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.RequestPause%2A> method of the <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl> instance returned by the <xref:System.Activities.Hosting.WorkflowInstance.Controller%2A> property is the only method that can be called while the <xref:System.Activities.Hosting.WorkflowInstance> is in the Running state. All other methods will throw an <xref:System.InvalidOperationException> if called.Given the rules for how <xref:System.Activities.Hosting.WorkflowInstance> transitions from one state to another, the public notion of Running and Paused can be defined as follows: |
| 37 | +
|
| 38 | +- Running - The state between a call to <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.Run%2A> and the next WorkflowInstance.OnNotify*. |
| 39 | +
|
| 40 | +- Paused - The state between the last WorkflowInstance.OnNotify* and the next call to <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.Run%2A>. |
| 41 | +
|
42 | 42 | ]]></format>
|
43 | 43 | </remarks>
|
44 | 44 | </Docs>
|
|
348 | 348 | <summary>Gets or sets the root environment for the workflow instance's arguments and variables.</summary>
|
349 | 349 | <value>The root environment for the workflow instance's arguments and variables.</value>
|
350 | 350 | <remarks>
|
351 |
| - <format type="text/markdown"><![CDATA[ |
352 |
| - |
353 |
| -## Remarks |
354 |
| - If this property is set after the workflow instance is initialized and <xref:System.Activities.Hosting.WorkflowInstance.IsReadOnly%2A> returns `true`, an <xref:System.InvalidOperationException> is thrown. |
355 |
| - |
| 351 | + <format type="text/markdown"><![CDATA[ |
| 352 | +
|
| 353 | +## Remarks |
| 354 | + If this property is set after the workflow instance is initialized and <xref:System.Activities.Hosting.WorkflowInstance.IsReadOnly%2A> returns `true`, an <xref:System.InvalidOperationException> is thrown. |
| 355 | +
|
356 | 356 | ]]></format>
|
357 | 357 | </remarks>
|
358 | 358 | </Docs>
|
|
799 | 799 | <param name="reason">The reason for aborting the workflow instance.</param>
|
800 | 800 | <summary>Called by the workflow runtime to notify the host that an abort operation has been requested for the workflow instance.</summary>
|
801 | 801 | <remarks>
|
802 |
| - <format type="text/markdown"><![CDATA[ |
803 |
| - |
804 |
| -## Remarks |
805 |
| - Once <xref:System.Activities.Hosting.WorkflowInstance.OnRequestAbort%2A> is called, most <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl> APIs except <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.Abort%2A> will throw an <xref:System.InvalidOperationException>. It is expected that after <xref:System.Activities.Hosting.WorkflowInstance.OnRequestAbort%2A> is called a host will trend toward a state in which it can satisfy the abort. |
806 |
| - |
| 802 | + <format type="text/markdown"><![CDATA[ |
| 803 | +
|
| 804 | +## Remarks |
| 805 | + Once <xref:System.Activities.Hosting.WorkflowInstance.OnRequestAbort%2A> is called, most <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl> APIs except <xref:System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.Abort%2A> will throw an <xref:System.InvalidOperationException>. It is expected that after <xref:System.Activities.Hosting.WorkflowInstance.OnRequestAbort%2A> is called a host will trend toward a state in which it can satisfy the abort. |
| 806 | +
|
807 | 807 | ]]></format>
|
808 | 808 | </remarks>
|
809 | 809 | </Docs>
|
|
830 | 830 | <param name="extensionManager">The extension manager to register.</param>
|
831 | 831 | <summary>Called by the host to register the specified extension manager, validate that all required extensions are present, and to initialize the collection of extensions to be used.</summary>
|
832 | 832 | <remarks>
|
833 |
| - <format type="text/markdown"><![CDATA[ |
834 |
| - |
835 |
| -## Remarks |
836 |
| - Extensions are keyed by type, and a host provided extension will always be used if provided. Extensions added through <xref:System.Activities.Hosting.WorkflowInstanceExtensionManager.Add%2A> use the runtime type of the object as the type key. Extensions providers added through <xref:System.Activities.Hosting.WorkflowInstanceExtensionManager.Add%2A> use the decared type T of the Func\<T> as the type key. Extension providers contributed by activities through the various *ActivityMetadata.AddDefaultExtensionProvider methods are dropped if a host extension exists for the declared type or if there is a broader type provided through AddDefaultExtensionProvider (ex. if Func\<StreamWriter> is provided and Func\<TextWriter> is provided, only Func\<StreamWriter> will be kept). If an extension does not exist in the collection that is required by an activity (expressed by calling *ActivityMetadata.RequireExtension) a <xref:System.Activities.ValidationException> is thrown. |
837 |
| - |
| 833 | + <format type="text/markdown"><![CDATA[ |
| 834 | +
|
| 835 | +## Remarks |
| 836 | + Extensions are keyed by type, and a host provided extension will always be used if provided. Extensions added through <xref:System.Activities.Hosting.WorkflowInstanceExtensionManager.Add%2A> use the runtime type of the object as the type key. Extensions providers added through <xref:System.Activities.Hosting.WorkflowInstanceExtensionManager.Add%2A> use the decared type T of the Func\<T> as the type key. Extension providers contributed by activities through the various *ActivityMetadata.AddDefaultExtensionProvider methods are dropped if a host extension exists for the declared type or if there is a broader type provided through AddDefaultExtensionProvider (ex. if Func\<StreamWriter> is provided and Func\<TextWriter> is provided, only Func\<StreamWriter> will be kept). If an extension does not exist in the collection that is required by an activity (expressed by calling *ActivityMetadata.RequireExtension) a <xref:System.Activities.ValidationException> is thrown. |
| 837 | +
|
838 | 838 | ]]></format>
|
839 | 839 | </remarks>
|
840 | 840 | </Docs>
|
|
886 | 886 | <summary>Gets or sets the <see cref="T:System.Threading.SynchronizationContext" /> used for scheduling the workflow instance.</summary>
|
887 | 887 | <value>The synchronization context used for scheduling the workflow instance.</value>
|
888 | 888 | <remarks>
|
889 |
| - <format type="text/markdown"><![CDATA[ |
890 |
| - |
891 |
| -## Remarks |
892 |
| - If this property is set after the workflow instance is initialized and <xref:System.Activities.Hosting.WorkflowInstance.IsReadOnly%2A> returns `true`, an <xref:System.InvalidOperationException> is thrown. |
893 |
| - |
| 889 | + <format type="text/markdown"><![CDATA[ |
| 890 | +
|
| 891 | +## Remarks |
| 892 | + If this property is set after the workflow instance is initialized and <xref:System.Activities.Hosting.WorkflowInstance.IsReadOnly%2A> returns `true`, an <xref:System.InvalidOperationException> is thrown. |
| 893 | +
|
894 | 894 | ]]></format>
|
895 | 895 | </remarks>
|
896 | 896 | </Docs>
|
|
914 | 914 | <Docs>
|
915 | 915 | <summary>Throws an <see cref="T:System.InvalidOperationException" /> if the workflow instance has been initialized, as determined by <see cref="P:System.Activities.Hosting.WorkflowInstance.IsReadOnly" />.</summary>
|
916 | 916 | <remarks>
|
917 |
| - <format type="text/markdown"><![CDATA[ |
918 |
| - |
919 |
| -## Remarks |
920 |
| - If <xref:System.Activities.Hosting.WorkflowInstance.IsReadOnly%2A> returns `true`, then an <xref:System.InvalidOperationException> is thrown. |
921 |
| - |
| 917 | + <format type="text/markdown"><![CDATA[ |
| 918 | +
|
| 919 | +## Remarks |
| 920 | + If <xref:System.Activities.Hosting.WorkflowInstance.IsReadOnly%2A> returns `true`, then an <xref:System.InvalidOperationException> is thrown. |
| 921 | +
|
922 | 922 | ]]></format>
|
923 | 923 | </remarks>
|
924 | 924 | </Docs>
|
|
0 commit comments