Skip to content

Commit 1d69ec0

Browse files
committed
Update documentation
1 parent b93cef8 commit 1d69ec0

19 files changed

+2113
-673
lines changed
Lines changed: 93 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,127 @@
1-
# virtual FinalizerHandler
2-
3-
The `FinalizerHandler` class is a utility class that handles the execution of dynamic finalizers.
4-
Finalizers are classes that implement the `TriggerAction.DmlFinalizer` interface and are defined in Custom Metadata.
5-
Finalizers can be used to perform custom actions after all DML operations have completed.
6-
The `FinalizerHandler` class provides the following functionality:
7-
- A way to bypass the execution of specific finalizers.
8-
- A way to check if a specific finalizer is bypassed.
9-
- A way to clear all bypasses.
10-
- A way to handle dynamic finalizers.
11-
---
12-
To use the `FinalizerHandler` class, you must first create a Custom Metadata type called `DML_Finalizer__mdt`.
13-
The `DML_Finalizer__mdt` Custom Metadata type must have the following fields:
14-
- `Apex_Class_Name__c`: The name of the Apex class that implements the finalizer.
15-
- `Order__c`: The order in which the finalizer should be executed.
16-
- `Bypass_Execution__c`: A flag that indicates whether or not the finalizer should be bypassed.
17-
- `Bypass_Permission__c`: The permission required to bypass the finalizer.
18-
- `Required_Permission__c`: The permission required to execute the finalizer.
19-
---
20-
Once you have created the `DML_Finalizer__mdt` Custom Metadata type, you can create finalizers by creating records
21-
in the `DML_Finalizer__mdt` object.
22-
To bypass the execution of a specific finalizer, you can call the `bypass` method of the `FinalizerHandler` class.
23-
To check if a specific finalizer is bypassed, you can call the `isBypassed` method of the `FinalizerHandler` class.
24-
To clear all bypasses, you can call the `clearAllBypasses` method of the `FinalizerHandler` class.
25-
To handle dynamic finalizers, you can call the `handleDynamicFinalizers` method of the `FinalizerHandler` class.
1+
# FinalizerHandler Class
2+
`virtual`
3+
4+
The `FinalizerHandler` class is a utility class that handles the execution of dynamic finalizers.
5+
6+
Finalizers are classes that implement the `TriggerAction.DmlFinalizer` interface and are defined in Custom Metadata.
7+
Finalizers can be used to perform custom actions after all DML operations have completed.
8+
9+
The `FinalizerHandler` class provides the following functionality:
10+
11+
- A way to bypass the execution of specific finalizers.
12+
- A way to check if a specific finalizer is bypassed.
13+
- A way to clear all bypasses.
14+
- A way to handle dynamic finalizers.
15+
---
16+
To use the `FinalizerHandler` class, you must first create a Custom Metadata type called `DML_Finalizer__mdt` .
17+
The `DML_Finalizer__mdt` Custom Metadata type must have the following fields:
18+
19+
- `Apex_Class_Name__c` : The name of the Apex class that implements the finalizer.
20+
- `Order__c` : The order in which the finalizer should be executed.
21+
- `Bypass_Execution__c` : A flag that indicates whether or not the finalizer should be bypassed.
22+
- `Bypass_Permission__c` : The permission required to bypass the finalizer.
23+
- `Required_Permission__c` : The permission required to execute the finalizer.
24+
---
25+
Once you have created the `DML_Finalizer__mdt` Custom Metadata type, you can create finalizers by creating records
26+
in the `DML_Finalizer__mdt` object.
27+
28+
To bypass the execution of a specific finalizer, you can call the `bypass` method of the `FinalizerHandler` class.
29+
To check if a specific finalizer is bypassed, you can call the `isBypassed` method of the `FinalizerHandler` class.
30+
To clear all bypasses, you can call the `clearAllBypasses` method of the `FinalizerHandler` class.
31+
32+
To handle dynamic finalizers, you can call the `handleDynamicFinalizers` method of the `FinalizerHandler` class.
2633
The `handleDynamicFinalizers` method will instantiate and execute all finalizers that are not bypassed.
2734

28-
2935
**Group** Trigger Actions Framework
3036

3137
## Methods
32-
### `public static void bypass(String finalizer)`
38+
### `bypass(finalizer)`
3339

3440
Bypass the execution of a specific finalizer.
3541

42+
#### Signature
43+
```apex
44+
public static void bypass(String finalizer)
45+
```
46+
3647
#### Parameters
48+
| Name | Type | Description |
49+
|------|------|-------------|
50+
| finalizer | String | The name of the finalizer to bypass. |
51+
52+
#### Return Type
53+
**void**
3754

38-
|Param|Description|
39-
|---|---|
40-
|`finalizer`|The name of the finalizer to bypass.|
55+
---
4156

42-
### `public static void clearBypass(String finalizer)`
57+
### `clearBypass(finalizer)`
4358

4459
Clear the bypass for a specific finalizer.
4560

61+
#### Signature
62+
```apex
63+
public static void clearBypass(String finalizer)
64+
```
65+
4666
#### Parameters
67+
| Name | Type | Description |
68+
|------|------|-------------|
69+
| finalizer | String | The name of the finalizer to clear the bypass for. |
4770

48-
|Param|Description|
49-
|---|---|
50-
|`finalizer`|The name of the finalizer to clear the bypass for.|
71+
#### Return Type
72+
**void**
5173

52-
### `public static Boolean isBypassed(String finalizer)`
74+
---
75+
76+
### `isBypassed(finalizer)`
5377

5478
Check if a specific finalizer is bypassed.
5579

80+
#### Signature
81+
```apex
82+
public static Boolean isBypassed(String finalizer)
83+
```
84+
5685
#### Parameters
86+
| Name | Type | Description |
87+
|------|------|-------------|
88+
| finalizer | String | The name of the finalizer to check. |
5789

58-
|Param|Description|
59-
|---|---|
60-
|`finalizer`|The name of the finalizer to check.|
90+
#### Return Type
91+
**Boolean**
6192

62-
#### Returns
93+
True if the finalizer is bypassed, false otherwise.
6394

64-
|Type|Description|
65-
|---|---|
66-
|`Boolean`|True if the finalizer is bypassed, false otherwise.|
95+
---
6796

68-
### `public static void clearAllBypasses()`
97+
### `clearAllBypasses()`
6998

7099
Clear all bypasses.
71100

72-
### `public virtual void handleDynamicFinalizers()`
101+
#### Signature
102+
```apex
103+
public static void clearAllBypasses()
104+
```
73105

74-
Handle dynamic finalizers.nstantiates and executes finalizers based on metadata.
106+
#### Return Type
107+
**void**
75108

76109
---
77-
## Classes
78-
### Context
79110

80-
Context to be passed to the implementation's `.execute` methodis object's definition is empty. We are establishing the interface
81-
to include the context to help future-proof the interface's specifications.
111+
### `handleDynamicFinalizers()`
82112

113+
Handle dynamic finalizers.nstantiates and executes finalizers based on metadata.
83114

84-
---
115+
#### Signature
116+
```apex
117+
public virtual void handleDynamicFinalizers()
118+
```
119+
120+
#### Return Type
121+
**void**
122+
123+
## Classes
124+
### Context Class
125+
126+
Context to be passed to the implementation's `.execute` methodis object's definition is empty. We are establishing the interface
127+
to include the context to help future-proof the interface's specifications.

0 commit comments

Comments
 (0)