Integrating BPM and Enterprise Content Management

Embedded enterprise content management using the document store feature

IBM® Business Process Manager V8.5 enables seamless integration with Enterprise Content Management (ECM) systems by providing an embedded CMIS-compliant (Content Management Interoperability Services) internal document store known as the BPM document store, which addresses the business requirement to include the management of related physical documents in the scope of a business process. In this article you'll find out how to achieve a content-driven integration scenario using the new document store feature. This content is part of the IBM Business Process Management Journal.

Fintan McElroy (fintan_mcelroy@uk.ibm.com), Senior Managing BPM Consultant, IBM

Fintan McElroy photoFintan McElroy is a Software Solutions Architect in IBM Software Services for WebSphere.



04 December 2013

Also available in Chinese

Getting started

Note: This article is not a general introduction to the integration of IBM BPM with an ECM system. For a general introduction to the subject, refer to the BPM Journal article Integrating IBM Business Process Manager V8 with an Enterprise Content Management system.

This article includes sample code for download. If you wish to follow along with the article and perform the scenario for yourself, you should have an installation of IBM BPM V8.5 or higher. Extract the provided zip file to your C:\ drive, then import into your Process Center the TWX file BPM_Document_Store_Sample - 1.0.twx that is in the C:\BPM85DocumentStore\twx folder.


Introduction

ECM systems manage documents of different types, such as records, images, and web pages, throughout their lifecycle. You can access and update such documents from a business process inside IBM BPM by using special ECM operations in services such as an integration service or a human service.

Since version 8.0 of IBM BPM, integration with ECM systems has been based on Content Management Interoperability Services (CMIS). CMIS (Figure 1) is an open standard administered by the Organization for the Advancement of Structured Information Standards (OASIS) that defines an abstraction layer for controlling diverse document management systems and repositories using web protocols.

Figure 1. CMIS standard
CMIS standard

A new feature added in IBM BPM V8.5 is an internal CMIS repository, known as the BPM document store, that provides the ability to support embedded ECM and uses consistent access mechanisms for integrating to it, like those that have been used since 8.0 for external ECM systems as shown in Figure 2.

Figure 2. CMIS access to internal documents
CMIS access to internal documents

Note that the internal BPM document store is not a fully featured ECM and is not intended as a replacement for an enterprise-scale ECM. Refer to the IBM BPM Information Center for details on the full set of capabilities and restrictions concerning the new document store feature.

The content integration capabilities using the internal BPM document store in IBM BPM allow for a number of typical scenarios:

  • Accessing and displaying documents in a Coach as part of the actions a user needs to perform in a process activity
  • Starting a business process as the result of a document event (such as the creation of a new document or an update made to an existing document)
  • Resuming a business process that is paused while it awaits an expected document event (such as the receipt of identification documents to be used as confirmation of entitlement)

Of these, this article focuses on the last one, because it's the most complex scenario, and because it contains aspects of the other two scenarios and therefore is is a more comprehensive illustration of the feature's capabilities. The logical scenario is illustrated as a BPMN (Business Process Model and Notation) process in Figure 3.

Figure 3. BPMN scenario involving asynchronous inbound events
BPMN scenario involving asynchronous inbound events

In this scenario some automatic processing (Initial Checks) is performed before an outbound message needs to be sent to request additional information from the customer. This outbound message is logical in that it could well be performed by a participant in the Order Management role calling the customer directly or it might be in the form of an email being sent. The Customer role shows the corresponding receipt of the message followed by some internal processing and then sending an outbound message as the response. This is all outside the control of the Order Management process, which will only know this phase has completed when the inbound message is received by the intermediate message event that precedes the Verification user activity. The rest of this article will demonstrate how to achieve this scenario using the internal BPM document store in IBM BPM 8.5.


A content-driven scenario demonstration

The scenario has been provided in the BPM Document Store Sample process application. If you want to follow along and run the scenario for yourself, you should download and import that sample into your Process Center. Once imported, open and run ECM Await Document Process by clicking the run icon, as shown in Figure 4.

Figure 4. Run process from Process Designer
Run process from Process Designer

Click to see larger image

Figure 4. Run process from Process Designer

Run process from Process Designer

When the process starts, switch to the Process Inspector view in Process Designer. You should see that the first activity in the process is active and awaiting action as shown in Figure 5. You can now run this activity to launch the associated Coach and interact with it.

Figure 5. Process in the Process Inspector view
Process in the Process Inspector view

Click to see larger image

Figure 5. Process in the Process Inspector view

Process in the Process Inspector view

Figure 6 shows some sample data entered into the Coach. Most important is the highlighted field for the customer's identifier, which you should take note of as you'll need it to match the documents that you'll upload later in the scenario.

