Bundling component functions

The Bundling component provides the following configuration functions.

Functions

Description

SelectByChannelName

Required. This function configures the channel for which process records are bundled.

SetOutsourcingPrinterOId

SetPostageDefinitionOId

Required. These functions set the printer and postage definition to be used for the created envelopes.

SelectByOrganisationalMetadata

SelectByPrintCommunicationId

SelectByRequestReference

SelectByCorrespondenceReference

SelectByCommunicationLabel

SelectAtMost

Optional. These functions configure which process records are selected for bundling. By default, all available process records for the configured channel are selected.

SortByXPath

SortByXPathDesc

Optional. These functions define criteria for sorting process records when they are combined into an envelope. By default, process records are not sorted, and the order of process records in an envelope is undefined.

AddChannelCoverLetter

Optional. This function configures the composition of a new cover letter for created envelopes. By default, a new cover letter is not created.

GroupByXPath

Optional. This function configures when process records must be combined into the same envelope, and when they must get their own envelopes. By default, each process record is put in its own envelope. You can call the functions multiple times.

ClearConfiguration

Optional. This function clears all settings configured by the preceding functions.

You can only call a "SelectBy" function of the same type once in a single script. To override the settings configured with the previously called functions, use ClearConfiguration.

  • SelectByChannelName

    Parameter: object name (String, case-insensitive). Set to a specific object name so bundling only selects process records distributed over the channel with this name.

  • SelectByOrganisationalMetadata

    Set the following parameters to configure bundling to only select the communications that have the given organisational metadata field with the given value.

    1. key (String, runtime database collation1). Set to a specific organisational metadata field.
    2. value (String, runtime database collation). Set to a specific value of this organizational metadata field. The value may not be empty.
  • SelectByPrintCommunicationId

    Parameter: identifier (BigInteger). Set to a specific print communication identifier so bundling only selects process records that originate from this print communication.

  • SelectByRequestReference

    Parameter: reference (String, runtime database collation). Set to a specific request reference so bundling only selects process records that originate from this request.

  • SelectByCorrespondenceReference

    Parameter: reference (String, runtime database collation). Set to a specific correspondence reference so bundling only selects process records that originate from this correspondence.

  • SelectByCommunicationLabel

    Parameter: label (String, runtime database collation). Set to a specific communication label so bundling only selects process records that originate from this communication.

  • SelectAtMost

    Parameter: count (Integer). Set to a specific number so bundling only selects at most this number of process records. If there are more process records available, it is not determined which ones are selected.

  • SortByXPath

    Parameter: xpath (String, case-sensitive). Set to a specific XPath expression so bundling sorts process records when they are combined into an envelope. The process records are sorted based on values computed by evaluating the XPath expression on the print communications from which these process records originate. The input for the XPath expression is an XML serialization according to the CcmBomBundlingInput XSD.

    The computed values are interpreted as text and compared using case-sensitive ordinal sorting rules. Sorting criteria specified by SortByXPath result in a sort in ascending order.

  • SortByXPathDesc

    Parameter: xpath (String, case-sensitive). Set to a specific XPath expression so bundling sorts process records when they are combined into an envelope. The process records are sorted based on values computed by evaluating the XPath expression on the print communications from which the process records originate. The input for the XPath expression is an XML serialization according to the CcmBomBundlingInput XSD.

    The computed values are interpreted as text and compared using case-sensitive ordinal sorting rules. Sorting criteria specified by SortByXPathDesc result in a sort in descending order.

    You can call SortByXPath and SortByXPathDesc more than once to specify multiple sorting criteria. When sorting, the criteria is evaluated in the order in which they are specified.

    A case-sensitive ordinal comparison method indicates that string comparison must use successive Unicode UTF-16 encoded values of the string (code unit by code unit comparison). This sorting method is culture invariant.

  • AddChannelCoverLetter

    Set the following parameter to configure bundling to compose a new cover letter for each envelope that it creates:

    alsoForSingletons (Boolean). Set to True to add a cover letter for all created envelopes, regardless of their size. Set to False to only add a cover letter for envelopes that consist of more than one process record.

    The Document Pack Template that composes this cover letter must be configured on the channel object for which envelopes are created. Otherwise, calling AddChannelCoverLetter results in an error. The Data Backbone defined by the CcmBomCoverLetterBackbone XSD is used for the cover letter composition.

  • GroupByXPath

    Parameter: xpath (String, case-sensitive). Set to a specific XPath expression so bundling finds the process records with values evaluating to this XPath expression and then combines them into the same envelope. The XPath expressions are evaluated on XML serializations of the print communications from which the process records originate, according to the CcmBomBundlingInput XSD.

    You can call GroupByXPath more than once to specify multiple grouping criteria. All XPath expressions must evaluate to the same value in order for process records to be combined. If you omit calling GroupByXPath, all process records are put into their own envelopes.

    Only process records for the same channel can be combined into the same envelope.

  • SetOutsourcingPrinterOId

    Parameter: object identifier (String, case-sensitive). Set to a specific object identifier so bundling marks all created envelopes with the outsourcing printer that has this identifier. The envelopes are distributed to this printer.

  • SetPostageDefinitionOId

    Parameter: object identifier (String, case-sensitive). Set to a specific object identifier so bundling classifies the created envelopes according to the postage classes defined in the postage definition with this identifier.

    The postage definition set by this function may not have any enclosure specified.

  • ClearConfguration

    Removes the settings configured by SelectByChannelName, SelectByOrganisationalMetadata, SelectByPrintCommunicationId, SelectByRequestReference, SelectByCorrespondenceReference, SelectByCommunicationLabel, SelectAtMost, GroupByXPath, AddChannelCoverLetter, SetOutsourcingPrinterOId, and SetPostageDefinitionOId. To reconfigure bundling, you need to call these functions anew.

Example

The following example shows a customization of the CCM_DoBundling script.

; Initialize the Bundling component.
Bundling = ModusProcess.GetComponent("Bundling")
Bundling.ClearConfiguration()

; Only select the CustomerOriginal communications for the request 
RQ-ADF for channel Channel-Name with EMEA for the AccountingGroup 
in the organisational metadata.
Bundling.SelectByChannelName("Channel-Name")
Bundling.SelectByRequestReference("RQ-ADF")
Bundling.SelectByCommunicationLabel("CustomerOriginal")
Bundling.SelectByOrganisationalMetadata("AccountingGroup", "EMEA")

; Select at most 1000 communications.
Bundling.SelectAtMost(1000)

; Make sure that (only) communications for the same recipient end up in the same envelope.
Bundling.GroupByXPath("ccm:Recipient/ct:Name")

;Make sure that processes are sorted by CaseIdentifier.
Bundling.SortByXPath(“ccm:OrganisationalMetadata/data:CaseIdentifier”)


; Configure the printer that will be set on each created envelope, and the postage definition that will be used.
Bundling.SetOutsourcingPrinterOId("04032016-64-opr-ccmebatch")
Bundling.SetPostageDefinitionOId("23102008-160-pod-dm")

; Run bundling.
Protocol("Running bundling.", 5)
EnvelopeCount = Bundling.Run()
Protocol("Bundling created " + EnvelopeCount + " envelope(s).", 5)

1 For all parameters with this remark, the collation is determined by the Batch & Output Management runtime database.