The Oracle Case Management API
Case Management is a new addition to Oracle BPM in release 188.8.131.52.7 (PS6). This new release contains the Case Management engine, see blog Léon at http://leonsmiers.blogspot.nl/ for more details. However, currently this release does not contain a case portal. The case management API’s, just like the already existing Oracle BPM API’s, help in developing a portal page with relative ease. This blog will use some real life examples from the EURent casemanagement application and portal application developed by Oracle.
The Oracle BPM Case Management API is a Java Based API that enables developers to programmatically access the new Case Management functionalities. It is an elaborate API that can access all the functionalities of Oracle Case Management. I will describe two of those functionalities in this blog: retrieving case data as DOM (http://www.w3.org/DOM/) and attaching a document to a case.
First of all when creating a Case Management project you will need to attach the following libraries:
These contain all the classes that are in the Case Management API.
To do anything with the BPM CaseManagement API in general it is necessary to create a CaseManagementServiceClient Object. The Case Management service client is the central piece of the Case Management API. It can be used to retrieve two different types of services. The first is the case stream service and the case service. The case stream service contains functionality to upload and download documents to and from a case. The second one is the CaseService. This service contains all the other functionality acting upon a case including but not limited to:
- Get a list of attached documents
- Abort a case
- Add a stakeholder
- Get case data
- Get a case activity
For a full overview of all the functionality go to:http://docs.oracle.com/cd/E28280_01/apirefs.1111/e25378/oracle/bpm/casemgmt/ICaseService.html
The following code snippet shows how to retrieve a caseStream service client:
Retrieving Casedata is an important part of the functionality of the BPM Case Management Suite. Figure 1 shows an example of the EURent portal application. Under the Case Details various information elements about a case can be identified.
Figure 1 Casedata, Stakeholders and Milestones
Retrieving casedata requires knowledge of the caseId . The caseId is a parameter assigned to a case when the case is created. The caseId is the unique identifier for a case. With the caseId a CaseIdentifier Object can be created with which the correct case can be identified. The caseData can be retrieved form the ICaseService with the identifier. The data is stored in a CaseDAta object which also hase a utility method to retrieve the Casedata as DOM. The following code example shows how this is done.
Uploading a file to a case is arguably one of the most common operations in case management. In the EURent portal application it is possible to open a dialog screen (figure 2) that enables you to select a file to be uploaded.
Figure 2 Upload Dialog
A functionality of the Case Management API allows you to track events that build up a history of all the events that have occurred within a case. As you can in figure 3 see it has identified the upload as an event.
Figure 3 Case Event list
The documents themselves are stored within Oracle UCM, an enterprise content management system. Figure 4 shows a snapshot of the webcenter shell used to acces oracle UCM that is attached to the EURent application. The case Management Suite will make a separate folder for each case and store the documens within that folder along with some metadata.
Figure 4 The document in oracle UCM
Uploading a document to Oracle BPM Case Management is done with a CaseStreamService client, which can be fetched from the CaseManagementServiceClient. Besides the Caseidentifier, required to find the correct case, the other parameters for the uploadMethod are pretty standard like the filename, contenttype and the inputstream.
I think the case Management API is a nice addition to to the Oracle BPM Suite. It offers a complete toolbox of functionality with which it should be possible to fulfill most of the businesses’ wishes regarding case management. It uses similar patterns as the previously introduced BPM API which enables developers that have experience with the BPM API to quickly see the possibilities with the Case Management API. One of the drawbacks is the lack of integration with a web framework. While the API is suited to build up a web interface from scratch it is in my opinion a downside that there are for instance no ADF components that integrate with the Case Management API.
Koen van Dijk Works as a systems engineer, specialized at finding technology related solutions for organizational challenges. He likes challenges that incorporate the soft and the hard side of organizations. Not only creating technological solutions but also making sure these solutions are accepted and used well within organizations. His technological focus lies with Oracle and Java technology.