IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Developing client applications for BPEL processes and tasks > Create plug-ins to customize human task functionality

Use a plug-in to post-process people query results

People resolution in Business Process Choreographer returns a list of the users that are assigned to a specific role, for example, potential owners of a task. You can create a plug-in that changes the results of people queries that are returned by people resolution.

For example, to improve workload balancing, you could remove users from the query result who already have a high workload.

To modify the results that are returned by people assignment and people substitution, you must write a class that implements the plug-in interface, assemble a JAR file for the plug-in, then install and activate it.

Complete the following steps to create a plug-in to post-process people query results.


Procedure

  1. Implement your people query result post-processing plug-in. Write a class that implements either the StaffQueryResultPostProcessorPlugin interface or the StaffQueryResultPostProcessorPlugin2 interface.

  2. Create an installable JAR file.

    1. Assemble your plug-in class and its helper classes into a JAR file.

    2. Create a service provider configuration file for the plug-in in the META-INF/services/ directory of your JAR file. The configuration file provides the mechanism for identifying and loading the plug-in. This file must conform to the Java™ EE service provider interface specification.

      1. In a text editor, create a service provider configuration file with the name com.ibm.task.spi. plug-in_nameStaffQueryResultPostProcessorPlugin, where plug-in_name is the name of the plug-in. The name of the configuration file does not depend on the name of the interface that you implemented.

        For example, if your plug-in is called MyHandler and it implements the com.ibm.task.spi.StaffQueryResultPostProcessorPlugin2 interface, the name of the configuration file is com.ibm.task.spi.MyHandlerStaffQueryResultPostProcessorPlugin.

      2. In the first line of the file that is neither a comment line (a line that starts with a number sign (#)) nor a blank line, specify the fully qualified name of the plug-in class created in step 1.

        For example, if your plug-in class is called StaffPostProcessor and it is in the com.customer.plugins package, then the first line of the configuration file must contain the following entry: com.customer.plugins.StaffPostProcessor.

    You have an installable JAR file that contains a plug-in that post-processes people query results and a service provider configuration file that can be used to load the plug-in.

  3. Install the JAR file in a shared library in the application server and associate it with the Human Task Manager application.

    1. Define a WebSphere Application Server shared library for the plug-in on the scope of the server or cluster where Business Process Choreographer is configured. For more information about using shared libraries, see the related task link.

    2. Associate the shared library with the TaskContainer application.
    3. Make the plug-in JAR file available to each affected Process Server that hosts a server or a cluster member.

  4. Configure the Human Task Manager to use the plug-in.

    1. In the administrative console, go to the Custom Properties page of the Human Task Manager.

      Click either Servers > Clusters > WebSphere application server clusters > cluster_name or Servers > Server Types > WebSphere application servers > server_name, then on the Configuration tab, in the Business Integration section, expand Business Process Choreographer, and click Human Task Manager. Under Additional Properties, select Custom Properties.

    2. Add a custom property with the name Staff.PostProcessorPlugin, and a value of the name that you gave to your plug-in, for example, MyHandler.

    The plug-in is now available for post processing people query results.

  5. Restart the server to activate the plug-in. The post processing plug-in is invoked after both the people assignment and people substitution have run.

    If you modify the plug-in, you must replace the JAR file in the shared library, and restart the server.

Create plug-ins to customize human task functionality


Related tasks:

Manage shared libraries


Related information:

Enterprise JavaBeans specification
Java 2 service provider interface specification
Sample: People assignment customization using the Post Processor Plugin