David Hanson
Case Manager Developer
September 11, 2013
Product Maintenance Training (PMT)
IBM Case Manager 5.2
ICM Model API
© Copyright IBM Corp. 2013. Course materials may not be reproduced in whole or in part without prior written permission of IBM.
Introduction
Course Overview
– Present the Case Client Model API introduced with ICM 5.2
Target Audience:
– Anyone designing or supporting solutions with ICM 5.2
Suggested Prerequisites:
– General familiarity with ICM and client JavaScript development
Version Release Date: September, 2013
© Copyright International Business Machines Corporation 2013. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
© Copyright IBM Corp. 2013. 2
Course Objectives
After this course you will be able to:
Understand where the Model API fits in the overall Case Client
Recognize when and how the model API should be called
© Copyright IBM Corp. 2013. 3
Course Roadmap
Explain what is the model API
– When to use the model API
– What functionality it provides
– Course Summary
© Copyright IBM Corp. 2013. 4
What is the Model API?
The ICM Model API are JavaScript classes that are part of the larger
ICM JavaScript Toolkit
They are non-UI components and generally represent ICM objects in the
repository such as Solution, Case, Task, etc.
They communicate with mid-tier services through a navigator plug-in.
Like with the navigator model API and services, the public API is the
JavaScript Model API. The plug-in services are not public API.
– We do not expect custom code to call the plug-in services directly
through HTTP. The only supported use is a JavaScript client calling
the model classes.
The model classes extend and reuse some navigator model classes.
The model classes provide functionality where it is not sufficient or
possible to achieve through the navigator API alone.
© Copyright IBM Corp. 2013. 5
5.2 Case Client Architecture
IBM Content Navigator web client
Case Manager Case Client
Page 1 Page n Properties page
widget
In-basket page Toolbar
Case Information Page widget
widget page widget events
page widget
InBasketContainer Custom
Action Add
Content grid Add Doc dlg Case Toolbar
events case page widget
ReAssign Dialog action
Comment Action
Content Navigator Model Case Manager Model
Result Set Property
Desktop Repository Request
… Solution Case Task
Controller …
Model API
and Plug-in
Services
Content Navigator Mid-Tier Services Case Manager Mid-Tier Services
© Copyright IBM Corp. 2013. 6
Part of the overall ICM JavaScript Toolkit
The ICM Model API are classes under the icm.model package
© Copyright IBM Corp. 2013. 7
Alternative to REST APIs
Case Client 5.2 calls the ICM model classes for functionality that Case
REST (runtime features only) provided in previous releases
– Communicating with the mid-tier through plug-in services
Benefits of integrating with navigator services through plug-ins
– Sharing connection to the server and the performance and simplified
session management that comes with that
– Sharing of the Request model object and its links to the desktop for
free message logging, status, relogin, and error dialogs
Likewise the core navigator model classes are used where PE REST
and CMIS were used previously
The model classes offer similar functionality as REST but in the form of
an object-oriented API
– Objects with state and encapsulate that state as you would expect
© Copyright IBM Corp. 2013. 8
Course Roadmap
– Explain what is the model API
When to use the model API
– What functionality it provides
– Course Summary
© Copyright IBM Corp. 2013. 9
When is the model API used?
In developing a custom widget
– Model object passed as part of the payload of an event
May be called by a Script Adapter
© Copyright IBM Corp. 2013. 10
Model Object Navigation
© Copyright IBM Corp. 2013. 11
Course Roadmap
– Explain what is the model API
– When to use the model API
What functionality it provides
– Course Summary
© Copyright IBM Corp. 2013. 12
Model API Functionality
Retrieve the deployed solutions
– Solutions deployed to any target object store registered with the navigator
desktop
For a particular solution
– Retrieve the case type or documents types
– Retrieve information about the properties across all case types
– Retrieve the roles
– Retrieve the static pages to show for a particular role
For a particular case type
– Attributes include
• What rights the user has to cases of that case type
• Whether dynamic (custom) tasks are supported
• The default view definition to use when editing cases of this type
– Retrieve information about the properties of the case type
– Retrieve the discretionary task types that can be created
– Discover the particular page to use for a page type and role
– Search for dynamic tasks compatible with this case type (attached to cases
of this type)
© Copyright IBM Corp. 2013. 13
Model API Functionality (2)
For case objects
– Retrieve a particular case or obtain a Case model object given
a navigator ContentItem (for example from a folder based
search)
– Create a case
– Update the properties of a case
– Split a case
– Relate cases together
– Retrieve the cases that are related to a case (through splitting
a case or generally relating cases together)
– Add and retrieve comments on cases
– Retrieve the case history
– Retrieve the tasks associated with a case
Classes for navigating the new case timeline history
© Copyright IBM Corp. 2013. 14
Model API Functionality (3)
For task objects
– Start a manual task
– Enable and disable certain tasks
– Stop and restart the workflow associated with a task
– Create a discretionary task
Dynamic (custom) tasks
– Create a dynamic task
– Update the data that describes the dynamic task and indicate if
the data is valid (allowing the task to be started)
– Start a dynamic task, causing dynamic workflow to be created
and launched
© Copyright IBM Corp. 2013. 15
Model API Functionality (4)
Work items
– ICM Model exposes a WorkItem object that encapsulates some
ICM specific behavior
• Better integration with case properties in the API
– Retrieve a particular work item or obtain an ICM WorkItem
given a navigator WorkItem (for example from an inbasket
query)
– Lock or unlock the work item
– Save or complete the work item
– Update the step parameters (properties) when saving or
completing
© Copyright IBM Corp. 2013. 16
Supports the collaborative editing of objects
Core objects in the API such as Case and WorkItem do not
expose scratchpad behavior
– No “dirty” state. State of the objects always reflect what was
last persisted.
– Similar to semantics of navigator objects such as ContentItem
and ecm.model.WorkItem
Some ICM model objects expose an “editable” object that
provides scratchpad semantics
– Modify properties and other attributes of the object before
saving
– Editable object can be shared by multiple widgets. Each
widget can apply its changes prior to saving.
© Copyright IBM Corp. 2013. 17
Supports the collaborative editing of objects (2)
Case object example
var caseEditable = caseObject.createEditable();
var p = caseEditable.propertiesCollection[“SOL_StringProp”];
p.setValue(“String value”);
caseEditable.save(lang.hitch(this, this._saveComplete));
When editable is saved, changes are reflected back on main non-
editable
– Client can subscribe to change notification on editable or non-
editable
– Multiple editables can exist for a particular non-editable. If any are
saved the non-editable and other editables are updated.
Much of editable features currently are for modifying the properties of the
object (case properties or step parameters)
– Client such as properties widget subscribes to change notifications at
each property level
– Beside property value, other property attributes can change when
EDS is involved
© Copyright IBM Corp. 2013. 18
Supports the collaborative editing of objects (3)
Creating a new object, a pending Editable object is obtained first
solution.createNewCaseEditable(caseType,
lang.hitch(this, function(caseEdit){
var p = caseEdit.propertiesCollection[...];
p.setValue(“String value”);
caseEdit.save(lang.hitch(this, this._saveNewComplete));
});
...
_saveNewComplete: function(caseEdit) {
var caseObj = caseEdit.caseObject;
},
Main model object doesn’t exist until pending Editable is saved
Model objects with corresponding Editable objects:
– Case / CaseEditable
• Modifying case properties
• Creating a new case
– WorkItem / WorkItemEditable
• Modifying step parameters when completing or saving a step
– Task / TaskEditable / LaunchStep
• Creating a discretionary task
• Properties (step parameters) are on the LaunchStep, an optional sub-object of TaskEditable
(when discretionary task is associated with a FileNet BPM workflow)
– A collection of PropertyEditable objects is on the editable and represents the properties
© Copyright IBM Corp. 2013. 19
Property Controller
In developing a custom widget you may also have occasion to use the
Property Controller classes (under the icm.model.properties.controller
package).
These classes provide the controller for the view rendered in the
Properties Widget.
They provide some additional features such as a mechanism for binding
and unbinding the controller to an ICM model object.
You can use the Property Controller classes to customize the
functionality of the properties view.
Some additional details are discussed in another presentation.
© Copyright IBM Corp. 2013. 20
Course Roadmap
– Explain what is the model API
– When to use the model API
– What functionality it provides
Course Summary
© Copyright IBM Corp. 2013. 21
Course Summary
You have completed this course and can:
Understand where the Model API fits in the overall Case Client
Recognize when and how the model API should be called
© Copyright IBM Corp. 2013. 22
Contacts
Product Marketing Manager: William (Doc) Mills ([email protected])
Product Manager: Dave Perman (
[email protected])
Subject Matter Experts (SME)/Area of Expertise: David Hanson, Ku
Chang, Laurent Dubois, Brent Taylor (properties controller)
Support: Ted Dullanty (
[email protected])
© Copyright IBM Corp. 2013. 23
Product Help/Documentation/Resources
Case Manager 5.2 Information Center
– http://pic.dhe.ibm.com/infocenter/casemgmt/v5r2m0/index.jsp
P8 5.2 Information Center
– http://pic.dhe.ibm.com/infocenter/p8docs/v5r2m0/index.jsp
© Copyright IBM Corp. 2013. 24