Introduction to FileNet P8 Component Integrator
The FileNet P8 Component Integrator makes it possible to interact with an external entity called a component which could be either a Java object or Java Messaging System (JMS). You can use it to import the Java classes and manage the communication between the process engine and the interfaces. The Component Integrator includes adaptors which are interfaces that communicate events from the process engine to external entities such as Java objects. Adaptors interact with different types of components from a workflow step.
Figure 1 shows the steps you should take to create a Java component queue in the Component Integrator.
Figure 1. Steps to create a Java component work performer in the Component Integrator

As shown in the chart above, the first step is to configure and deploy the components (1). You can use the FileNet P8 Process Configuration Console to create a component queue (2 and 3).
Next, deploy the necessary jar files for the component on the Application Engine server, and register the component in the Process Task Manager (4 and 5). The Process Designer retrieves configuration information from the Process Engine (6).
Then create workflow definitions. You can create a component step and select the registered component and method to invoke. You need to also specify the workflow fields that will be passed as parameters to the method at runtime (7). The workflow definitions (requests for work) are then transferred to Process Engine queues (8).
Figure 2 depicts the runtime interaction between the Component Integrator and Application Engine services such as the component manager, the process engine queues, and a custom entity shown in the same figure. When the workflow process is executed, the Component Manager retrieves the request from the component queues and invokes the components via the adaptors. For each step in the workflow, the following general sequence of events takes place. First, information is sent to the component via the adaptor. Then, the component performs its work and interacts with the custom entity. Finally, the work result is saved in the step.
Figure 2. The runtime interaction of the Component Integrator

