IBM Case Manager 5.0 Application Development Lauren Mayes, Mike Marin, Alan Babich, David Wang, Ganesh Vaideeswaran, Jay Brown October 1, 2010
Introduction Course Overview Target Audience Application developers Prerequisites: IBM Case Manager Architecture Overview Session Version Release Date: Q4, 2010 Copyright International Business Machines Corporation 2010. All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 2 P8 & IBM Case Manager 5.0
Course Overview The presentation is designed to Introduce the REST services and object model for IBM Case Manager CASE REST Process Engine REST CMIS APIs 3 P8 & IBM Case Manager 5.0
REST REpresentational State Transfer REST defines a set of architectural principles for defining services that focus on a system's resources; Key goals: Scalability Generality of interfaces Independent deployment of components Intermediary components to reduce latency, enforce security and encapsulate legacy systems A RESTful web service is implemented using HTTP and the principles of REST Provides a collection of resources that provide base URI for the web service mime type of the data supported by the web service usually JSON, XML a set of operations using HTTP methods GET, PUT, POST and DELETE A directory structure-like set of URIs for accessing and updating resources Stateless on the server Can be consumed be a wide range of clients, written in different languages 4
IBM Case Manager REST services Browser Client HTTP XML/JSON Integration Tier - WebSphere Application Server Process Engine REST (PE REST) Case Management REST (Case REST) Process Engine Java API Process Engine Content Management Interoperability Service (CMIS) Content Engine Java API P8 Engine Content Engine Case Manager includes three REST services that are used together to access and manipulate cases 5 P8 & IBM Case Manager 5.0
Deployed Solution 6 P8 & IBM Case Manager 5.0
Case REST URI format: http://host:port/{context}/caserest/v1/{resourcename}[? TargetObjectStore={objectStoreName}][&{resourceParameters}] JSON returned in response Example - get list of case types in a solution 7
Case REST Example Get case types in a solution Request http://myserver:9080/casemanager/caserest/v1/solution/candidate%20selection %202/casetypes?TargetObjectStore=TOS02 8 Response { "CaseTypes":[ { "CaseType":"CSLM2_Candidate", "Description":"Candidate for position", "DisplayName":"Candidate" }, { "CaseType":"CSLM2_Interview", "Description":"Interview for position", "DisplayName":"Interview" } ] }
Case REST resource summary 9
Case REST - info Ping method to see if the Case REST protocol is running Call the GET method on /CASEREST/v1/info In general, all the input and output payloads are JSON, except for info which is an HTML page 10 Template Documentation
PE REST URI format: http://host:port/{context}/{servlet}/p8/bpm/v1/{resourcename}[? cp={connectionpointname}][&{resourceparameters}] JSON returned in the response Example - get roles that the logged on user is a member of 11
PE REST Example get roles in a solution Request http://myserver:9080/casemanager/p8bpmrest/p8/bpm/v1/appspaces/candidate %20Selection%202/myroles?cp=newportvm24_796_tos02 Response { "Customer Service Representative":{ "name":"customer Service Representative", "URI":"appspaces\/Dannay+Insurance+Claims\/roles\/Customer+Service+Representat ive" }, "Adjuster":{ "name":"adjuster", "URI":"appspaces\/Dannay+Insurance+Claims\/roles\/Adjuster" } 12
PE REST Resources - application spaces, roles, users and groups 13
PE REST Retrieving in-baskets for a role 1. First, retrieve list in-baskets for a role, use resource: /p8/bpm/v1/appspaces/{appspace}/roles/{role} E.g.... p8/bpm/v1/appspaces/candidate%20selection%202/roles/clerk? cp=newportvm24_796_tos02... 2. From the response, get the URI for the in-basket... "workbaskets":{ "Clerk":{ "customattributes":{ "CB_Inbasket":{ "value":"candidate Selection 2", "type":2, "name":"cb_inbasket", "isarray":false } }, "name":"clerk", "URI":"queues\/CSLM2_Clerk\/workbaskets\/Clerk" }, In-basket resource... 3. Construct URI to retrieve the work items in the in-basket, use resource: /p8/bpm/v1/queues/{queue}/workbaskets/{workbasket} 14 E.g.... /p8/bpm/v1/queues/cslm2_clerk/workbaskets/clerk...
PE REST Resources queues, in-baskets, work items Resource Description /queues/{queue}/workbaskets/{workbasket} GET attributes of an in-basket, including columns and user filters /queues/{queue}/workbaskets/{workbasket}/queue elements GET work items in an in-basket /queues/{queue}/workbaskets/{workbasket}/queue elements/count GET number of work items in an in-basket /queues/{queue}/stepelements/{wobnum} GET get a step element (work item) PUT update a step element (work item) 15
CMIS REST OASIS standard for content management Defines a domain model and bindings that include Web Services and ReSTful AtomPub CMIS specification http://docs.oasis-open.org/cmis/cmis/v1.0/cmis-spec-v1.0.pdf IBM P8 implementation of CMIS Support query and update of documents and folders Metadata retrieval Does not support setting access rights, custom objects, admin functions Use of CMIS does NOT mean that case management can be implemented on any content repository Example - query for a case using case identifier http://myserver:9080/casemanager/resources/tos02/query 16
CMIS Example response XML Response (partial) 17
CMIS usage in case management Query for cases Create case Update case properties Get case and document class definitions (metadata) Add folder to a case Query for document to add to a case Add document to a case 18
CMIS - Help and ping page 19 http://myserver:9080/casemanager/index.jsp P8 & IBM Case Manager 5.0
Design Object Store Folder Structure 20 P8 & IBM Case Manager 5.0
Target Object Store Folder Structure 21 P8 & IBM Case Manager 5.0
References 22 CMIS APIs Primary reference document is the specification. http://docs.oasis-open.org/cmis/cmis/v1.0/cmis-spec-v1.0.pdf Extensions will be documented as part of CMIS 1.0 documentation and referenced from IBM Case Manager documentation PE REST and Case REST will be documented in the P8 InfoCenter P8 & IBM Case Manager 5.0
Q&A 23 P8 & IBM Case Manager 5.0