code: function defineFinaliseBatchTask() {
      const taskDef = TaskDef.defineTask(finaliseBatch.name, finaliseBatch, batchAndProcessOutcomesSettings);
      taskDef.defineSubTask(discardAnyRejectedMessages.name, discardAnyRejectedMessages, batchAndCancellableSettings);
      taskDef.defineSubTask(saveBatchState.name, saveBatchState, batchSettings);
      taskDef.defineSubTask(postFinaliseBatch.name, postFinaliseBatch, batchSettings);
      return taskDef;
    }
docs: Defines the finalise batch task (and its sub-tasks) to be used to track the state of the finalising phase.
  @returns {FinaliseBatchTaskDef} a new finalise batch task definition (with its sub-task definitions)