ApexSensei

Drills Asynchronous Apex

Build a Batch lifecycle

Batch Apex splits a big job into chunks.

Your task

Complete the Batch class so execute marks the target Accounts Processed and finish writes Batch finished to a marker Account.

public class AS_01C8E9DAF4E0_AccountBatch implements Database.Batchable<SObject> {
    private Set<Id> accountIds;
    private Id markerId;

    public AS_01C8E9DAF4E0_AccountBatch(Set<Id> accountIds, Id markerId) {
        this.accountIds = accountIds;
        this.markerId = markerId;
    }

    public Database.QueryLocator start(Database.BatchableContext context) {
        return null;
    }

    public void execute(Database.BatchableContext context, List<SObject> scope) {
    }

    public void finish(Database.BatchableContext context) {
    }
}

Requirements

  1. selectsOnlyTargetIds should pass
  2. processesTwoHundredInOneChunk should pass
  3. marksFinishAfterProcessing should pass
  4. finishesAnEmptySelection should pass
  5. completesAsBatchJob should pass

Sign in to open this drill