Skip to content

Commit f7c8caa

Browse files
committed
Update README with compile-safe bypass methods for sObjects, Apex classes, and Flows, and add documentation generation instructions
1 parent b78e840 commit f7c8caa

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,29 +242,35 @@ You can bypass all actions on an sObject as well as specific Apex or Flow action
242242

243243
#### Bypass from Apex
244244

245-
To bypass from Apex, use the static `bypass(String name)` method in the `TriggerBase`, `MetadataTriggerHandler`, or `TriggerActionFlow` classes.
245+
The framework provides compile-safe bypass methods that accept type references.
246+
247+
**Bypass sObjects using Schema.sObjectType:**
246248

247249
```java
248250
public void updateAccountsNoTrigger(List<Account> accountsToUpdate) {
249-
TriggerBase.bypass('Account');
251+
TriggerBase.bypass(Schema.Account.SObjectType);
250252
update accountsToUpdate;
251-
TriggerBase.clearBypass('Account');
253+
TriggerBase.clearBypass(Schema.Account.SObjectType);
252254
}
253255
```
254256

257+
**Bypass Apex classes using System.Type:**
258+
255259
```java
256260
public void insertOpportunitiesNoRules(List<Opportunity> opportunitiesToInsert) {
257-
MetadataTriggerHandler.bypass('TA_Opportunity_StageInsertRules');
261+
MetadataTriggerHandler.bypass(TA_Opportunity_StageInsertRules.class);
258262
insert opportunitiesToInsert;
259-
MetadataTriggerHandler.clearBypass('TA_Opportunity_StageInsertRules');
263+
MetadataTriggerHandler.clearBypass(TA_Opportunity_StageInsertRules.class);
260264
}
261265
```
262266

267+
**Bypass Flows using Flow.Interview:**
268+
263269
```java
264270
public void updateContactsNoFlow(List<Contacts> contactsToUpdate) {
265-
TriggerActionFlow.bypass('Contact_Flow');
271+
TriggerActionFlow.bypass(Flow.Interview.Contact_Flow.class);
266272
update contactsToUpdate;
267-
TriggerActionFlow.clearBypass('Contact_Flow');
273+
TriggerActionFlow.clearBypass(Flow.Interview.Contact_Flow.class);
268274
}
269275
```
270276

@@ -615,3 +621,19 @@ public void execute(FinalizerHandler.Context context) {
615621
}
616622
}
617623
```
624+
625+
---
626+
627+
## Documentation Generation
628+
629+
This project uses [ApexDocs](https://github.com/cparra/apexdocs) to generate documentation from Apex class comments. To generate the documentation:
630+
631+
```bash
632+
npx @cparra/apexdocs markdown \
633+
-s trigger-actions-framework \
634+
-t docs \
635+
-p public \
636+
-g docsify
637+
```
638+
639+
The generated documentation will be available in the `docs/` directory and can be viewed using any static site generator or served directly.

0 commit comments

Comments
 (0)