Figure 6. Completed customer application information
Completed customer application information

Once the user activity is completed (after clicking Submit) the Process Inspector shows that the process has moved on to the next activity (Figure 7), which is an intermediate content event (a special type of message event that is associated with an event in the CMIS content store). The process will remain at this step until a content event arrives that correlates to this process instance (that is, an event for the same customer uniquely identified by the customer identifier field).

Figure 7. Process awaiting inbound content event
Process awaiting inbound content event

Click to see larger image

Figure 7. Process awaiting inbound content event

Process awaiting inbound content event

In order to move the process instance past this activity, you need to generate a document event. This will be done on receipt of the expected document from this customer. You upload the document by running the provided human service Document Upload Client CS, as shown in Figure 8.

Figure 8. Service for uploading documents to document store
Service for uploading documents to document store

Click to see larger image

Figure 8. Service for uploading documents to document store

Service for uploading documents to document store

A utility service named Delete All Documents Utility is included in the process application which, as the name suggests, will delete all documents in the document store. This service can be used between tests to clear any stored documents in the document store.

When you first run this service, there shouldn't be any existing documents in the internal BPM document store and the Coach should appear as shown in Figure 9.

Figure 9. Initial UI with no existing documents
Initial UI with no existing documents

To upload a document, click Create Document to open the dialog shown in Figure 10.

Figure 10. Wizard for uploading documents showing default values
Wizard for uploading documents showing default values

