{"id":16483001,"url":"https://github.com/ilyamatsuev/apex-trigger-framework","last_synced_at":"2026-03-18T19:58:40.707Z","repository":{"id":57723102,"uuid":"278740483","full_name":"IlyaMatsuev/Apex-Trigger-Framework","owner":"IlyaMatsuev","description":"Trigger framework for Apex simplifying the trigger handlers dispatching","archived":false,"fork":false,"pushed_at":"2022-08-21T22:53:05.000Z","size":90,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-31T04:21:39.995Z","etag":null,"topics":["apex","library","salesforce","trigger-framework","triggers"],"latest_commit_sha":null,"homepage":"","language":"Apex","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IlyaMatsuev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-10T21:55:10.000Z","updated_at":"2022-07-10T08:26:46.000Z","dependencies_parsed_at":"2022-08-25T12:01:23.739Z","dependency_job_id":null,"html_url":"https://github.com/IlyaMatsuev/Apex-Trigger-Framework","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/IlyaMatsuev/Apex-Trigger-Framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaMatsuev%2FApex-Trigger-Framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaMatsuev%2FApex-Trigger-Framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaMatsuev%2FApex-Trigger-Framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaMatsuev%2FApex-Trigger-Framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IlyaMatsuev","download_url":"https://codeload.github.com/IlyaMatsuev/Apex-Trigger-Framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaMatsuev%2FApex-Trigger-Framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29319691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apex","library","salesforce","trigger-framework","triggers"],"created_at":"2024-10-11T13:12:44.101Z","updated_at":"2026-02-10T22:34:36.251Z","avatar_url":"https://github.com/IlyaMatsuev.png","language":"Apex","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apex Trigger Framework\n\n[![Scratch org CI](https://github.com/IlyaMatsuev/Apex-Trigger-Framework/actions/workflows/scratch-org-ci.yml/badge.svg?branch=main)](https://github.com/IlyaMatsuev/Apex-Trigger-Framework/actions/workflows/scratch-org-ci.yml)\n[![codecov](https://codecov.io/gh/IlyaMatsuev/Apex-Trigger-Framework/branch/main/graph/badge.svg?token=TP4BO5MZUC)](https://codecov.io/gh/IlyaMatsuev/Apex-Trigger-Framework)\n\nSimple Apex Trigger Framework wrapped as an unlocked package. Contains the following features:\n\n-   Delegating trigger handlers\n-   Exchanging parameters between all handlers\n-   Skiping mechanism\n-   Configuring trigger error handlers\n-   Binding asynchronous trigger handlers (Queueable)\n\n## Overview\n\nTo create a trigger handler you first need to implement the `Triggers.IHandler` interface:\n\n```java\npublic class TestTriggerHandler implements Triggers.IHandler {\n    public void handle(Triggers.Context context) {\n        // Sample logic\n        Integer count = context.stash.containsKey('count') ? (Integer) context.stash.get('count') : 0;\n        context.stash.put('count', ++count);\n        System.debug('count: ' + count);\n    }\n}\n```\n\nThe example of using the framework:\n\n```java\ntrigger Account on Account (before insert, before update, before delete, after insert, after update, after delete) {\n\tTriggers.dispatcher\n        .bind(TriggerOperation.AFTER_INSERT, new TestTriggerHandler())\n        .bind(TriggerOperation.AFTER_UPDATE, new TestTriggerHandler())\n        .bindAsync(TriggerOperation.AFTER_DELETE, new TestAsyncTriggerHandler())\n        .run();\n}\n```\n\nFirst, setup all your handlers by calling `bind()` or `bindAsync()` methods from the `Triggers.dispatcher` instance. After all handlers set you call the `run()` method.\n\n## Installation\n\nYou can just install the package by the link on a [sandbox](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001wNArQAM) or [dev org](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001wNArQAM).\n\nIf you prefer using salesforce CLI you can run:\n\n```\nsfdx force:package:install -p 04t5Y000001wNArQAM -w 10 -b 10 -u \u003cusername\u003e\n```\n\n## Documentation\n\nFor more detailed information about the content of the repository and the sfdx package, please visit the [docs folder](docs).\n\n## Questions\n\nIf you have any questions you can start a discussion.  \nIf you think something works not as expected or you want to request a new feature, you can create an issue with the appropriate template selected.\n\n## Contributing\n\nPull requests are welcome.  \nFor major changes, please open an issue first to discuss what you would like to change.  \nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filyamatsuev%2Fapex-trigger-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filyamatsuev%2Fapex-trigger-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filyamatsuev%2Fapex-trigger-framework/lists"}