The samples for the Web client are installed automatically, but they are not part of the Web client configuration, therefore, they are not configured automatically. When you have installed the Web client, you must configure the samples according to the information provided in the following sections.
It is assumed that you have installed and configured the Web client, and created a process template list, a process instance list, and a work list before configuring the samples. You can create these lists after having logged on to the Web client for the first time, or by using the standard MQ Workflow Client.
The following samples are provided with the Web client:
Core Viewers | The core viewers provide the source code for the DefaultViewer and JSPViewer classes. |
InternetConnectionViewer | With this sample, you can change the look and feel of the worklist to mimic the IBM FlowMark V2 Internet Connection. |
CommandHandlerAdapter | With this sample, you can register more than one command handler and dispatch commands. |
HTMLDocHandler | With this sample, you can access the process documentation from the template list of the Web client. |
AuditTrailHandler | This sample uses JDBC and XML to display audit trail information for processes and activities. |
EmailHandler | This sample uses SMTP to send notification e-mails when an item has been transferred. |
Credit Request | This sample contains Web client additions for the credit request sample that is delivered with MQ Workflow. |
StarterPEAHandler | This sample uses the onLogon hook to start a batch Program Execution Agent (PEA) for the 'Web user'. |
BasicAuthenticationHandler | This sample demonstrates third-party authentication using HTTP/1.1 Basic Authentication. |
Application Data Integration | This sample demonstrates how to integrate non-MQ Workflow data in activity implementation JSPs. |
Group Work List | The group work list is a 'tutorial' where you learn how to create your own group worklist, according to the design given by the Web client. It shows how you can you can customize the worklist and how to add new commands. |
Web Credit Request (web) | This sample is a complementary support pack that illustrates the 'Web user' feature and the usage of a User-defined Program Execution Server (UPES). |
If you want to work with MQ Workflow directly ('out of the box'), you can use the core
viewers which offer the full functionality of the MQ Workflow APIs. The files are called
<MQWFDir>/smp/WebClient/DefaultViewer.java
and
<MQWFDir>/smp/WebClient/JSPViewer.java
. You can also use the sample code for developing your own viewers.
This viewer offers minimal worklist functionality, such as checkin, checkout, or refresh. This
sample changes the look and feel of the worklist of the Web client to mimic the IBM FlowMark V2
Internet Connection. To do this, you can register a custom Viewer
, or replace the JSP
that is responsible for rendering the lists when using the JSPViewer
. You can switch your browser to German to see localized texts. German is the only available translated language for the viewer. Also refer to the API documentation for
InternetConnectionViewer.java.
To run this sample using a custom Viewer
:
point.gif
, workflow.gif
, and restart.gif
files from the <MQWFDir>/smp/WebClient/images
directory to the
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/images
directory.WebClient.properties
file and set
DefaultViewer=com.ibm.workflow.servlet.sample.InternetConnectionViewer |
<MQWFDir>/smp/WebClient
directory. You must restart the Web client to activate the changes you made.
CLASSPATH
because this sample viewer is already contained in the fmcohcli.jar
file.To run this sample using a custom JSP:
point.gif
, workflow.gif
, and restart.gif
files from the <MQWFDir>/smp/WebClient/images
directory to the
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/images
directory.<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/forms/ListViewer.jsp
file, then
copy <MQWFDir>/smp/WebClient/forms/InternetConnectionListViewer.jsp
to
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/forms/ListViewer.jsp
. Make sure that the new ListViewer.jsp
has its modification time updated. Otherwise, the JSP might not be recompiled.WebClient.properties
file and set
DefaultViewer=com.ibm.workflow.servlet.client.JSPViewer |
ListViewer.jsp
from your backup.This sample
CommandHandler loads up to 16 other command handlers and dispatches user-defined
commands to them, so that you can use more than one custom handler. It also
shows how to read settings from the WebClient.properties
file. Also refer to the API documentation for
CommandHandlerAdapter.java.
To use this sample:
WebClient.properties
file and set
CommandHandler=com.ibm.workflow.servlet.sample.CommandHandlerAdapter |
[CommandHandlerAdapter]
section of the WebClient.properties
file, register all command handlers that you want to use by adding lines of
the form
<CommandHandlerClassName>=<index> |
CLASSPATH
because this sample CommandHandler is already contained in the fmcohcli.jar
file.
With this sample, you can access HTML documentation that is exported from MQ Workflow Buildtime from the template list of the Web client. See also the API documentation for HTMLDocHandler.java.
To prepare the HTML documentation for a process:
ProcessDocs
subdirectory in <MQWFDir>/cfgs/<cfgID>/WebClient/webpages
. The process documentation files will be created in this directory. If the Buildtime component is
installed on a different machine than the Web client, you must copy the exported HTML files to that subdirectory on your Web server.<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/ProcessDocs/<ProcessName>.htm
.
Use the process name as file name, and use .htm
(not .html
) as file extension. This is necessary because the HTMLDocHandler uses the Process Template name to find the corresponding HTML file. For the same reason you must export each process individually.
To run this sample:
htmldoc.gif
file from the
<MQWFDir>/smp/WebClient/images/action
directory to the
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/images/action
directory.WebClient.properties
file and set
CommandHandler=com.ibm.workflow.servlet.sample.HTMLDocHandler |
Alternatively, you can use the CommandHandlerAdapter. You must restart the Web client to activate the changes.
Note:
You need not change the CLASSPATH
because this sample CommandHandler is already contained in the fmcohcli.jar
file.
HTMLDocHandler
does not show an icon for processes for which no HTML documentation is available in the <MQWFDir>/cfgs/<cfgID>/WebClient/webpages/ProcessDocs
directory. You can find the source code for this CommandHandler in the <MQWFDir>/smp/WebClient
directory.This sample accesses the audit trail using JDBC and returns the event data in XML format. This data is then formatted using XSL style sheets. You can query the audit trail data from the process list where a table with all events is displayed, or from the worklist, on which activity statistics are displayed. Both lists use the Bean Scripting Framework to exploit JavaScript within the XSL style sheet. See also the API documentation for AuditTrailHandler.java.
CLASSPATH
of your application server. As a rule, this is
the location where you registered the fmcohcli.jar
file. In
WebSphere, for example, the location is the 'Command line arguments'
field on the 'Application Server Properties' - 'General' page. If you are using Xalan-Java
V2.2-D13 or later, you must also add the xml-apis.jar file to the CLASSPATH.
CLASSPATH
of your application server.
audittrail.gif
file from the
<MQWFDir>/smp/WebClient/images/action
directory to the
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/images/action
directory.
AuditTrail.xsl
and Statistics.xsl
from the
<MQWFDir>/smp/WebClient/xml/xsl
directory to the
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/xml/xsl
directory.WebClient.properties
file and set
CommandHandler=com.ibm.workflow.servlet.sample.AuditTrailHandler |
DB2Server
, Database
, DB2User
,
and DB2Password
settings in the [AuditTrail]
section
of the WebClient.properties
file
and make sure they are correctly set for your environment.StyleSheetPI
and the StyleSheetWI
lines to get formatted HTML pages instead of the XML output data. You must restart your application server to activate the changes you made.
This sample handler intercepts the transferItem command in the ListViewer.jsp
file. With this sample, you can specify an e-mail address that determines where to send the notification of the item transfer. See also the API documentation for
EmailHandler.java.
CLASSPATH
of your application
server. As a rule, this is the location where you registered the
fmcohcli.jar
file. For example, in WebSphere the location is
the 'Command line arguments' field on the 'Application Server Properties'
-> 'General' page.
EmailViewer.jsp
file from the <MQWFDir>/smp/WebClient/forms
directory to the <MQWFDir>/cfgs/<cfgID>/WebClient/webpages/forms
directory. If your mail client natively supports HTML, you can also copy the
<MQWFDir>/smp/WebClient/forms/EmailViewer_html.jsp
file to
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/forms/EmailViewer.jsp
. This also contains some additional documentation.
WebClient.properties
file and set
CommandHandler=com.ibm.workflow.servlet.sample.EmailHandler |
DefaultViewer=com.ibm.workflow.servlet.client.JSPViewer |
DefaultViewer
class.
Host
and the Address
settings in the
[SMTP]
section of the WebClient.properties
file, and make sure that they are set correctly for your environment. You
must restart your application server to activate the changes you made. This sample contains HTML and JSP forms that you can use with the Credit Request sample that is delivered with MQ Workflow. It shows how to customize the look and feel of the forms that are displayed when processes and work items are started from the Web client. For further details, refer to the corresponding section in How to execute activities. This sample also shows how to use the 'Web user' feature of the Web client that allows you to start processes without logging on to MQ Workflow.
To run this sample using the Web client:
<MQWFDir>/scenario/credit/fmccred.fdl
into the Runtime database and translate it. For details on how to use the Runtime import utility,
refer to the MQ Workflow Getting Started with Buildtime book.<MQWFDir>/scenario/credit/processes
directory to the
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/processes
directory.<MQWFDir>/scenario/credit/programs
to the
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/programs
directory.<MQWFDir>/scenario/credit/images
to the
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/images
directory.creditsample.css
from the <MQWFDir>/scenario/credit
directory to the <MQWFDir>/cfgs/<cfgID>/WebClient/webpages
directory.WebClient.properties
file and set
DefaultViewer=com.ibm.workflow.servlet.client.JSPViewer |
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/processes/CreditRequest.jsp
.
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/programs/NCollectCreditData.jsp
.
To run this sample using the 'Web user' feature:
<MQWFDir>/scenario/credit/fmccred.fdl
into the Runtime database and translate it. For details on how to use the Runtime import utility,
refer to the MQ Workflow Getting Started with Buildtime book.<MQWFDir>/scenario/credit/starter
directory to the <MQWFDir>/cfgs/<cfgID>/WebClient/webpages/starter
directory.<MQWFDir>/scenario/credit/starter/starter.fdl
file
to create a user ID STARTER with the password password.WebClient.properties
file and set
DefaultViewer=com.ibm.workflow.servlet.client.JSPViewer |
WebClient.properties
file by setting the StarterUserID
and StarterPassword
properties. You must restart the Web client to activate these changes. The
StarterUserID
cannot be used to log on to MQ Workflow with the
Web client./MQWFClient
, which is the default when the Web client is configured in the default configuration FMC, you must enter the new root URI in this file. For configurations other than FMC this is MQWFClient-<cfgID>
.This sample shows how to use the CommandHandler.onLogon() and CommandHandler.onLogoff() hooks to automatically start a Program Execution Agent for the 'Web user'. See also the API documentation for StarterPEAHandler.java.
Note: This Program Execution Agent (PEA) is not suited for activities that require user interaction, because it runs on the application server machine. If you expect a rather high workload for the Web user ID, use a User-defined PES (UPES) instead of this PEA. For a completely different use of the onLogon
hook see the Group Work List tutorial.
WebClient.properties
file and set
CommandHandler=com.ibm.workflow.servlet.sample.StarterPEAHandler |
WebClient.properties
by adding the following line:
StarterPEA=true |
This sample shows how to use the
CommandHandler.getCredentials() hook to extract credentials from an HTTP request that are later used to authenticate with MQ Workflow without having to specify a userID
and password
for the
BuiltinHandler.logon() command.
See also the API documentation for
BasicAuthenticationHandler.java.
WebClient.properties
file and set
CommandHandler=com.ibm.workflow.servlet.sample.BasicAuthenticationHandler |
fmczchk -c inst:m,RTAuthenticationExitTypeServer,JAVA -y <cfgID> |
CLASSPATH=<MQWFDir>\bin\fmcoutil.jar;<MQWFDir>\bin\fmcohcli.jar |
com.ibm.workflow.java.exit.Authentication
)
is already contained in the fmcohcli.jar file. Therefore, if you do not use this sample, you must not put this .jar file on the CLASSPATH of the MQ Workflow Administration server.java.exe
file in the
<WinDir>\system32
directory because the MQ Workflow Java bridge must be able to find the JVM DLL.
@setlocal @fmczchk -bc inst:m,RTAuthenticationExitTypeServer,JAVA -y <cfgID> @set path=<JDKDir>\bin;%path% set CLASSPATH=<MQWFDir>\bin\fmcoutil.jar;<MQWFDir>\bin\fmcohcli.jar start fmcamain -c -y <cfgID> @endlocal |
userID
or
password
.This sample shows how to display non-Workflow data in activity implementation JSPs, how to store non-Workflow data entered in theses JSPs, and how to use custom icons in the process monitor.
Custom icons are assigned to activities when modeling the process in the MQ Workflow Buildtime component. If you want these icons to be displayed in the process monitor of the Web client, they must be converted to the JPG format and placed in the <MQWFDir>/cfgs/<cfgID>/WebClient/webpages/images/icons
directory. On Unix platforms, make sure that the file names have lowercase characters only.
To run this sample:
<MQWFDir>/smp/WebCredit/appdata.fdl
into the Runtime database and translate it. For details on how to use the Runtime import utility, refer to the MQ Workflow Getting Started with Buildtime book.ACreateCustomer.jsp
, ASaveCustomer.jsp
,
and AShowCustomer.jsp
files from the
<MQWFDir>/smp/WebClient/programs
directory to the
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/programs
directory.letter.jpg
and the diskette.jpg
files from the
<MQWFDir>/smp/WebClient/images/icons
directory to the
<MQWFDir>/cfgs/<cfgID>/WebClient/webpages/images/icons
directory.