This example demonstrates how a credit request can be processed by a bank using WebSphere MQWorkflow's web and WebSphere MQ interfaces.

This example illustrates how to use WebSphere MQWorkflow and the WebSphere MQWorkflow Web Client. It uses a DB2 database to permanently store customer and credit information. This information is displayed and updated while working on the credit request.
All database updates are performed using a user-defined Program Execution Server, whereas Java Server pages are used to retrieve the data from the database, based on key information in WebSphere MQWorkflow.
Subsequently '<MQWFDir>' should be replaced with the actual WebSphere MQWorkflow root directory (e.g. 'C:\MQWF') and '<CFGID>' with the configuration ID (e.g. 'FMC') under which the WebClient has been configured. '<WASDIR>' should be replace with the WebSphere Application Server's root directory (e.g. 'C:\WebSphere\AppServer').
If you have an older version of the SupportPac installed, replace the contents of the <MQWFDir>\scenario\WebCredit directory with the new files. The existing customer database and the WebSphere MQ setup can be left untouched (don't create the database, queue or channels if migrating).
Then follow the installation instructions below to copy the JSPs to the right location.
For the Java UPES, the default queue name has been changed from 'WEBCREDIT' to 'WebCreditInput' (mixed case) and the default queue manager has been changed to 'FMCQM'. You should import the new WebCredit FDL.
In the installation instructions it is assumed that you use a Microsoft Windows NT/2000/XP Installation with default settings for database and queue manager. If you don't have a default installation, you must modify the FDL (<MQWFDir>\scenario\WebCredit\Model\WebCredit\WebCredit.fdl) to direct the user-defined Program Execution Server to the queue manager and queue you selected and update the CustomerUPES.properties file to reflect your environment.
Make sure your Web Server (or the user ID that the Web Server uses) has connect authorization to DB2 - otherwise the JSPs cannot read data from DB2 (this includes adding the file 'db2java.zip' to the Web Server's CLASSPATH so that the Web Server has access to the JDBC classes).
This section explains the installation of the web pages for WebSphere V5.x.
WebSphere V5 is configured by deploying an Enterprise Archive (.EAR File) which holds a Web Application Archive File (.WAR File) that has been created by the WebSphere MQWorkflow configuration utility (fmczutil).
During deployment of the enterprise archive all the contents of the .EAR and .WAR files are being unzipped into WebSphere's installedApps directory into a directory '<WASDIR>\installedApps\<hostname&rt;MQWFWebClient_<CFGID>.ear\fmcohcli.war'.
From the scenario\WebCredit directory, copy the contents of the starter directory to the configured Web Application Server's fmcohcli.war\programs directory and the contents of the program's directory to the configured Web Application Server's fmcohcli.war\programs directory.
If using a workflow configuration ID different from 'FMC' for the Web Client, the pages that start the process have to be modified to reflect the configuration ID.
The WebClient in WebSphere MQWorkflow is usually configured to include the workflow configuration ID in its URL (e.g. '/MQWFClient-WEB') except when the WebClient has been created for the default configuration. In this case the URL is just '/MQWFClient'. This means that all occurrences of '/MQWFClient/' have to be replaced to '/MQWFClient-<CFGID>/' where '<CFGID>' is the ID under which the WebClient has been configured if the WebClient is configured under anything but the default configuration ID.
The following files in the starter directory have to be adapted (search for 'MQWFClient'):
If you want to use the Java-based UPES you'll have to follow the following steps. If you want to use the WebSphere MQIntegrator Broker V2 message flow you'll have to follow the steps in the message flow installation section.
In the following steps <FMCQM> is used for the name of Workflow's queue manager. Please substitute your actual name whenever you see this placeholder.
A WebSphere Business Integration Modeler process model has been supplied. It can be found in the directory <MQWFDir>\scenario\WebCredit\Model\WebCredit. The WebSphere Business Integration Workbench (version 4.2.3 or higher) can be used to examine/simulate the process model. The same directory holds a file (WebCredit_4_Monitor.xml) which can be used into the WebSphere Business Integration Monitor to monitor the process.
Now follow this link to import the FDL.
For WebSphere MQWorkflow to be able to talk to WebSphere MQIntegrator Broker it is necessary to setup connectivity between the two WebSphere MQ queue managers. You'll need to create Channels that connect WebSphere MQWorkflow's queue manager with WebSphere MQIntegrator's queue manager. This SupportPac contains three script files for WebSphere MQ to create the required resources. The file extension is: mqs and they are located in <MQWFDir>\scenario\WebCredit\MessageFlow. Before you run them, check the contents and change them, if necessary for your environment. For details on how to create channels and transmission queues, refer to the WebSphere MQ System Administration. See the chapter on Remote Administration.
This file is used to define the required queue for 'send' and 'receive' from the queue manager FMCQM to MQSIQM. If you use other queue manager names than the proposed ones, change the queue manager name in this file as well. In addition, you must adapt the host name. Change the localhost to your host name and replace 1414 with the port as defined in the MQSI configuration. (1414 is the default port used by WebSphere MQ.)
After having adapted this file to your environment, create the channel using the following WebSphere MQ command from a command prompt:
runmqsc FMCQM < fmcqmcl.mqs
This file is used to define the required queue for 'send' and 'receive' from the queue manager MQSIQM to FMCQM. If you use other queue manager names than the proposed ones, change the queue manager name in this file as well. In addition, you must adapt the host name. Change the localhost to your host name and replace 5010 with the port defined in the WebSphere MQWorkflow configuration on the Queue Manager page. (5010 is the default port used by WebSphere MQWorkflow.)
After having adapted this file to your environment, create the channel using the following MQ command from a command prompt:
runmqsc MQSIQM < mqsiqmcl.mqs
An additional queue is needed as input for WebSphere MQIntegrator Broker, where WebSphere MQWorkflow puts the XML message. This queue must be created in the WebSphere MQIntegrator Broker queue manager, using this command:
runmqsc MQSIQM < mqsiqmq.mqs
Alternatively, you can create all the definitions manually. Follow this link to see instructions on how to do this. If for whatever reason you don't get messages into the WebCreditInput queue on the WebSphere MQIntegrator Broker Queue Manager, try to delete the definitions that were created automatically and recreate them manually.
fmcibie -uADMIN -ppassword -o -i -t <MQWFDir>\scenario\WebCredit\Model\WebCredit\WebCredit.fdl
Make sure that you have already imported the FDL file that contains the 'STARTER' user ID (<MQWFDir>\scenario\credit\starter\starter.fdl), which is contained in the WebSphere MQWorkflow Credit Scenario.That's it. You can go on to running the scenario.
This step is only necessary if you use the Java-based UPES. If you running WebSphere MQIntegrator Broker, you can skip this step and continue.
Locate the file CustomerUPES.bat in the the directory <MQWFDir>\scenario\WebCredit\CustomerUPES.
Start the UPES using the CustomerUPES.bat batch file. To demonstrate how WebSphere MQ holds on to a message it's possible to defer starting the UPES until a message has arrived in the queue (e.g. after the first activity in the process has been executed).
If you want to shutdown the Customer UPES you can use the shutdown script that's provided in <MQWFDir>\scenario\WebCredit. Since this version of the UPES is implemented with Synchpoint control it is also possible to just kill the UPES (it may take a short while for WebSphere MQ to clean up its resources however).
Note: Note that the very first access to each Web page may be slow since the Web Server needs to compile the Java Server pages. Any subsequent access will be much faster.
There are two user IDs, WEBBANK_CLERK and WEBBANK_LOANMANAGER, that are used in the business process. All steps are done by the WEBBANK_CLERK, except for an optional approval step. This has to be done by the WEBBANK_LOANMANAGER (only if the credit risk is not considered 'Low'). Log on to the WebSphere MQWorkflow Web Client using the user ID WEBBANK_CLERK and start the activities assigned to this user ID.
Note that this is demonstration code. For an implementation of production quality, you would have to implement certain parts in a different way.
Currently all JSPs open or close their own database connection for each request. While this works fine for the purposes of this demonstration, a robust implementation would use database connection pools - for example, DataSources within the IBM WebSphere Application Server.