IBM® FileNet® P8 software helps enterprises in storage and retrieval of content, business process automation and case management. FileNet Content Engine is the core component of the IBM FileNet ECM suite for enterprise-level content management. Of the many tasks that the FileNet P8 system performs, it works as a very robust document management system. A user interacts with FileNet Content Engine through Workplace, a Java Enterprise Edition (JEE) application that provides a web interface to the FileNet Content Engine.
In content management systems, document editing is one of the primary tasks. In the FileNet Content Engine, editing is performed through the following sequence of actions:
- Check out the document to a local file system from the server (analogous to document download).
- Edit and save the document using a document editor locally.
- Check the document back in to the Content Engine server (analogous to document upload).
In a content management system, check-in and checkout activity constitutes the bulk of the load on the system. Therefore, testing FileNet Content Engine for document check-in and checkout activity becomes critical in assessing the overall performance of the system.
In this article, we describe a method that configures IBM® Rational® Performance Tester to load-test FileNet P8 Content Engine.
The following steps are involved in configuring Rational Performance Tester for load testing the document editing process of the FileNet P8 Content Engine.
- Create the test script.
- Set test script parameters to add variability to the load test.
- Modify the test script for correct execution.
- Create a schedule and running the load test.
The sections that follow describe these steps in detail.
Create a test script in Rational Performance Tester:
- Open the Rational Performance Tester workbench.
- Create a new performance test project.
After creating the project, you will be prompted to create a new test script from a recording.
- In the pop-up window, select RPT HTTP Recording as the recorder type. Give an appropriate name to the test, and start the recording.
Rational Performance Tester will open the default browser, Microsoft Internet Explorer, to capture the requests.
- Access the Workplace application, perform the required actions in the browser, and stop recording by closing the browser.
This will generate the test script with the HTTP requests corresponding to these actions.
Tip:
Be sure to give meaningful names to
HTTP requests in the test script. From Rational Performance
Tester v8.1 onward, you can use the icon (white page with blue
pencil, circled in Figure 1) in the Recorder Test Annotation
toolbar to give appropriate names to requests while recording a
test script.
Figure 1. Recorder Test Annotation toolbar
Note:
Capture the actions related to
checkout and check-in operations in the same test script. This
approach makes it easier to incorporate the scripting logic that
will ensure that a user is allowed to perform only a check-in
operation on a document that he has already checked out.
The following actions should be carried out while recording the test script in Rational Performance Tester:
- Access Workplace by typing the relevant URL in the browser,
for
example:
http://testhost:9080/Workplace - Log in to Workplace with the relevant user credentials.
- Go to the folder containing the documents by selecting the relevant object store from the home page.
- To check out a document, select it and right-click to access the operations menu, and select the Check Out operation.
- In the new browser window that opens, download the checked-out document and close the window.
- Edit the downloaded document.
- To check in the modified document, select the checked-out document, right-click to access the operations menu, and select the Check In operation.
- In the check-in wizard that opens, perform these actions:
- In the Set Properties step, enable check-in as the major version and use the default values for all other properties.
- In the Set Security step, use the default security policies.
- In the Select File step, use the Local File option to browse and locate the modified document, and then click Finish.
- Click OK to confirm the changes. This will close the wizard and check in the document.
- Log out of Workplace.
You need to vary the version series ID in the checkout request to enable the test script to work with different documents.
The latest version of the document is always the one checked out. The test script will use the version series ID as a reference rather than the latest document version. The FileNet P8 Content Engine changes the reference from the version series ID to the latest doc version, and then checks that document out.
- Create a data pool in Rational Performance Tester with the version series IDs of different documents in the respective folder and object store.
- You can use the Java code snippet in Listing 1 to retrieve these values from the respective document objects by using the FileNet P8 Content Engine client API.
Listing 1. Code to retrieve the version series IDs
public Connection getConnection(String host, String port){
//Build the FileNet connection URL
String filenetUrl = "http://" + host + ":" + port + "/wsi/FNCEWS40MTOM/";
//Return the Connection to the caller
return Factory.Connection.getConnection(filenetUrl);
}
public void getDocAttributes(String host, String port, String userid,
String passwd, String objStoreName, String folderPath)
{
//FileNet P8 Admin user name and password
String userName = userid;
String password = passwd;
boolean userPushed = false;
try{
/* Establish connection with the FileNet P8 Content Engine Server based
* on host and port details
*/
Connection conn = getConnection(host,port);
Subject loginUser = UserContext.createSubject(conn,userName,
password,"FileNetP8WSI");
UserContext.get().pushSubject(loginUser);
userPushed = true;
//Access the Domain and ObjectStore information
Domain gcd = Factory.Domain.fetchInstance(conn,null,null);
String domainName = gcd.get_Name();
ObjectStore objStore = Factory.ObjectStore.fetchInstance(gcd,objStoreName, null);
/* Fetch the folder object that contains the documents
* Get the document set in the folder and iterate
*/
Folder folder = Factory.Folder.fetchInstance(objStore, folderPath, null);
DocumentSet docSet = folder.get_ContainedDocuments();
Iterator iter = docSet.iterator();
Document currentDoc = null;
String docTitle = null;
String docId = null;
String docVersionId = null;
int majorVersion = -1;
int minorVersion = -1;
int versionStatus = -1;
Versionable currentVersion = null;
// versionid represents the version series id
System.out.println("doctitle,docid,versionid,majorversion,minorversion,
versionstatus");
//Retrieve the document properties from the current document object
while (iter.hasNext()){
currentDoc = (Document)iter.next();
docTitle = currentDoc.get_Name();
docId = currentDoc.get_Id().toString();
currentVersion = currentDoc.get_CurrentVersion();
majorVersion = currentVersion.get_MajorVersionNumber();
minorVersion = currentVersion.get_MinorVersionNumber();
docVersionId = currentVersion.get_VersionSeries().get_Id().toString();
versionStatus = currentVersion.get_VersionStatus().getValue();
System.out.println(docTitle + "," + docId + "," + docVersionId + ","+
majorVersion + "," + minorVersion + "," + versionStatus);
}
}finally{
if(userPushed)
UserContext.get().popSubject();
}
}
|
Figure 2 shows the checkout request in the test script that contains the version series ID.
Figure 2. Checkout request with the version series ID
In the checkout request, the vsId variable represents the version series ID (see Figure 3 the checkout request details).
- Substitute the value of this variable with the data pool that contains the version series IDs of different documents.
Figure 3. Checkout request details
Tip:
To add more variation to the load
tests, you can vary the values for user credentials, object
store, and folder-related details in the test script.
The check-in operation is always carried out on the reservation version of the document (The reservation version indicates a checked-out but not yet checked in version of a document.) For the check-in operation to work correctly, the document ID of the checked-out document should be used as an input to the check-in request. To ensure this, you can use the custom code feature in Rational Performance Tester to parse and retrieve the document ID from a URL in the response of the checkout request.
In the test script, the response of the checkout request that contains the argument to custom code is shown in Figure 4.
Figure 4. Checkout response containing the argument to the custom code
Listing 2 shows the URL that contains the document ID of the recently checked-out document in the response of the checkout request. This URL should be passed as an argument to the custom code.
Listing 2. URL details
http://jaltarang.in.ibm.com:9080/Workplace/getContent?mode=download&objectType=document&id={753DFAA1-3EE5-4C44-89E3-51DEFFB7E371}&objectStoreName=mcs1db2&returnUrl=http%3A%2F%2Fjaltarang.in.ibm.com%3A9080%2FWorkplace%2FWcmCloseWindow.jsp%3Fop%3Dcheckout%26refreshUrl%3Dhttp%253A%2F%2Fjaltarang.in.ibm.com%253A9080%2FWorkplace%2FBrowse.jsp%253FwindowId%253DmainWindow%26eventName%3DStateChanged
Listing 3 shows the custom code snippet to parse and retrieve the document ID.
Listing 3. Code to parse and retrieve the document ID
public String exec(ITestExecutionServices tes, String[] args)
{
int startIndex = args[0].indexOf("id=") + 3;
int endIndex = startIndex + 38;
tes.getTestLogManager().reportMessage(args[0].substring(startIndex,endIndex));
return args[0].substring(startIndex,endIndex);
}
|
The check-in request in the test script that contains the document ID is shown in Figure 5.
Figure 5. Check-in request with the document ID
In the check-in request, the id variable represents the document ID (see Figure 6). The value of this variable should be substituted with the value returned by the custom code.
Figure 6. Check-in request details
Note:
To add more variety to the load
tests, you can also vary the content of the document that gets
checked in. Rational Performance Tester v8.1.1 and later has a
built-in functionality to do this. See the IBM TechNote titled
"Rational Performance Tester: Substituting request content from
a file" (cited in the Resources
section) for more information.
Create a schedule and run the load test
- After modifying the test script, create a schedule in Rational Performance Tester.
- Add the test script to this schedule.
- Specify the required number of users and the ramp-up rate, and run the test for the required duration.
Important:
It is important to run the cancel checkout operation on all of the relevant documents after running a load test. In most of the scenarios, when a load test finishes, the majority of virtual users would have exited without performing all of the actions in the test script. This results in a lot of documents being in the checked-out state. The next iteration of the load test will report a lot of errors if this clean-up activity is not carried out. You can use the Java code snippet shown in Listing 4 to automate running the cancel checkout operation on the documents.
Listing 4. Code to automate the cancel checkout operation
public void deleteReservation(String host, String port, String userid,
String passwd, String objStoreName, String folderPath)
{
//FileNet P8 Admin user name and password
String userName = userid;
String password = passwd;
boolean userPushed = false;
try{
/* Establish Connection with the FileNet P8 Content Engine Server
* based on host and port details
*/
Connection conn = getConnection(host,port);
Subject loginUser = UserContext.createSubject(conn,userName,
password,"FileNetP8WSI");
UserContext.get().pushSubject(loginUser);
userPushed = true;
Domain gcd = Factory.Domain.fetchInstance(conn,null,null);
String domainName = gcd.get_Name();
//Fetch Object store, Folder and document set in the folder
ObjectStore objStore = Factory.ObjectStore.fetchInstance(gcd,objStoreName, null);
Folder folder = Factory.Folder.fetchInstance(objStore, folderPath, null);
DocumentSet docSet = folder.get_ContainedDocuments();
Iterator iter = docSet.iterator();
Document currentDoc = null;
/* Iterate through the document set, run cancel check out on the documents
* and save the changes
*/
while (iter.hasNext())
{
currentDoc = (Document)iter.next();
docTitle = currentDoc.get_Name();
VersionSeries vs = currentDoc.get_VersionSeries();
if(vs.get_IsReserved ())
{
Document resv = (Document) vs.get_Reservation();
Versionable versionable = resv.cancelCheckOut();
((Document)versionable).save(RefreshMode.NO_REFRESH);
System.out.println("reservation deleted for docTitle:" + docTitle);
}
}
}finally{
if(userPushed)
UserContext.get().popSubject();
}
}
|
Use this process with other applications
The article walked you through the steps to configure IBM Rational Performance Tester to load test the document editing functionality of FileNet Content Engine. Although it focused on Rational Performance Tester, the key concepts and the artifacts included in this article can be used with other load-testing tools.
Learn
- To learn more about IBM FileNet
P8:
- Read Writing great code with the IBM FileNet P8 APIs, Part 1, by Bill Carpenter, to jump-start using the FileNet APIs (IBM developerWorks, October 2008).
- Check the IBM FileNet P8 documentation.
- Read these IBM® Redbooks® publications:
- Browse the IBM Enterprise Content Management overview page.
- Find out more on the Rational Performance Tester product overview page.
- Then Explore the Rational Performance Tester page on IBM developerWorks for links to technical articles and browse the user assistance in the Rational Performance Tester Information Center.
- Read this TechNote for v8.1.1: Rational Performance Tester: Substituting request content from a file.
- Visit the Rational
software area on developerWorks for technical resources
and best practices for Rational Software Delivery Platform
products.
- Stay current with developerWorks technical events and webcasts focused on
a variety of IBM products and IT industry topics.
- Attend a free developerWorks Live! briefing to get up-to-speed quickly on IBM products and tools, as well as IT industry trends.
- Watch developerWorks on-demand demos, ranging from product installation and setup demos for beginners to advanced functionality for experienced developers.
- Improve your skills. Check the
Rational training and certification catalog, which
includes many types of courses on a wide range of topics. You
can take some of them anywhere, any time, and many of the
"Getting Started" ones are free.
Get products and technologies
- Download
the trial version of IBM Rational Performance
Tester.
- Evaluate
IBM software in the way that suits you best: Download it
for a trial, try it online, use it in a cloud environment, or
spend a few hours in the SOA Sandbox learning how to implement service-oriented
architecture efficiently.
Discuss
- Join the Rational Performance Testing forum or the SOA Testing forum,
where you can share you questions and knowledge about IBM
performance testing products.
- Rate or review Rational software. It’s quick and easy.
Really.
- Share your knowledge and help
others who use Rational software by writing a developerWorks article. Find out what makes a good developerWorks article and how to
proceed.
- Follow Rational software on Facebook, Twitter
(@ibmrational), and YouTube,
and add your comments and requests.
- Ask and answer questions and
increase your expertise when you get involved in the Rational forums, cafés, and wikis.
- Get social about thought
leadership. Join the Rational community to share your Rational software
expertise and get connected with your peers.

Venumadhav Vanagondi has more than five years of experience as a software performance analyst. He has worked with several IBM customers in resolving performance problems and is proficient in using performance estimation, testing, and monitoring tools. He holds a master's degree in computer science from the Indian Institute of Technology Madras.

Sanjay Singh has around 12 years of experience in designing and developing high-performance, scalable enterprise software in content management, telecom, and finance. He has been with IBM for last five years and is a senior member of the ECM team in the IBM India Software Lab. Sanjay has a B. Tech. degree from the Indian Institute of Technology Kanpur.





