All Projects → rsoesemann → Apex Chainable

rsoesemann / Apex Chainable

Licence: mit
Chain Batches in a readable and flexible way without hardcoding the successor.

Projects that are alternatives of or similar to Apex Chainable

Asakusafw
Asakusa Framework
Stars: ✭ 114 (+322.22%)
Mutual labels:  batch, framework
Apex Unified Logging
Platform-Event-based Apex logger for unified logging over transaction boundaries
Stars: ✭ 101 (+274.07%)
Mutual labels:  apex, clean-code
Bodywork Core
Deploy machine learning projects developed in Python, to Kubernetes. Accelerated MLOps 🚀
Stars: ✭ 145 (+437.04%)
Mutual labels:  batch, framework
codeclimate-apexmetrics
ApexMetrics - Code Climate engine for Salesforce [DISCONTINUED use CC PMD instead)
Stars: ✭ 46 (+70.37%)
Mutual labels:  clean-code, apex
Apex Domainbuilder
Framework to setup Apex test data in a highly flexible and readable way using the Test Data Builder pattern.
Stars: ✭ 61 (+125.93%)
Mutual labels:  apex, clean-code
Cp Ddd Framework
A lightweight flexible development framework for complex business architecture with full ecosystem!轻量级业务中台开发框架,中台架构的顶层设计和完整解决方案!
Stars: ✭ 566 (+1996.3%)
Mutual labels:  framework, clean-code
Android Architecture Components Kotlin
Clean code App with Kotlin and Android Architecture Components
Stars: ✭ 23 (-14.81%)
Mutual labels:  clean-code
Cascadingtabledelegate
A no-nonsense way to write cleaner UITableViewDelegate and UITableViewDataSource in Swift.
Stars: ✭ 931 (+3348.15%)
Mutual labels:  clean-code
Programming Book Recommendations List
My personal list of books that I recommend to read if you are a software developer
Stars: ✭ 22 (-18.52%)
Mutual labels:  clean-code
Up Node8
The way this project is packaging the Node 8 app isn't the best. Try the official example of Apex Up that uses the Node binary!
Stars: ✭ 22 (-18.52%)
Mutual labels:  apex
Blossom
A free open-source design framework for the modern web
Stars: ✭ 26 (-3.7%)
Mutual labels:  framework
C cpp project framework
CMake build system( framework) with kconfig support for C/CPP projects
Stars: ✭ 26 (-3.7%)
Mutual labels:  framework
Ps Webapi
(Migrated from CodePlex) Let PowerShell Script serve or command-line process as WebAPI. PSWebApi is a simple library for building ASP.NET Web APIs (RESTful Services) by PowerShell Scripts or batch/executable files out of the box.
Stars: ✭ 24 (-11.11%)
Mutual labels:  batch
Webcpp
用C++开发web服务器框架
Stars: ✭ 23 (-14.81%)
Mutual labels:  framework
Xtd forms
Modern c++17 library to create native gui for Microsoft Windows, Apple macOS and Linux.
Stars: ✭ 25 (-7.41%)
Mutual labels:  framework
Salesforce Apex Templates
Looking for a possibility to use Email Templates within APEX code? Here's the answer!
Stars: ✭ 22 (-18.52%)
Mutual labels:  apex
Core
The core source repository for the Cherab project.
Stars: ✭ 26 (-3.7%)
Mutual labels:  framework
Theoremjs
A Math library for computation in JavaScript 📕
Stars: ✭ 917 (+3296.3%)
Mutual labels:  framework
Gmdjs
Grid Material Design
Stars: ✭ 24 (-11.11%)
Mutual labels:  framework
Kaito
🌎⠀An HTTP Framework for TypeScript
Stars: ✭ 26 (-3.7%)
Mutual labels:  framework

Apex Chainable Codacy Badge

Deploy to Salesforce

Apex Batches can be chained by calling the successor batch from the finish() method of the previous batch. But such hardcoding makes this model inflexible. It's hard to build the chain from outside, neighter from a central class nor on runtime dependant on business logic.

The same applies when the execute() method of Schedulable or Queueable classes call other classes.

With Chainable

The Chainable wrapper class of this repository overcomes those drawbacks.

  • No need to hardcode successor batch in finish() method
  • Created batch chains of arbitrary length without changing existing Batch classes
  • Support Queueable and Schedulable classes as chain members
  • Allows sharing and passing of variables between chain members
      new FirstBatch().setShared('result', new Money(0))
            .then(AnotherBatch())
            .then(QueueableJob())
            .then(ScheduledJob())
            ...
            .execute();

Without Chainable

class FirstBatch implements Batchable<SObject> {
    Iterator<SObject> start(BatchableContext ctx) { ... }

    void execute(BatchableContext ctx, List<Account> scope) { ... }

    void finish(BatchableContext ctx) {
        Database.enqueueBatch(new SecondBatch()); 
    }
}
class AnotherBatch implements Batchable<SObject> {
    Iterator<SObject> start(BatchableContext ctx) { ... }

    void execute(BatchableContext ctx, List<Account> scope) { ... }

    void finish(BatchableContext ctx) {
        System.schedule('name', cron, new ScheduledJob()); 
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].