This project contains all the components required to merge the attached doc files (.doc/.docx) in a process
The workflow should create a cover page, with the names from the attached .doc/.docx documents. Store the cover page in Alfresco Content Repo. Generate another document by combining the cover page and the merged documents.
- Alfresco Process Services (powered by Activiti) (Version 1.9 and above) - If you don't have it already, you can download a 30 day trial from Alfresco Process Services (APS).Instructions & help available at Activiti Docs, Alfresco BPM Community
-
Setup Alfresco Activiti if you don't have one already. Instructions & help available at Activiti Docs, Alfresco BPM Community
-
Import the Merge-Documents.zip app available in this project into Activiti.
-
Javascript code to extract info of attached documents
import groovy.json.JsonSlurper; def jsonSlurper = new JsonSlurper(); def attachedFileList = jsonSlurper.parseText(execution.getVariable('attachedFiles')); def attachedFileNames = attachedFileList.findAll().collect{it.name}; execution.setVariable('attachedFileNames', attachedFileNames);
-
The javascript code to merge document.
java.lang.System.out.println("*** Started - Merge document *** "); documentMergeBean.mergeDocuments('coverLetterDoc;file1;file2', 'coverLetterDoc', execution); java.lang.System.out.println("*** Finished - Merge document *** ");
-
Publish/Deploy the App.
- http://docs.alfresco.com/process-services1.6/topics/document_merge_bean_documentmergebean.html
- https://docs.alfresco.com/activiti/docs/dev-guide/1.4.0/#_document_merge_bean_documentmergebean
- http://docs.alfresco.com/process-services1.6/topics/document_templates.html
- https://docs.alfresco.com/activiti/docs/dev-guide/1.5.0/#_document_templates