5: CCM_Bundling

  1. Timer body script, or the CCM_DoBundling script, which selects a customizable set of process records for a specific channel from the database, and bundles them into envelopes in one go by calling the Run function from the Bundling component. For more information on the Run function and the available configuration functions, see Run function in bundling and Bundling component functions.
  2. Surrounding timer, which ensures that the CCM_DoBundling script is called at a particular time.

Loop body script

By default, CCM_DoBundling behaves as follows:

  • Selects all available process records for the Print channel at once.
  • Does not group process records; each process record gets its own envelope.
  • Does not restrict the size of the created envelopes.
  • Does not compose a new cover letter.
  • Uses Default_PostageDefinition to determine the postage class of each created envelope.
  • Sends all created envelopes to the Default_OutsourcingPrinter printer.

You can customize this behavior by editing the CCM_DoBundling script. In the script, add or change the calls to the configuration functions that are provided by the Bundling component.

Surrounding timer

The surrounding timer runs the CCM_DoBundling script at a set interval. By default, the script is run once a day at 2 AM. The running stops if the process receives a Stop or Cancel signal, or if the CCM_DoBundling script throws an exception.

If the bundling script must run frequently at small intervals it shouldn't use a timer object. Instead it should use a loop that contains sleep statements for implementing the interval.

Error handling

After the CCM_DoBundling script ends, the surrounding timer calls it again at the next scheduled run.

It is only safe to run multiple bundling processes simultaneously if the process records that they select are disjointed; that is, they are guaranteed to select different process records from the database.