Posts tagged "postprocess"

Designing a Correspondence Draft workflow

Saving correspondences as a draft (i.e., an in-progress correspondence), and the ability to reopen the same at a later point in time, seems to be a common use case in Correspondence Management.

While it is known that the Adobe CM solution can be easily extended to save correspondence drafts by following some very simple steps, I would like to enlighten as to how one could extend beyond that to design an end-to-end workflow around it.


In a nutshell, this post talks about the steps you could follow to Save your correspondence drafts (in the CRX repository), load the (list of) saved drafts on the Manage Assets interface and then (usually at a later point in time) choose a particular draft to be re-opened in the Create Correspondence interface.

The same workflow can have multiple iterations, depending upon the number of steps taken to author the final correspondence.


Here are the steps that you could follow to design such a correspondence draft workflow :

The steps below involve code changes (both Flex and Java), so please ensure that you have setup your development environment correctly, before proceeding.

Step 1 : Save correspondence drafts from Create Correspondence

Your first step would be to enable Save As Draft functionality on the Create Correspondence UI. After these changes, you will have a new SaveAsDraft button on your Create Correspondence UI, that can be clicked to invoke the postprocess (an ADEP process) designed and configured for that button.

If you are new to designing postprocesses for the solution, it is highly recommended that you read more on designing postprocesses.

We will now look into what needs to be done in the process…

Step 2 : Postprocess definition to save drafts

In the ADEP process that you design for Step 1, save the XML data (given to the postprocess) onto a given location in the CRX repository as a node (of type XML), with the Letter template name as a property on that node. You may add other details (properties) to the node such as the username who saved the correspondence , timestamp when the draft was saved, comments captured from the user when saving the draft, etc.

Your saved draft nodes may look like this (assuming you save them under /content/CMDrafts) :







Step 3: Custom OSGi Service to fetch drafts

Now that you have a process that saves your correspondences in the CRX repository as nodes, you need the ability to fetch those from CRX (so that they can be enlisted).

Use/customize the CM Solution Template’s Services (Java) project to define an OSGi service that can fetch the XML data nodes (and their details/properties) from CRX. The first couple of steps in this post indicate how to write an OSGi service and expose it over Flex and Spring remoting (note that you do not need the other steps, since the Services project is already configured to do that for you).

Your service would return a List of a custom value object, say DraftVO, which contains the XML data URL string (URL to node in the CRX repository, which would be something like crx:///content/CMDrafts/SampleLetterDraft1.xml) and the other properties attached to the draft’s node (created in Step 2).

Additionally, your service could filter the list of drafts based on the logged in user, so that a user only sees the drafts saved by him/her. Of course, you need to ensure that Step 2 persists the username within the node properties (to filter the appropriate nodes).

Step 4: List Drafts on the Manage Assets

Now that you have a service which can return you a list of drafts saved in the system, you can customize the Manage Assets UI to enlist these drafts.

To do so, you can start by adding a new tab, say “Drafts“, alongside the existing tabs on the Manage Assets interface. When you launch the Manage Assets UI after these changes, it should look something like this:





The Drafts tab can be designed such that it contains a DataGrid which will enlist the saved drafts within the grid, by invoking the service, that we defined in Step 3, as the data provider. The columns to be shown in the grid would depend on what properties you have saved (in Step 2) for a given draft item.

The below snapshot is a sample that shows two columns for the drafts list – the Letter template used for the draft, and the time when the draft was saved (assuming that the user is only seeing drafts loaded by him/her).





Step 5: Reload selected draft

Before you proceed, if you are not already aware of reloading correspondences in CM, please ensure that you read through how to reload a correspondence in CM.

So, now that you have fetched the list of drafts on the UI, you would add a toolbar above your data grid, that has a button Reload (see snapshot above). The button should have a click handler, such that when you select a draft item, and click Reload, it launches the CCR UI with the URL http://server:port/cm/createcorrespondence.html?cmDataUrl=<the data URL for the selected Draft item>. The data URL would be available to you for each item through the DraftVO that your service returns in Step 3.


That’s it, you now have an end-to-end workflow for saving and reloading correspondence drafts!

Note that this is just an example that shows the solution’s extension and core capabilities to design such a workflow. You may tweak this to have more steps within it, design a more sophisticated UI, or extend this further depending upon the actual requirements.

Postprocessing your correspondence

Correspondences created in enterprises would typically have to be integrated to a back-end process for further distribution (via email, fax, print), document processing (apply digital signatures, encryption, etc.) or archival of the correspondence.

The Adobe Correspondence Management solution provides a convenient way to achieve this by leveraging orchestrations/processes on the ADEP Document Services platform for defining the back-end process (that can use one or more Document Services, based on the enterprise requirements), and providing the ability to easily bind them to a given correspondence template.

Read more about creating a postprocess for the CM solution on the Document Server.

Once such processes are created on the Document Server, can then be mapped to a Letter template in the  Postprocess drop down of the Letter Template Editor (as shown below), where the available postprocesses (as defined on the Document Server) are listed:








Tip: If you create a new process, with an existing Manage Assets UI session opened, your process will not be listed in the Postprocesses dropdown until you relaunch or refresh (F5) the Manage Assets browser window (or open the Manage Assets UI in a new browser window).

When the correspondence creation is complete (using the Create Correspondence UI), users can Submit the correspondence (see snapshot below indicating the Submit button), which invokes the associated/mapped postprocess for that Letter template, with the final correspondence PDF and XML data (used to generate the PDF). The postprocess, which would be an orchestration, can then act upon the document (PDF) as necessary.