-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
WorkflowCommitWorkBatchService.xml
93 lines (84 loc) · 7.39 KB
/
WorkflowCommitWorkBatchService.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<Type Name="WorkflowCommitWorkBatchService" FullName="System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService">
<TypeSignature Language="C#" Value="public abstract class WorkflowCommitWorkBatchService : System.Workflow.Runtime.Hosting.WorkflowRuntimeService" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit WorkflowCommitWorkBatchService extends System.Workflow.Runtime.Hosting.WorkflowRuntimeService" />
<TypeSignature Language="DocId" Value="T:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class WorkflowCommitWorkBatchService
Inherits WorkflowRuntimeService" />
<TypeSignature Language="F#" Value="type WorkflowCommitWorkBatchService = class
 inherit WorkflowRuntimeService" />
<TypeSignature Language="C++ CLI" Value="public ref class WorkflowCommitWorkBatchService abstract : System::Workflow::Runtime::Hosting::WorkflowRuntimeService" />
<AssemblyInfo>
<AssemblyName>System.Workflow.Runtime</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Workflow.Runtime.Hosting.WorkflowRuntimeService</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]</AttributeName>
<AttributeName Language="F#">[<System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Allows custom logic for the commitment of work batches.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
> [!NOTE]
> [!INCLUDE[DeprecatedContent](~/includes/deprecatedcontent-md.md)]
When a work batch is committed the runtime calls into the <xref:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService> and gives it a delegate to call to do the actual committing of the work batch. The runtime still has the primary responsibility of committing the work batch but allows the <xref:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService> to insert itself in the process for customization around the commit process.
This process allows custom error handling logic. If the <xref:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService> owns the transaction, which is the case when the <xref:System.Transactions.Transaction.Current%2A?displayProperty=nameWithType> property returns `null` therefore necessitating the need to create a new ambient transaction, it is allowed to call the delegate more than once, creating a new transaction for each call. The most common case for this for example is to handle intermittent network problems or SQL cluster failovers. If the call to the <xref:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatchCallback> throws an exception <xref:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService> can catch this exception, start a new transaction and call the delegate again. This gives a level of resilience to workflow instance execution that otherwise would cause workflows to terminate.
## Examples
The following example demonstrates a class that inherits from <xref:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService>.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wf_samples/cs/snippets.cs" id="Snippet0":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/wf_samples/vb/snippets.vb" id="Snippet0":::
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected WorkflowCommitWorkBatchService ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.#ctor" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" />
<MemberSignature Language="C++ CLI" Value="protected:
 WorkflowCommitWorkBatchService();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Workflow.Runtime</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>When implemented in a derived class, initializes a new instance of the <see cref="T:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CommitWorkBatch">
<MemberSignature Language="C#" Value="protected internal virtual void CommitWorkBatch (System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatchCallback commitWorkBatchCallback);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig newslot virtual instance void CommitWorkBatch(class System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService/CommitWorkBatchCallback commitWorkBatchCallback) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatch(System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatchCallback)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overridable Sub CommitWorkBatch (commitWorkBatchCallback As WorkflowCommitWorkBatchService.CommitWorkBatchCallback)" />
<MemberSignature Language="F#" Value="abstract member CommitWorkBatch : System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatchCallback -> unit
override this.CommitWorkBatch : System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatchCallback -> unit" Usage="workflowCommitWorkBatchService.CommitWorkBatch commitWorkBatchCallback" />
<MemberSignature Language="C++ CLI" Value="protected public:
 virtual void CommitWorkBatch(System::Workflow::Runtime::Hosting::WorkflowCommitWorkBatchService::CommitWorkBatchCallback ^ commitWorkBatchCallback);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Workflow.Runtime</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="commitWorkBatchCallback" Type="System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService+CommitWorkBatchCallback" />
</Parameters>
<Docs>
<param name="commitWorkBatchCallback">The <see cref="T:System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatchCallback" /> delegate to call to commit the work batch.</param>
<summary>Called to commit the work batch.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>