Customizing the Oracle BPM Worklist can be done by creating and adding a Worklist Decorator class to your configuration. There are many reasons why you may want to do this. You may want to color code low, medium and high priority work items, format a display value with an icon or image, or you may just want to alternately shade lines in the BPM workspace as shown below.
Oracle BPM versions 6.x to 10g (Aqualogic BPM ) allow you to do this. For the complete java class see WorkListDecorator Sample Code below. This code implements three methods that can be used to alter the way the work list appears these methods are as follows:
public String getCellStyle(String viewName, InstanceInfo instance, Column columnInfo, int rowNo) ;
public String getRowStyle(String viewName, InstanceInfo instance, int rowNo) ;
public String getValue(String viewName, InstanceInfo instance, Column columnInfo, Locale locale, String value, int rowNo) ;
These three methods are call-back methods used by the BPM Workspace application to get custom attributes associated with the work-list. The input parameters contain pertinent important information you can use to decorate the work-list as required. This information is described in the table below.
| Field Name | Description |
| String viewName | Name of the view. The default work-list name is unified-inbox. If you create custom views, this will be populated with the name of the custom view. |
| InstanceInfo instanceInfo | Contains detailed information about the instance; like activity name, instance name, instance variables and process details. |
| Column | Contains information about the column, like column size, format and ID. |
| Locale locale | Contains information about the locale |
| String value | Contains the display value (String contents) of the field value. |
| int rowNo | The row number starting with zero. |
<br/>
To register your custom decorator object with your workspace, locate the workspace.properties files and modify the entry as show below. This file is located in the <BPM_HOME>/webapps/workspace/WEB-INF directory
fuego.workspace.worklist.styleResolverClassname=com.ssglimited.workspace.view.WorkListDecoratorImpl
You will need to compile your WorkListDecorator object and place the complied java object (.class) or jar file in the <BPM_HOME>/webapps/workspace/WEB-INF/classes or <BPM_HOME>/webapps/workspace/WEB-INF/lib directory. If you are using BPM in an application server like Weblogic, you will need to re-build the workspace and redeploy the workspace ear file. This can be done in the Process Administrator.
If you are having difficulty getting this to work, turn on the Workspace log. For enterprise versions, simply look in the App Server console or edit the logging in the workspace.properties file. For Studio, refer to my blog post on Workspace Logging.
WorkListDecorator Sample Code for Shading lines in the Work-list
</code>
package com.ssglimited.workspace.view;
import java.util.Locale;
import fuego.workspace.model.view.WorkListDecorator;
import fuego.papi.InstanceInfo;
import fuego.papi.Presentation.Column;
public class WorkListDecoratorImpl implements WorkListDecorator{
public String getCellStyle(String viewName, InstanceInfo instanceInfo, Column columnInfo, int rowNo) {
return "";
}
public String getRowStyle(String viewName, InstanceInfo instanceInfo, int rowNo) {
String inlineStyle="background-color: #ffff"; //White
if (rowNo % 2 > 0) {
inlineStyle="background-color: #f8f8f8"; //Gray
}
return inlineStyle;
}
public String getValue(String viewName, InstanceInfo instance, Column columnInfo, Locale locale, String value, int rowNo) {
// System.out.println("***Mark Test **** "+viewName+" column"+ arg2.getId()+"arg4"+ value +" "+rowNo);
return value;
}
}