I have set up a workflow where I take in small XML files via hot folder and save the record to the Connect database using Set Properties. In the same workflow I later retrieve items and group based on an customer ID then on a product ID and then on a document type value. What would be the best way to insert separator sheets between each group for printing? Using the built in slip sheet functionality in the output preset can’t be done because I need each sheet to have variable data on it identifying each group.
I think you might be able to pull this off by making the slip sheets just another part of the template.
For example, you’d have a template with 2 sections. One for the main output and one for the slip sheet.
As each regular data file comes in, a condition triggers them to use the regular section. Once the job is complete and you’re ready to pull it for printing, however, you’d have a little work to do. First, you’d have to retrieve the job and get a list of all the customer ID’s and Product IDs. Then you’d use those to generate new data files that would be used to trigger the creation of the slip sheet.
With those generated, you could then retrieve the set again, this time with the slip sheets and the regular content.
From there it’s just a matter of sorting the document sets such that the slip sheet is always first. So it would probably need a special document type value that forces it to the front of the sort all the time.
The trouble I’m having is due to the requirement that these print in one big batch and multiple slip sheets should print:
Print a slip sheet at the start of the group
Print a slip sheet between each Customer ID
Print a third slip sheet between each Product ID
I can easily batch the XML files together, but sorting the files by customer ID and product ID is a problem.
What are we looking at in terms of customer per file, product id per file?
Maybe following approach will work?
- First, in datamapper create placeholder fields for marking slip sheets: groupBreak, customerBreak, productBreak
- Have local variables maintaining current and last values: currGroup, lastGroup, currCust, lastCust etc
- Retrieve items in the desired sort orders outputting fields in metadata
- Initialize the local vars based on the first retrieved element
- Run metadata sequencer on lowest split
- Set currX values
- Have a condition that checks if currX and lastX are different, if they are, update respective *Break field
- Run Update Data Records to push the changed *Break fields
The sort order should not change so from there it should be just a matter of having sections controlled by *Break fields