code: function createFinaliseBatchTask(batch, context) {
      // Define a new finalise task definition for the batch & updates the batch with it
      batch.taskDefs.finaliseTaskDef = defineFinaliseBatchTask();
  
      const task = context.taskFactory.createTask(batch.taskDefs.finaliseTaskDef, finaliseTaskOpts);
  
      // Cache it on the batch
      const finalisingTasks = batch.getOrSetFinalisingTasks();
      finalisingTasks[task.name] = task;
  
      return task;
    }
docs: Creates a new finalise batch task to be used to finalise the batch and to track the state of the finalising phase.
  @param {Batch} batch - the batch to be processed
  @param {StreamConsumerContext} context - the context to use
  @returns {FinaliseBatchTask} a new finalise batch task (with sub-tasks)