To avoid the classical XY problem, I’ll try to explain as much as possible the scenario.
We have several templates to generate bills. We want to add a new section for the payment channel.
Since the payment template is standard, we want to be able to re-use it as much as possible across multiple workflows that use different bills templates so we want the payment template to live in its own template file.
We need a mechanism to mix and match content items from two different content sets. It is also possibile that the two sets don’t match in size.
For instance, we can have the bills content set with 100 bills (content items) and the payment content set with 30 content items. We need to append the 30 content items from the payment set to specific content items of the bills set.
We have an internal IT that can develop an ad-hoc program if given directions on how to manipulate the content sets either through the workflow APIs or file manipulations.
An ideal scenario would see a workflow like:
datamapper for bills
content creation with bills template
datamapper for payment
content creation for payment
MAGIC to append content item X from payment sets to content item K from bills set
If both the “bills content set” and the “payment content items” are generated by the same Workflow process at the same time or if they are generated by different Workflow processes and/or at different times?
If both the “bills content set” and the “payment content items” contain matching (record field) values which you can use to merge them together?
Both Bills and Payment content set, with the current workflow brainstorming, will be produced in the same workflow at the same time. However, we could split the generation in two different workflows if needed.
All the bills that will have a payment associated will have matching record fields.
According to the provided information I assume that you’ll have generate one PDF document per bill and one PDF document per payment and that you have to merge the payment PDF documents with the corresponding bill PDF document once the individual PDF documents are created. You may want to do this by a single Workflow process or by multiple Workflow processes.
The aim would be to avoid generating the single PDFs of each bill and payment and directly generated an already “mixed” PDF.
Indeed! I don’t know how I forgot about this feature and had to search it through the help pages. Quoting from the documentation:
Commingling is a method by which Print Content Items are merged together to create mail pieces going to each recipient. For instance, retrieving a letter, an invoice and a notice within the same mail piece, which presumably could be added within the same envelope.
Provided we intelligently structure our datamappers and templates we should be able to use this action step to “reassemble” each document correctly.
I’ll try to further study this functionality and see if we can work around it. Never used it before.