docs: function loadBatchState(batch, context) {
    const task = this;
    // const initiatingTask = task.parent;
  
    const contents = batch.describeContents();
  
    if (batch.records.length <= 0) {
      const reason = `Cannot load state for an empty batch - ${contents}`;
      context.warn(reason);
      if (task) task.reject(reason);
      return Promise.resolve([]);
    }
  
    const streamConsumerId = batch.streamConsumerId || (batch.key && batch.key.streamConsumerId);
    const shardOrEventID = batch.shardOrEventID || (batch.key && batch.key.shardOrEventID);
  
    if (batch.messages.length <= 0 && batch.rejectedMessages.length <= 0 && batch.unusableRecords.length <= 0) {
      context.info(`Skipping load state of batch (${shardOrEventID}), since ${contents}`);
      return Promise.resolve([]);
    }
  
    const batchDesc = `batch (${shardOrEventID}) with ${contents}`;
  
    if (isBlank(streamConsumerId) || isBlank(shardOrEventID)) {
      const errMsg = `Cannot load state of batch WITHOUT a complete batch key - streamConsumerId (${streamConsumerId}) & shardOrEventID (${shardOrEventID})`;
      context.warn(errMsg, '-', batchDesc);
      return Promise.resolve([]);
    }
  
    // Look up the actual function to be used to do the load of the previous tracked state (if any) of the current batch
    const loadBatchStateFn = Settings.getLoadBatchStateFunction(context);
  
    if (!loadBatchStateFn) {
      // Should never get here, since configuration validation should eliminate this case
      return Promise.reject(new FatalError(`FATAL - Failed to load state of ${batchDesc}, since no loadBatchState function configured`));
    }
  
    // Create a task to be used to execute and track the configured loadBatchState function
    const fnName = isNotBlank(loadBatchStateFn.name) ? loadBatchStateFn.name : 'loadBatchState';
    const loadBatchStateTask = task.createSubTask(fnName, loadBatchStateFn, batchSettings, initiateTaskOpts);
  
    // Load the previous tracked state of the batch (if any)
    const p = loadBatchStateTask.execute(batch, context);
    return whenDone(loadBatchStateTask, p, undefined, context);
  }