Content Supported by Sourcelens Consulting
<html>
<head>
<title>Work-Flow sample using the Microsoft Message Queue and Visual Basic</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body>
<div align="center"><center>
<table border="0" cellpadding="0" cellspacing="8" width="98%">
<tr>
<td align="right" valign="top" width="20%"> </td>
<td width="15"></td>
<td valign="bottom" width="80%"><font size="5" face="Arial">Work-Flow sample using the
Microsoft Message Queue & VB </font></td>
</tr>
<tr>
<td valign="top" width="20%"><strong><font face="Arial">Table of contents</font></strong><font
size="3" face="Arial"><br>
</font><font size="2" face="Arial"><a href="#Overview:">Overview</a><br>
<a href="#Requirements:">Requirements</a><br>
<a href="#Description of components:">Description of components</a><br>
<a href="#Walk through sample:">Walk through sample</a><br>
<a href="#Features worth noting">Features worth noting</a></font><p><font size="3"
face="Arial"><br>
</font></td>
<td width="15"></td>
<td valign="top" width="80%"><a name="Overview:"><font size="3"><strong>Overview:</strong></font></a><p><font
size="3">This sample is provided to show how easy it is to construct work-flow
applications using Visual Basic & the Microsoft Message Queue. Feel free to
reuse or modify any/all of the code contained in this project.</font></p>
<p><font size="3">The work-flow sample consists of a system simulating a simplified
'insurance claim processing' system. Claims are entered using a VB front end.
When submitted, these claims are placed in a 'insurance claims queue.' A second VB
application allows an 'insurance claims processor' to approve the claims. Once
approved, the claims are moved to a second 'accounting queue.' A third VB
application is used to process the claims in the 'accounting' queue. When these are
approved the messages are removed from the second queue and the work-flow is complete.</font></p>
<p><font size="3">A fourth application is used to administer the entire system. It
allows the creation and monitoring of the queues.</font></p>
<hr>
<p><strong><a name="Setup:"><font size="4">Setup</font></a></strong></p>
<p><strong><a name="xxxx"><font size="3">Running the Workflow sample on a single machine:</font></a></strong></p>
<p><font size="3">The Workflow sample can be run on a single machine, if the machine is installed with Windows NT Server. To run on a single machine: </font></p>
<p><font size="3">1.       On the server machine, install the Microsoft Windows NT 4.0 Option Pack (with MSMQ's Enterprise Controller). The Option Pack can be found on the Visual Studio 6.0 Disk 2 in the WinNToptPak directory; optionally, go to the Microsoft website (www.microsoft.com), and search for Microsoft Windows NT 4.0 Option Pack to get to the download page. </font></p>
<p><font size="3">2.       SQL Server must be installed on the machine. </font></p>
<p><font size="3">3.       Install Visual Basic 6.0 (or later). </font></p>
<p><font size="3">4.       Run the sample. </font></p>
<p><strong><a name="xxxx"><font size="3">Running the Workflow sample on an intranet:</font></a></strong></p>
<p><font size="3">The sample can also be run as a client application on an intranet, as long as a machine running Windows NT Server is also on the network. To run the sample on a client machine installed with Win98 or WinNT: </font></p>
<p><font size="3">1.       On the client machine, install the Microsoft Windows NT 4.0 Option Pack (with MSMQ, any configuration). The Option Pack can be found on the Visual Studio 6.0 Disk 2 in the WinNToptPak directory; optionally, go to the Microsoft website (www.microsoft.com), and search for Microsoft Windows NT 4.0 Option Pack to get to the download page.
</font></p>
<p><font size="3">2.       Also on the client machine, install Visual Basic 6.0 or later. </font></p>
<p><font size="3">3.       Install the Workflow sample on the client machine. </font></p>
<p><font size="3">4.       On the server machine, install Microsoft Windows NT 4.0 Option Pack with the MSMQ Enterprise Controller (requires SQL Server). </font></p>
<p><font size="3">5.       Run the sample. </font></p>
<p> </p>
<hr>
<p><a name="Description of components:"><strong><font size="3">Description of components:</font></strong></a></p>
<p><font size="3">The sample is composed of four projects:</font></p>
<blockquote>
<p>admspt0.vbp : Sets up the queues for the sample. Allows the viewing of
queue contents.</p>
<p>claimsp1.vbp : Allows the submission of claims (starts the work-flow)</p>
<p>procsp2.vbp : Allows the processing of claims from the first queue and moves
them to the second queue.</p>
<p>accstp3.vbp : Allows the processing of claims from the second queue (finished
the work-flow).</p>
</blockquote>
<hr>
<p><a name="Walk through sample:"><font size="2" face="Arial"><strong>Walk through sample:</strong>
(note, each of these steps can be done on the same or different machines)</font></a></p>
<blockquote>
<p><strong>a) Setup the queues:</strong></p>
<blockquote>
<p>1. Start 'Adminster_Step0'   (admspt0.vbp)</p>
<p>2. Click 'Create new queues' button.</p>
<p>3. Specify the location of the queues in the format 'MachineName\QueueSpecifier' (no
'\\' before the machine name). If the format '.\QueueSpecifier' is used the queue
will be created on the current machine.</p>
<p>4. Click the 'Create new queues' button.</p>
<p><strong>Result:</strong> You have now created the queues for you enterprise work-flow
system</p>
</blockquote>
<p><strong>b) Start some work-flow:</strong></p>
<blockquote>
<p>5. Start 'ClaimEntry_Step1' (claimsp1.vbp)</p>
<p>6. Modify any claim attributes you want.</p>
<p>7. Click the 'Submit' button.</p>
</blockquote>
<blockquote>
<p><strong>Result:</strong> You have now submitted a message to the first message queue in
your work-flow system.</p>
<p> </p>
</blockquote>
<p><strong>c) Move some work-flow along in your system</strong></p>
<blockquote>
<p>8. Start 'Processing_Step2.vbp' (procsp2.vbp)</p>
<p>9. Select a message that you want to process from the first queue and double-click on
it in the listbox.</p>
<p>10. Click the 'Approve' button.</p>
</blockquote>
<blockquote>
<p><strong>Result:</strong> You have now moved a work-flow item from the first queue to
the second queue.</p>
<p> </p>
</blockquote>
<p><strong>d) Finish the work-flow in your system.</strong></p>
<blockquote>
<p>11. Start 'Accounting_Step3.vbp' (accstp3.vbp)</p>
<p>12. Select a message that you want to process from the second queue and double-click on
it in the listbox.</p>
<p>13. Click the 'Approve' button.</p>
</blockquote>
<blockquote>
<p><strong>Result:</strong> You have now removed the message from the second queue and
completed your work-flow operation.</p>
<p> </p>
<hr>
</blockquote>
</blockquote>
<p><a name="Features worth noting"><strong><font size="2" face="Arial">Features worth
noting:</font></strong></a></p>
<blockquote>
<p><font size="2" face="Arial"><strong>Queue GUID caching:</strong> The support
routines provided cache the GUID (Globally Unique IDentifier) of the queue locally (in the
system registry). This allows a queue to be accessed even when the machine is
disconnected from the network (this is useful for things like submitting messages to the
queue when offline). This code is of general interest to people developing message
queue systems.</font></p>
<p><font size="2" face="Arial"><strong>Persisting variables in messages:</strong> In
order to allow the structured persistence of groups of variables (i.e. data) a class was
introduced that stores this data in a PropertyBags (new in VB6.0!) and then allows the
property-bags to be persisted/de-persisted to/from messages. This demonstrates how
easy it is to persist property bags..</font></p>
<p><font size="2" face="Arial"><strong>Message Queue Events:</strong> The projects
contain code that allows the receiving of events from the Microsoft Message Queue.
This allows an application to be updated when new messages arrive in a specified queue.</font></p>
</blockquote>
<blockquote>
<p><font size="2" face="Arial"><strong>General purpose code:</strong> The module '</font>modQueueSupport'
contains functions that are of general use to anyone developing message queue oriented
solutions.</p>
</blockquote>
</td>
</tr>
<tr>
<td valign="top" width="20%"></td>
<td width="15"></td>
<td valign="top" width="80%"></td>
</tr>
</table>
</center></div>
</body>
</html>