For the first test, we'll deliberately supply values that won't correlate on the process instance. The process instance correlation rules (we'll examine how this is achieved later) decree that the process instance is expecting a specific document type (Application). In the dialog, select one of the other document types and supply example data for the other fields as suggested in Figure 11 (remembering to use the same customer identifier as you used in the initial data entry step). Click OK to complete the creation step.

Figure 11. Create document with sample values (no correlation)
Create document with sample values (no correlation)

You should now be able to verify in Process Inspector that the process instance remains at the activity awaiting a content event, and no correlation has happened due to the fact you explicitly chose a document type other than Application. You can now correct this by clicking Create Document again, and this time supplying the correct combination of document type and customer identifier as shown in Figure 12. This time, upload a file by clicking Browse and selecting the Sample Document.pdf, which you should find in C:\BPM85DocumentStore\upload if you extracted the supplied zip file to your C:\ directory.

Figure 12. Create document with sample values (should correlate to process instance)
Create document with sample values (should correlate to process instance)

Click to see larger image

Figure 12. Create document with sample values (should correlate to process instance)

Create document with sample values (should correlate to process instance)

This time the correlation should succeed and the process instance should move on to the final activity (Confirm Application), as shown in Figure 13.

Figure 13. Process showing confirmation step awaiting action
Process showing confirmation step awaiting action

Click to see larger image

Figure 13. Process showing confirmation step awaiting action

Process showing confirmation step awaiting action

To complete the scenario (and verify the expected document has indeed been received by the process instance), launch the final activity, which should result in the Coach displayed as shown in Figure 14. If you want to see the document in full screen, click Open in new window as highlighted in the figure.

Figure 14. Confirmation activity displayed with initial values
Confirmation activity displayed with initial values

Click to see larger image

Figure 14. Confirmation activity displayed with initial values

Confirmation activity displayed with initial values

In order to complete the scenario, the user performing the activity completes the form as shown in Figure 15 and clicks Confirm. The process instance should then show as completed in Process Inspector.

Figure 15. Confirmation activity completed
Confirmation activity completed

Key components used to build the scenario

The scenario we just demonstrated has been achieved using a number of key techniques that we'll examine in this section:

  • Configuring an intermediate content event to receive the inbound document message within the business process
  • Defining of an event subscription to detect the creation of a document in the internal BPM document store
  • Providing an enhanced version of the Document List Coach control that allows for the setting of metadata properties on an uploaded document

Configuring an intermediate content event

The intermediate content event defined on the process shown in Figure 16 is associated with a UCA (undercover agent) that has been defined as part of an event subscription.

Figure 16. Intermediate content event configuration
Intermediate Content Event configuration

In order to ensure the correct document receipt event is associated with the particular instance of the business process, a correlation needs to be defined as highlighted in the Data Mapping section in Figure 17.

Figure 17. Intermediate content event data mapping
Intermediate Content Event data mapping

Defining an event subscription

In order to send the event representing the creation of a new document, you need to specify an event subscription against the internal BPM document store, as shown in Figure 18. The relevant important settings are highlighted. Note that other Event Types can also be detected, such as an existing document being updated.

Figure 18. Event subscription
Event subscription

Click to see larger image

Figure 18. Event subscription

Event subscription

The configured Attached Service acts as the subscription handler containing the logic to decide what to do when a document creation event is detected. The highlighted called service in Figure 19 is a special Content Integration element that allows for invoking the defined operations on the content store, in this case the Get document operation to retrieve the document information.

Figure 19. Subscription handler – call to get document
Subscription handler – call to get document

Click to see larger image

Figure 19. Subscription handler – call to get document

Subscription handler – call to get document

Recall that in the runthrough of our scenario, we showed that it requires a special combination of the document type and customer identifier in order to trigger the correlation to the waiting process instance. The logic to achieve this is performed in a service named Check Application Info, which is called from the subscription handler as shown in Figure 20.

Figure 20. Subscription handler – call to Check Application Info
Subscription handler – call to Check Application Info

Click to see larger image

Figure 20. Subscription handler – call to Check Application Info

Subscription handler – call to Check Application Info

The created document will have metadata associated with it in the form of document properties. You'll see in the next section how these are specified upon uploading. These document properties are checked in the Check Application Info service (Figure 21) and the result matches if the expected document type is detected.

Figure 21. Logic to check document properties
Logic to check document properties

Click to see larger image

Figure 21. Logic to check document properties

Logic to check document properties

After a decision gateway validates whether the document matches the defined type, an Invoke UCA step (Figure 22) will send the event through for any listening business process instances that have the respective UCA defined.

Figure 22. Subscription handler – call to invoke UCA
Subscription handler – call to invoke UCA

Click to see larger image

Figure 22. Subscription handler – call to invoke UCA

Subscription handler – call to invoke UCA

The UCA definition is shown in Figure 23. Note the documentation that explains the special use of a Service implementation in order to pass through the business data field to be used for correlation.

Figure 23. UCA definition
UCA definition

Click to see larger image

Figure 23. UCA definition

UCA definition

Using the Document List control

The Content Management Toolkit provides a Document List control for displaying documents in a document store and to allow for adding and modifying documents within it. That control allows for defining static properties that apply to every uploaded document; however, the requirements of this scenario are that dynamic metadata properties be added to each uploaded document. We've provided an enhanced version of the Document List control (named Extended Document List), which is shown used in the Coach in Figure 24.

Figure 24. Usage of Extended Document List Coach View
Usage of Extended Document List Coach View

Click to see larger image

Figure 24. Usage of Extended Document List Coach View

Usage of Extended Document List Coach View

In order to compare and contrast the enhancements, in Figure 25 we show the out-of-the-box Document List Coach View. Note the included JavaScript™ files that have been highlighted.

Figure 25. Provided Document List Coach View
Provided Document List Coach View

We created the Extended Document List Coach View by taking a copy of the Document List Coach View and renaming the provided JavaScript files to distinguish them from the originals. The highlighted main JavaScript file (Figure 26) contains the core logic that has been extended to support the ability to add dynamic properties on document upload.

Figure 26. Extended Document List Coach View
Extended Document List Coach View

Click to see larger image

Figure 26. Extended Document List Coach View

Extended Document List Coach View

The reason for needing to extend the control is to allow for dynamic property setting on a document by document basis. The configuration settings inherited from the base Document List control (Figure 27) show that there is a provision to specify static properties. However, every subsequent uploaded document would have the same properties, so this is not sufficient for the requirements of the scenario.

Figure 27. Upload properties configuration options in Document List
Upload properties configuration options in Document List

The extended JavaScript files have additional logic that is highlighted with the comments convention starting with // EXTENSION : as illustrated in the code fragment shown in Figure 28. The code provides for adding additional fields on the dialog that is displayed when the user creates a document. Those field values are then set as document properties on the document that is uploaded to the document store. You can examine the provided JavaScript files for yourself if you are interested in understanding the code enhancements.

Figure 28. Example of extension logic in JS file
Example of extension logic in JS file

Click to see larger image

Figure 28. Example of extension logic in JS file

Example of extension logic in JS file

Conclusion

This article demonstrated a content-driven scenario using the BPM document store embedded ECM capability introduced in IBM BPM V8.5. You've seen how to correlate the receipt of a document with an existing process instance that is expecting that document as evidence to support an application. You've learned about the features in IBM BPM used to achieve the scenario, including some enhancements to the provided Document List Coach control that allow a user to specify metadata properties when uploading documents to the BPM document store.


Download

DescriptionNameSize
Sample codeBPM85DocumentStore.zip1.6MB

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Business process management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management
ArticleID=956058
ArticleTitle=Integrating BPM and Enterprise Content Management
publish-date=12042013