This tutorial describes the integration of DB2 Content Manager Enterprise Edition Version 8.3 with WebSphere Process Server V6.0.1. This document consists of the the following chapters:
DB2 Content Manager Enterprise Edition V8.3 includes a high-performance document routing engine to direct documents and folders of documents from one user to another. For complex process automation requirements such as those that involve human tasks outside the document environment or integrations with a variety of applications, systems and services, WebSphere Process Server is the process management environment of choice.
WebSphere Process Server uses a service-component architecture to deliver one programming model to connect and use existing IT resources to solve business problems. Using simplified tooling to describe and create the solution, components can be brought together to create a managed business process. Processes can be based on automated steps that together constitute a single transaction or they can involve human interaction and can run for days, weeks or months. Processes types vary greatly, ranging from Web services or Web page navigation to business transaction support.
The DB2 Content Manager / WebSphere Process Server (CM/WPS) Integration Quick Start provides some key ingredients for the creation of content-centric processes. The term "content-centric" refers to a process in which a content object, typically a document or image, stored in the content management system plays an important role. Examples are review processes such as those involved in publishing, invoice processing, or claims handling. Content-centric processing is also seen in Business To Business (B2B) scenarios where electronic documents are exchanged between different companies.
Human activities and automated steps that modify the content object are key elements of content-centric processes. The content object is usually a folder and is said to be routed through the process or (work)flow. Modifying it can mean a number of things such as adding documents to or removing documents from the folder, changing attribute values on documents, modifying access rights, adding annotations, signatures, or watermarks, etc.
The DB2 Content Manager / WebSphere Process Server Integration Quick Start provides best practices and pre-assembled building blocks that support the creation and management of content-centric processes based on the WebSphere Process Server and DB2 Content Manager environments. Typical interaction patterns between the process engine and the content management system are demonstrated through code samples and comprehensive documentation.
This Quick Start builds on previous versions which showed interaction between DB2 Content Manager and the Business Process Choreographer component of WebSphere Business Integration Server Foundation.
The main topic of Revision 2 is support of WebSphere Process Server V6. Revision 2 of the Integration Quick Start consists of the following elements:
The Integration Toolkit is a collection of service components (Java classes and EJBs) that implement the following interaction patterns between the content management and process management system:
The Quick Start Client is a Web application that enables process users to see work that is assigned to them, fetch work items and work with content objects in DB2® Content Manager Enterprise Edition V8.3. Though the Quick Start Client is customized for use with the Auto Claims Process it provides generic out of the box capabilities and can easily be adjusted to the needs of other processes.
The Auto Claims Process illustrates how the Integration Toolkit can be used to create a content-aware process. This process involves human-based activities that can be performed using the Quick Start Client, services provided by the Integration Toolkit and some simulated internal or external Web services that can involve legacy applications or B2B transactions.
The Integration Toolkit and the Quick Start Client are provided as sample code. They also serve as educational resources for learning how to integrate the two products. The Quick Start Guide that can be downloaded below describes how the source code can be modified to meet specific requirements of a custom integration solution. See the license statements in the documentation or source files for details.
The following statements apply to the source code of the DB2 Content Manager / WebSphere Process Server Integration Quick Start:
Licensed Materials - Property of IBM IBM DB2 Content Manager Enterprise Edition V8 (program number 5724-B19) (c ) Copyright IBM Corp. 1994, 2005. All Rights Reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. DISCLAIMER OF WARRANTIES : Permission is granted to copy and modify this Sample code, and to distribute modified versions provided that both the copyright notice, and this permission notice and warranty disclaimer appear in all copies and modified versions. This software is provided "AS IS." IBM and its Suppliers and Licensors expressly disclaim all warranties, whether EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR WARRANTY OF NON-INFRINGEMENT. IBM AND ITS SUPPLIERS AND LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFEREDBY LICENSEE THAT RESULT FROM USE OR DISTRIBUTION OF THE SOFTWARE OR THE COMBINATION OF THE SOFTWARE WITH ANY OTHER CODE. IN NO EVENT WILL IBM OR ITS SUPPLIERS AND LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF IBM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
The integration toolkit requires a DB2 Universal Database-based library server and it does not support z/OS or i5/OS environments, nor clustered environments.
See Trademarks for details on the trademarks used in this document.
For both the development and runtime environments, the DB2 Content Manager library server needs to be based on a DB2 Universal Database V8. For details on the required DB2 UDB fixpack levels see the DB2 Content Manager product documentation. The integration toolkit only supports a DB2 Universal Database-based library server. Note that Fixpack 2 of DB2 Content Manager V8.3 is a prerequisite of the CM/WPS Integration Quick Start if you want to use the Custom CM-based user registry. Where DB2 Content Manager V8.3 is mentioned in the following sections this alway implies at least Fixpack 2.
The following system configuration is required for the development and test environment (chapter 2):
The development workstation as well as the server should have at least 1 GByte of main memory. However, at least 2 GByte are recommended.
This guide uses Windows platform conventions for path names. Before proceeding we recommend that you look up the install directories of the following products because they will be used later in this guide:
<IBMCMROOT> |
= | DB2 Content Manager installation folder (e.g. c:\Program
Files\IBM\db2cmv8 or /usr/db2cmv8 ) |
<DB2HOME> |
= | home folder of the DB2 instance which hosts the Content Manager
library server (e.g. c:\Program Files\IBM\sqllib or /home/db2inst1/sqllib ) |
<WID_HOME> |
= | WebSphere Integration Developer install folder (e.g. c:\Program
Files\IBM\Websphere\ID\6.0 ) |
<WPS_HOME> |
= | WebSphere Process Server install folder (e.g. c:\Program
Files\IBM\Websphere\ProcessServer ) |
<WPS_PROFILE_HOME> |
= | folder of the WebSphere Integration Developer profile to be used
on the development workstation (e.g. c:\Program
Files\IBM\Websphere\IntegrationDeveloper\profiles\ProcSrv01 ) |
Note that we are using the default icmadmin
to refer to
the ID of the library server administrator. If the ID of your library
server administrator is different, replace all occurences of icmadmin
with the ID used on your system.
We recommend starting with 2. Setting up the Development Environment and Testing the Sample Process as this lays the foundations for further explorations in the area of integrating content and workflow. This chapter describes how to set up the infrastructure to build and test integrated workflows. You may want to take a tour of the sample process as described in 3. A Tour of the Sample Process. 4. Developing a Custom DB2 Content Manager / WebSphere Process Server Integration Solution introduces the individual elements of the Integration Toolkit and describes the steps necessary when creating a custom CM/WPS integration solution based on the Integration Toolkit and Quick Start Client 5. Invoking DB2 Content Manager Web Services from within a process outlines how Content Manager Web Services can be incorporated into a process. 6. Hints and Troubleshooting provides some hints and tips which may be useful when working with the sample. 7. Further Reading provides links to product documentation, Redbooks and Support pages.
This chapter describes the steps needed to set up a development environment for the Integration Quick Start. At the end of this chapter the Quick Start Client can be used to work the sample process and to explore the results of running the server-side integration functions. Depending on the reader's previous experience with the WebSphere Studio Application Developer environment, completing this paragraph will take approximately 1-2 hours.
Detailed instructions on how to install and configure the required software can be found in the product documentation. See 7. Further Reading at the end of this document. This section contains some hints about configuration settings that are specific to the use of these products in the context of the Integration Quick Start. See 1.3 Software Requirements for details on the system configuration required for chapter 1.
Installation hints for Information Integrator for Content
In each of the following installation windows, perform the described task:
<IBMCMROOT>
.Custom
.DB2 Content Manager Version 8 connector
and DB2
Content Manager Version 8 Java connector toolkit
.<IBMCMROOT>
.Installation hints for the test environment
You can either install with the WebSphere Integration Developer V6.0.1 with a test environment or install WebSphere Process Server V6.0.1 separately. We recommend a separate installation of WebSphere Process Server as this offers more explicit control over port and user settings. If you want to install WebSphere Process Server with the WebSphere Integration Developer product you need to check Integrated Test Environment during installation. In this case a default profile is created automatically with<WPS_PROFILE_HOME>
set to
<WID_HOME>\pf\wps
.
If you decide to install WebSphere Process Server separately, you need to create a profile to be used as test environment based on the following steps:
ProcSrv01
may be OK. You may want to make this your default profile.icmadmin
as user ID and the corresponding password.icmadmin
,
the corresponding password, server1
as the server name,
and Cloudscape V5.1
as the database product.icmadmin
with the corresponding password. As the name of the administrative
group enter the administrative group to which icmadmin
belongs. On a Windows system this is usually Administrators
.(Cloudscape)
and name (WPRCSDB)
.The Quick Start sample process is based on a modified version of the
DB2 Content Manager sample data. This step describes how to load the
sample data and adjust it for use with the sample process. The sample
process uses a new attribute XYZ_ClaimAmount
to distinguish
'cheap' cases for which a high process throughput is desirable and
'expensive' cases for which additional research is required.
Furthermore, two new attributes, WF_OnCreate
and WF_OnDelete
,
are required to enable creation and termination of process instances
based on content events (see Content
Event Handling for details).
serverStatus.bat -all
in the bin
folder of the WebSphere Application Server installation that hosts the
resource manager. Run startServer.bat icmrm
to start the
resource manager if it is not yet running.XYZ_ClaimAmount
with the properties shown below:WF_OnCreate
with the properties
shown below and click OK to store the new attribute:WF_OnDelete
with the same characteristics as WF_OnCreate
.XYZ_ClaimFolder
, right-click Properties,
open the Attributes tab and add two new attributes: WF_OnCreate
and WF_OnDelete
both with the default value ClaimsHandlingProcess.
XYZ_AdjReport
and select Properties.XYZ_ClaimAmount
to this item type, as shown below:Adjuster Report (Content Manager v8.1 Sample Item
Type)
.The Quick Start Client uses Single Sign On (SSO) so users need to authenticate only once instead of having to log on to the process environment and to the DB2 Content Manager server. This step configures DB2 Content Manager so it can use the credentials provided by the application server to authenticate a user. Note that some of these settings are global (allow trusted logon, password not required for all users) so it is important to understand their potential impact on other DB2 Content Manager-based applications.
icmadmin
).ClientUserAllPrivsSSO
, select AllowTrustedLogon
in the Privileges field and click OK to save the new
privilege set.Agent1, Agent2, Adjuster1,
Adjuster2, Underwriter1, Underwriter2, UnderwriterAssistant1,
and UnderwriterAssistant2
double-click the name to open
the properties window and replace the value in the Maximum Privilege
set field with ClientUserAllPrivsSSO
quickStartSampleRev2wps.zip
into a temporary
folder <TMP>
.bpecm.properties
from <TMP>
to <WPS_PROFILE_HOME>\properties
.bpecm.properties
with an editor and make sure the
propertyContentManagerAuthenticationPwd=...
contains the
password of the library server administrator (icmadmin). Note that a
simple encryption method referred to as ROT13 can be used to avoid
storing the password in un-encrypted form. Apply ROT13 encryption by
adding a decimal 13 to the numeric character representation of each
character in the password string, e.g. ABC would become NOP. Set ContentManagerAuthenticationPwdEncryption
to 1 to enable the use of ROT13 encryption. Note that the proposed
encryption is for demo purposes only. If you plan to use the code in a
production environment you might want to choose a more enhanced
encryption method.security
under <WPS_PROFILE_HOME>
and copy the files users.prop
and groups.prop
from <TMP>
to this new directory.<WPS_PROFILE_HOME>\security\users.prop
in
an editor, locate the line icmadmin:passw0rd:2:2:
and
replace passw0rd
with the password of the library server
administrator (icmadmin) on your system.This step adjusts compiler settings and makes the project files available to the build environment. We recommend setting the browser configuration so it opens the Web browser in a new window which provides more flexibility when watching project contents and running the Web client at the same time.
<WORKSPACE_FOLDER>
. If
not prompted for a workspace, start it from the command line as
follows: <WID_HOME>\wid.exe -setworkspace
<WORKSPACE_FOLDER>
.IBMCMROOT
into the 'Name' field and the value of
<IBMCMROOT>
into the 'Path' field.IBMWPSROOT
into the 'Name' field and the value
of <WPSROOT>
into the 'Path' field.localhost
should be OK.<WPS_HOME>
.The Integration uses a JDBC connection to access the library server database. This connection and other settings such as global security need to be configured with the Process Server's administrative console.
icmadmin
. Since security is not yet enabled this only
serves as a name for your session. In case you close the admin console
without saving your changes you will be able to recover by logging on
with this same userid again.Environment > WebSphere
Variables
and set the scope to Node
level by
checking the radio button labeled Node and clicking Apply.DB2_JDBC_DRIVER_PATH
is
present (you may need to switch the scope to Node) and
that it points to <DB2HOME>/java
IBMCMROOT
. In the Scope
section click Server: server1 and Apply.
Click New, enter IBMCMROOT
into the Name
field, and <IBMCMROOT>
into the Value
field. Click OK to store the new variable.Servers > Application
Servers
, click server1.${IBMCMROOT}/cmgmt
into the Classpath
field and click Apply ws.ext.dirs
exists, add a
semicolon followed by ${IBMCMROOT}/lib;${DB2_JDBC_DRIVER_PATH}/db2java.zip
to the end of its value. If no such property exists, create a new one
with this value.<HOSTNAME><NODENAME><CELLNAME>/BPEAuthDataAliasJMS_<HOSTNAME>_server1
that has been created during process container configuration.Alias | ICMNLSDBAuthDataAlias |
|
User ID | icmadmin |
|
Password | icmadmin's password | |
Description (optional) | Authentication data alias for CM library server administrator |
server1
.DB2 Legacy CLI-based Type 2 JDBC Driver (XA)
is not
listed on the cell, node, or server1 level, perform the following steps
to add it at the server1 level:
${DB2_JDBC_DRIVER_PATH}/db2java.zip
and that the Implementation class name is COM.ibm.db2.jdbc.DB2XADataSource
.DB2 Legacy CLI-based Type 2 JDBC Driver (XA)
and
click Data Sources in the Additional
Properties to display the data sources that are based on this
JDBC provider. If the JDBC provider has just been added, the list will
be empty.Name | replace DB2 Legacy CLI-based Type 2 JDBC Driver XA Data
Source with icmnlsdb |
|
JNDI Name | replace jdbc/DB2 Legacy CLI-based JDBC Driver XA
DataSource with jdbc/ICMNLSDB |
|
Description (optional) | replace New JDBC Datasource with CM library
server |
|
Component-managed Authentication Alias | select <HOSTNAME><NODE>/ICMNLSDBAuthDataAlias
from the list |
|
Container-managed Authentication Alias | select <HOSTNAME><NODE>/ICMNLSDBAuthDataAlias
from the list |
|
Mapping-configuration alias | select DefaultPrincipalMapping from the list |
|
Database name | icmnlsdb |
icmnlsdb
.Test
Connection for datasource icmnlsdb on server server1 at node
<HOSTNAME><NODE> was successful
.The following steps need to be performed for both the integrated test environment and a separately installed WebSphere Process Server.
icmadmin
into the Server user ID
field and the corresponding password into the Server user
password field.com.ibm.websphere.security.FileRegistrySample
into the Custom registry class name field.groupsFile
and value ${USER_INSTALL_ROOT}/security/groups.prop
.usersFile
and value ${USER_INSTALL_ROOT}/security/users.prop
.icmadmin
's
password).Server
Overview
editor. Expand the Security section,
check Security is enabled on this server and enter icmadmin
and the corresponding password (you may need to collapse and re-expand
the section to see the input fields). Press CTRL-S to store the
changes.wid
, change the user ID and password to icmadmin
and the corresponding password.BPEContainer_widNode_server1
.BPESystemAdministrator
and
click Look up groups.wid
and add AdminsGroup
to the list and click OKTaskContainer_widNode_server1
(the role name is TaskSystemAdministrator
.<TMP>\projects.zip
and click OK. A list of 8 projects (ClaimsHandling
,
CMBPCIntegration
, CMBPCIntegrationBeans
, CMBPCIntegrationLibrary
,
CMConnectionManagement
, ContentViewerApplet
,
QuickStartClient
, QuickStartClientApp
) shows
up in the section below. Click Select All and Finish
to import the projects.CMBPCIntegrationBeansClient
in the EJB client JAR Creation dialogue and click Finish
to start project creation.CMAdministrator
role to the list. Click CMAdministrator and check Users/Groups
in the WebSphere Bindings section. Scroll down to the
Groups section and add the administrator group of this
system (to which icmadmin
belongs, on a Windows system
typically Administrators
) to the list by clicking Add
entering the group name and clicking Finish. Scroll
down to the Security Role Run As Bindings section and
add icmadmin
and the corresponding password. Press CTRL-S
to save your changes.The integration sample process provided with DB2 Content Manager Enterprise Edition V8.3 was designed to be compatible with the sample process used to illustrate document routing (DB2 Content Manager Enterprise Edition V8.3 includes a document routing engine for use with document lifecycle management within DB2 Content Manager).
The new sample process provided with CM/WPS Integration Quick Start focuses on the integration of different services both human-based and automatic. Automated services such as retrieval of the insurance policy or the fraud history check illustrate the inclusion of third party applications or B2B transactions with external service providers.
This is a more natural way of demonstrating the use of WebSphere Process Server since the DB2 Content Manager Enterprise Edition V8.3 sample process is a simple human-centric document flow example that can easily be implemented on the basis of document routing.
The sample process provided with the CM/WPS Integration Quick Start
implements a simplified Claims Handling Process. Though it uses some
insurance terminology and corresponding sample data, it can be seen as
an example of a more abstract review and approval process.
ClaimAmount
attribute). For small claims, members of the
UnderwriterAssistantsGroup investigate the documents in the folder and
complete the review activity by approving or rejecting the claim. With
a ClaimAmount
> $5000 claims are considered big. In
this case, an external FraudHistory service is
consulted that prepares a fraud history report assessing the
trustworthiness of the claimant based on certain criteria derived from
the case and policy data. The fraud history report is made available
to members of the UnderwritersGroup who are entitled to review either
small or large claims. However, only members of the UnderwritersGroup
can approve or reject large claims.Group | Group members | |
Mailroom | AgentsGroup |
Agent1, Agent2 |
ValidateAndAdjust | AdjustersGroup |
Adjuster1, Adjuster2 |
ReviewSmallClaim | UnderwriterAssistantsGroup |
UnderwriterAssistant1, UnderwriterAssistant2 |
ReviewLargeClaim | UnderwritersGroup |
Underwriter1, Underwriter2 |
If your library server name is not icmnlsdb
you need to
open <WORKSPACE_FOLDER>\QuickStartClient\JavaSource\com\ibm\bpe\cm\util\ProcessData.java
in WebSphere Application Developer Integration Edition, change
the value of CM_DATASTORE_NAME
accordingly, and re-build
the project QuickStartClient
. Note that the update is
enabled in the active Web project on the fly so the server does not need
to be re-started.
This section explains two different ways to create process instances either explicitly by an application or implicitly based on Content Event Handling. Explicit creation may be preferred if the application that manages incoming documents is within the control of your organization so that code can be added to explicitly create process instances where needed. The code used to create instances based on existing items can serve as a basis for custom development. Implicit creation may be preferred in cases where document import is treated as a black box or the corresponding application is not within the control of your organization.
Agent1
with password passw0rd
(which by default is the same for
all roles of the sample process).XYZ_InsPolicy
,
XYZ_ClaimForm
, XYZ_AdjReport
, and XYZ_PolReport
.
The latter three are linked to a XYZ_ClaimFolder
that has
the attribute WF_OnCreate
with a default value of ClaimsHandlingProcess
.
Creating an item of type XYZ_ClaimForm
triggers the
creation of an item of type XYZ_ClaimFolder
which contains
it due to auto-foldering. The creation of this folder triggers the
creation of an instance of the ClaimsHandlingProcess
which
carries a reference to the claim folder due to the WF_OnCreate
attribute and its default value (the process name).startProcessInstances.jsp
.
Click any of the links to open the corresponding form./XYZ_ClaimFolder
which locates
all instances of XYZ_ClaimFolder
and creates instances of
the ClaimsHandlingProcess for each element of the result list. By
adding additional conditions (as for example /XYZ_ClaimFolder/OUTBOUNDLINK[@LINKTYPE
= "DKFolder"]/@TARGETITEMREF => XYZ_ClaimForm[@XYZ_ClaimNumber =
"4-852369"]
) the query can be refined to restrict the items for
which process instances should be created to e.g. all claim forms with
claim number 4-852369
. Note that when starting processes
for the DB2 Content Manager sample data based on a query you may see
warnings in the console indicating that the policy can not be added to
the folder since the folder already contains it. This is due to the
fact that each folder of the sample data already contains instances of
all three item types. The message can be ignored.XYZ_ClaimForm
item type in DB2 Content Manager. Due to auto foldering this triggers
the creation of a corresponding XYZ_ClaimFolder. Since the XYZ_ClaimFolder
item type has the attribute WF_OnCreate defined and pointing to a
default value of ClaimsHandlingProcess
this triggers the
creation of a process instance.-> Item created
). If content event handling works
properly, another message is displayed that says => Process
started with ItemPID [...]
. Note that the message prefix
indicates its origin. Messages starting with ->
originate from the Quick Start Client. Those starting with =>
result from the integration toolkit and if the prefix is >>
they originate from the process. The messages => Looking up
policy with number: ...
and => Number of matching
insurance policies for claim [...]: 1
) indicate the successful
completion of the first process activity (RetrievePolicy
).Add part
link that can be
used to attach the actual document. Clicking Add part
switches to the Import part page.<IBMCMROOT>\firststeps\data\4-852369.tif
and click Import to add it to the new item. Note that
the console output confirms the upload with a message (->
imported file of length: 27688 mime type: image/tiff
). You may
add another part by importing the incident photo <IBMCMROOT>\firststeps\data\1ABC089.jpg
.
Note that in this case you need to explicitly select the mime type JPEG
from the list since automatic detection fails for files of this type.=> Number of matching insurance policies for claim [...]: 1
in the server console confirms that an appropriate insurance policy has
been located in DB2 Content Manager which has the policy number as
entered in the claim form. The RetrievePolicy service has retrieved this
item from Content Manager and added it to the folder that is routed
through the process.
Adjuster1
.>> Query
[/XYZ_ClaimFolder[@ITEMID IN ("...")]]
-> Work item
claimed
. Note that Adjuster1
now owns this work
item. If another member of the AdjustersGroup
runs a work
list query by opening his work list page, this work item will not show
up any longer.Street
field in
the address to 259 Blue Rd.
. When clicking Save
you will see the effect of the modification on the updated work item
page.<IBMCMROOT>\firststeps\data\4-852369_adjustment.tif
.
Click Work Item in the menu bar to return to the Work
Item View and note that the Adjuster Report is now a member of
the claim folder. Reminder: submit
remaining documents for claim number 3-742019 iteration (1)
.
Click Refresh in the menu bar of the Quick Start Client to refresh the
adjuster's worklist. Notice that it again contains an entry referring
to case 3-742019
.-> Work item completed
to
confirm successful completion of this step.=>
Documents are ready for claim: 3-742019
and a confirmation is
sent to the person that submitted the claim (=> Dear...
).
Furthermore, the following two messages are shown: => Claim
Amount is large (10000.00)
and => Fraud report for Mary
Twain is good
that result from the decision point and the Check
Fraud History service respectively.Underwriter1
.3-742019
.
Note that the columns in the work list differ from the adjuster's
worklist in that they now contain the name of the current activity
(members of the group UnderwritersGroup may perform either the
ReviewSmallClaim or the ReviewLargeClaim activity) and the creation
date of the adjuster report.OK
into the field Justify decision,
select Approve, and click Complete.=;>
Dear Mr. Twain, your claim (3-742019) has been accepted. <Reason:
OK>. Yours Sincerely XYZ_Insurance.
Note that <Reason:
...<
corresponds to a text module which might be rendered
into an acceptable text by the communication service.=> Pay claim subprocess started on item [...] [...] [...]
indicate a subprocess that performs the corresponding financial
transaction in parallel to the notification. Note that in place of a
real BPEL process we simulate this activity by a simple Java class that
implements the CMProcessInterface
and displays this
message.UnderwriterAssistant1
.=> Dear Mr. Twain,
we apologize that your claim(...) has been rejected. <Reason:
...>...
.This section points to some important concepts and artifacts in WebSphere Integration Developer and explains their role for the sample process.
DependenciesClaimsHandling
module (the module
hosting the sample process) and select Open Dependency Editor.
Note that this module depends on the library CMBPCIntegrationLibrary
which is provided by the Integration Toolkit. This library contains
interface, business object, and Java definitions needed when working
with the functions of the Integration Toolkit.CMBPCIntegrationLibrary
and note that it
consists of definitions for Data Types (business objects) and
Interfaces. In the Physical Resources view (Window
> Show View > Physical Resources) you can see that this
library also contains a Java interface com\ibm\bpe\cm\CMBPCConstants
ClaimsHandling
module und double click ClaimsHandling
right below. This
opens the Assembly Diagram of the ClaimsHandling
SCA component in the assembly editorClaimsHandlingProcess
component is wired
to five supplementary services. The first two (CMServicesImport
,
CollectionPointServiceImport
) are imported from the
Integration Toolkit. The other three (FraudHistoryService
,
CommunicationService
, PayClaimSubprocess
) are
specific to the sample process. For the sake of keeping the sample
process simple and concentrating on the integration with DB2 Content
Manager, these services have a simple Java implementation that can be
found in the com\ibm\bpe\cm\sca\
folder of this module
(Physical Resources view). Double-clicking a component's box in the
assembly diagram opens the corresponding implementation if it is in the
same module. In case of Java implementations it opens the Java source
page editor. In case of the process, it opens the BPEL definition of
the process.CMProcessInterface
) as the
ClaimsHandlingProcess
so it would also be a
content-centric process.ClaimsHandlingProcess
in the assembly diagram. This opens the process definition in the BPEL
editor.Receive
activity, you
see that this process implements the CMProcessInterface
which is mandatory for all content-centric processes that use the
Integration Toolkit.GetItemPid
and Initialize
retrieve the
unique identifier of the item that is routed through the process and
makes it available as a process property (see chapter 4 for details.RetrieveClaimNumber
, RetrievePolicyNumer
and the subsequent Java snippets (SetClaimNumber
and InitAddPolicyToFolder
do some further initialization by retrieving attribute values from DB2
Content Manager.AddPolicyToFolder
invokes the Folder
Management service to retrieve the corresponding insurance
policy. Click InitAddPolicyToFolder
and inspect the
details view to see the Content Manager XPath query that identifies the
appropriate policies: /XYZ_InsPolicy[@XYZ_PolicyNum=\"" +
policyNum + "\" AND @VERSIONID = latest-version(.)]
.DisplayNumRetrievedPolicies
is a Java snippet that
displays the result of the policy retrievalDefineWaitCondition
initializes
the reminder count (number of loops due to collection point timeout)
and the document types and quantities required to proceed with the
process (collection point condition).DefineWaitCondition
initializes the response
variable of the ValidateAndAdjust
activity since the first
activity inside the loop (SetValidateAndAdjustRequest
)
copies the values from the response to the request variable to ensure
changes which tha adjuster may have made to the collection point
condition are retained throughout the loop.WhileDocumentsAreNotReady
is a structured activity
that executes a loop while its entry condition is true. Click its box
and check out the Details to see that the entry
condition is based on the reminder count. Setting it to a negative
value forces the loop to terminate.SetValidateAndAdjustRequest
)
is an assignment activity that prepares the input message for the human
activity that follows (ValidateAndAdjust
) by initializing
the number of retrieved contracts to the results of the number of
matches returned from the AddPolicyToFolder
service and
the number of iterations to the reminder count.ValidateAndAdjust
corresponds to a
Participating Task ClaimsHandlingProcessTask3
.
Clicking the link to this task in the Details view
shows the staff settings. Click Potential Owner in the
Receiver settings section to see that its verb is Group
Members with a group name of AdjustersGroup
.
Close the task definition to return to the process.InitCollectionPointService
and SetTimeoutValue
define the parameters needed for the collection point service such as
the timeout in seconds and the item types and respective quantities to
wait for. The timeout value is set in a separate Java snippet (instead
of an assign activity) since it involves a type change from String to
Integer. The Quick Start Client that serves as user interface for the
participating tasks relies on the convention that all tasks return data
in String format which makes this conversion necessary.CollectionPointService
invokes an asynchronous
mechanism that lets the process wait until the folder that is routed
through the process satisfies the conditions defined by its input
parameters. See section 4.5 for details.CMBPCConstants
interface of the CMBPCIntegrationLibrary
.PrepareLoopExit
and Remind
are Java
snippets that print a status message to the console output and leave
(condition met) or re-enter (timeout) the loop.FolderDeleted?
and Otherwise
signal
undesirable results and are consequently followed by activities that
initialize an error message and trigger and throw an exception. Note
that the process is enclosed by a scope with an exception handler that
ensures that any exception triggered within the process is properly
caught and displayed on the console.PrepareAttributeLookup
that initializes
the fraud History value and specifies the attribute values that are
retrieved for subsequent use in the remainder of the process: the first
and last name of the client who submitted the claim, the date of
incident and the adjusters estimate of the claim amount.LookupContentAttributes
retrieves the corresponding
values and AssignValues
assigns them to input messages for
the human tasks that implement the review.SendNotificationLetter
is an operation of the CommunicationService
that sends a notification back to the client (implemented as a Java
method that displays a mail skeleton on the server log).CheckClaimAmount
contains a
case activity that evaluates the adjuster's estimate of the claim
amount. If it is small, it continues with the ReviewSmallClaim
activity. Otherwise it invokes the ExternalFraudHistoryService
and then the ReviewLargeClaim
activity.UnderwriterAssistantsGroup
and
UnderwritersGroup
respectively.PrepareFraudHistorySummary
activity in the
'otherwise branch' assigns the result of the ExternalFraudHistoryService
to the input message of the ReviewLargeClaim
activity.AssignReviewComment
)
pulls the reviewer's comment from the output message of the review
activity (both are of the same type) and stores it in a variable ReviewerComment
that will be given as input parameter to the communication service for
sending the review notification to the client.Accepted?
evaluates the decision
property of the reviewer's output message. If true, it proceeds to the
parallel section that contains two activities: NotifyAcceptance
,
an operation of the communication service that notifies the client
about the acceptance of the case and PayClaimSubprocess
that performs the corresponding financial transaction.NotifyRejection
).setACL
service of the Integration Toolkit. However, changing the ACL of items
may involve additional administrative steps to ensure proper deletion
when cleaning up data associated with the sample. To keep management of
the sample and its data simple we have not incorporated such a step.
See section 6.3 for details on how to clean up
data used by the sample process.There are a number of situations in which a step of the process might
fail. The sample process illustrates the use of a fault handler by
encapsulating all activities following the initial receive activity
within a scope and attaching a fault handler to this scope. This fault
handler catches faults of the type FolderDeletedFault
that
occur if the folder on which an active collection point condition is
registered is deleted. See the throw activity ThrowFolderDeletedFault
in the Data Validation segment of the process for a
cause of this fault. The fault is thrown as a consequence of the COLLECTIONPOINT_ITEM_DELETED
result code of the collection point service. The Initialize
activity at the beginning of the process shows how faults can be thrown
from within a Java snippet. Information about the fault is communicated
with the variable FaultVariable
of type ProcessFault
.
In our example ProcessFault
only specifies a messageText
.
It may be extended to provide more details about the fault. By adding
further fault handlers to the scope other types of faults can be managed
accordingly.
This chapter describes the elements of the Integration Toolkit and outlines how they can be combined to create a custom integration solution.
The following sections assume a basic familiarity with DB2 Content Manager Enterprise Edition V8.3, WebSphere Integration Developer V6, and WebSphere Process Server V6. They focus on the concepts that are specific to an integration solution based on the Integration Toolkit and Quick Start Client. Valuable resources to get familiar with the environment are the redbooks and documentation referenced in chapter 7 at the end of this document. From the point of view of business process creation we recommend the Business Integration samples that can be found in the Samples Gallery of the local WebSphere Integration Developer Information center which can be opened by clicking Help > Samples Gallery. We recommend working through at least one of the 'Build it yourself' style samples such as the Loan application sample in the Application Samples > Business Integration section and taking the time to look up new concepts in the redbooks or documentation.
From a resource perspective, a workspace of a custom solution that integrates DB2 Content Manager with WebSphere Process Server typically consists of the following three enterprise applications each consisting of a number of modules:
ClaimsHandling
in the sample).CMBPCIntegrationApp
hosting the
modules provided by the Integration Toolkit: CMBPCIntegrationLibrary
,
CMBPCIntegration
, CMBPCIntegrationBeans
, CMBPCIntegrationBeansClient
,
CMConnectionManagement
.QuickStartClientApp
hosting the Web
module QuickStartClient
.A solution that uses a custom Web-based (that may be built based on the JSF components of the BPC explorer) or Portal-based client only needs to deploy the first two enterprise applications while the Quick Start Client builts on top of the functions provided by the Integration Toolkit.
The following sections describe the individual elements of the Integration Toolkit and Quick Start Client that can be used to build on custom integration solution in more detail.
The Integration Toolkit is a set of artifacts (SCA components, Interfaces, Business Objects, EJBs, and Java classes) that support the creation of content-centric processes. See the figure below for a schematic representation of the Integration Quick Start architecture:
The yellow and red blocks mark the elements of the Integration Quick Start: the Claims Handling sample process, the Quick Start Client, and the Integration Toolkit. The CM-based user registry is a special case as it may be installed and used independently from the other elements of the Integration Quick Start. See section 4.9 for details on the CM-based user registry.
The Integration Toolkit provides building blocks for functions that are typically found in business processes that work with content. They are especially important for content-centric business processes but can also be found in processes that involve content but have a different main focus. This document refers to this set of common functions as content / workflow interaction patterns.
The Integration Toolkit offers building blocks for the following interaction patterns:
These building blocks are available in the form of SCA (Service Component Architecture) components, Enterprise Java Beans, and Java classes. The SCA components are the main vehicle for incorporating the functions offered by the Integration Toolkit into business processes. They are supported by interface definitions and business objects that define how the business process interacts with the SCA components. The EJBs provide the infrastructure needed to implement the Content Event Handling and Collection Point, and Combined Query patterns. The rest of this section provides some background about the available EJBs and their role within the Integration Toolkit.
Startup beans are WebSphere-specific stateful
session beans that are automatically notified when a WebSphere
application is started or stopped. A bean is designated as a startup
bean by implementing special home and remote interfaces. When WebSphere
starts an application, it looks for beans that implement these special
startup bean interfaces. If it finds any, it arranges to invoke the
beans start() and stop() methods on application initialization and
termination. The Integration Toolkit uses the startup bean (CMBPCIntegrationBeans\com\ibm\bpe\cm\CMBPCIntegrationStartupBean
)
to start and stop the asynchronous bean described below. Note that the
startup bean starts when the enterprise application is started. It
terminates when the enterprise application is stopped.
Asynchronous beans are WebSphere-specific enterprise beans that are executed asynchronously and provide support for application threading within a J2EE environment. There are three types of asynchronous beans:
CMBPCIntegration
class which perform the following operations:
The Stateless Session Bean of the Quick Start
Integration (CMBPCIntegrationBeans\com\ibm\bpe\cm\CMBPCIntegrationBean
)
provides a remote interface for the Combined Query
function described in 4.8.
A process that uses any of the toolkit functions needs to comply with the following conventions:
CMProcessInterface
provided by the
CMBPCIntegrationLibrary
.createItemRef
operation of the CMServices
componentTo create a new content-centric process proceed as follows:
New > Project > Business Integration
> Module
and enter a name for the Module such as MyModule
(the default location should be OK).MyModule
and select Open
Dependency Editor. In the Libraries section
of the dependency editor click Add and select CMBPCIntegrationLibrary
.
Press CTRL-S to store the change and close the dependency editor.CMProcessInterface
from CMBPCIntegrationLibrary
> Interfaces
and drop it into the assembly editor and select
Component with no implementation type.Component1
with a more useful name in the properties view such as MyProcess
.MyProcess
and select Generate
Implementation > Process. On the Generate
Implementation dialogue you can define a folder for the
process such as com.ibm.bpe.cm.myprocess
.MyProcess
is created based on the interface partner MyProcessComponent
and is displayed with the process editor.
|
ItemId
,
ComponentId
, and VersionNo
to the
corresponding input parameters of the startProcess
operation. You may now delete InputVariable
from the list
of variables.CMServicesInterface
from CMBPCIntegrationLibrary
> Interfaces
and drop it into the Reference Partners
section at the right-hand side of the business process editor.Invoke
with CreateItemRef
and in the Details
tab
click Browse and select the CMServicesInterface
partner. Select the operation createItemRef
from the list
and assign the input variables (ItemId
, ComponentId
,
VersionNo
) to the corresponding input parameters and the
output variable (ItemRef
) to the output parameter.MyProcess
and select Delete.
Press CTRL-S to update the assembly diagram and wait for the progress
information to signal completion of the build. Drag MyProcess
from MyModule > Business Logic > Processes
and drop
it into the assembly diagram. Note that it now contains a small icon 1:1
on the right hand side that represents its partner link to CMServices
.CMServicesInterface
from CMBPCIntegrationLibrary
> Interfaces
and drop it into the assembly editor right of MyProcess
.
Select Import with no binding on the Component
Creation dialogue.Import1
in the Description tab of the Properties
view with CMServicesImport
.CMServicesImport
and select Generate
Binding > SCA Binding.CMServicesExport
on the SCA Export Selection dialogue and click OK.MyProcess
and
select Wire to existing. Note that this connects the
process component MyModule
with its referenced partner CMServicesImport
.import
com.ibm.bpe.cm.CMBPCConstants;
to the (so far empty) list of
Java imports.CreateItemRef
Invoke activity.Snippet
with Initialize
and switch to the Details tab.ItemPid = ItemRef.getString(CMBPCConstants.BOATT_ITEM_REF_PIDSTRING); setProcessCustomProperty(CMBPCConstants.PROCESS_PROPERTY_ITEMPID, ItemPid); setProcessCustomProperty(CMBPCConstants.PROCESS_PROPERTY_ITEMID, ItemId); setProcessCustomProperty(CMBPCConstants.PROCESS_PROPERTY_COMPONENTID, ComponentId); setProcessCustomProperty(CMBPCConstants.PROCESS_PROPERTY_VERSIONNUMBER, VersionNo.toString());
The CreateItemRef
activity invokes the createItemRef
operation of the CMServices
component. Its implementation
creates a DKItemPid
object from the supplied ItemId
,
ComponentId
, and VersionNo
parameters and runs
a Content Manager query that returns the missing information such as the
server name and item type from the Content Manager Library server.
The Java snippet Initialize
copies the values of the
four variables ItemId
, ComponentId
, VersionNo
,
and the ItemPid stored in the variable ItemRef
into custom
properties of the process where it can be used by Integration Toolkit
functionality such as Combined Queries or Collection Points.
The following sections describe the individual building blocks for content-centric processes that are provided by the Integration Toolkit in more detail.
With content event handling, activities in DB2 Content Manager generate events that can be handled by the business process management system. The Integration Toolkit provides an implementation of content event handling that deals with item creation and deletion events. If defined properly, an item creation event triggers the creation of a process instance as soon as an item of a certain type is stored in DB2 Content Manager. The newly created process instance contains a reference to the item just created. If capturing of deletion events is specified, the deletion of an item in DB2 Content Manager triggers the removal of any process instances 'carrying' it.
How to use Content Event HandlingThe DB2 Content Manager administrator specifies which items trigger
creation or deletion events based on the custom attributes WF_OnCreate
and WF_OnDelete
that need to be assigned to the item types
for which content event handling should be enabled. Both attributes need
to be defined as a variable length character string with a minimum
length of zero and a maximum length of 254 as shown below:
To enable an item type for content event handling add WF_OnCreate
or WF_OnDelete
to its list of attributes and enter the
template name of the process to be notified as the default value.
The value of the attribute WF_OnCreate
specifies the
name of a process to start whenever the corresponding event occurs. So,
for example, if the WF_OnCreate
attribute for the XYZ_ClaimFolder
item type is set to ClaimsHandlingProcess
, then whenever a
user creates a new item of type XYZ_ClaimFolder
, a new
instance of the process ClaimsHandlingProcess
is started by
submitting the item's itemId
, componentId
, versionNumber
as input message to the process which needs to implement the appropriate
interface of type CMProcessInterface
. If multiple versions
of this process are deployed, the most recent process with respect to
the Valid From date is selected. If the attribute WF_OnDelete
is present in the definition of the item type XYZ_ClaimFolder
with a default value of ClaimsHandlingProcess
, deleting an
item of this type terminates all instances of the process ClaimsHandlingProcess
that carry this item.
With this synchronization mechanism, content event handling enables some degree of referential integrity between the content repository and the process management system in the sense that document creation or deletion causes corresponding action in the process management system in order to keep the two systems in synch.
How Content Event Handling is implementedItem type definitions that have a WF_OnCreate
or WF_OnDelete
attribute are registered in a table BPECONTENTENVENTS
that
the Integration Toolkit creates in the library server database. Each row
in the BPECONTENTEVENTS
table constitutes a content event
request. The method checkContentEvent()
of the utility
class CMBPCIntegration\com\ibm\bpe\cm\util\ContentEventHandling
is called regularly from the asynchronous bean (CMBPCIntegration\com\ibm\bpe\cm\util\AsyncBeanWork
)
to see if a new process instance should be created or if process
instances should be deleted. It scans the BPECONTENTEVENTS
table and performs the corresponding creation or deletion operations in
the order in which requests have been added to the table deleting the
rows as soon as the corresponding action has been performed
successfully. If an action fails, an error message is written to the log
the row remains in the table and the event is retried during the next
cycle of the asynchronous bean. The BPECONTENTEVENTS
table
is created during server startup by the startup bean (CMBPCIntegrationBeans\com\ibm\bpe\cm\util\CMBPCIntegrationStartupBean
)
if it does not exist yet.
The BPECONTENTEVENTS
table has the following structure:
CREATETS TIMESTAMP ITEMID CHAR(26) COMPONENTID CHAR(18) VERSIONID SMALLINT REQUEST SMALLINT PROCESSNAME VARCHAR(254)
The CREATETS
column is the creation date and time of the
content event. It ensures that content events are processed in the order
in which they are received. The ITEMID
, COMPONENTID
and VERSIONID
columns are the key values of the
corresponding itemPid the creation or deletion of which triggered the
event. The REQUEST
column indicates the type of CM event: 1
for creation, 2 for deletion. The PROCESSNAME
column
indicates the name of the process to be created or deleted. Rows are
written to the BPECONTENTEVENTS
table using database
triggers. These triggers are automatically created by the Asynchronous
Bean for DB2 Content Manager item types that contain the custom
attributes WF_OnCreate
or WF_OnDelete
. The
trigger is created on the underlying DB2 Content Manager Component Table
(a table of the form ICMUTnnnnnsss
where nnnnn and sss are
sequences of numbers representing the component type ID and the segment
ID respectively) by the startup bean. The startup bean deletes all
existing triggers and replaces them with triggers that correspond to the
current state of the library server database. Note that when adding or
removing WF_OnCreate
or WF_OnDelete
attributes
to/from item types, the server needs to be re-started (or the CMBPCIntegrationApp
re-deployed) to ensure the Content Event Handling mechanism can pick up
the change.
Once the trigger is created, create and delete operations for the
item type result in requests being written to the BPECONTENTEVENTS
table. This has the benefit of decoupling the DB2 Content Manager
transaction from the subsequent Check Content Event transaction so that
the performance impact to the DB2 Content Manager transaction is
minimal. The BPECONTENTEVENTS
table is created by the
startup bean if it does not yet exist.
In addition to this 'standard usage', content event handling can also be viewed as specific instance of a more general concept that may be applied to other special processing, as needed.
Examples:
A collection point can be used where the item that is routed through
the process is a folder. A collection point is an activity in the
process which waits until a certain folder condition is valid. This
condition is expressed in terms of <ITEMTYPE, QUANTITY>
pairs. A set of such pairs specifies how many instances of the named
item types need to be in the folder for the process instance to resume
execution. <1, XYZ_ClaimForm>
, <2,
XYZ_AdjReport>
, <1, XYZ_PolReport>
is an
example that lets the process instance wait until one claim form, two
adjuster reports, and one police report are available in the claim
folder that is routed through the process.
A collection point is modeled by an invoke activity that invokes the
collectionPoint
operation on the CMServices
component.
|
CollectionPointService
from CMBPCIntegrationLibrary
> Interfaces
and drop it into the Reference Partners
section at the right-hand side of the business process editor.Assign
with InitCollectionPointCondition
and in the Details
tab add three assignments to this activity as shown below (for
illustration purposes we are using fixed values based on the sample
data. Note that requiredItems
is an array. To assign a
value to elements of this array select Variable in the
target section and click CollectionPointCondition... >
requiredItems... > itemType
. Note that this only displays the
scalar variant of the query: /requiredItems/itemType
. You
need to manually enter the index value of the array into the query
field so that it displays /requiredItems[1]/itemType
. Note
that array positions start with 1.InitCollectionPointCondition
.Invoke
with CollectionPointService
and in the Details
tab click Browse and select the CollectionPointService
partner. The operation is set to collectionPoint
since
this is the only operation available at this interface.ItemRef
, CollectionPointCondition
,
TimeoutSeconds
) to the corresponding input parameters and
the output variable (CollectionPointResult
) to the output
parameter.MyProcess
and select Delete.
Press CTRL-S to update the assembly diagram and wait for the progress
information to signal completion of the build. Drag MyProcess
from MyModule > Business Logic > Processes
and drop
it into the assembly diagram. Note that it now contains a small icon 1:1
on the right hand side that represents its partner link to CMServices
.CollectionPointService
from CMBPCIntegrationLibrary
> Interfaces
and drop it into the assembly editor right of MyProcess
.
Select Import with no binding on the Component
Creation dialogue.Import1
in the Description tab of the Properties
view with CollectionPointServiceImport
.CollectionPointServiceImport
and select Generate
Binding > SCA Binding
.MyProcess
and select Wire to
existing. Note that this connects the process component MyModule
with its referenced partner CMServicesImport
.Note that a process using a collection point must be defined as long running since the availibility of documents usually depends on some external conditions that are beyond the control of the process and typically person-based. Furthermore, a timeout may be specified to ensure the process instance resumes execution in lack of the required documents. The timeout value is typically used to trigger a reminder or corrective action to ensure the process instance does not wait forever.
The CollectionPointResult
parameter returns a numeric
status value that represents one of the following situations:
A typical implementation of the collection point looks as shown below:
The Assign activity instantiates the input
parameters of the collection point service. It submits the reference to
the folder (ItemRef
), and defines the collection point
condition and timeout value as shown above. The case statements inside
the Choice activity evaluate the return value of the
collection point service and triggers corresponding actions such as
sending a notification in case of a timeout or terminating the process
instance in case of a failure. Invoking the collection point service and
evaluating its results is typically done inside a loop so the collection
point service can be re-entered in case of a timeout as shown by the
Claims Handling sample process. If the initialization also happens
within the loop, collection point conditions and timeout values can be
modified dynamically with each iteration to, for example, loosen the
conditions in case of a timeout.
Since the class implementing the collection point SCA component (CMBPCIntegration\com\ibm\bpe\cm\sca\CollectionPointServiceImpl
)
instantiates the ServiceImplAsync
interface, the SCA
infrastructure redirects calls to any of its operations (there only is
one: collectionPoint
) to the method invokeAsynch
which has a caller ticket and service callback as parameters. invokeAsynch
calls the collectionPoint
method in CMBPCIntegration\com\ibm\bpe\cm\api\CMBPCIntegration
where in- and output parameter mapping takes place. Then the condition
is registered by the addCollectionPointRequest
method in CMBPCIntegration\com\ibm\bpe\cm\util\CollectionPoint
that writes it to a table BPECOLLECTIONPOINTITEMTYPES
in
the DB2 Content Manager library server.
The DB2 Content Manager library server database contains two tables for collection point support provided by the Integration Toolkit.
The table BPECOLLECTIONPOINTS
contains one row for each
active collection point request. It is defined as follows:
SEQID INTEGER NOT NULL PRIMARY KEY CREATETS TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP CORRELATION BLOB(1M) NOT NULL ITEMID VARCHAR(26) NOT NULL TIMEOUT BIGINT NOT NULLThe
SEQID
column contains a unique sequence ID serving as foreign key for the
BPECOLLECTIONPOINTITEMTYPES
table. The
CREATETS
column contains the creation date and time of the collection point
request. It ensures that collection point requests are processed in the
order in which they are created. The
CORRELATION
column keeps a serialized instance of the CollectionPointCallbackInfo
class that stores the
serviceCallback
and
Ticket
which the
invokeAsynch
method has obtained from the SCA infrastructure. The process engine uses
this information to correlate the response message with the request
message so it knows which process instance should be notified if the
collection point condition evaluates to true. The
ITEMID
column is the Item ID of the folder to be checked.
TIMEOUT
stores the time in milliseconds at which the collection point condition
times out
The table BPECOLLECTIONPOINTITEMTYPES
contains one row
for each item type and quantity specified in the collection point
request. It is defined as follows:
SEQID INTEGER NOT NULL ITEMTYPENAME VARCHAR(254) ITEMTYPEQUANTITY INTEGERThe
SEQID
references a sequence ID of
BPECOLLECTIONPOINTS
(foreign key). The
ITEMTYPENAME
column contains the name of the item type to wait for.
ITEMTYPEQUANTITY
specifies the number of items of type
ITEMTYPENAME
to wait for.
There is a one-to-many relationship between BPECOLLECTIONPOINTS
and BPECOLLECTIONPOINTITEMTYPES
, based on the SEQID
key. Any of these tables is created by the CMBPCIntegrationStartupBean
if it does not already exist.
The method checkCollectionPoint()
that is called by the
asynch bean performs a (JDBC-based) SQL query which returns a list of
collection points that are satisfied. For each satisfied collection
point, it deletes the collection point request from the BPECOLLECTIONPOINTS
table and sends a response message back to the Collection Point Invoke
activity of the process. A request is also removed if the folder that is
routed through the process has been deleted before the collection point
condition is satisfied. Each row in the BPECOLLECTIONPOINTS
table represents a collection point, and each row in the BPECOLLECTIONPOINTITEMTYPES
table represents an item type condition for a collection point. checkCollectionPoint()
effectively joins these tables with the DB2 Content Manager Links, Items
and NLS Keywords tables to identify all satisfied collection points
within two requests to the library server database. checkCollectionPoint()
uses the "Folder Contains" link type to determine the contents of
folders. It sums the items for the specified DB2 Content Manager folder,
and if the resulting counts are greater than or equal to the quantities
specified in the collection point conditions, then the collection point
is considered to be satisfied. The NLS Keywords table maps the DB2
Content Manager item type names to numeric Item Type IDs using the base
name for the item type, which may be expressed in any language. However,
to avoid a potential cross product, the join is limited to ENU
,
which must be present (though not necessarily in use).
There are a number of situations in which there is a need to access
the attribute values of the item that is routed through the process or
of items in the folder that is routed through the process. Typical
situations are conditions on links in a parallel section (flow) of the
process or on switch statements in a 'case' section that determine the
path to be taken depending on the value of an attribute. Another typical
situation is instantiating the input message of a staff activity or
other service by extracting attribute values from the folder or from an
item in the folder and placing them into parts of the input message to
make them available as input parameters to the service. The CMServices
component of the Integration Toolkit offers the following operations to
extract attribute values from items or to evaluate conditions over
attributes:
Each of these operations takes an item PID (ItemRef
) as
input parameter and either a single attribute specification in the form
<itemTypeName>/<attributePath>
or an AttributeSpecs
data object that carries a list of individual attribute specifications.
<itemTypeName>
specifies the type of item that
holds the attribute value of interest (the same attribute may be defined
for many different items).
<attributePath>
can be an atomic attribute name or a
sequence of attribute names separated by '/' in case of an attribute
hierarchy (as for example in customer/address/city
).
getContentAttribute
and getFolderContentAttribute
are the 'single specification, single value' variants of the attribute
lookup. They return a single value based on a single attribute
specification and should not be used for looking up attributes of item
types where more than one instance may be stored in a folder. In this
case the 'multiple specification, multiple values' variants getContentAttributes
and getFolderContentAttributes
should be preferred. They
return arrays of values where each array corresponds to an item in the
folder. Note that these variants can also be used to look up multiple
attribute values within a single request to the library server.
The two variants getContentAttribute(s)
and getFolderContentAttribute(s)
differ in that the former looks up attributes of the folder while the
latter looks up attributes belonging to items within the folder. Note
that only a single level of embedding is supported by the Integration
Toolkit. The table below summarizes the available variants:
attribute of folder | attribute of item in folder | |
single spec, single value | getContentAttribute |
getFolderContentAttribute |
multiple spec, multiple value | getContentAttributes |
getFolderContentAttributes |
The following figure shows the typical use of a multiple attribute value lookup that consists of a preparational step that initializes the attribute specifications, the lookup service invocation, and an evaluation step that (in this example) prints the attribute values to the server's console.
The PrepareAttributeLookup
activity assigns the two
attribute specification XYZ_AdjReport/XYZ_LicPlate
and XYZ_AdjReport/XYZ_ClaimAmount
(not shown) to the variable AttributeSpecs
that serves as
input parameter to the 'multiple spec, multiple values' operation getFolderContentAttributes
that looks up attribute values on items that reside in the folder.
The result of the getFolderContentAttributes
operation
is a data object of type AttributeValues
that contains a
list of attribute values.
The Java snippet DisplayAttributeValues
retrieves the
result list and prints their attribute values to the server log. Note
that type conversion takes place while looking up values from the data
object. It is important to understand that though an AttributeValue
contains an element of type anySimpleType
that corresponds
to the class Object
, it can not simply be retrieved as
follows:
BigDecimal ca = (BigDecimal)claimAmount.get("value");
This leads to a class cast exception as claimAmount.get("value")
returns a string value. Instead the following format needs to be used as
in the example shown above:
BigDecimal ca = claimAmount.getBigDecimal("value");
Instead of printing the values to the server log, a typical use of attribute values is in conditional processing where the path through the process is controlled by the value of attributes or variables in the process. Furthermore, the links between activities in a parallel section (flow) can be conditional, meaning that the link is only followed if the condition is true. Since the values returned from an attribute lookup are mapped to Java classes they can be used in Java expressions that form case statements or link conditions. In the example above different paths of a process can be taken by comparing the claim amount value with a predefined threshold.
Alternatively, the boolean result of the operation evaluateCondition
can be used in conditional processing to base a decision on a content
query. evaluateCondition
takes a Content Manager XPath
expression as input parameter and returns true if the result of the
query is non empty. The following substitutable parameters can be
included in XPath expressions to further qualify the results:
%ITEMID% %COMPONENTID% %VERSIONID%
These substitutable parameters are replaced with the values of the Item ID, Component ID and Version ID (respectively) of the DB2 Content Manager item routed through the process. The Item ID and Component ID parameters are character strings, and the substituted values include quotes to produce a valid XPath expression. The Version ID parameter is a number, which can be used in numeric expressions (e.g. %VERSIONID% > 3). Note that use of these substitutable parameters is optional and that the XPath expression is not limited to querying attributes of items associated with the process.
Here is an example of a conditional link expression that checks to see if the mortgage amount exceeds $333,700:
This Java expression uses the %ITEMID%
substitutable
parameter to get the Content Manager Item ID associated with the
process. This Item ID qualifies the search so that it only applies to
the Content Manager item associated with the current process. In this
example, the item type is Mortgage and the name of the Content Manager
attribute is Amount. If the mortgage amount exceeds $333,700 for the
item associated with the current process instance, then the link will be
followed and the next activity on that link will be executed.
The Integration Toolkit provides some additional content services that operate on the folder which is routed through the process
Folder ServicesThe folder service adds one or more items to a folder. The two
available operations are addFlowItemToFolder
and addItemToFlowFolder
.
Both operations take the itemPid of the item that is routed through the
folder and an XPath query as input and return a numeric value that
represents the size of the result list obtained from running the XPath
query. The operations differ as follows:
addFlowItemToFolder
In this case the XPath query needs to return a folder. This operation
adds the item that is routed through the process to this folder. If the
item routed through the process is itself a folder this will create a
nested folder structure.
addItemToFlowFolder
In this case the item routed through the process needs to be a folder.
This operation adds the items returned by the XPath query to the folder
that is routed through the process.
The setACL
service sets the ACL of an item to a new
value. If this item is a folder, it recursively changes the ACLs of all
items in the folder to match this new ACL. Note that only a single level
of folder-containment is supported.
The input parameters of the setACL service are the ItemRef
of the item to be re-indexed (usually the item routed through the
folder) and the name of the new ACL.
The reindex
service assigns a new item type to an item.
Note that if this service is invoked on the item that is routed through
the folder, the activity that invokes it needs to be followed by createItemRef
and Initialize
activities as done at the beginning of a
content-centric process to ensure the information about this item is
consistent. For details on createItemRef
and Initialize
see section 4.3.
The input parameters of the reindex service are the ItemRef
of the item to be re-indexed and the name of the target item type. The
source and target item type need to be compatible for the reindex
operation to suceed as specified in the DB2 Content Manager
documentation. This operation has no output parameter.
Typically, end users are not aware of underlying technologies and need not be concerned with whether they are using a process management system or a content repository. Ideally, these users have a single user interface that enables them to efficiently search for information, regardless of how that information is stored. In order for this to be the case, the Integration Toolkit provides a combined query capability that efficiently searches for information in both the DB2 Content Manager library server and the process engine database (i.e. not only content and its attributes, but also properties of the enclosing process instance). This query capability utilizes search criteria for both systems (the "where" clause) as well as attributes (the "select" clause). Combined query results only include items to which the caller has access. This means that the item must exist in a work list, and that the caller be authenticated as a user who has access to the work item.
To take advantage of this combined query capability, a Web programmer uses the combinedQuery method available on the session bean of the Integration Toolkit which has the following interface:
public QueryResultSet combinedQuery( String selectClauseWorkflow, String flowItemTypeNameContent, String flowItemTypeAttributesContent, String additionalAttributesContent, String whereClauseWorkflow, String xPathContent, String orderByClauseWorkflow, java.util.TimeZone timezoneWorkflow);
The combinedQuery method returns a List
of result rows.
Each result row is a List
of columns that contains the
values in the order in which they are specified by the select clauses of
the query (first the process properties, then the item attributes). For
details on how this can be used to implement the concept of a worklist
see QuickStartClient\WebContent\listWorkItems.jsp
.
As work flows through a process management system, it is acted on by a variety of automated and manual steps. When a work item arrives at a manual step (task), the process management system must decide which users should have access to the item. This is referred to as staff resolution. WebSphere Process Server provides a highly configurable staff resolution facility that uses a role / verb model to identify user access for a work item. These are the predefined roles that describe the types of access supported:
Process Server uses staff verbs to assign users to these staff roles. The staff verbs are configurable queries to an underlying directory service, and are limited only by the power and flexibility of that service. For example, if the directory service supports a manager of relationship, then the staff verb can utilize that relationship to resolve a role to a manager of a user. WebSphere Process Server utilizes a pluggable interface to the underlying staff repository, and comes preconfigured with interfaces for LDAP, the WebSphere User Repository and a System directory.
One of the building blocks offered by the Integration Toolkit is the Content Manager-based user registry which uses the DB2 Content Manager user and group definitions to support group membership. This means that users only need to be defined once, using the DB2 Content Manager system administration interface, and that staff resolution can be performed at the group level. Alternatively an LDAP server can be used as a centralized repository for user and group definitions.
Note: Using a custom WebSphere User Registry affects all application running on the WebSphere Application Server such as the Administrative Console. With a dedicated WebSphere Application Server installation for DB2 Content Manager and Business Process Choreographer (potentially also hosting the Resource Manager application) this should typically not be a problem as we recommend to use the library server userid (icmadmin) as Application Server and process administrator. If the Application Server is intended to host other applications as well, potential side effects when using a custom user registry need to be considered.
quickStartSampleRev2wps.zip
contains a JAR file icmuserregistry.jar
with the CM-based user registry that is ready to be used. To install it
on a WebSphere Application Server proceed as follows:
icmuserregistry.jar
from quickStartSampleRev2wps.zip
and copy it to <WPS_HOME>\lib
.icmadmin
.icmadmin
into the Server user ID
field and the corresponding password into the Server user
password field.com.ibm.bpe.cm.conmgmt.ContentManagerWebSphereUserRegistry
into the Custom registry class name field.icmadmin
will be able to logon the next time the server is restarted.bpecm.properties
file needs to be in the Application Server's properties directory.
Furthermore, the cmbsdk81.jar
library, the JDBC driver and
the <IBMCMROOT>\cmgmt
folder need to be in the class
path of the application server. If you have performed the steps in Chapter 2 on this application server, this is all
set up properly. If not, you need to do the following:
Important: When using the integrated test environment with the BPE
and HTM administrator roles mapped to AdminsGroup
a
corresponding group definition needs to be created in DB2 Content
Manager using the Content Manager system administration client.
>> CM WAS User Registry - getUniqueUserId [...] >> CM WAS User Registry - getUniqueGroupIds, user=ICMADMIN >> CM WAS User Registry - check password for user icmadmin Cleaning up CM connection...>> successful.
perform the steps described in section 6.11 to re-enable credential caching as described.
Section 6.8 describes how the user
registry library can be exported from a Quick Start workspace. This may
be important, e.g. if you want to replace the simple algorithm used to
encrypt the password in bpecm.properties
with a more
sophisticated one. Note that the 'ROT13 encryption' only prevents the
password from being obvious. This may be OK if proper file access rights
are in place for the Application Server's install folders. For a real
production use this method may need to be replaced with a more
sophisticated encryption.
The Quick Start Client is a generic Web-based client that does not cover the full range of capabilities offered by DB2 Content Manager and WebSphere Process Server but it provides what can be thought of as a reasonable set of typically used functions and illustrates the use of the Integration Toolkit. Since it is available as source code it can be extended and adjusted to fit the specific needs of a certain solution.
All process-specific information can be found in QuickStartClient\JavaSource\com\ibm\bpe\cm\util\ProcessData.java
.
This class needs to be modified when using the client with different
roles and data. The following settings are typically subject to
modification:
Global constants
CM_DATASTORE_NAME
⇒ The name of the library
server database (e.g. icmnlsdb)AUTO_LINK_ATTRIBUTE
⇒ The name of the attribute
that defines folder membership if a folder is routed through the
processWorklist definitions
A worklist defines certain aspects of the client's look and feel. listWorkItems.jsp
lists the available work items based on a work list ID and showWorkItems.jsp
displays the available actions based on this work list ID. When a user
logs on to the system with a specific role, a work list ID must be
provided as parameter to listWorkItems.jsp
which it passes
along to showWorkItems.jsp
. The example customization of
the Quick Start client has an initial page index.jsp
from
which users can log on to different roles of the sample process. When
clicking on the map, a corresponding work list ID (WLID) is assigned so
that each user sees the appropriate list of work items.
Work list IDs are used as an index into three arrays: workListQueryMap
,
addToFolderActionItemTypes
, and addToFolderActionNames
.
They should be defined using symbolic constants as in the following
example:
static public final int ROLE1_WLID = 0; static public final int ROLE2_WLID = 1; static public final int NUM_OF_WLIDS = 2; static public final int DEFAULT_WLID = ROLE1_WLID;
The workListQueryMap
defines the columns of a worklist
for a given WLID in terms of process properties and item attributes. A WorkListQueryMap
defines the parameter of the combined query to be run when retrieving
work items for the role having this WLID.
addToFolderActionItemTypes
and
addToFolderActionNames
define which documents a user with this WLID can add to the folder that
is routed through the flow. For example
addToFolderActionItemTypes[ROLE1_WLID] = { "AdjReport", "FraudReport", "ReliabilityStudy" }; addToFolderActionNames[ROLE1_WLID] = { "Adjuster Report", "Fraud Report", "Reliability Study" };
...means that a user with WLID ROLE1_WLID
may add
instances of the item types djReport
, FraudReport
,
and ReliabilityStudy
to the folder that is routed through
the flow. The action column of the work page will refer to these actions
by Add Adjuster Report
, Add Fraud Report
, Add
Reliability Study
based on the elements of addToFolderActionNames
.
In- and output messages of participating tasks are implemented based
on input and output data objects assigned to the staff operation in a
WSDL file. We recommend a naming convention such as: <TaskName>TaskInterface.wsdl
for the WSDL and <TaskName>Request.xsd
for the input
data object and <TaskName>Response.xsd
for the output
data object. The name of the input parameter in the WSDL should be request
,
the name of the output parameter response
. JavaSource\com\ibm\bpe\cm\CompleteWorkServlet.java
relies on this naming convention. If all properties of the output data
object are of type String, this servlet automatically maps parameters of
the HTML form to the corresponding properties of the output data object
if the parameter name is identical with the name of the property. The
WSDL and XSD files are stored in QuickStartClient\WebContent\WEB-INF\lib
so they are in the runtime classpath of the Web application.
The method staffActions(String activityName, DataObject inDO)
defines the display elements for the 'Process activity' section of the
work page. This section is defined as a table segment spanning four
columns. There is no limit on the number of rows. The final column
always contains the available actions (Complete and Cancel). This
section typically displays some parts from the input message of this
staff activity (2nd parameter) and contains form elements that can be
used to instantiate its output message. The name of the form element
needs be of the form msgpart.xxx
where xxx
is
the name of the corresponding message part. If all properties of the
output data object (<TaskName>Response.xsd
) are of
type String, no custom logic needs to be added to JavaSource\com\ibm\bpe\cm\CompleteWorkServlet.java
as it automatically maps form values to output properties with the same
name. If non-string-typed variables are involved, an additional
conversion step is required in the process or custom logic needs to be
added to this servlet.
Here a simple example of a 'review activity' with an input data object that contains the text to be reviewed and an output message consisting of a rating in the range 1 to 5.
static public String staffActions(String activityName, DataObject inDO) { try { String result = "<td colspan=\"4\"></td>"; // default if (activityName.equals("Review")) { String textToBeReviewed = inDO.getString("TextToBeReviewed"); result = "<TD colspan=\"2\">\n" + "Text to be reviewed:" + textToBeReviewed + "</TD>" + "<TD colspan=\"2\">\n" + "<SELECT name=\"msgpart.rating\">" + "<OPTION value=\"1\" SELECTED>1</OPTION>" + "<OPTION value=\"2\">2</OPTION>" + "<OPTION value=\"3\">3</OPTION>" + "<OPTION value=\"4\">4</OPTION>" + "<OPTION value=\"5\">5</OPTION>" + "</SELECT>" + "</TD>"; } // 'Review' activity else if (activityName.equals("SomeOtherActivity")) { .... } } catch (WSIFException e) { e.printStackTrace(); } return result; }
QuickStartClient\JavaSource\com\ibm\bpe\cm\util\Helpers.java
contains a method
prepareName()
that can be used to map a
display name to some potentially truncated form that displays well on
the client pages. For the First Steps sample data this means cutting off
the comment in parenthesis: (Content Manager V8.1 Sample Item
Type)
or to truncate the display name of the XYZ_ClaimFolder Claim
Application Folder to contain other claim related documents (e.g.
adjuster report, auto photos, claim form, etc) and linked by Claim
Number
at character position 24. This method may be helpful in
cases like this where the display name serves as a 'description' of the
item type in addition to being the (localizable) name that is displayed
to users. prepareName()
assumes display names have the form
<actual display name> (<description>)
where <actual
display name
is the name to be shown in the client and (<description>)
is the comment that describes the item type in more detail. The
constants DISPLAY_NAME_SIZE_LIMIT
and DISPLAY_NAME_TRUNCATION_POS
can be used additionally to truncate long names (those the length of
which exceeds DISPLAY_NAME_SIZE_LIMIT
) to a maximum size of
DISPLAY_NAME_TRUNCATION_POS
. Note that specific rules may
need to be applied depending on the locale .
Since the QuickStartClient is a sample, it is not considered a complete Content Manager or Process Choreographer client. However, as the this section should have demonstrated, it is not specific to the sample process but can be easily modified to support other content and process models. Individual functions can be added by extending the available source code. Here is a list of some of the client's limitations.
sortFolderItmes()
of the CMBItem
class.Chapter 2 explained the steps required to set up a test environment. This section briefly covers some aspects that are important when planning to move to a production environment.
Globalization and AccessibilityAll Web pages of the Quick Start Client use UTF8 encoding. The static
content can easily be localized by creating translated versions of these
pages. To avoid code duplication for JSPs we recommend using a different
approach for most of the JSPs except help.jsp
, namely using
Java Resource Bundles since most JSPs only contain small portions of
static text such as banner or column titles. A similar approach needs to
be taken to internationalize messages of the Integration Toolkit such as
those thrown in case of an IntegrationException
or ConnectionException
.
Note that using images to represent the process flow as in index.jsp
requires a corresponding text-only version to meet accessibility
requirements.
For long-running processes in a production environment we recommend to consider replacing the use of Cloudscape as platform for the BPE database with an enterprise-level database such as DB2 UDB. See the WebSphere Process Server documentation for details on how this is done.
To avoid the server termination problem apply the steps in 6.4. Disabling the just in time compiler is not an option in a production environment.
Security and User ManagementFor evaluation purposes the development environment set up in chapter 2 used a file based custom registry. However, in a production environment this is not recommended as it relies on a file that contains passwords in readable format. For use in a production environment we recommend to use either the Content Manager-based user registry or an LDAP directory server. The steps required to use the Content Manager-based user registry are described in section 4.9 and 6.8. Details on using an LDAP server can be found in the product documentation referenced at the end of this document.
It may be advisable to consider implementing a 'real' encryption
method for the password stored in bpecm.properties
. The
sample offers a simple encryption method referred to as ROT13 which
prevents the password from being obvious but this does not offer a real
protection in cases where access to the Process Server's lib directory
is not (or can not be) properly protected. CMConnectionManagement\com\ibm\bpe\cm\conmgmt\Environment.java
supports the extension with stronger encryption mechanisms based on the
configuration property ContentManagerAuthenticationPwdEncryption
.
To create a custom integration solution the following projects need
to be imported from quickStartSampleRev2wps.zip
:
The folder QuickStartClient\WebContent\WEB-INF\lib
that
is in the runtime classpath of the Quick Start Client needs to include
the following resources: copies of bpe137650.jar
, task137650.jar
from <WPS_ROOT>\ProcessChoreographer\client
, bpecmutil.jar
from the same directory of the Integration Quick Start, and CMProcessInterface.wsdl
from CMBPCIntegrationLibrary\com\ibm\bpe\cm\
. Furthermore
the WSDL and XSD files for the task interfaces are to be placed into
this directory.
Create a process as described in section 4.3
adding functionality of the Integration Toolkit as described in the
respective sections of this chapter. As tasks are added, adjust the
definitions in QuickStartClient\JavaSource\com\ibm\bpe\cm\utils\ProcessData.java
accordingly. For testing purposes it may be useful to create a modified
QuickStartClient\WebContent\index.jsp
that allows logging
on to the process with different roles or starting the process either
explicitly (using a query) or implicitly (using Content Event Handling).
It may be useful to disable the feature Automatically delete the process after completion during testing as this simplifies investigating error conditions since failed work items remain the process database and can be retrieved using the BPC Explorer. Note that if the process contains a collection point or one or more human tasks it needs to be defined as long running. Both settings, Process is long-running and Automatically delete... can be made on the Details tab of the process properties view. To switch to this view click the white background of the process definition in the BPEL editor and click the Properties tab. Click Details to switch to the details view. This displays two check boxes with which these properties can be dis- or enabled.
Service invocation is one of the key integration patterns in service orientation architectures (SOA). DB2 Content Manager V8.3 offers a powerful web service interface and thereby adds a standards-based access to the content repository which can be invoked from any service consumer. WebSphere Process Server V6 comes with a BPEL compliant business process engine (Business Process Choreographer) that allows orchestrating and choreographing (web) service calls. This chapter explains the steps needed to invoke DB2 Content Manager web services from a BPEL process and how to build an integrated solution based on web service technology.
Here is an outline of the scenario used in this chapter:
XYZ_AdjReport
item type of the sample data.This chapter assumes the following system configuration:
Details on how to install the DB2 Content Manager web service support
can be found in the product documentation (see Further
Reading). The Content Manager web services support installs an
additional server cmwebsvc
on the WebSphere Application
Server. To perform the scenario described in this chapter the DB2
Content Manager web service server must be properly installed and
running. To verify this point your browser to the URL shown below. Note
that you may need to replace localhost
with the name of the
repository server and and you may need to add a port number.
To use the DB2 Content Manager web services in a Process Server environment, the following step needs to be performed to ensure proper treatment of namespaces.
<IBMCMROOT>\cmgmt\cmbxmlservices.properties
in an editor and add the lineforceItemNamespace=http://www.ibm.com/xmlns/db2/cm/beans/1.0/schema
Make sure you have installed WebSphere Integration Developer 6.0.1 with the WebSphere Test Environment (WTE) or an additional standalone WebSphere Process Server 6.0.1. No additional setup or configuration steps are required to work with the DB2 Content Manager web services.
In order to invoke a DB2 Content Manager web service, you need to export a WSDL package from the System Administration Client that contains WSDL and XSD files with information about...
Item type and attribute definitions are important ingredients of a DB2 Content Manager data model. When exporting the data model or parts of it to a WSDL package, the data definitions are translated to XSD definitions and thereby made available at the web service interface. If you plan to access your item type definition in a business process, make sure you defined them in DB2 Content Manager prior to exporting the web service definition. To export a complete data model into a WSDL package log on to the System Administration Client, select Data Modeling - Item Types and then right-click to bring up the pop-up menu. Select Export All to WSDL file. You can also export item types individually or subsets of item types by clicking them and selecting Export to WSDL file.
Specify a location for the resulting zip file. Then, extract the zip file to a location in your file system. As a result, you get the following four files:
CMWebService.wsdl
cmbmessages_modified.xsd
cmdatamodel_modified.xsd
itemtype_modified.xsd
Important: ensure that the port number and host namematches your
settings of the cmwebsvc
service. This information can be
found near to the end of CMWebService.wsdl
:
<wsdl:port binding="tns:CMWebServiceBinding" name="CMWebServicePort"> <soap:address location="http://localhost:9081/CMBSpecificWebService/services/CMWebService"/> </wsdl:port>
Start WebSphere Integration Developer 6.0.1 (WID), point the workbench to a new empty workspace, and proceed as follows:
QueryCM_Module
and click Finish.QueryCM_Process
into the name
field and click Finish. This creates the artifacts for
a new business process based on a simple interface with a single input
variable Input1
of type String. This
variable will be used later to specify a DB2 Content Manager XPath
query string.When the process generation step is completed the WID screen look as follows:
In order to work with the DB2 Content Manager web services, you need to import both the web service definition and the data definitions (based on the item types) to WebSphere Integration Developer.
Note: You might have to disable XML schema validation before importing the Content Manager WSDL and XSD files. Select Window > Preferences > Validation and disable the XML Schema Validator checkbox.
Explore the imported definitions in the Data Object, Interface and Web Service Ports sections of the Business Integration view.
In order to run our scenario, we need input and output messages for the RunQuery web service call. For result processing in a loop, we also need a counter and a variable to store an item from the result set.
Variable name | Data Type |
QueryRequest |
RunQueryRequest (CM definition) |
QueryReply |
RunQueryReply (CM definition) |
Item |
Item (CM definition) |
ResultCount |
int |
FirstName |
string |
LastName |
string |
Variable
.Variable
with the
corresponding name from the table below.
CMWebServicePortType
interface definition
from the Business Integration view and drop it to the
Reference Partners section of the BPEL editor. This
creates a new partner which can be referenced by invoke activities of
the BPEL process.Model the BPEL process according to the following layout by selecting activity types from the menu on the left of the BPEL editor and dropping them onto the appropriate location of the business process. While the activity stays selected, click the Description tab of the Properties view to enter the activity name.
Note that this is an example of a non-interruptible process (micro flow) since it does not involve human activities (tasks) and potentially long-running services such as a collection point. Non-interruptible processes do not need to store information about intermediate process states in the process engine's database and run in a single transaction. If a process does not qualify as non-interruptable, this needs to be explicitly set by right-clicking the background of the BPEL editor and selecting Process is long-running in the Details pane.
Input1
(as a String). No additional
parameters need to be set - just use the Receive
activity which the tools create for you. "From" parameter type | "From" parameter value | "To" parameter type | "To" parameter - QueryRequest |
Fixed Value | ICM |
Variable | /AuthenticationData/ServerDef/ServerType |
Fixed Value | icmnlsdb |
Variable | /AuthenticationData/ServerDef/ServerName |
Fixed Value | icmadmin |
Variable | /AuthenticationData/LoginData/UserID |
Fixed Value | <password> |
Variable | /AuthenticationData/LoginData/Password |
Variable | Input1 |
Variable | /QueryCriteria/QueryString |
Fixed Value | ATTRONLY |
Variable | /retrieveOption |
CMWebServicePortType
partner link to invoke the DB2 Content Manager RunQuery
web service.CMWebServicePortType
partner:
CMWebServicePortType
from the list of partners. Click OK.QueryRequest
as input variable.QueryReply
as output variable.ResultCount
. Use the details panel to copy /ResultSet/count
in QueryReply
to variable ResultCount
. ResultCount
variable from the list to the
right into the drawing area.0
.ResultCount
variable to the first and the snippet representing the constant 0 to
the second input slot of the comparison operator and wire the output
slot of the comparison to snippet labeled Result.
FirstName
and LastName
.
"From" variable Item | "To" variable |
/ItemXML/XYZ_AdjReport/XYZ_AdjustFName |
FirstName |
/ItemXML/XYZ_AdjReport/XYZ_ClaimLName |
LastName |
The QueryCM_Module
will now be completed by connecting
the sample process with the required partner. Then we describe how the
business process can be tested using the BPC Explorer.
QueryCM_Process
you
just modeled into the editor view.
CMWebServicePortType
from the Business
Integration view and drop it into the assembly area. The Component
Creation window opens.CMWebService
into the name field.
Now that the module creation has been completed the new application
is ready to be deployed and tested. Create a new server configuration
pointing to a WebSphere Process Server installation and add your module
to the server (right-click the server configuration, select Add
and remove projects, and add QueryCM_ModuleApp
to
the list of configured projects). Start the server and use the BPC
explorer to submit a new request to your business process (right-click
the server configuration and select Launch > BPC Explorer).
In the BPC Explorer start a new Process (click on My Process
Templates, select QueryCM_Process and click on Start
Instance). To test your business process, add /XYZ_AdjReport
as the input string for the input message. This will return all adjuster
report data stored with the DB2 Content Manager first steps sample data.
The console output created by the BPEL process looks as follows:
Please note that for simplicity of this description, no error
handling has been implemented. In particular, the business process logic
assumes that the Content Manager query returns solely items of type XYZ_AdjReport
.
If you specify an XPath query that results in a set of items of a
different type, the business process will fail with an exception.
With this business process, you have built a new service which implements a certain interface and performs a certain task. In the SOA programming model, it is straightforward to reuse this new service and aggregate it to create new services based on the existing ones. The SCA programming model in WebSphere Integration Developer allows you to export the new service in several different ways (e.g. as SCA service, web service or JMS service) and to use it within other modules.
XYZ_ClaimFolder
and
check their values for XYZ_ClaimNumber
.Server server1 open for e-business
shows up in the console view. Note that other messages may follow so it
may not be the last one that shows up during the startup procedure.Server server1
is stopped.
signals successful completion of the step.<WPS_PROFILE_HOME>\logs\server1
.<WPS_PROFILE_HOME>\bin\startServer.bat
(hint:you may want to create a script that cleans up the logs and then
starts a process to automatize the cleanup).Server
server1 open for e-business
shows up. Note that other messages
may follow so it may not be the last one that shows up during the
startup procedure.<WPS_PROFILE_HOME>\logs\server1\SystemOut.log
with an editor and search for a line that says Web Module
adminconsole has been bound to admin_host[*:9060,*:9043]
. The
first number shown between the square brackets is the <ADMINPORT>
and the second one is the <SECURED_ADMINPORT>
that
needs to be used if security is enabled.<http://<HOSTNAME>:<ADMINPORT>/ibm/console
(if security is not enabled) or <https://<HOSTNAME>:<SECURED_ADMINPORT>/ibm/console
(if security is enabled).<WPS_PROFILE_HOME>\bin\stopServer.bat
and wait for the message Server server1 is stopped.
which
signals successful completion of the step./*[<Claim Number (Content Manager
V8.1 Sample Attribute)> LIKE "3-%"]
to identify all items
created when running the Quick Start Client.icmnlsdb
as icmadmin
and drop
the three tables bpecontentevents, bpecollectionpoints,
bpecollectionpointitemtypes
.With the just in time compiler enabled the server may terminate due to a mismatch between the Java Runtime Environment and the legacy DB2 JDBC driver. Disabling the just in time compiler is a quick but undesirable fix with significant performance impact. It is recommended to update the Java Runtime Environment to the latest interim fix or fixpack to get rid of this problem. By the time this documentation is published, this is Service Release 4 that can be downloaded from this support page. The required files and instructions are on the support site. Here are some hints that help to install the update:
<WPS_HOME>
folder.<WPS_HOME>\updateinstaller\maintenance
.<WPS_HOME>\updateinstaller\update.exe
.server1
and log on to the administrative
console.Servers > Application
Servers
, and click server1.TViewerApplet.java
has been changed.
cmbview81.jar
into this folder.
<IBMCMROOT>\lib
,
and click OK.cmbview81.jar
.QuickStartClient/WebContent/appletViewer
in the
Into folder: field.QuickStartClient/WebContent/appletViewer/cmbview81.jar
and select Refresh.ContentViewerApplet
.<WORKSPACE_FOLDER>\QuickStartClient\WebContent\appletViewer
.
Type appletViewer.jar
into the File name:
field and click Save.QuickStartClient/WebContent/appletViewer/appletViewer.jar
and select Refresh.CMBPCIntegrationApp
,
QuickStartClientApp
, or ClaimsHandlingApp
is
currently deployed on the server, perform the following steps to
undeploy them:
The
project cannot be built until its prerequisite XXX is built. Cleaning
and building all projects is recommended
(where XXX
is a project name such as CMBPCIntegration
) you can get
rid of this error with the following trick: on the main menu select
Project > Build Automatically which switches off the
automatic build mode. Do the same again to switch the automatic build
mode back on again. This re-builds the projects and removes the error
message. Wait for the progress information that says Building
workspace to complete.<WPS_PROFILE_HOME<\logs\server1\SystemOut.log
and <WPS_PROFILE_HOME<\logs\server1\SystemErr.log
)
for potential problems.>>
.
These contain output from the Integration Toolkit. The startup sequence
should, for example, list the message >> CMBPCIntegration
services started
that signals successful initialization of the
asynchronous bean. If Content Event Handling is used (based on
attributes WF_OnCreate
or WF_OnDelete
, you
may see messages of the type >> Dropping trigger WP...
or >> Adding trigger ... to column ... of table ...
.
If Content Event Handling or the Collection Point mechanism is used the
first time, the startup sequence will contain messages that indicate
the creation of the corresponding tables (BPECONTENTEVENTS
,
BPECOLLECTIONPOINTS
, and/or BPECOLLECTIONPOINTITEMTYPES
.
Potential warnings may savely be ignored.The enterprise application ClaimsHandlingApp
can be
started as follows:
To stop an enterprise application ClaimsHandlingApp
perform the following steps:
wasadmin
or icmadmin
)
and select Process Instances > Administered by me.Perform the following steps to generate a (new) icmuserregistry.jar
from your workspace:
CMConnectionManagement
<WPS_HOME>\lib\icmuserregistry.jar
into
the Select the export destination field.JAR export finished with warnings. See details
for additional information
may show up where the details say /CMConnectionManagement/META-INF/MANIFEST.MF
was replaced by the generated MANIFEST.MF and is no longer in the JAR.
.
This message can safely be ignored. Click OK
to close the
message window.With global security enabled, the console view of WebSphere Integration Developer may refuse to display log files. A solution for this problem is described in this Technote.
The XSD specification allows different data types to have the same
QName. cmbwebservices.jar in <IBMCMROOT>\lib
contains
an instance of cmbmessages.xsd
which shares QNames with
definitions in cmbmessages_modified.xsd
that has been
imported from the Content Manager administration client. To ensure
definitions with the same QName occur only once on the classpath,
perform the following steps when using the Web Services in combination
with the Integration Toolkit:
icmadmin
ws.ext.dirs
and replace ${IBMCMROOT}/lib;
with ${IBMCMROOT}/lib/cmbsdk81.jar;${IBMCMROOT}/lib/cmb81.jar;${IBMCMROOT}/lib/log4j-1.2.8.jar;
.The following steps are only needed if you plan to use the Quick Start Client:
Deployment Descriptor: QuickStartClientApp
to open it with the editor.ICMLIB
into the Name: field.DB2 Content Manager libraries
for use with the CM/WPS Integration Quick Start
into the Description:
field.${IBMCMROOT}/lib/cmbservlets81.jar
${IBMCMROOT}/lib/cmbtag81.jar
${IBMCMROOT}/lib/cmbview81.jar
If the following sequence of messages shows up test server console
periodically (approx. every second) this means that credential caching
is disabled and the server has to go to DB2 Content Manager each time it
needs to authenticate the user icmadmin
. Perform the steps
listed below to re-enable credential caching.
>> CM WAS User Registry - getUniqueUserId [...] >> CM WAS User Registry - getUniqueGroupIds, user=ICMADMIN >> CM WAS User Registry - check password for user icmadmin Cleaning up CM connection...>> successful.
icmadmin
.Simple WebSphere
Authentication Mechanism (SWAM)
and click OK.Lightweight Third Party
Authentication
.The following terms are trademarks of the International Business Machines Corporation in the United States, other countries, or both:
IBM | i5/OS | z/OS |
Redbooks | AIX | Cloudscape |
DB2 | DB2 UDB | DB2 Universal Database |
WebSphere | Lotus | Tivoli |
Linux is a trademark of Linus Torvalds in the United States, other countries, or both.
Microsoft, Windows, and Windows NT are trademarks of Microsoft Corporation in the United States, other countries, or both.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.UNIX is a registered trademark of The Open Group in the United States and other countries.
Other company, product, and service names may be trademarks or service marks of others.