Configuring a Sample Case Operations Component
IBM Case Manager
Configuring a Sample Case Operations Component
Overview
By configuring the Case Operations component, users can perform custom actions in a workflow in
FileNet® P8 Platform applications. Some example custom actions included in the following sample
code are creating a case, adding a case comment, attaching an external file, and creating a
subfolder.
If you intend to use the source code in any way, read this document and the flowchart diagram
before you take any action.
Download the Case Operations Component Sample for IBM Case Manager for Multiplatform and
Case Operations Component Sample for IBM Case Manager English from here:
https://www.ibm.com/services/forms/preLogin.do?source=swg-COCs4IBMCM
Disclaimer
The code can be compiled, modified, or enhanced to fit your needs. However, IBM does not
support the code in any way and is not liable for any detrimental usage induced by the code.
System requirements
Ensure that you install and configure the following software:
IBM Case Manager, Version, 5.1.1 or later
Properly installed FileNet P8 Platform software that supports IBM Case Manager, Version
5.1.1
Resources
IBM Case Manager Information Center:
http://publib.boulder.ibm.com/infocenter/casemgmt/v5r1m0/index.jsp?topic=/com.ibm.casemgmttoc.
doc/ic-homepage.html
IBM Redbooks® called Advanced Case Management with IBM Case Manager:
http://w3.itso.ibm.com/redpieces/abstracts/sg247929.html
July 2012
1
Configuring a Sample Case Operations Component
IBM Case Manager
Configuring a sample case operations component
Each step in this procedure corresponds to a step in the flowchart diagram (Case Operations
Diagram.doc). For example, Step 1 (Design and edit your solution) is also Step 1 in the flowchart
diagram. Reversely, if you are looking for detailed instructions for Step 6 in the flowchart diagram,
look for Step 6 in this document.
The following procedure uses sample data that you should remove from your test environment. The
last step in the procedure is to reset your test environment, which will remove the sample data.
Step 1: In Case Manager Builder, design or edit your
solution in the design object store
Design your solution with cases and tasks. It is assumed that you can use Case Manager Builder to
create and edit solutions.
Step 2: Build and compile the caseoperation.jar file
Build the CaseOperation.java file into the caseoperation.jar file in your development environment.
Add the following three JAR files to your class path:
JAR file
Description
jace.jar
Content Engine API. This file can be found in Content Engine installation directory:
c:\Program Files\IBM\FileNet\WebClient\CE_API\lib\jace.jar
pe.jar
Process Engine API. This file can be found in Process Engine installation directory:
c:\Program Files\IBM\FileNet\WebClient\Router\lib\pe.jar
acmapi.jar
IBM Case Manager API. This file can be found in the WebSphere Application Server
or IBM Case Manager installation directory:
C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\node
name\CaseManager.ear\CaseManager.war\WEB-INF\lib\acmapi.jar
File structure
All public methods that are defined in your single class (CaseOperation.java) can be called by the
Process Engine component manager. The component manager handles authentication and
authorization through JAAS before it executes individual methods. If you review the attached
CaseOperation.java source file, you see 14 public methods and 1 private method.
Exception handling
In the Case Operations sample, all exception handling items are logged to a local file. However, the
exception is thrown back to the caller, which is the component manager. When the component
manager catches an exception, the specified task is placed in the Conductor queue. Because of
this design in Process Engine, your component must be free of bugs before the component is
installed and called by the component manager.
July 2012
2
Configuring a Sample Case Operations Component
IBM Case Manager
Step 3: Configure the Case_Operations component queue
After you build the caseoperation.jar file, create the Case_Operations component queue in Process
Designer, add component methods to a task, and set up component method parameters.
The caseoperation.jar file should contain only one class: caseoperation.class.
Create the component queue for each solution individually if necessary.
Creating the Case_Operations component queue in Process Designer
1. Log into Workplace XT.
July 2012
3
Configuring a Sample Case Operations Component
IBM Case Manager
2. Click Tools > Advanced Tools > Process Designer.
3. Edit your solution by clicking File > Solution > Edit:
You will see your design object store, solution, solution definition, and case type. A workflow or task
should be shown in Process Designer.
July 2012
4
Configuring a Sample Case Operations Component
July 2012
IBM Case Manager
5
Configuring a Sample Case Operations Component
IBM Case Manager
4. Click View > Configuration.
July 2012
6
Configuring a Sample Case Operations Component
IBM Case Manager
5. Right-click Component Queues and select Register Additional Classes.
6. Register the following three JAR files:
acmapi.jar
acmrest.jar
caseoperation.jar
Both the acmapi.jar and acmrest.jar files are in the WebSphere Application Server installation
directory: C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\node
name\CaseManager.ear\CaseManager.war\WEB-INF\lib.
July 2012
7
Configuring a Sample Case Operations Component
IBM Case Manager
7. Right-click Component Queue and select New.
July 2012
8
Configuring a Sample Case Operations Component
IBM Case Manager
8. For the queue name, enter Case_Operations and click Next.
9. In the Adaptor field, select Java Component and then click Configure.
July 2012
9
Configuring a Sample Case Operations Component
IBM Case Manager
10. In the Select a Java Class window, select the caseoperation.jar from the list. Then, select the
CaseOperation.class and click OK.
11. Enter your JAAS credentials. Then, in the Configuration Context field, enter CaseLogin and
click Finish. Use the JAAS credentials that you use to log into Content Engine.
July 2012
10
Configuring a Sample Case Operations Component
IBM Case Manager
12. In the Component Properties window, double-click the Case_Operations queue. Then, click
the Operations tab.
July 2012
11
Configuring a Sample Case Operations Component
IBM Case Manager
13. In the Operations pane, click the Import icon:
14. Select all methods to add and click OK.
July 2012
12
Configuring a Sample Case Operations Component
IBM Case Manager
15. Click OK to close the Component Properties window.
July 2012
13
Configuring a Sample Case Operations Component
IBM Case Manager
16. From the main window in Process Designer, click File > Solution > Close.
17. Click Yes to save your changes.
July 2012
14
Configuring a Sample Case Operations Component
IBM Case Manager
Adding component methods to a task
1. In Process Designer, reopen the case type of the solution.
2. Insert a component by dragging and dropping the Component icon between the steps.
July 2012
15
Configuring a Sample Case Operations Component
IBM Case Manager
3. Click the Component tab and then click the Add icon.
All Case Operations methods should be displayed.
July 2012
16
Configuring a Sample Case Operations Component
IBM Case Manager
4. Select the addCaseComment and createCase methods and then click OK.
You can add as many methods as needed.
Setting up component method parameters
When you set up the method parameters, follow these rules:
Always use Expression Builder to set your parameter if possible.
Use single quotation marks for hard-coded strings, for example, ‘TOS’.
Each return value (if the method returns a value) must be unique so that it can be used as
an input parameter to another method.
1. To set up the createCase() method parameters, review the following data from the code:
/**
createCase() - creates a new instance of the same case type.
@param caseFolderPath
The full Content Engine path of the current working case folder.
F_CaseFolder.PathName must be used as parameter
in Process Designer.
@param TOS
The target object store name. For example: 'TOS2'
@param create
A boolean property from the case type indicating if a new case
instance needs to be created. If your case type contains such
boolean property, then use F_CaseFolder.yourBooleanPropertyName.
If you don't have such property, set it to true.
@return
GUID of the new case.
*/
July 2012
17
Configuring a Sample Case Operations Component
IBM Case Manager
public String createCase(
String caseFolderPath,
String TOS,
boolean create)
throws Exception
2. Select the createCase method in the General tab. Then, from the operation parameters list,
select param1 and from the expression type, select <Build Expression>.
July 2012
18
Configuring a Sample Case Operations Component
IBM Case Manager
3. From the Expression Builder menu, select Guid Fields.
4. From the Properties list, select F_CaseFolder and then select PathName. Click Insert and then
click OK.
July 2012
19
Configuring a Sample Case Operations Component
IBM Case Manager
In Process Designer, the operation parameter param1 now has the expression
F_Casefolder.Pathname.
5. For param2, enter the hardcoded string of your target object store.
a. Open the Expression Builder window by clicking <Build Expression> and enter your
target object store name, for example, ‘TOS2’, in the text box.
b. Click OK.
Be sure you use single quotation marks around the name of the target object store.
July 2012
20
Configuring a Sample Case Operations Component
IBM Case Manager
In Process Designer, the operation parameter param2 now has the expression ‘TOS2’.
July 2012
21
Configuring a Sample Case Operations Component
IBM Case Manager
6. For param3, which is a Boolean field, in the Expression Builder window, enter true. Then, click
OK.
July 2012
22
Configuring a Sample Case Operations Component
IBM Case Manager
7. Make the return_value parameter unique by clicking the Workflow Properties tab and then the
Data Fields tab. Select the return_value row and click the Copy icon.
July 2012
23
Configuring a Sample Case Operations Component
IBM Case Manager
8. Select Copy_of_return_value.
9. Change the value to createCaseReturnValue.
July 2012
24
Configuring a Sample Case Operations Component
IBM Case Manager
10. Return to the Component tab and select createCaseReturnValue for the return_value for the
createCase() method.
11. Click the Up Arrow icon to ensure that the createCase() method is executed before the
addCaseComment() method.
July 2012
25
Configuring a Sample Case Operations Component
IBM Case Manager
12. Set up the addCaseComment() method parameters by following the steps similar to the ones
described previously. Review the following data from the code:
/**
addCaseComment() - adds a new comment to this case instance
@param caseFolderPath
The full Content Engine path of the current working case folder.
F_CaseFolder.PathName must be used as parameter
in Process Designer.
@param TOS
The target object store name. For example: 'TOS2'
@param comment
The comment to be added
*/
public
String
String
String
void addCaseComment(
caseFolderPath,
TOS,
comment) throws Exception
You use the return value from the createCase() method as the comment text, so when you are
finished, addCaseComment() method parameter should look like this:
July 2012
26
Configuring a Sample Case Operations Component
IBM Case Manager
Step 4: Stop the Component Queue Manager
1. On the Content Engine server, open a command prompt and change to the C:\Program
Files\IBM\FileNet\WebClient\Router directory. Then, run the following commad: routercmd.bat.
2. If the component manager for your connection point region is running, in Process Task Manager,
right-click your connection point region and click Stop..
The following screen capture shows that the connection point region is running:
The following screen capture shows that the connection point region is stopped:
July 2012
27
Configuring a Sample Case Operations Component
IBM Case Manager
Step 5: In Case Manager Builder, deploy the solution
Deploy your solution to the target object store. For information about how to deploy solutions, see
the IBM Case Manager Information Center:
http://publib.boulder.ibm.com/infocenter/casemgmt/v5r1m0/index.jsp?topic=/com.ibm.case
mgmttoc.doc/ic-homepage.html
Step 6: Start the Component Queue Manager
In this step, copy caseoperations.jar and related files to the Process Engine server, and then
start the Component Queue Manager.
1. On the Content Engine server, open a command prompt and change to the C:\Program
Files\IBM\FileNet\WebClient\Router directory. Then, run the following commad: routercmd.bat.
If you do not see your connection point region, right-click Component Managers, select New,
select your connection point, and then click OK.
2. Select the component manager for your connection point region. Then, click the Required
Libraries tab.
3. Add the following JAR files to your system:
acmapi.jar
acmrest.jar
caseoperation.jar
JSON4J_Apache.jar
July 2012
28
Configuring a Sample Case Operations Component
IBM Case Manager
To make the files easier to find, an icm subdirectory was created under the directory
\Router\lib where the JAR files were copied to.
You can find the acmapi.jar, acmrest.jar and JSON4J_Apache.jar files in the following
WebSphere Application Server installation directory: C:\Program
Files\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\node
name\CaseManager.ear\CaseManager.war\WEB-INF\lib.
4. Add the following configuration context to the taskman.login.config file in the Router
directory:
CaseLogin
{
com.filenet.api.util.WSILoginModule required debug=false;
filenet.vw.server.VWLoginModule required routerurl="localhost:32771/vwrouter";
};
5. Start the component manager for your connection point region by right-clicking on it and clicking
Start.
July 2012
29
Configuring a Sample Case Operations Component
IBM Case Manager
Step 7: Test the component
In this step, you test the Case_Operations component in Case Manager Client by creating and
completing tasks for cases.
1. In Case Manager Client, create several cases and work through the tasks.
2. Verify whether the component methods were called successfully by reviewing the exception log
file on the server or use the Process Engine vwtool and search for unrouted work items. The
sample code logs all exceptions to the c:\temp\CaseOperationException.log file and then throws the
exception back to the component manager. To search for un-routed work items in vwtool:
a. Open a command prompt on your Process Engine server.
b. Run the vwtool tool and log in by entering your Process Engine credentials.
c. Enter your region number if it is not 1 and then enter wobq Conductor, for example:
July 2012
30
Configuring a Sample Case Operations Component
IBM Case Manager
If everything works as expected, you are done.
If you need to add new methods to your existing component, go to Step 1 and start the entire
process again.
If you need to modify or delete existing methods for your existing component, go to Step 8.
Step 8: Stop the Component Queue Manager
1. On the Content Engine server, open a command prompt and change to the C:\Program
Files\IBM\FileNet\WebClient\Router directory. Then, run the following commad: routercmd.bat.
2. If the component manager for your connection point region is running, in Process Task Manager,
right-click your connection point region and click Stop..
The following screen capture shows that the connection point region is running:
July 2012
31
Configuring a Sample Case Operations Component
IBM Case Manager
The following screen capture shows that the connection point region is stopped:
July 2012
32
Configuring a Sample Case Operations Component
IBM Case Manager
Step 9: Reset the environment in Case Manager Builder
After you deploy a solution as described in Step 5, component method signatures are also created
in the Process Engine region. After method signatures are created in the region, the methods
cannot be changed.
If you plan to delete or modify an existing method, you must reset the environment in Case
Manager Builder, which will reinitialize the Process Engine region.
1. From Case Manager Builder, reset the development environment.
2. After you successfully reset the environment, go to Step 1 and start the entire process again.
July 2012
33
© Copyright 2026