Case Study: Bundling of Documents
Note: Following example is too complex for GUI configuration.
Imagine the following scenario: You have just configured the production application for your customer who wants to bundle two document types: duplexed cheques and the associated duplex letters, and output a metadata csv file.
The customer wants the cheques to be positioned first in the combined document. The DocBridge Mill application is built, production is run and the customer is satisfied with the result.
Then, a few days later you get an e-mail from your satisfied customer who now wants to reverse the sequence of the pages within the document.
DocBridge Mill offers a simpler solution to this problem:
The cluster driver contains the lineextract element whose sub-elements provide elegant ways of solving the problem. The following example shows you how to map this logic (highlighted in yellow) using the scripting functionality in DocBridge Mill.
Note that for this example, FILENAME is the CSV file extracted in an initial DocBridge Mill pass. The entries marked in red designate the column name of the CSV file.
<lineextract>
<filename>
<script>$ROOT_DIR+"/success/"+FILENAME</script>
</filename>
<pagefrom>
<script>PAGEFROM</script>
</pagefrom>
<pageto>
<script>PAGETO</script>
</pageto>
<reversecondition>
<script>IF(pos("1", DOCNBR)>0, "TRUE", "")</script>
</reversecondition>
</lineextract>
In this example, the CSV file is read out line by line using a cluster driver. The sub-elements are then used for various actions before the pages of the file are written to the output file. The expressions marked in green define a condition.
Example:
If DOCNBR has the value 1, the position within DOCNBR will be calculated and returned as numerical value to complete the >0 logic. If the result is TRUE, the page sequence (PAGETO after PAGEFROM)is reversed and the pages from FILENAME are written accordingly in the output file.
Instead of using a complex array, DocBridge Mill enables the required page reordering is achieved in fewer than 15 lines of script.
You will find more information on lineextract in the DocBridge Mill Manual for the Administration and Implementation.