We'll introduce how the Component Integrator works before we implement the Component Integrator based work performer.
We define a process operation that associates parameter values with a component method. Using process operations, we can pass work item fields' values to a component method. When a running workflow has a work item that reaches a component step (a component that has been created as a step in a workflow), the Component Integrator automatically performs a series of operations. The method automatically reads the work item field values, waits for a response from the component method, updates work item field values according to any changes resulting from the execution of the component method, saves the work item and unlocks it. Lastly, the method completes the step by dispatching the work item to a subsequent step.
Implement the Component Integrator based work performer
Now you should have an elementary understanding of how to implement a Component Integrator-based work performer. It is time to examine the following five major steps to accomplish this implementation.
- Deploy a custom Java class.
- Use the Process Configuration Console to create a component queue and define component queue operations.
- Use the Process Task Manager to start and stop the Component Manager and to start and stop components.
- Use the Process Designer to create a business process and add the registered Java component queue to the process.
- Use FileNet Workplace to validate the business process.
In Part 2, you created the Java Business Entities for the IBM Content Manager repository as well as a gateway class for operation methods of these Java Business Entities. Now you'll register the gateway class into the Component Integrator to create a component queue. After that, you can use all the operation methods in the process definition. After that, the business process can freely interact with the IBM Content Manger repository via this component queue. The following sections describe how to do it.
There are three parts for the custom Java class.
- The Java business entities
- The gateway class
- The Java Authentication and Authorization Service (JAAS) class and configuration file
The Java business entities and the gateway class have been implemented in Part 2. Here you only need to create the JAAS class and configuration file. Why do you need JAAS classes and configuration file? The reason is that the FileNet P8 Component Integrator uses the JAAS to perform the authentication. You should create the JAAS authentication module and login configuration file for the Java business entities class. To configure the JAAS, you should complete the following 5 steps:
1. First, create a LoginModule class for the system that the custom class accesses. You can follow the Login Module Developer's Guide and the JAAS Authentication Tutorial to create the LoginModule classes. SampleLoginModule.java implements the desired underlying authentication. SampleLoginModule's user authentication simply verifies that the name and password that user inputs have specific values. The SampleLoginModule's source code is shown below.
Listing 1. The sample loginModule code - SampleLoginModule.java
public class SampleLoginModule implements LoginModule
{
private Subject m_subject;
private CallbackHandler m_callbackHandler;
private Map m_sharedState;
private Map m_options;
private String m_username = null;
private boolean m_validSession = true;
// testUser's SamplePrincipal
private SamplePrincipal m_principal;
public void initialize(Subject subject,
CallbackHandler callbackHandler, Map sharedState, Map options)
{
this.m_subject = subject;
this.m_callbackHandler = callbackHandler;;
this.m_options = options;
this.m_sharedState = sharedState;
}
public boolean login() throws LoginException
{
if (m_callbackHandler == null)
{
throw new LoginException("Error:
no CallbackHandler available to get authentication information");
}
String password = null;
m_username = (String)m_sharedState.get("javax.security.auth.login.name");
password = (String)m_sharedState.get("javax.security.auth.login.password");
if (m_username == null)
{
Callback[] callbacks = null;
callbacks = new Callback[3];
callbacks[0] = new TextOutputCallback(TextOutputCallback.INFORMATION,
"Sample Authentication");
callbacks[1] = new NameCallback("user name:");
callbacks[2] = new PasswordCallback("password:", false);
try
{
m_callbackHandler.handle(callbacks);
m_username = ((NameCallback)callbacks[1]).getName();
char[] tmpPassword = ((PasswordCallback)callbacks[2]).getPassword();
if (tmpPassword != null)
password = new String(tmpPassword);
else
password = null;
((PasswordCallback)callbacks[2]).clearPassword();
m_sharedState.put("javax.security.auth.login.name",m_username);
m_sharedState.put("javax.security.auth.login.password", password);
}
catch (java.io.IOException ioe)
{
throw new LoginException(ioe.toString());
}
catch (UnsupportedCallbackException uce)
{
throw new LoginException("Error:
no CallbackHandler available to get authentication information");
}
}
try
{
}
catch (Exception e)
{;
throw new LoginException(e.toString());
}
m_validSession = true;
return (m_validSession);
}
...
}
|
The SamplePrincipal.java is a sample class that implements the java.security.Principal interface. It is used by SampleLoginModule.
Listing 2. The sample principal code - SamplePrincipal.java
public class SamplePrincipal implements Principal, java.io.Serializable
{
private String name;
public SamplePrincipal( String name )
{
if( name == null )
throw new NullPointerException( "illegal null input" );
this.name = name;
}
public String getName()
{
return name;
}
public String toString()
{
return ("SamplePrincipal: " + name);
}
public boolean equals( Object o )
{
if( o == null )
return false;
if( this == o )
return true;
if( !(o instanceof SamplePrincipal) )
return false;
SamplePrincipal that = (SamplePrincipal) o;
if( this.getName().equals( that.getName() ) )
return true;
return false;
}
public int hashCode()
{
return name.hashCode();
}
...
}
|
2. Secondly, create a jar file to hold the custom Java class and corresponding LoginModule classes. You need to package the JAAS LoginModule classes and the gateway class in this jar. For convenience, you can also download the jar named ICMOperations.jar from the Download section.
3. Then, create a JAAS Login Configuration file containing a LoginContext section. The following code shows the login configuration file. You can append the text to the FileNet Router's default JAAS configuration file taskman.login.config. This file is located in filenet_installation_directory/AE/Router. You can get the taskman.login.config in the Download section.
Listing 3. The JAAS configuration
Sample
{
filenet.vw.server.VWLoginModule required;
com.ibm.cm.businesslogic.operations.jaas.SampleLoginModule required debug=true;
};
|
4. Next, deploy the JAAS Login Configuration file, customized JAR file and the required JAR files by copying these files to the deployment location on the Application Engine server. Actually, you can also copy these files to any location you want to. In general, it would be filenet_installation_directory/AE/Workplace/WEB-INF/lib.
5. Finally, stop the Component Manager and specify the custom JAR file you have created as one of the required Java libraries in the Component Manager. In Figure 3, we add the JAR file ICMOperation.jar and also the related JAR files. You can download the relatedJARFiles.zip JAR files in the Download section.
Figure 3. Add the JAR file and the related JAR files into the Component Manager

Note: If the Java class has dependent modules included neither in the JAR file nor in the existing specified required libraries, it is also needed to specify the jar files containing the dependent modules as required libraries. Since the Java Business Entities are using CM OOAPI to communicate with Content Manager repository, you should catalog the database before executing them. Refer to this guide to perform the catalog.
Create a component queue and define component queue operations
You use the Process Configuration Console to create and configure a component queue for the deployed custom Java class or the JMS queue. Only one class or JMS queue can be associated with a single Process Engine component queue. However, you can configure multiple component queues for any given class or JMS queue by assigning different names to the additional component queues. For instructions, see Configuring Component Queues.
In the ABC Company’s Auto Insurance Claim system, you may only register one Java component; it's easy to design the business process with the use of Process Designer. Now you'll register a new component queue step by step.
First, launch the FileNet Workplace Process Configuration Console and register additional classes for this Java component. Figure 4 shows this step. If the Java component JAR file has some related Java class files or jar files, you should register them before creating new Java component queues.
Figure 4. Add the JAR file and the related JAR files into the Component Manager

After the registration of some additional jar files, you create a new Java component queue. You can specify any wanted name. Figure 5 shows this step.
Figure 5. Create a new java component queue

Now, choose the Java adaptor for the Java component queue. You may choose the jar file which contains the custom Java class and the JAAS configuration class. In our case, it is ICMOperation.jar. You should also choose the custom Java class which exposes all the operation methods. In the same case, it is ICMOperation.class. Figure 6 shows this step.
Figure 6. Configure the Java adaptor files

In this step, set the Java adaptor properties and the JAAS credentials such as the user name, password and the configuration context. In this case, input the following configuration Figure 7 shows.
Figure 7. Configure the Java adaptor properties and the JAAS credentials

In Figure 8, set operation methods you want to expose. Only public methods can be exposed.
Figure 8. Configure the operations.

In the end, save the created component queue. Figure 9 shows this step.
Figure 9. Save the created component queue

Now you have created a component queue which can expose all the function methods of the Java Business Entities.
Refresh all the configurations
After you have created the new component queue, refresh all the configurations with the Process Task Manager to make the created component queue available in the Component Manager. Figure 10 shows this step.
Figure 10. Refresh all the configurations

Now you can see the created component queue available in the component manager, as Figure 11 shows.
Figure 11. The brand-new component queue available in the Component Manager

After all these configurations, you can directly use this new component queue in the business process. You can see the component queue methods available in the Process Designer. Figure 12 shows these component queue methods.
Figure 12. The created component queue ICMOperations is available in the Process Designer

In Part 3 you've registered your created ABC Company's Auto Insurance Claim system's Java business entity objects into the FileNet P8 Component Integrator, used the Process Task Manager to manipulate the new component queue and made this component queue available for the business process.
Part 4 will describe how to use FileNet Business Process Designer to implement a workflow definition to utilize the brand-new created component queue and how to execute this business process.
| Description | Name | Size | Download method |
|---|---|---|---|
| JAAS configuration file | taskman.login.config | 1KB | HTTP |
| JAAS Configuraion and Gateway class jar | ICMOperations.jar | 9KB | HTTP |
| Related jar files | relatedJARFiles.zip | 10.0MB | HTTP |
| Install and Configure CM runtime client | configure.txt | 1KB | HTTP |
Information about download methods
Learn
-
Visit the developerWorks Enterprise Content Management to expand your Content Manager skills and link to articles, tutorials, documentation, and so on.
-
Visit the FileNet Business Process Manager to learn more about Business Process Management skills.
-
Visit the IBM FileNet P8 4.0 to learn more about the whole platform about FileNet P8.
Get products and technologies
- Download
FileNet Content Manager demo
to see how IBM FileNet P8 integrates content, process, and compliance to streamline, manage, and optimize an auto claim handling process.
- Download
IBM product evaluation versions
and get your hands on application development tools and middleware products from
DB2®, Lotus®, Rational®, Tivoli®, and
WebSphere®.
Discuss
- Check out
developerWorks blogs and get involved in the developerWorks community.

Jingguo Yao is a staff software engineer in IBM China Software Development Lab (CSDL). He works on IBM Content Manager development.
Comments (Undergoing maintenance)







