Part 2 of this series showed you how to use WebSphere Business Modeler V6.1 to refine your end-to-end business process models. With the new features in Modeler V6.1, process owners can now model and simulate a complete view of their business processes, which can be deployed on all IBM business process management (BPM) systems, including FileNet and WebSphere Process Server. In Part 3 of this series, you'll learn how to take the implementation artifacts that are exported from the Modeler process models, perform the necessary customization in WebSphere Integration Developer V6.1 and FileNet P8 V4.0.2, and generate an end-to-end simple claim process that spans WebSphere Process Server and FileNet P8, and uses capabilities from both BPM systems.
Import the XPDL into FileNet Process Designer
Part 2 included the generated XPDL file for the ArchiveClaim process. The first thing you need to do is import that XPDL file into FileNet and prepare the subprocess for invocation by the BPEL process. To do this, complete the following steps:
- In the FileNet Workplace Web interface, select Author => Advanced Tools => Process Designer to open the FileNet Process Designer.
- In the Process Designer, select File => Open to import the XPDL
file into the Process Designer as shown in Figure 1.
Figure 1. ArchiveClaim XPDL imported into FileNet
The Archive Approved Claim and Archive Unapproved Claim tasks are transformed into a FileNet general step. The IsClaimApproved decision node is transformed to a FileNet condition routing branch [1] and [2]. The Modeler condition expressions are converted into FileNet condition routing expressions (for example,
ClaimApprovedRep = false). - In the Process Designer, select View => Workflow properties => Data
Fields. The ClaimNumberRep and ClaimApprovedRep repositories are converted
to FileNet data fields as shown in Figure 2.
Figure 2. Modeler repositories transformed into FileNet data fields
Create FileNet folders for archival
A FileNet attachment is a link to information that a participant uses to complete a step in a workflow. In our simple claim process, the submitted claim form and photos of the accidents are examples of attachments. FileNet P8 provides an object store for storing such objects. In this example, we'll create two folders,, ApprovedClaimFolder and UnapprovedClaimFolder, in the FileNet object store. Approved claims attachments will be stored in the ApprovedClaim folder, and rejected claims attachments will be stored in the UnapprovedClaim folder, so that they can be retrieved for future auditing after the process instance has been completed.
Use FileNet content engine to archive documents
The FileNet Content Manager content engine facilitates the manipulation of documents in FileNet object store. To use the FileNet content engine in the workflow, you first need to associate the attachments from the workflow with the folders you created.
- In the Process Designer, select View => Workflow properties => Attachments.
- Create the three attachments ApprovedClaim, RejectedClaim, and ClaimDoc, as shown
in Figure 3. Set the target for the ApprovedClaim attachment to the
ApprovedClaimFolder, and the target for the RejectedClaim to the
RejectedClaimFolder. The ClaimDoc attachment is mapped at run-time to the
target attachment (for example, photo) that needs to be archived.
Figure 3. Define attachments and their target folders
- Now change the Archive Approved Claim and Archive Unapproved Claim general
steps into component steps by right-clicking on each of the steps and selecting
Change Step Type => Component Step, as shown in Figure 4.
Figure 4. Change the archive general steps into component steps
- In the Operation Selection page, select file for the attached documents
as shown in Figure 5.
Figure 5. Define the file operation parameters
- The file operation takes two parameters: a
sourceDocumentand adestFolder, as shown in Figure 6. For both paths, you need to set thesourceDocumentto ClaimDoc. You'll learn how to set this parameter in Make the ArchiveClaim process into a Web service and export its WSDL. Set thedestFolderto ApprovedClaim and RejectedClaim, which you defined in step 2.
Figure 6. Select the FileNet content engine file operation
Make the ArchiveClaim process into a Web Service and export its WSDL
In order to make the FileNet ArchiveClaim process invocable by the BPEL SimpleClaim process, you need to provide a Web service interface for it. To do this, complete the following steps:
- Add a Receive step to the FileNet workflow.
- Define the Web Service Partner link name.
- Add the partner link to the Receive step and create parameters. In this example, you need to create the following parameters: ClaimNumber for the claim ID, ClaimApproved indicating whether the claim was approved, and ClaimDoc containing the metadata about associated attachments such as a photo. You'll see how to set these parameters from the BPEL process in the next section.
- Rewire the workflow to include the Receive step.
Figure 7 shows the updated ArchiveClaim process.
Figure 7. Receive step added to enable the process for Web service invocation
You have now implemented the ArchiveClaim. - Select File => Validate to validate the process.
- Select File =>Transfer to deploy it on the FileNet engine.
- When the process is deployed, a WSDL file is generated. You need to get a copy
of the WSDL file to imported into the ExpressClaim BPEL process, so that
ExpressClaim can call the ArchiveClaim process running on FileNet. To do this,
select View => Workflow Properties => Web Services to open
the ArchiveClaim partner links in the Web Services Explorer, as shown in Figure
8. You'll find the WSDL definition at the URL specified in the WSDL URL
field.
Figure 8. Locate the generated WSDL
Import the project interchange file into Integration Developer
Part 2 of this series included the generated Integration Developer project interchange file for importing into Integration Developer. You need to make the following changes in Integration Developer, as described in the following sections:
- Generate a user interface for the human task.
- Replace the ArchiveClaim WSDL with the ArchiveClaim WSDL generated from FileNet and modify the BPEL to use the FileNet WSDL.
- Write a JAX-RPC handler to handle attachments.
The download includes the modified Integration Developer project interchange files.
Generate a user interface for the human task
Generate a client application for the Process Claim human task based on the Lotus® form (ProcessClaimForm.xpdl) you created in Modeler in Part 2. To generate the client application, select Generate User Interfaces from the Insurance module and select ExpressClaim, as shown in Figure 9. A J2EE project is created. Install this project into Process Server, along with the Insurance application.
Figure 9. Generate a Web UI for the process claim human task
Modify BPEL to use the FileNet-generated WSDL
The WSDL exported from FileNet contains the new service endpoint that you need to
use. Replace the original WSDL with the new WSDL and update the ArchiveClaim
import in the assembly diagram. In the ExpressClaim BPEL flow, add a new
Assign element, as shown in Figure 10, to assign the
ClaimNumber and
ClaimApproved parameter values from the Claim business
object to the FileNet ArchiveClaim process interface parameters.
Figure 10 - Add an Assign Element to assign values to the FileNet ArchiveClaim process
But what about the ClaimDoc that contains the metadata about the associated attachments that we defined in Make the ArchiveClaim process into a Web Service and export its WSDL? This attachment requires some custom coding. First let's look at the schema that FileNet generated when we generated the WSDL for the ArchiveClaim process, shown in Listing 1.
Listing 1 - XSD Schema generated by FileNet for invoking ArchiveClaim
<xsd:complexType name="AClaimPTarchiveClaimInputType0">
<xsd:sequence>
<xsd:element name="ClaimApproved" type="xsd:boolean"/>
<xsd:element name="ClaimNumber" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="AClaimPTarchiveClaimInput"
type="tns:AClaimPTarchiveClaimInputType0"/>
<xsd:complexType name="AClaimPTarchiveClaimInput3Type1">
<xsd:sequence>
<xsd:element name="ClaimDoc" type="xsd:base64Binary"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="AClaimPTarchiveClaimInput3"
type="tns:AClaimPTarchiveClaimInput3Type1"/>
|
As expected, ClaimApproved and ClaimNumber are simple XSD types, and we can simply use the BPEL Assign function to set them. However, ClaimDoc is a binary type, and FileNet expects it to be created as an element in the SOAP body with some special attributes. These attributes tell FileNet how to extract the SOAP attachments. In order to set up the ClaimDoc parameter and its corresponding FileNet attributes, as well as add the photo attachment, you need to create a custom JAX-RPC handler, as described in the next section.
Use a JAX-RPC handler to add attachments
SOAP attachments provide a means of sending data that is ill-suited for inclusion in a SOAP XML message, such as arbitrary binary data. When the ExpressClaim BPEL process invokes the FileNet ArchiveClaim process to archive the claim and accompanying documents, such as an accident photo, the photo is sent to the ArchiveClaim service via a SOAP attachment.
To intercept the SOAP message to add the attachment before the ArchiveClaim process is called, you can add a simple client-side JAX-RPC handler. The handler will intercept the SOAP message before it invokes the actual service.
The project interchange zip file includes an
AttachmentHandler.java class. This class implements the
handleRequest method, which is invoked by the framework
when the SOAP message arrives. Listing 2 shows a snippet of the code that adds the
photo as an attachment to the SOAP message, as well as other attributes that
FileNet requires. You can find the complete code in the
download.
Listing 2. JAX-RPC handler to add SOAP attachment
public boolean handleRequest(MessageContext context) {
// Get the SOAP message
SOAPMessageContext smc = (SOAPMessageContext) context;
SOAPMessage sMessage = smc.getMessage();
SOAPEnvelope soapEnvelope = smc.getEnvelope();
//
// Create an attachment for the photo and add it to the SOAP message
//
FileDataSource fds = new FileDataSource( new File(getAccidentPhoto()) );
DataHandler dh = new DataHandler(fds);
AttachmentPart attachment = sMessage.createAttachmentPart();
attachment.setDataHandler(dh);
sMessage.addAttachmentPart(attachment);
//
// Add ClaimDoc to the message and add FileNet required attributes to ClaimDoc
//
claimDoc = soapEnvelope.createName("ClaimDoc", "claim", uri);
...
claimDoc.addAttribute(href, getContentId());
claimDoc.addAttribute(docFileName, getFileName());
claimDoc.addAttribute(docTitle, getTitle());
...
}
|
To register the AttachmentHandler to be called by the Web service, you need to add it to the deployment descriptor for the Insurance module using the Deployment Descriptor editor, as shown in Figure 11.
Figure 11. Update deployment descriptor to include attachment JAX-RPC handler
To run the application, open the Business Process Choreographer Explorer. Once the application is running, browse the FileNet ObjectStore and locate the attachments that are archived for the insurance claims in either the ApprovedClaimFolder or UnapprovedClaimFolder, as shown in Figure 12.
Figure 12 - FileNet content repository
In this article you learned how to quickly integrate processes running on WebSphere Process Server and FileNet using Web services. By taking advantage of the flexible SOA architectural style, you can leverage the strengths of both content-centric BPM using FileNet, and process-centric BPM using Process Server. In the Part 4, you'll learn how to monitor the sample simple claim business process that is running on both Process Server and FileNet P8.
| Description | Name | Size | Download method |
|---|---|---|---|
| Sample workspace artifacts | download.zip | 7.3KB | HTTP |
Information about download methods
Learn
-
Business Process Management with SOA, Part 1: Gathering monitoring metrics to analyze your business process
(developerWorks 2007): Part 1 shows you how to use WebSphere Business Monitor and
WebSphere Business Modeler to analyze monitored data to help identify processes
that need improvement.
-
Business Process Management with SOA, Part 2: Improve your business process with business rules, forms and content management
(developerWorks 2008): Part 2 shows you how to use some of the new features in
WebSphere Business Modeler V6.1 to enhance your business process definitions so
that process owners can model their end-to-end business processes regardless of
where they are deployed.
-
What is new in WebSphere Business Modeler 6.1
(developerWorks 2007): This article describes the new features of WebSphere
Business Modeler V6.1 that enhance business user productivity, support BPM
interoperability, and improve business modeling.
-
IBM
FileNet P8 Platform Product Documentation:
Get product documentation for FileNet P8.
-
How to create
a simple JAX-RPC handler
(developerWorks 2003): This article describes how you can build a simple handler
that measures the time it takes to execute a particular request and log the result
in a file.
-
SOAP 1.2 Attachment Feature: Read
the documentation on the attachment feature.
-
FileNet Business Process Manager:
Get product information, including features and benefits.
-
Build BPM applications using FileNet, Part 1: A guided tour to content and process modeling with the FileNet P8 platform
(developerWorks 2007): This is the first in a series of three articles introducing
you to the process of building Business Process Management (BPM) applications
using the IBM FileNet P8 platform and the Business Process Framework (BPF).
-
developerWorks BPM zone:
Get the latest technical resources on IBM BPM solutions, including downloads,
demos, articles, tutorials, events, webcasts, and more.
-
Business Process Management enabled by SOA:
Get product information, including features and benefits.
-
WebSphere Business Modeler V6.1:
Get product information, including features, benefits, demos and trial downloads.
-
WebSphere Integration Developer V6.1:
Get product information, including features and benefits.
Get products and technologies
-
WebSphere Process Server V6.1:
Get product information, including features and benefits.

Alex Fernandes is an Advisory Software Developer at IBM's Toronto Canada lab. He is part of the BPM Architecture and Advanced Technology team. Alex's past experience includes relational and multidimensional database modeling. You can reach Alex at afernand@ca.ibm.com.

Christina Lau is a Senior Technical Staff Member at IBM. Christina leads the BPM Architecture and Advanced Technology Team in WebSphere, focusing on next-generation BPM technologies and consumability improvements in the BPM solution stack. You can reach Christina at clau@ca.ibm.com.

Bhadri Madapusi is a Software Developer working in the IBM Toronto Lab. He earned his MSc in Information Systems from BITS, India, and his MSc in Computer Science from Queens University, Canada. His interests include software modeling, design patterns, and data management. You can read Bhadri at bhadrim@ca.ibm.com.
Comments (Undergoing maintenance)





