This chapter explains how to model document management for dynamic case management. Document management within the Blueriq platform is developed using the CMIS standard for connecting to an existing Document Management System (DMS). The connection that is made is only tested and released for an Alfresco DMS. This functionality will only work when the CMIS connection is configured correctly. For more information on this subject see How to setup a CMIS connection. The basic_DCM project does not contain these parts because the absence of an Alfresco implementation will generate errors.

The first part of this chapter are easy examples to explain the concept, the second part is extra information on how to integrate document management in a dashboard situation.

Open, update and delete documents

The possibility to manage documents from a Blueriq dashboard is available with a set of services and containers developed for the communication with a DMS. To open, update or delete documents, the four steps shown in the image underneath need to be modeled.

Create the list

To create a list of documents you have to use the service AQ_CMIS_GetDocumentMetadata. This service will get metadata for a set of files from a DMS. This service retrieves document metadata and places it in the profile of the session. You can decide yourself what entity and attributes should hold the information. Since there can be more than one document in the DMS, you need to select a multiton entity in this situation. There are a set of default  (CMIS) parameters you can use and it is possible to use custom properties. All theses attributes can be used to filter the results as well.

 

AQ_CMIS_GetDocumentMetadata with filtering on the caseID

The created instances will be placed in a table using the AQ_InstanceSelectorPlus with a set of buttons, for example. This results in the example shown underneath at runtime.

After a delete or update action you often want to refresh the list. Before retrieving the metadata again you should delete the instances that are already in the profile to avoid double entries.

Open a document

To open documents that are available on a DMS the container AQ_CMIS_DownloadDocument is available. This container will download the requested document to your session. It can be placed directly in the AQ_InstanceSelector container to work with the corresponding document.

Update and delete a document

The service AQ_CMIS_DocumentManager is developed to perform actions on a document, these are save, update and delete. We will describe the last two in this chapter. Saving a file will be described later.

For example, the service shown underneath can be connected to the document list using a button and flow. Using the functionality of the AQ_InstanceSelector one set of metadata is made active, so the action is performed for the correct file.

The AQ_CMIS_Documentmanager for deleting a document.

The update action is developed to update the metadata, not to add a new version of the file. Creating a new version of a file is done by saving a file with the same name in the same directory. Version management is done by the DMS, not by the Blueriq platform.

Save an uploaded document to a DMS

To save documents that are available on your system to a DMS, a set of services and containers are available. The image underneath displays the steps that needs to be modeled.

 

Place the document in scope

The first two steps are combined in one container, the AQ_Web_FileUpload. This container makes it possible to select a file on your hard drive and place the document in the scope for Blueriq. This way Blueriq can save it to the DMS.

AQ_Web_FileUpload container

Save the document to the DMS

After a page with this container the same service as described before is modeled, the AQ_CMIS_DocumentManager with a save action. This service makes it possible to save a document with a set of custom metadata in a specified folder on the DMS.

 

 

The AQ_CMIS_DocumentManager service that stores a document in a directory with the CaseID and the Case ID as a custom parameter.

When a second file with the same name in the same folder is stored, Alfresco creates a new version. To prevent this, use the case ID in the folder structure or the name of the file.

Save a Blueriq document to a DMS

 Saving a Blueriq generated document can be stored in a DMS. The steps displayed in the image underneath need to be modeled.

The third step is equal to saving an uploaded document so it will not be described here. The first two steps are done using the service AQ_Document_Renderer. This service renders a dynamic document that is created using Blueriq to a PDF file and places it in the session scope. After it is rendered, it can be saved to the DMS using the AQ_CMIS_DocumentManager.

AQ_Document_Renderer