
The batch processor sequencing is as follows:
Inline Batch Start and Batch End actions are are only processed in the action which is supplied to the Batch Processor. As an action which is to be batch processed can call other actions which might independently be passed to the batch processor, there is a method to chain multiple Batch Start and Batch End actions.
As an example, let's say that you have an action named ABC which is designed to be run through the Batch Processor which has Batch Start and Batch End inline actions. You have another action named DEF also designed to be run through the Batch Processor which calls action ABC. The Batch Start and Batch End inline actions in ABC will never be called if DEF is passed to the Batch Processor.
There are various ways to get around the issue for Batch Start. As an example, action ABC could test if it was the started action and if not, it could manually call Batch Start. This requires changing action ABC and there is no easy way to get the Batch End action called.
Configuring the batch chain lets you get around the issue. A batch chain is established by placing an Include statement with a Batch Chain Action specification anywhere in the main action. The Include statement is interpreted as an Action include when exporting. When the Batch Processor is started it looks for all Include - Batch Chain Action statements. Immediately prior to calling Batch Start or Batch End in the main action, every action which appears on an Include - Batch Chain Action statement will have its Batch Start and Batch End inline actions executed ... if any.
The specified actions do not have to have a Batch Start and Batch End inline action. However, if they have neither, the Include statement is somewhat redundant. The action named on the Include - Batch Chain Action statement must exist or the batch process will terminate. Note that when exporting, an action's non existence on an Include statement is not treated as an error.
The process works recursively. Every action named on an Include - Batch Chain Action statement will also be scanned for contained Include - Batch Chain Action statements. When located, they also get added to the batch chain. If your actions all define their dependencies, you only have to worry about those actions immediately run from the main action.
Here's a few more details:
Example: Action GHI is passed to the Batch Processor and is defined as:
' statements in action GHI Start Batch Start ' statements in action GHI's Batch Start Start Batch End ' statements in action GHI's Batch End Include Batch Chain Action 'DEF'
Action DEF is defined as:
' statements in action DEF Start Batch Start ' statements in action DEF's Batch Start Start Batch End ' statements in action DEF's Batch End Include Batch Chain Action 'ABC' Include Batch Chain Action 'ABC2'
Action ABC is defined as:
' statements in action ABC Start Batch Start ' statements in action ABC Batch Start
Action ABC2 is defined as:
' statements in action ABC2 Start Batch End ' statements in action ABC2's Batch End
When the batch processor starts, the Batch Start inline action will be run in DEF and ABC (in no particular order), then in GHI. When the batch processor has finished processing all folders containing audio files, the Batch End inline action will be run in DEF and ABC2 (in no particular order), then in GHI.