Upload
bazookajoe
View
217
Download
0
Embed Size (px)
Citation preview
7/23/2019 Client Work Manager Integration
1/158
Workflow Solutions
InfoImageClient Work Manager Interface Integration Guide
UNISY
2008 Unisys Corporation.
All rights reserved.
Printed in USADecember 2008 8206 3637-000
7/23/2019 Client Work Manager Integration
2/158
NO WARRANTIES OF ANY NATURE ARE EXTENDED BY THIS DOCUMENT. Any product or related information
described herein is only furnished pursuant and subject to the terms and conditions of a duly executed agreement to
purchase or lease equipment or to license software. The only warranties made by Unisys, if any, with respect to the
products described in this document are set forth in such agreement. Unisys cannot accept any financial or other
responsibility that may be the result of your use of the information in this document or software material, including
direct, special, or consequential damages.
You should be very careful to ensure that the use of this information and/or software material complies with the
laws, rules, and regulations of the jurisdictions with respect to which it is used.
The information contained herein is subject to change without notice. Revisions may be issued to advise of such
changes and/or additions.
Notice to Government End Users: This is commercial computer software or hardware documentation developed atprivate expense. Use, reproduction, or disclosure by the Government is subject to the terms of Unisys standard
commercial license for the products, and where applicable, the restricted/limited rights provisions of the contract
data rights clauses.
Correspondence regarding this publication can be submitted through the normal support process for the product in
question as a UCF. For documentation problem, use the "USER-DOC" component in the UCF.
Visit http://www.support.unisys.com/EPA/TXT/IIF-WELCOME?PLA=IIF&FORM=HTML-UNISYS
Unisys and InfoImage are registered trademarks of Unisys Corporation in the United States and other countries.
All other brands and products referenced in this document are acknowledged to be the trademarks or registered
trademarks of their respective holders.
7/23/2019 Client Work Manager Integration
3/158
8206 3637-000 iii
Contents
Section 1. Introduction
Purpose ................................................. ................................................. ....... 11Scope ................................................. .................................................. ...... 11Audience ............................................ ................................................. ............ 11
Section 2. Client Work Manager ActiveX Interface
Description .......................................... .................................................. ...........21Capabilities........................................................................................................21 Development Environments...... ............................................... ................... 22VB ............................................ ............................................... ... 22VBA ............................................ ............................................... ... 22VBScript ........................................... ............................................... .... 22Integration/Execution of Custom Code in Client Work
Manager............................. ............................................... ............ 23Procedure .................................................. ............................................ 23Description of the Hierarchy..................................... ................................... 24Error Handling .............................................. ................................................. .. 25ActiveX Objects.................. ................................................. ........................... 25
Desktop Object.................................................. ............................................. 26Desktop Object Method................. .................................................. ............ 26Desktop Object Properties ................................................... ....................... 26Desktop Object Events............................ .................................................. ... 28Domain Object .............................................. ............................................... . 229Domain Object Methods .............................................. .............................. 229Domain Object Properties..........................................................................233Domains Collection Object.........................................................................240Domains Collection Object Properties ................................................... .240FaxRequest Object ............................................... ....................................... 241FaxRequest Object Properties......................... ......................................... 241FormField Object ................................................ .......................................... 243FormField Object Properties......................................................................243FormFields Collection Object.....................................................................247FormFields Collection Object Method.....................................................247iiCollection Object ................................................ ........................................ 248iiCollection Object Properties....................................................................249ImagePage Object........................................................................................249ImagePage Object Method................................................ ........................249Import Object................................................................................................253Import Object Method............................................... ................................. 253Import Object Properties............................................................................254
7/23/2019 Client Work Manager Integration
4/158
Contents
iv 8206 3637-000
ImportClass Object...................... ...................................................... .......... 255ImportClass Object Properties ......................................................... ........ 255ImportClasses Collection Object..................................................... ......... 256ImportClasses Collection Object Properties.......................................... 256
Note Object.................................................. .............................................. ... 257Note Object Properties......................................... ...................................... 257Page Object.............. ............................................... ...................................... 258Page Object Method ............................................. ...................................... 258Page Object Properties........................................... .................................... 258Pages Collection Object ........................................... .................................. 259Pages Collection Object Method....................................... ....................... 259Pages Collection Object Properties....................... .................................. 260PrintRequest Object.... ............................................... ................................. 260PrintRequest Object Properties................................ ................................ 260QueryForm Object............................................... ........................................ 262QueryForm Object Properties................................................................... 262QueryForms Collection Object .............................................. ................... 263
QueryForms Collection Object Properties........... .................................. 263wmError Object................................... .............................................. ........... 264WmError Object Properties.............................................................. ......... 264wmRectangle Object ......................................... ......................................... 265wmRectangle Object Properties...................... ........................................ 265WorkflowHistory Collection Object.............................. ........................... 265WorkflowHistory Collection Object Properties .................................... 265WorkflowHistoryInfo Object...................................................... ............... 266WorkflowHistoryInfo Object Properties.................................... ............. 266WorkflowLocation Object..................... ..................................................... 267WorkflowLocation Object Properties ............................................... ...... 267WorkflowLocations Collection Object .................................................... 269WorkflowLocations Collection Object Properties................................ 269WorkflowQueue Object ........................................... .................................. 270WorkflowQueue Object Methods .......................................... ................. 270WorkflowQueue Object Properties......................................................... 272WorkflowQueues Collection Object....................................................... . 273WorkflowQueues Collection Object Properties ................................... 273WorkflowVariable Object..................................................... ...................... 274WorkflowVariable Object Method ..................................................... ...... 274WorkflowVariable Object Properties....................................................... 274WorkflowVariables Collection Object .............................................. ....... 278WorkflowVariables Collection Object Properties................................. 278Workitem Object.................................................................... ...................... 279Workitem Object Methods........................................ ................................ 279
Workitem Object Properties.......................................... ........................... 290WorkitemClass Object................................ .............................................. 2100WorkitemClass Object Properties ............................................ ............. 2100WorkitemClasses Collection Object................................................. ......2102WorkitemClasses Collection Object Properties...................................2102Workitems Collection Object............................................... ................... 2103Workitems Collection Object Method .................................................. 2103Example of a Word VBA Project that Accesses Client Work
Manager Objects............................................. ....................... 2105
7/23/2019 Client Work Manager Integration
5/158
Contents
8206 3637-000 v
Example of a VBA Project in Outlook that Accesses ClientWork Manager Objects...... .................................................. . 2107
Section 3. Form Script Interface
Overview .........................................................................................................31Capabilities........................................................................................................31 Development Environment ............................................... ............................31VBScript ...............................................................................................31VBA Environment ................................................. ...........................................31Form User Exits.......................................... ............................................... ..... 32Form User Exits and Terminal Emulation Interface .............................. 310FViewer Object........................................... .................................................. .312FViewer Object Methods .............................................. ..............................312FViewer Object Properties............................................................... .......... 314FViewer Object Events ........................................... .................................... 315Valid Shortcut Values For Optional Parameter Shortcut
Addmenuitem Method ............................................ .......317
Section 4. Import User Exit Interface
Description .......................................... .................................................. ...........41Software Components...................................................................................41User Exit Architecture....................................................................................41Programmer Interface........................................... ........................................ 42Capabilities................................................................... .................................... 42Sample Procedure to Implement a Client Work Manager
Import User Exit..... ..................................................... ................ 42Client Work Manager Import User Exit Object........................................44Client Work Manager Import User Exit Methods ................................... 44Client Work Manager Import User Exit Properties................................. 45
Section 5. Tool Functions
CreateWorkitem Function..... ..................................................... .................. 52Purpose .............................................. ................................................ 52Parameters ............................................ ............................................... ... 52ImportItem Function......................... .................................................. ........... 53Purpose .............................................. ................................................ 53Parameters ............................................ ............................................... ... 53ListDirectory Function.... ..................................................... .......................... 53
Purpose .............................................. ................................................ 53Parameters ............................................ ............................................... ... 53RunProgram Function.................................................... ................................ 54Purpose .............................................. ................................................ 54Parameters ............................................ ............................................... ... 54RunVBAMacro Function................................................................ ................ 54Purpose .............................................. ................................................ 54Parameters ............................................ ............................................... ... 54RunVBScript Function............................................................................ ........ 54
7/23/2019 Client Work Manager Integration
6/158
Contents
vi 8206 3637-000
Purpose ................................................. ............................................. 54Parameters ............................................... ............................................... 54SendWorkitem Function...................................................... ......................... 55Purpose ................................................. ............................................. 55
Parameters ............................................... ............................................... 55SetFormFields Function................................................. ............................... 56Purpose ................................................. ............................................. 56Parameter .............................................. ............................................... . 56
Appendix A. Troubleshooting
Debug Files Required by Unisys Client Group......................................... A1WorkManager Log File, WM-.dbg....................................... A1CAL/ClientAPI Log File, .dbg ................................................ .A2Client Services Log File, ClientServices.dbg ............................................A3LumberJack Tool............................................................................................A3
Appendix B. Sample VBScripts and VBA Projects
Locations .........................................................................................................B1For More Information.....................................................................................B1
Appendix C. Supported Image Formats and AssociatedCompressions
Supported Image Formats and Compressions ........................................C1
7/23/2019 Client Work Manager Integration
7/158
8206 3637-000 11
Section 1
Introduction
Purpose
Unisys Client Work Manager provides a standard Unisys InfoImage desktop withcomplete, out-of-the-box functionality, modern user interface, and easy integration
with other applications.
This guide discusses the interfaces that enable you to customize Client Work Managerto handle the specific needs of the application, such as special role definitions and
Form User Exits. Through these interfaces, you can take advantage of the Client WorkManager function set to design, write and integrate customized code that integratesspecial features into the desktop.
Client Work Manager enables this integration by:
Exposing its business objects for external applications
Supporting VBScript as a standard scripting language
Supporting VBA as an optional scripting language
This guide discusses the following interfaces:
Client Work Manager ActiveX Interface
Form Script Interface
Import User Exit Interface
Scope
This guide describes the data structures and functions of the programming interfacewith sample programs and error codes. The prerequisite information for developing
Windows programs and coding various languages is beyond the scope of this
document.
Audience
This guide is intended primarily for programmers responsible for designing,
developing, and implementing programs that interface with Client Work Manager.
7/23/2019 Client Work Manager Integration
8/158
Introduction
12 8206 3637-000
7/23/2019 Client Work Manager Integration
9/158
8206 3637-000 21
Section 2
Client Work Manager ActiveX Interface
Description
The Client Work Manager Interface is a repository of ActiveX objects that provides aconvenient interface for using the features of Client Work Manager to build a
customized desktop.
Because Client Work Manager is designed as an object model and is an ActiveXexecutable, its properties and methods are exposed. Therefore, it provides for a COM
interface to the desktop. This COM interface enables a smooth integration for you touse Client Work Managers numerous functions and attributes in your customizedapplications.
The object model consists of a series of related classes. All events are raised to the
Desktop object. A global object that contains a reference to the Desktop object ispassed to each object in the structure so events can be raised.
This section provides a complete description of all the Client Work Manager objectsthat are exposed, and their methods and properties. This section also provides
procedures for using the Client Work Manager objects.
Capabilities
Customize Desktop Roles
You can access workitems, the desktop, domains, form fields, and image pages, as
well as perform numerous other functions to customize a Client Work Managerdesktop role.
Integrate Special Features into the Desktop
You can integrate a special feature into the desktop that is not part of the out of thebox desktop functionality. By accessing the Client Work Manager Object Model, you
can meet the specialized needs of a business application.
7/23/2019 Client Work Manager Integration
10/158
Client Work Manager ActiveX Interface
22 8206 3637-000
Development Environments
VB
To use the Client Work Manager ActiveX Interface, Client Work Manager must be
installed. Client Work Manager is selected as a reference from the VB menu,Project/References in the customized application. Since Client Work Manager
exposes its objects, a Visual Basic project that defines the customized program canuse those exposed properties and methods. Customized applications can be run asexecutable programs, with their own convenient Visual Basic forms that include third
party controls to create a user interface tailored to the specific requirements. Thesecustomized programs can also be assigned to a tool on a toolbar. See
Integration/Execution of Custom Code in Client Work Manager.
VBA
The VBA development environment is included as an option to Client Work Manager. Ifthe VBA Add-on is installed, the IDE will be tied to the host application, Client Work
Manager, thus enabling you to toggle between the IDE and the Client Work Managerhost window. Then, you can easily create a programmable application, a VBA Macrothat will perform some customized function by accessing external objects as well as
Client Work Manager objects.
Typically, the host application provides a menu item such as the Visual Basic Editorcommand, from the Macro submenu of the Tools menu. Thus, a VBA Macro can be
created within Client Work Manager.
After the VBA Macro is created, it can be assigned to a tool on a toolbar as detailed in
the next section.
VBScript
VBScript is available as part of the core product of Client Work Manager. The scripts
will be assigned to tools on toolbars but will not have the development environmentof VBA. The VBScripts are made up of customization functions that access the
exposed properties and methods of Client Work Manager.
The VBScripts are created using a generic text editor such as Notepad or WordPad.The procedures are provided in the next section for assigning the VBScripts to a toolon a toolbar.
7/23/2019 Client Work Manager Integration
11/158
Client Work Manager ActiveX Interface
8206 3637-000 23
Integration/Execution of Custom Code in ClientWork Manager
The customized code (either a desktop role implemented as a VBA Macro, a VBScript,or a specialized desktop feature implemented as a VB program) gets executed byassigning it to a tool on a toolbar.
Procedure
The System Administrator can follow this procedure to assign a script or program to atool on a toolbar:
1. Log on to Client Work Manager as an Administrator and select theAdministration menu.
2. On the Administration menu, select Desktop Administrationto open the
Desktop Administration window.
3. On the File menu, click Open Desktop.
4. Open the appropriate desktop.
5. On the Toolbars menu, click Customize Toolbars to open the Customize
Toolbars form.
6. Select the Tools tab and click New.
7. Enter the identifying features of the new tool by selecting one of the following
in the Functions dialog box:
If the tool is to execute a Then select
VB program, RunProgram.
VBAMacro, RunVBAMacro.
VBScript, RunVBScript.
8. After selecting one of these options, enter the Macro name, or VBScriptprocedure, or VB program name with parameters, if required, in the table.
An administrator uses the InfoImage Enterprise Administrator to assign VBA projectsand VBScripts to a role definition. When the administrator initially defines the roles, the
role definition files are added to the roles. (The Client Work Manager online Help filetopic titled Desktop Administration explains these procedures.) These files are .dsk,.atb, .vba and .vbs files. The IEA Client searches for .vba or .vbs files and sends them
to the IEA Server with the other role definition files. Therefore, when an end user logson to Client Work Manager, he is provided with the roles that are assigned to him. The
role definition files are loaded, including the .vba and .vbs files that were assigned to arole definition by the administrator.
7/23/2019 Client Work Manager Integration
12/158
Client Work Manager ActiveX Interface
24 8206 3637-000
When a user clicks on a tool, Client Work Manager searches for the function to
execute. This function was determined in the previous procedure.
If this function is Then Client Work Manager runs
RunVBAMacro, The macro name in the loaded VBA project.
RunVBScript, The VBScript function.
RunProgram, The program name that was associated with the tool.
Description of the Hierarchy
In an object library, all objects have a unique set of methods, properties, and events.To use the hierarchy, you must often move down through the hierarchy. Refer to thefollowing diagram.
Diagram
Desktop
Domains
WorkitemClasses
WorkitemClass
ImportClasses
ImportClass
FormFields
FormField
WorkflowQueues
WorkflowQueue
WorkflowVariables
WorkflowVariable
IndexField
Workitems
Workitem
Workitems
(Children)
Pages
Page
Note
Import
ImagePage
WorkflowHistory
WorkflowHistoryInfo
WorkitemLocations
WorkitemLocation
Domain
IndexFields
7/23/2019 Client Work Manager Integration
13/158
Client Work Manager ActiveX Interface
8206 3637-000 25
Error Handling
Error checking is handled by the application, which uses NotifyError in the Notifyevent in the Desktop class. NotifyError, described in the Desktop object, is a
reference to an error class (wmError) if an error has occurred. Refer to the wmErrorobject for a description of its properties and how to use them when handling errors inan application.
ActiveX Objects
The ActiveX objects are the following:
Desktop ObjectDomain Object
Domains Collection ObjectFaxRequest Object
FormField ObjectFormFields Collection ObjectiiCollection Object
ImagePage ObjectImport Object
ImportClass ObjectImportClasses Collection Object
Note ObjectPage ObjectPages Collection Object
PrintRequest ObjectQueryForm Object
QueryForms Collection ObjectwmError Object
wmRectangle ObjectWorkflowHistory Collection ObjectWorkflowHistoryInfo Object
WorkflowLocation ObjectWorkflowLocations Collection Object
WorkflowQueue ObjectWorkflowQueues Collection Object
WorkflowVariable ObjectWorkflowVariables Collection ObjectWorkitem Object
WorkitemClass Object
WorkitemClasses Collection ObjectWorkitems Collection Object
Each is discussed in this section.
7/23/2019 Client Work Manager Integration
14/158
Client Work Manager ActiveX Interface
26 8206 3637-000
Desktop Object
The Desktop object sits at the top of the object model. It has several purposes. As theroot object, it enables you to reference other objects in the Client Work Manager
object hierarchy. All events are funneled through this class. Use WithEvents whendeclaring the variable that will contain the instance of the desktop class. (PublicWithEvents gMyDesktop as Desktop)
When creating a new instance of this class the following can occur:
If Then
Client Work Manager is installed The Login window is displayed.
Client Work Manager is already up
and running
The instance of the Desktop class that was
created will connect to the one that is running.
Desktop Object Method
Cleanup
Cleanup
Use the Cleanup method of the Desktop object to perform housekeeping for the
desktop class. Call this method before setting the desktop object to Nothing.
Syntax
Public Function Cleanup()
Example
Public WithEvents gDesktop As DesktopSub DisconnectDesktop()
If Not (gDesktop Is Nothing) ThengDesktop.CleanupSet gDesktop = Nothing
End IfEnd Sub
Desktop Object Properties
Domains, IsReady, UserName, SelectedItems
7/23/2019 Client Work Manager Integration
15/158
Client Work Manager ActiveX Interface
8206 3637-000 27
Iterate through a Collection of Domain Objects
Use the Domains property of the Desktop object to return a collection that contains
Domain objects that are indexed by Workflow Domain name.
Syntax
Public Property Get Domains() As Domains
Example
Public WithEvents gDesktop As DesktopDim Dom As Domain
List1.ClearFor Each Dom In gDesktop.Domains
List1.AddItem Dom.Name
Next DomList1.ListIndex = List1.ListCount 1
Determine if Desktop is Ready
Use the IsReady property of the Desktop object to determine whether the Desktopexecutable is ready to handle object model requests.
Syntax
Public Property Get IsReady() As Boolean
Example
Public WithEvents gDesktop As Desktop
If gDesktop.IsReady = False ThenList4.AddItem Waiting for Desktop to become ready.
Reference the e-Workflow & Imaging User Name
Use the UserName property of the Desktop object to get the e-Workflow & Imaginguser name of the currently logged in session.
Syntax
Public Property Get UserName() As String
ExamplePublic WithEvents gDesktop As DesktopList1.AddItem gDesktop.UserName
7/23/2019 Client Work Manager Integration
16/158
Client Work Manager ActiveX Interface
28 8206 3637-000
Iterate Through a Collection of Object_ID Strings
Use the SelectedItems property of the Desktop object to return a collection of
Object_ID strings. These strings can be used to index into a Workitems collection. The
Object_Ids in the collection are the currently selected Workitems on the desktop.
Syntax
Public Property Get SelectedItems() As Workitems
Public Property Set SelectedItems() NewValue As Workitems
Example
Public WithEvents gDesktop As DesktopDim Wi As workitem
For i = 1 To gDesktop.SelectedItems.CountSet Wi = gDesktop.SelectedItems(i)
List3.AddItem Wi.NameList3.Selected(List3.NewIndex) = Wi.IsReserved
Next I
Desktop Object Events
The Desktop Object events in this section are listed in alphabetical order.
AfterLogin
The AfterLogin event is used to signal that a user has established a session with a
Workflow Domain.
Syntax
Public Event AfterLogin(Domain As domain)
Domain is a reference a Domain object on which the event occurred.
7/23/2019 Client Work Manager Integration
17/158
Client Work Manager ActiveX Interface
8206 3637-000 29
BeforeDocumentViewerOpen
When the Document Viewer for a workitem is about to be opened the following event
will be raised by the Desktop class.
Syntax
Public Event BeforeDocumentViewerOpen(Workitem As Workitem, Cancel As Integer)
Workitem An object that represents the workitem for which the event has
occurred.
Cancel Determines whether Client Work Manager displays the Document
Viewer. If the Object Model client sets the Cancel parameter totrue, Client Work Manager does not display the Document Viewer.If the Object Model client sets the Cancel parameter to false, Client
Work Manager displays the Document Viewer. The default value isfalse.
BeforeIndexFormOpen
When an index form for a workitem is about to be opened the BeforeIndexFormOpen
event will be raised by the Desktop class. This event signifies that Client WorkManager is attempting to display the index form for a workitem. This event is raised
regardless of the origin of the request to open the index form. In other words, theevent will be raised whether the user selected the Index (ID_Index) tool from a toolbar
or menu bar and when the Document AutoView Index Form user preference option ison and the document viewer has been opened.
Syntax
Public Event BeforeIndexFormOpen(Workitem As Workitem,Cancel as Integer)
Workitem An object that represents the workitem for which the event
occurred.
Cancel Determines whether Client Work Manager displays the index form
or not. If the object model client sets the Cancel parameter to true,Client Work Manager will not display the index form. If the object
model client sets the Cancel parameter to false, Client WorkManager will display the index form. The default value is false.
Programming Note:If the client program wants to display their own custom indexform, it should set the Cancel parameter to true set a timer and return to Client Work
Manager. When the timer goes off, display the custom index form.
Examples
See the WMTest sample and the ScanManager.vba project in the Samples directory
on the installation CD.
7/23/2019 Client Work Manager Integration
18/158
Client Work Manager ActiveX Interface
210 8206 3637-000
BeforeLogin
The BeforeLogin event is used to signal that the Client Work Manager log in dialog isabout to be displayed. This event can be used to bypass the Client Work Manager log
in dialog, which allows the object model client program to present a custom log indialog or determine the login parameters using some other mechanism.
Syntax
Public Event BeforeLogin(UserName As String,Password As String,
DomainName As String,RoleName As String,
ShowLoginUI As Integer,Cancel As Integer)
UserName The name of the InfoImage user.
Password The InfoImage password for the user.
DomainName The name of the Workflow Domain to use forthe log in process.
RoleName The name of the role to use for this user afterlogin. If this is a valid role for the user, the
Select Role dialog will not display.
ShowLoginUI Determines whether the logon dialog shoulddisplay. (True/False)
Cancel Determines whether the log in process is to be abortedor continued.
BeforeNoteViewerOpen
When a Note viewer for a note in a workitem is about to be opened the following
event will be raised by the Desktop class.
Syntax
Public Event BeforeNoteViewerOpen(Note As Note, Cancel As Integer)
Note An object that represents the Note for which the event has
occurred.
Cancel Determines whether Client Work Manager displays the note
viewer. If the Object Model client sets the Cancel parameter totrue, Client Work Manager does not display the Note viewer. If theObject Model client sets the Cancel parameter to false, Client Work
Manager displays the Note viewer. The default value is false.
7/23/2019 Client Work Manager Integration
19/158
Client Work Manager ActiveX Interface
8206 3637-000 211
Programming Note:If the client program chooses to display a custom note viewer
form, the program should set the Cancel parameter to true, set a timer, and the returnto Client Work Manager. Then, when the timer goes off, display the note viewer indexform.
Example
See the WMTest sample program in the Samples directory on the installation CD.
BeforeQueryFormOpen
When a query form is about to be opened the following event will be raised by theDesktop class.
Syntax
Public Event BeforeQueryFormOpen
(FormName As String,FormFields As FormFields,,
Cancel As Integer)
FormName The name of the form about to open.
FormFields A collection of FormField objects.
Cancel Determines whether Client Work Manager displays the query form.If the Object Model client sets the Cancel parameter to true, Client
Work Manager does not display the query form. If the ObjectModel client sets the Cancel parameter to false, Client Work
Manager displays the query form. The default value is false.
Programming Note:If the client program chooses to display a custom query form,the program should set the Cancel parameter to true, set a timer, and the return to
Client Work Manager. Then, when the timer goes off, display the query form.
7/23/2019 Client Work Manager Integration
20/158
Client Work Manager ActiveX Interface
212 8206 3637-000
BeforeQueryResultsDisplay
When a query result is about to be displayed, the Desktop class will raise the
following event.
Syntax
Public Event BeforeQueryResultsDisplay(Workitems As Workitems, Modified As
Integer)
Workitems The collection of workitem objects that is the result of a query. Thiscollection can be modified to allow for filtering of data before thequery result is displayed. The Modified parameter is used to signify
the collection has been modified.
Modified A Boolean that represents whether the Object Model client has
modified the workitems collection object. This tells the Client WorkManager to display the modified data.
BeforeQueryRetrieve
When a workitem is about to be retrieved from a query results list the Desktop class
will raise the following event.
Syntax
Public Event BeforeQueryRetrieve
(Workitem As Workitem,Cancel As Integer)
Workitem An object that represents the workitem object that is about to be
retrieved.
Cancel Determines whether Client Work Manager retrieves the workitem.
If the Object Model client sets the Cancel parameter to true, ClientWork Manager does not retrieve the workitem. If the Object Modelclient sets the Cancel parameter to false, Client Work Manager
retrieves the workitem. The default value is false.
7/23/2019 Client Work Manager Integration
21/158
Client Work Manager ActiveX Interface
8206 3637-000 213
BeforeQueueContentsDisplay
When the contents of a queue are about to be displayed, the Desktop class will raisethe following event.
Syntax
Public Event BeforeQueueContentsDisplay(Workitems As Workitems,
Modified As Integer)
Workitem The collection of workitem objects that is the contents of a queue.
This collection can be modified to allow for filtering of data beforethe queue contents is displayed. The Modified parameter is used to
signify the collection has been modified.
Modified A Boolean that represents whether the Object Model client has
modified the workitems collection object. This tells the Client Work
Manager to display the modified data.
BeforeQueueRetrieve
When a workitem is about to be retrieved from a queue the Desktop class will raise
the following event.
Syntax
Public Event BeforeQueueRetrieve
(Workitem As Workitem,Cancel As Integer)
Workitem An object that represents the workitem object that is about to beretrieved.
Cancel Determines whether Client Work Manager retrieves the workitem.If the Object Model client sets the Cancel parameter to true, Client
Work Manager does not retrieve the workitem. If the Object Modelclient sets the Cancel parameter to false, Client Work Manager
retrieves the workitem. The default value is false.
BeforeTerminate
The BeforeTerminate event is used to signal that the Client Work Manager is about to
terminate. This event can be used to stop Client Work Manager from terminating.
Syntax
BeforeTerminate(Cancel As Integer)
Cancel Determines whether the terminate process will be stopped orcontinued.
7/23/2019 Client Work Manager Integration
22/158
Client Work Manager ActiveX Interface
214 8206 3637-000
BeforeWorkitemClose
When a workitem is about to be closed the Desktop class will raise the followingevent.
Syntax
Public Event BeforeWorkitemClose(Workitem As Workitem,
SaveChanges As Boolean,Cancel As Integer)
Workitem An object that represents the workitem object that is about to beclosed.
SaveChanges A Boolean that states if the workitem is to be saved before it isclosed.
Cancel Determines whether Client Work Manager closes the workitem. If
the Object Model client sets the Cancel parameter to true, ClientWork Manager does not close the workitem. If the Object Modelclient sets the Cancel parameter to false, Client Work Manager
closes the workitem. The default value is false.
BeforeWorkitemCreate
When a workitem is about to be created the Desktop class will raise the followingevent.
Syntax
Public Event BeforeWorkitemCreate
(WorkitemName As String,WorkitemType As WorkitemTypeConstants,WorkitemClass As String,CopyCurrentValues As Boolean,
Cancel As Integer)
WorkitemName The name of the new workitem.
WorkitemType The type of workitem to create; 1=Document, 2=Folder.
WorkitemClass The class of the new workitem. This class must already bedefined in the system. Class names are case-sensitive.
CopyCurrentValues Determines whether index values are copied from the
workitem that is currently selected in the grid. True or False.
Cancel Determines whether Client Work Manager creates the
workitem. If the Object Model client sets the Cancelparameter to true, Client Work Manager does not retrieve theworkitem. If the Object Model client sets the Cancel
parameter to false, Client Work Manager retrieves theworkitem. The default value is false.
7/23/2019 Client Work Manager Integration
23/158
Client Work Manager ActiveX Interface
8206 3637-000 215
BeforeWorkitemFile
When a workitem is about to be filed into a folder the Desktop class will raise thefollowing event.
Syntax
Public Event BeforeWorkitemFile(Workitem As Workitem,
Folder As Workitem,Cancel As Integer)
Workitem An object that represents the workitem object that is about to befiled.
Folder The folder object into which the workitem is to be filed.
Cancel Determines whether Client Work Manager files the workitem. If theObject Model client sets the Cancel parameter to true, Client Work
Manager does not file the workitem. If the Object Model client setsthe Cancel parameter to false, Client Work Manager files theworkitem. The default value is false.
BeforeWorkitemOpen
When a workitem is about to be opened the Desktop class will raise the following
event.
Syntax
Public Event BeforeWorkitemOpen(Workitem As Workitem, Cancel As Integer)
Workitem An object that represents the workitem object that is about to beopened.
Cancel Determines whether Client Work Manager opens the workitem. If
the Object Model client sets the Cancel parameter to true, ClientWork Manager does not open the workitem. If the Object Model
client sets the Cancel parameter to false, Client Work Manageropens the workitem. The default value is false.
7/23/2019 Client Work Manager Integration
24/158
Client Work Manager ActiveX Interface
216 8206 3637-000
BeforeWorkitemRemoveFromDesktop
When a workitem is about to be removed from the desktop (desk delete) the Desktopclass will raise the following event.
Syntax
Public Event BeforeWorkitemRemoveFromDesktop(Workitem As Workitem,
SaveChanges As Boolean,Cancel As Integer)
Workitem An object that represents the workitem object that is about to beremoved from the desktop.
SaveChanges A Boolean that indicates whether to save the workitem savedbefore removing it from the desktop.
Cancel Determines whether Client Work Manager DeskDeletes the
workitem. If the Object Model client sets the Cancel parameter totrue, Client Work Manager does not DeskDelete the workitem. Ifthe Object Model client sets the Cancel parameter to false, Client
Work Manager DeskDeletes the workitem. The default value isfalse.
BeforeWorkitemReserve
When a workitem is about to be reserved for changes the Desktop class will raise the
following event.
Syntax
Public Event BeforeWorkitemReserve (Workitem As Workitem, Cancel As Integer)
Workitem An object that represents the workitem object that is about to bereserved.
Cancel Determines whether Client Work Manager reserves the workitem.
If the Object Model client sets the Cancel parameter to true, ClientWork Manager does not reserve the workitem. If the Object Modelclient sets the Cancel parameter to false, Client Work Manager
reserves the workitem. The default value is false.
7/23/2019 Client Work Manager Integration
25/158
Client Work Manager ActiveX Interface
8206 3637-000 217
BeforeWorkitemSave
When a workitem is about to be saved the Desktop class will raise the followingevent.
Syntax
Public Event BeforeWorkitemSave (Workitem As Workitem, Cancel As Integer)
Workitem An object that represents the workitem object that is about to besaved.
Cancel Determines whether Client Work Manager saves the workitem. Ifthe Object Model client sets the Cancel parameter to true, Client
Work Manager does not save the workitem. If the Object Modelclient sets the Cancel parameter to false, Client Work Managersaves the workitem. The default value is false.
BeforeWorkitemSend
When a workitem is about to be sent the Desktop class will raise the following event.
Syntax
Public Event BeforeWorkitemSend(Workitem As Workitem,
SendOptions As WorkitemSendConstants,colQueueNames As Collection,
Cancel As Integer)
Workitem An object that represents the workitem object that is about to
be sent.SendOptions Defines how the workitem is to be handled. The possible values
are:
wmSendOptionsToDefault = 1wmSendOptionsReturn = 2
wmSendOptionsToQueues = 4wmSendOptionsRetain = 8
colQueueNames A collection of queues where to send workitems.
Cancel Determines whether Client Work Manager sends the workitem.
If the Object Model client sets the Cancel parameter to true,Client Work Manager does not send the workitem. If the Object
Model client sets the Cancel parameter to false, Client WorkManager sends the workitem. The default value is false.
7/23/2019 Client Work Manager Integration
26/158
Client Work Manager ActiveX Interface
218 8206 3637-000
BeforeWorkitemSysDelete
When a workitem is about to be removed from the system (System Delete) theDesktop class will raise the following event.
Syntax
Public Event BeforeWorkitemSysDelete(Workitem As Workitem,, Cancel As Integer)
Workitem An object that represents the workitem object that is about tobe removed from the system.
Cancel Determines whether Client Work Manager SysDeletes theworkitem. If the Object Model client sets the Cancel parameter
to true, Client Work Manager does not SysDelete the workitem.If the Object Model client sets the Cancel parameter to false,Client Work Manager SysDeletes the workitem. The default
value is false.
BeforeWorkitemUnfile
When a workitem is about to be unfiled from a folder the Desktop class will raise thefollowing event.
Syntax
Public Event BeforeWorkitemUnfile(Workitem As Workitem, Folder As Workitem, Cancel As Integer)
Workitem An object that represents the workitem object that is about to be
unfiled.
Folder The folder object from which the workitem is to be unfiled.
Cancel Determines whether Client Work Manager unfiles the workitem. Ifthe Object Model client sets the Cancel parameter to true, Client
Work Manager does not unfile the workitem. If the Object Modelclient sets the Cancel parameter to false, Client Work Manager
unfiles the workitem. The default value is false.
7/23/2019 Client Work Manager Integration
27/158
Client Work Manager ActiveX Interface
8206 3637-000 219
BeforeWorkitemUnreserve
When a workitem is about to be unreserved the Desktop class will raise the followingevent.
Syntax
Public Event BeforeWorkitemUnreserve (Workitem As Workitem, Cancel As Integer)
Workitem An object that represents the workitem object that is about to beunreserved.
Cancel Determines whether Client Work Manager unreserves theworkitem. If the Object Model client sets the Cancel parameter to
true, Client Work Manager does not unreserve the workitem. If theObject Model client sets the Cancel parameter to false, Client WorkManager unreserves the workitem. The default value is false.
DocumentViewerClosed
When the Document Viewer for a workitem is closed the following event will be
raised by the Desktop class.
Syntax
Public Event DocumentViewerClosed(Workitem As Workitem)
Workitem An object that represents the workitem for which the event has
occurred.
DocumentViewerOpen
When the document viewer for a workitem has been opened the following event will
be raised by the Desktop class.
Syntax
Public Event DocumentViewerOpen(Workitem As Workitem)
Workitem An object that represents the workitem for which the event hasoccurred.
7/23/2019 Client Work Manager Integration
28/158
Client Work Manager ActiveX Interface
220 8206 3637-000
DocumentViewerUIAction
The Desktop class will raise the DocumentViewerUIAction event when a userinterface action has occurred in the Document Viewer. The Document Viewer will
raise the UIActionEvent event, Client Work Manager then forwards to the Client WorkManager Object Model clients as the DocumentViewerUIAction event.
Syntax
Public Event DocumentViewerUIAction(Workitem As Workitem,sAction as String,
sItem as String,sUndefined As String,
bCancel as Boolean)
Workitem An object that represents the workitem for which the event hasoccurred.
sAction A string defining the UI Action.
sItem An optional event parameter defining an item relevant to UI Action.
sUndefined An additional parameter not yet defined (reserved for future use).
bCancel A Boolean flag to cancel UI Action (not applicable to all actionevents)
Example
See the WMTest sample program in the Samples directory on the installation CD.
IndexFormClosed
When an index form for a workitem is closed the following event will be raised by theDesktop class.
Syntax
Public Event IndexFormClosed(Workitem As Workitem)
Workitem An object that represents the workitem for which the event has
occurred.
7/23/2019 Client Work Manager Integration
29/158
Client Work Manager ActiveX Interface
8206 3637-000 221
IndexFormOpen
When an index form for a workitem has been opened the following event will beraised by the Desktop class.
Syntax
Public Event IndexFormOpen(Workitem As Workitem)
Workitem An object that represents the workitem for which the event hasoccurred.
IndexFormSaved
When an index form for a workitem has been saved the following event will be raisedby the Desktop class.
Syntax
Public Event IndexFormSaved(Workitem As Workitem)
Workitem An object that represents the workitem for which the event hasoccurred.
Monitor
The Monitor event is used to signal when a transaction of the type that is listed in theNotifyTrans definition has occurred. This event will occur when the Client Work
Manager user initiated a transaction to occur or an object model client initiated thetransaction. The Monitor event is similar to the existing Notify event. The Notify eventis always returned to the object model client that initiated a transaction. The Monitor
event raises the same information as the Notify event and raises the event to allobject model clients that are connected to the Client Work Manager object model.
Syntax
Public Event Monitor(NotifyProps As iiCollection,
NotifyTrans As NoticeActionConstants,NotifyType As NoticeTypeC onstants,
NotifyError As wmError)
NotifyProps is a collection of the various property variables. See the iiCollection class
for details in the this guide.
propWorkitem = 1propPage = 2
propFileName = 3propQueueNames = 4propSendOptions = 5
propFolder = 6propClassName = 7
propWorkflowLocations = 8
7/23/2019 Client Work Manager Integration
30/158
Client Work Manager ActiveX Interface
222 8206 3637-000
propWorkitems = 9
propQueueName = 10propDomainName = 11propPrintRequest = 12
propFaxRequest = 13propWorkitemModificationType = 14
NotifyTrans is the type of transaction that has occurred.
wmReserveWorkitem = 1wmUnReserveWorkitem = 2
wm RemoveFromDesktop = 3wmCreateWorkitem = 4
wmSav eWorkitem = 5wm AddImagePage = 6
wmA ddImport = 7wmAddNote = 8
wmSaveAsFile = 9wmDeletePage = 10wmSendWorkitem = 11
wmFileIntoFolder = 12wmRemoveFromFolder = 13
wmReclassifyWorkitem = 14wmQueueGetNextWorkitem = 15
wmQueueGetContents = 16wmQueueRetrieveWorkitem = 17wmPrintRequest = 18
wmFaxRequest = 19wmQuery = 20
wmRetrieveWorkitem = 21
wmOpenWorkitem = 22wmWorkitemModified = 23
NotifyType is the type of notification for the transaction.
wmNoticeActivity = 1
wmNoticeCompleted = 2wmNoticeErrored = 3
NotifyError is a reference to an error class if an error has occurred.
New Enumeration for workitem modifications
The NotifyTrans value wmWorkitemModified is raised when CAL raises theModifyItem event. The workitem object is found in the NotifyProps collectionparameter using the propWorkitem enumeration value as the key. The ModifyItem
ActionCode parameter is found in the NotifyProps collection parameter using thepropWorkitemModificationType enumeration value as the key.
Public Enum WorkitemModificationType
wmModifyCLItemSetRetain = 24wmModifyDocImportReclassify = 22
7/23/2019 Client Work Manager Integration
31/158
Client Work Manager ActiveX Interface
8206 3637-000 223
wmModifyDocImportRename = 21
wmModifyDocImportsAdd = 3wmModifyDocImportsRemove = 4wmModifyDocImportUpdate = 23
wmModifyDocumentPagesImport = 0wmModifyDocumentReclassify = 2
wmModifyDocumentSetName = 1wmModifyFChildrenAdd = 5
wmModifyFChildrenRemove = 6wmModifyFolderChildStatus = 25wmModifyFolderReclassify = 10
wmModifyFolderSetName = 9wmModifyFormFieldStatus = 8
wmModifyFormFieldValue = 7wmModifyImportReclassify = 13
wmModifyImportSetName = 12wmModifyImportUpdate = 11
wmModifyMarkupBkgColor = 27wmModifyMarkupBorder = 33wmModifyMarkupBorderColor = 30
wmModifyMarkupFontName = 35wmModifyMarkupFontSize = 36
wmModifyMarkupFontStyle = 37wmModifyMarkupPatternColor = 28
wmModifyMarkupPatternType = 31wmModifyMarkupPosition = 40wmModifyMarkupRotateWithImage = 34
wmModifyMarkupSubType = 26wmModifyMarkupText = 38
wmModifyMarkupTextColor = 29
wmModifyMarkupTransparent = 32wmModifyMarkupZOrder = 39wmModifyNoteName = 41wmModifyNotesAdd = 16
wmModifyNotesRemove = 17wmModifyNoteText = 42
wmModifyPageMarkupsAdd = 14wmModifyPageMarkupsRemove = 15
wmModifyPageModified = 44wmModifyPageMoved = 45wmModifyPagesAdd = 19
wmModifyPageSetName = 18
wmModifyPageSetUserData = 42wmModifyPagesRemove = 20End Enum
7/23/2019 Client Work Manager Integration
32/158
Client Work Manager ActiveX Interface
224 8206 3637-000
NoteViewerClosed Event
When the note viewer for a workitem is closed the following event will be raised bythe Desktop class.
Syntax
Public Event NoteViewerClosed()
Notify
Use the Notify event to signal the client when an action has occurred.
Syntax
Public Event Notify
NotifyProps As iiCollection,NotifyTrans As NoticeActionConstants,
NotifyType As NoticeTypeConstants,NotifyError As wmError)
NotifyProps is a collection of the various property variables. See the iiCollection classfor details.
propWorkitem = 1
propPage = 2propFileName = 3
propQueueNames = 4propSendOptions = 5
propFolder = 6
propClassName = 7propWorkflowLocations = 8
propWorkitems = 9propQueueName = 10
propDomainName = 11propPrintRequest = 12
propFaxRequest = 13
NotifyTrans is the type of transaction that has occurred.
wmReserveWorkitem = 1wmUnReserveWorkitem = 2
wmRemoveFromDesktop = 3wmCreateWorkitem = 4
wmSaveWorkitem = 5wmAddImagePage = 6
wmAddImport = 7wmAddNote = 8wmSaveAsFile = 9
wmDeletePage = 10wmSendWorkitem = 11
wmFileIntoFolder = 12wmRemoveFromFolder = 13
7/23/2019 Client Work Manager Integration
33/158
Client Work Manager ActiveX Interface
8206 3637-000 225
wmReclassifyWorkitem = 14
wmQueueGetNextWorkitem = 15wmQueueGetContents = 16wmQueueRetrieveWorkitem = 17
wmPrintRequest = 18wmFaxRequest = 19
wmQuery = 20wmRetrieveWorkitem = 21
wmOpenWorkitem = 22
NotifyType is the type of notification for the transaction.
wmNoticeActivity = 1
wmNoticeCompleted = 2wmNoticeErrored = 3
NotifyError is a reference to an error class if an error has occurred. Refer to the
wmError object for a description of its properties to use when handling errors in anapplication.
Example
Private Sub gDesktop_Notify(NotifyProps As WorkMan.iiCollection, NotifyTrans As_
WorkMan.NoticeActionConstants, NotifyType AsWorkMan.NoticeTypeConstants, _
NotifyError As WorkMan.wmError)
Dim nstring As StringDim workitem As workitemDim fn As String
Dim Folder As workitemDim s As String
Dim prq As PrintRequestOn Error Resume Next
Set workitem = NotifyProps(propWorkitem)Debug.Print NotifyError.Number; NotifyError.Source
Select Case (NotifyType)Case wmNoticeActivity
nstring = ActivityCase wmNoticeCompleted
nstring = CompletedCase wmNoticeErrored
nstring = ErroredEnd Select
Select Case (NotifyTrans)Case wmReserveWorkitem
List4.AddItem nstring & & Workitem Event: Reserve & workitem.Name&_ ; & NotifyError.Description
Case wmUnReserveWorkitemList4.AddItem nstring & & Workitem Event: UnReserve
7/23/2019 Client Work Manager Integration
34/158
Client Work Manager ActiveX Interface
226 8206 3637-000
workitem.Name &_ ; & NotifyError.Description
Case wmRemoveFromDesktopList4.AddItem nstring & & Workitem Event: Remove From Desktop &_workitem.Name & ; & NotifyError.Description
Case wmCreateWorkitemList4.AddItem nstring & & Workitem Event: Create Workitem &_
workitem.Name & ; & NotifyError.DescriptionIf mAutoCreate Then
Call AutoIndex(workitem)End If
Case wmSaveWorkitemList4.AddItem nstring & & Workitem Event: Save Workitem & _
workitem.Name ; & NotifyError.DescriptionCase wmAddImagePage
List4.AddItem nstring & & Workitem Event: Add Image Page &_workitem.Name & ; & NotifyError.Description
Case wmAddImportList4.AddItem nstring & & Workitem Event: Add Import &workitem.Name _ & ; & NotifyError.Description
Case wmAddNoteList4.AddItem nstring & & Workitem Event: Add Note & workitem.Name
& _ ; & NotifyError.DescriptionCase wmDeletePage
List4.AddItem nstring & & Workitem Event: Delete Page & from_& workitem.Name & ; & NotifyError.Description
Case wmSaveAsFile
Set mpage = NotifyProps(propPage)fn = NotifyProps(propFileName)
List4.AddItem nstring & & Workitem Event: Save As File & fn & from
_ & workitem.Name & ; & NotifyError.DescriptionCase wmSendWorkitem
List4.AddItem nstring & & Workitem Event:Send & workitem.Name & ; &_ NotifyError.Description
Case wmFileIntoFolder
Set Folder = NotifyProps(propFolder)List4.AddItem nstring & & Workitem Event:File Into Folder _
& workitem.Name & >> & Folder.Name & ; & NotifyError.DescriptionCase wmRemoveFromFolder
Set Folder = NotifyProps(propFolder)
List4.AddItem nstring & & Workitem Event: Remove From Folder &_
workitem.Name &
7/23/2019 Client Work Manager Integration
35/158
Client Work Manager ActiveX Interface
8206 3637-000 227
Case wmQueueGetContents
s = NotifyProps(propQueueName)List4.AddItem nstring & & Queue Event: GetContents & s & : &_NotifyError.Description
Case wmQueueRetrieveWorkitems = NotifyProps(propQueueName)
List4.AddItem nstring & & Queue Event:Retrieve From Queue & s & got &_ workitem.Name & : & NotifyError.Description
Case wmPrintRequestSet prq = NotifyProps(propPrintRequest)
List4.AddItem nstring & & Workitem Event:Print Request: &workitem.Name_ & submitted to & prq.QueueName &
NotifyError.DescriptionEnd Select
List4.ListIndex = List4.ListCount - 1
List1_Click
End Sub
Terminate
The Terminate event occurs when the desktop is about to end.
Syntax
Public Event Terminate( )
Example
Private WithEvents mDesktop As Desktop
Private Sub mDesktop_TerminateCall DisconnectDesktop
MsgBox The Client Work Manager is terminating.End Sub
7/23/2019 Client Work Manager Integration
36/158
Client Work Manager ActiveX Interface
228 8206 3637-000
ToolClick
The ToolClick event is raised when the user clicks on any tool in the main menu bar ortoolbar of Client Work Manager and the popup menus from the GRID and ShortCutBar.
The ability to cancel the Client Work Manager default behavior for a tool is provided bythe Cancel parameter.
Syntax
Public Event ToolClick(Tool_ID As String, Cancel As Integer)
Tool_ID The unique identifier for a tool in a Toolbar definition file (.atb)
Cancel Determines whether Client Work Manager should perform the
default behavior of the tool that was clicked. If the object modelclient sets the Cancel parameter to true, Client Work Managerwill not process the selected tool. If the object model client sets
the Cancel parameter to false, Client Work Manager will process
the selected tool. The default value is false.
Programming Note:If the client program wants to perform a custom behavior for
the tool that was clicked, it should set the Cancel parameter to true set a timer andreturn to CWM. When the timer goes off, perform the custom behavior.
7/23/2019 Client Work Manager Integration
37/158
Client Work Manager ActiveX Interface
8206 3637-000 229
Domain Object
The Domain object enables you to create and modify workitems on the WorkflowDomain to which it is connected.
Domain Object Methods
CreateWorkitem, Query, RetrieveWorkitem, and RetrieveWorkitemByID
CreateWorkitem
Use the CreateWorkitem method to create a new workitem that is added to the
desktop as a retained item and is returned both opened and reserved.
When a workitem is created, it is given a temporary object ID by which it can be
uniquely identified. When the new workitem is first saved, the system assigns it apermanent object ID and the temporary ID is no longer valid. Therefore, the client
application should update any references to the workitems ID immediately after it issaved for the first time. Returns from this method are made through the Desktop
class, Notify event.
NotifyProps contents
Key Data Type
PropWorkitem Workitem Object
Syntax
Public Sub CreateWorkitem(WorkitemName As String, WorkitemType As _WorkitemTypeConstants,WorkitemClass As String)
WorkitemName The external name of the new workitem. It must not
contain * (asterisk sign), % (percent),/ (slash),\ (backslash), or tabcharacters.
WorkitemTypeConstants Must be either wmTypeDOCUMENT orwmTypeFOLDER.
WorkitemClass Must already be defined in the system. Class namesare case-sensitive.
Example
Dim Dom As DomainDim DomainName As String
DomainName = List1.List(List1.ListIndex)Set Dom = gDesktop.Domains(DomainName)
Dim i As IntegerFor i = 1 To 3
Dom.CreateWorkitem Auto Test & i, wmTypeDocument, INVOICE2
7/23/2019 Client Work Manager Integration
38/158
Client Work Manager ActiveX Interface
230 8206 3637-000
Next
End Sub
QueryUse the Query method to perform a query on workitems. Returns from this method
are made through the Desktop class Notify event. In addition to explicit search values(.Value = Smith) with or without the use of a wildcard (.Value = Smith%), search
values may also specify relative values, by preceding the value with the characters >,=, =M), or multiple explicit values (OR query .Value =A|C|R|X). If the FormField is a date (FormField.DataType = wmFormTypeDate) then a
date-range may also be specified. (.Value >=1/1/1999
7/23/2019 Client Work Manager Integration
39/158
Client Work Manager ActiveX Interface
8206 3637-000 231
If Domain.Name = Then Exit Sub
Set Dom = gDesktop.Domains(DomainName)For i = 1 to Dom.QueryForms.Count
List1.Additem Dom.QueryForms.Item(i).Name
formname = Dom.QueryForms(i).formnameSet flds = Dom.FormFields(formname)
flds(fieldname).Value = fieldvalueSet qform = Dom.QueryForms (i)
Dom.Query flds, qform.QueryType, wmQueryLocationArchive, 20, qformSet CurQWorkitesm = UeWI.CurrentQWorkitemsFor each workitem in CurQWorkitems
Dom.RetrieveWorkitem workitem, True, FalseList1.AddItem Domain Event: Retrieved Workitem& workitem.Name
Next workitemNext
End Sub
QueryEx
Use the QueryEx method in the Domain Class to search for workitems and display the
results in the Client Work Manager detail pane. You can use the QueryEx method toreplace the preceding Query method.
Syntax
Public Sub QueryEx(QryFields As FormFields, _QueryType As wmQueryTypeConstants, _
QueryLocation As wmQueryLocationConstants, _MaxMatches As Long, _QueryForm As QueryForm, _
TreeNodeKey As St ring, _Optional bShowResults As Boolean = False)
QryFields The form fields collection of values on to query.
QryType Either wmQueryTypeDocument or wmQueryTypeFolder.
QueryLocation Either wmQueryLocationDomain or wmQueryLocationArchive.
MaxMatches The maximum number of matches requested.
QueryForm The query form object for a form.
TreeNodeKey The key to the query form node or the query results node
location to which the query result will be placed.
bShowResults Either True or False. Determines whether to display the results
in the Client Work Manager Detail pane.
7/23/2019 Client Work Manager Integration
40/158
Client Work Manager ActiveX Interface
232 8206 3637-000
RetrieveWorkitem
Use the RetrieveWorkitem method to retrieve a workitem to the desktop that was the
result of a query. Note that the workitem is not opened. An explicit open of a
workitem must be done. See Workitem Object, OpenWorkitem Method. Returns fromthis method are made through the Desktop class Notify event.
NotifyProps contents: for wmNoticeErrored
Key Data Type
PropWorkitem Workitem Object
PropDomainName String
NotifyProps contents: for wmNoticeCompleted
Key Data Type
PropWorkitem Workitem Object
Syntax
Public Sub RetrieveWorkitem(Workitem As Workitem, ReserveOption As Boolean,_AutoViewOption As Boolean)
Note that ReserveOptionand AutoViewOptionare not used in this version. SeeWorkitem Object, OpenWorkitem Method.
Example
See the example for the Query method of the Domain object.
RetrieveWorkitemByID
Use the RetrieveWorkitemByID method to retrieve a workitem to the desktop when
only the Object_ID is known. Note that the workitem is not opened. An explicit openof a workitem must be done. See Workitem Object, OpenWorkitem Method.
Returns from this method are made through the Desktop class Notify event.
NotifyProps contents: for wmNoticeErrored
Key Data Type
PropWorkitem Workitem Object
PropDomainName String
7/23/2019 Client Work Manager Integration
41/158
Client Work Manager ActiveX Interface
8206 3637-000 233
NotifyProps contents: for wmNoticeCompleted
Key Data Type
PropWorkitem Workitem Object
Syntax
Public Sub RetrieveWorkitemByID(ObjectID As String, ReserveOption As Boolean,_AutoViewOption As Boolean)
Note that ReserveOption and AutoViewOption are not used in this version. See
Workitem Object, OpenWorkitem Method.
Example
Static ID As String
Dim DomainName As StringDim Dom As domain
ID = InputBox$(Please enter the Object ID of the workitem to retrieve.,_Retrieve by ID ID)
If ID = Then Exit Sub
DomainName = List1.List(List1.ListIndex)If DomainName = Then Exit Sub
Set Dom = gDesktop.Domains(DomainName)Dom.RetrieveWorkitemByID ID, False, True
Domain Object Properties
EscalateQueue, FormFields, FunctionalSecurity, ImportClasses, ISSignedOn, Name,QueryForms, WorkflowQueues, WorkflowVariables, WorkitemClasses, and Workitems
Retrieve Escalation Queue Name
Use the EscalateQueue property of the Domain object to find the name of the queuedefined by an Administrator for escalation purposes.
Syntax
Public Property Get EscalateQueue() As String
Example
Dim DomainName As String
Dim Dom As domainDim msg As String
DomainName = List1.List(List1.ListIndex)If DomainName = Then Exit SubSet Dom = gDesktop.Domains(DomainName)
If Dom.EscalateQueue = Thenmsg = Escalate Queue has not been defined for this user.
7/23/2019 Client Work Manager Integration
42/158
Client Work Manager ActiveX Interface
234 8206 3637-000
Else
msg = Escalate Queue is & Dom.EscalateQueueEnd IfMsgBox msg
Retrieve Form Fields in the Specified Form Name
Use the FormFields property of the Domain object to retrieve the form fields
contained in the specified FormName. FieldName indexes FormFields.
Syntax
Public Property Get FormFields(FormName As String) As FormFields
Example
Dim Dom As Domain
Dim ffield As FormFieldDim DomainName As String
DomainName = List1.List(List1.ListIndex)Set Dom = gDesktop.Domains(DomainName)
For each ffield in Dom.FormFieldsfrmFormFields.Combo1.AddItem ffield.FieldName
Next ffieldfrmFormFields.Show 1
Determine Functional Security Privileges
Use the FunctionalSecurity property of the Domain object to determine the current
users functional security privileges.
Syntax
Public Property Get FunctionalSecurity(WhatFunction As wmSecurity) As wmAbility
The argument WhatFunction may be one of the following constants:
wmSecurityNoteCreate = 1wmSecurityNoteModify = 2
wmSecurityNoteDelete = 3wmSecurityMarkupCreate = 4
wmSecurityMarkupModify = 5wmSecurityMarkupDelete = 6
wmSecurityDocPrintFax = 7wmSecurityDocReserve = 8wmSecurityDocIndex = 9
wmSecurityDocName = 10wmSecurityDocImport = 11
wmSecurityDocExport = 12wmSecurityDocImportImage = 13
wmSecurityDocExportImage = 14wmSecurityDocFile = 15
7/23/2019 Client Work Manager Integration
43/158
Client Work Manager ActiveX Interface
8206 3637-000 235
wmSecurityDocUnfile = 16
wmSecurityDocReclassify = 17wmSecurityDocScan = 18wmSecurityDocCut = 19
wmSecurityDocCopy = 20wmSecurityDocPaste = 21
wmSecurityDocDelete = 22wmSecurityDocPreferences = 23
wmSecurityDocImportNew = 24wmSecurityDocScanSetup = 25wmSecurityDesktopFileCabinet = 26
wmSecurityDesktopInBox = 27wmSecurityDesktopOutBox = 28
wmSecurityDesktopScanner = 29wmSecurityDesktopFormsCreator = 30
wmSecurityDesktopBatchPrint = 31wmSecurityDesktopSystemConsole = 32
wmSecurityFolderReserve = 33wmSecurityFolderIndex = 34wmSecurityFolderName = 35
wmSecurityFolderImport = 36wmSecurityFolderExport = 37
wmSecurityFolderFile = 38wmSecurityFolderUnfile = 39
wmSecurityFolderPrintFax = 40wmSecurityFolderReclassify = 41wmSecurityFolderCut = 42
wmSecurityFolderCopy = 43wmSecurityFolderPaste = 44
wmSecurityFolderDelete = 45
wmSecurityFolderCreateSubfolder = 46wmSecurityFolderImportNew = 47wmSecurityPagePrintFax = 48wmSecurityResultsViewerPrintFax = 49
wmSecurityResultsViewerRetrieveReserved = 50wmSecurityScanOptions = 51
wmSecurityScanLoadProfile = 52
wmAbility may be one of the following constants:
wmAbilityNo = 0
wmAbilityYes = 2
wmAbilityYesIfCreator = 1
Example
Dim Dom As DomainDim ffield As FormField
Dim DomainName As StringDomainName = List1.List(List1.ListIndex)
Set Dom = gDesktop.Domains(DomainName)
7/23/2019 Client Work Manager Integration
44/158
Client Work Manager ActiveX Interface
236 8206 3637-000
If Dom.FunctionalSecurity(wmSecurityNoteCreate) = wmAbilityNo Then
Print No ability to create a Note.
Retrieve Information on all the Import ClassesUse the ImportClasses property of the Domain object to get all the import classes that
are defined on this Workflow Domain. ImportClassName indexes ImportClasses.
Syntax
Public Property Get ImportClasses() As ImportClasses
Example
Dim Dom As DomainDim iclass As ImportClass
Dim DomainName As String
DomainName = List1.List(List1.ListIndex)Set Dom = gDesktop.Domains(DomainName)
For each iclass in Dom.ImportClassesfrmImportClasses.Combo1.AddItem iclass.ImportClassName
Next iclassfrmImportClasses.Show 1
Determine Whether Workflow Domain Session is Active
Use the IsSignedOn property of the Domain object to determine if the Workflow
Domain session is active.
Syntax
Public Property Get IsSignedOn() As Boolean
Example
Dim Dom As DomainDim DomainName As String
DomainName = List1.List(List1.ListIndex)Set Dom = gDesktop.Domains(DomainName)
If Dom.IsSignedOn = True ThenPrint Domain session is Active.
End If
Retrieve Name of Workflow Domain
Use the Name property of the Domain object to get the name of the Workflow
Domain to which this class is connected.
Syntax
Public Property Get Name()As Variant
7/23/2019 Client Work Manager Integration
45/158
Client Work Manager ActiveX Interface
8206 3637-000 237
Example
Dim Dom As DomainDim DomainName As String
DomainName = List1.List(List1.ListIndex)
Set Dom = gDesktop.Domains(DomainName)Print Dom.Name
Retrieve the Query Forms
Use the QueryForms property of the Domain object to get the query forms that are
contained in the Workflow Domain.
Syntax
Public Property Get QueryForms() As QueryForms
ExampleSee the example for the Query method.
Retrieve the Items in a Workflow Queue
Use the WorkflowQueues property of the Domain object to get workflow queueitems, one per queue, existing on this Workflow Domain.
Syntax
Public Property Get WorkflowQueues(QueueType As wmQueueTypeConstants) As_WorkflowQueues
The argument QueueTypesmay be one or more of the following:
wmQueueTypeSourcewmQueueTypeDestination
wmQueueTypeMailboxwmQueueTypePrint
wmQueueTypeFax
Example
Dim Dom As Domain
Dim Que As WorkflowQueueDim DomainName As String
DomainName = List1.List(List1.ListIndex)Set Dom = gDesktop.Domains(DomainName)For each Que in Dom.WorkflowQueues(wmQueueTypePrint)
frmPrint.Combo1.AddItem Que.QueueNameNext Que
frmPrint.Show 1
7/23/2019 Client Work Manager Integration
46/158
Client Work Manager ActiveX Interface
238 8206 3637-000
Retrieve the Workflow Variables
Use the WorkflowVariables property of the Domain object to get the requestedworkflow variables, either route variables or user variables.
Syntax
Public Property Get WorkflowVariables(Name As String, Category As_wmWorkflowVariableCategory, Optional UserName As String=) As_
WorkflowVariables
Name The name of the requested workflow variable. To search for all
workflow variables, pass an empty string.
Category Either one of the wmWorkflowVariableCategory categories:
wmWorkflowVariableCategoryRoute route variables
wmWorkflowVariableCategoryUser user variables
UserName The user name for the user variable. This parameter is optional. It isignored if the category is wmWorkflowVariableRoute. To search for all
users, pass an empty string.
Example
Dim Dom As Domain
Dim WFvar As WorkflowVariableDim DomainName As String
DomainName = List1.List(List1.ListIndex)Set Dom = gDesktop.Domains(DomainName)
For each WFVar in Dom.WorkflowVariables(, wmWorkflowVariableCategoryRoute)WithWFVarList4.AddItem --------------------
List4.AddItem Name= & .NameList4.AddItem Comment= & .Comment
List4.AddItem Modifiable= & .ModifiableList4.AddItem Category= & .Category
List4.AddItem VariableType= & .VariableTypeEnd With
Next WFVar
Retrieve Information on all the Workitem Classes
Use the WorkitemClasses property of the Domain object to get information on all ofthe workitem classes that are defined in this Workflow Domain. WorkitemClasses isindexed by ClassName.
Syntax
Public Property Get WorkitemClasses() As WorkitemClasses
7/23/2019 Client Work Manager Integration
47/158
Client Work Manager ActiveX Interface
8206 3637-000 239
Example
Dim Dom As DomainDim wiclass As WorkitemClass
Dim DomainName As String
DomainName = List1.List(List1.ListIndex)Set Dom = gDesktop.Domains(DomainName)For each wiclass in Dom.WorkitemClasses
frmWorkitemClasses.Combo1.AddItem wiclass.ClassName
Next wiclassfrmWorkitemClasses.Show 1
Retrieve Workitem Objects That are on the Desktop
Use the Workitems property of the Domain object to get the workitem objects thatare on the desktop in this Workflow Domain.
Syntax
Public Property get Workitems() As Workitems
Example
Dim Dom As Domain
Dim Wi As WorkitemDim DomainName As String
DomainName = List1.List(List1.ListIndex)Set Dom = gDesktop.Domains(DomainName)
For Each Wi In Dom.WorkitemsIf Wi.WorkitemType = wmTypeFolder Then
If Wi.Name = List2.List(List2.ListIndex) Then
FileThis.FileInFolder WiExit For
End IfEnd If
Next Wi
7/23/2019 Client Work Manager Integration
48/158
Client Work Manager ActiveX Interface
240 8206 3637-000
Domains Collection Object
The Domains collection object contains all of the Workflow Domains that are availableto a user. Through this object, you can reference one or more Domain objects.
Domains Collection Object Properties
Item and Count
Iterate Through a Collection of Workflow Domains
Use the Item property of the Domains collection object to reference an element in the
collection, specifically a single Workflow Domain.
Syntax
Public Property Item(vntIndexKey As Variant) As domain
The index argument, vntIndexKey, can be either be the item position in thecollection (index) or the key.
Example
Dim Dom As DomainsSet Dom = gDesktop.Domains
For i = 1 to Dom.CountList1.AddItem Dom.Item(i).Name
Next i
Determine the Number of Domain Objects Referenced by theCollection
Use the Count property of the Domains object to retrieve the number of elements inthe collection, specifically the number of Domain objects.
Syntax
Public Property Get Count() As Long
Example
Dim Dom As Domains
Set Dom = gDesktop.DomainsFor i = 1 to Dom.Count
List1.AddItem Dom.Item(i).Name
Next i
7/23/2019 Client Work Manager Integration
49/158
Client Work Manager ActiveX Interface
8206 3637-000 241
FaxRequest Object
The FaxRequest object is used to submit a remote fax request for a document.
FaxRequest Object Properties
Comment, Company, FromPage, HeaderMessage, IncludeAnnotations,
IncludeCoverSheet, IncludeFormData, IncludeNotes, NumCopies, PageRange,PhoneNumber, QueueName, Receiver, Sender, and ToPage
Retrieve the Fax Options
Use the following properties of the FaxRequest object to retrieve Fax options:
Property Description
Comment Get or set the comment associated with a fax.
Company Get or set the name of the company receiving the fax.
FromPage Get or set the first page ordinal of the fax.
HeaderMessage Get or set the message for the header of each faxed page.
IncludeAnnotations Determine whether to include annotations in the fax or whether
annotations are included in the fax.
IncludeCoverSheet Determine whether to include a cover sheet in the fax or whether
a cover sheet is included in the fax.
IncludeFormData Determine whether to include a data form in the fax or whether a
data form is included in the fax.
IncludeNotes Determine whether to include notes in the fax or whether notes
are included in the fax.
NumCopies Get or set the number of copies of the fax.
PageRange Get or set the page range of the fax. PageRange can be one of
the following constants:
wmFaxPageRangeAll = 0
wmFaxPageRangeNone = 1
wmFaxPageRangeFromTo = 2
PhoneNumber Get or set the phone number of the recipient of the fax.
QueueName Get or set the name of the fax queue to which to submit the fax
request.
Receiver Get or set the receiver of the fax.
Sender Get or set the name of the user sending the fax.
ToPage Get or set the last page ordinal of the fax.
7/23/2019 Client Work Manager Integration
50/158
Client Work Manager ActiveX Interface
242 8206 3637-000
Example
Dim faxreq As FaxRequestSet faxreq = New FaxRequest
faxreq.comment = Personal fax
faxreq.company = ABC Companyfaxreq.FromPage = 2faxreq.HeaderMessage = This is ConfidentialIf faxreq.IncludeAnnotations = True Then
Print Annotations includedIf faxreq.CoverSheet = True Then
Print Cover Sheet includedIf faxreq.IncludeFormData = True Then
Print Form Data is includedIf faxreq.IncludeNotes = True Then
Print Notes are included
faxreq.NumCopies = 5faxreq.PageRange = wmPrintPageRangeAll
faxreq.PhoneNumber = 215-555-1212faxreq.Receiver = Anita
faxreq.Sender = Mr. Smithfaxreq.ToPage = 4
7/23/2019 Client Work Manager Integration
51/158
Client Work Manager ActiveX Interface
8206 3637-000 243
FormField Object
The FormField object describes a form field in a form, which allows the retrieval of thenumerous field attributes.
FormField Object Properties
ColumnNumber, DataType, DefaultValue, FieldName, Flags, HelpText, ImageEditRect,ImageOCRRect, ImagePageNumber, IndexName, Length, Prompt, RangeHigh,RangeLow, RowNumber, Status, Value, and ValueList.
Retrieve the Attributes of a Field on a Form
Use the following properties of the FormField object to retrieve the attributes of a
field on a Form:
Property Description
ColumnNumber Get the column number of the form field.
DataType Determine the data type of the form field.
DefaultValue Get the default value of the form field.
FieldName Get the form fields name.
Flags Get the flags that are set for the form field.
HelpText Get the form fields help text.
ImageEditRect Get the location of the Edit rectangle.
ImageOCRRect Get the location of the OCR rectangle.
ImagePageNumber Get the image page number assigned to the image page file
associated with the field on the form.
IndexName Get the name of the field by which the form is indexed.
Length Get the length of the field.
Prompt Get field help for the field on the form.
RangeHigh Get the upper limit for a value that can be entered for a text or
number field on a form.
RangeLow Get the lower limit for a value that can be entered for a text or
number field on a form.RowNumber Get the row number of the form field.
Status Get the status of the field on the form.
Value Get the value of the field on the form.
ValueList Get a list of valid values for the field on a form.
7/23/2019 Client Work Manager Integration
52/158
Client Work Manager ActiveX Interface
244 8206 3637-000
Syntax
Public Property Get ColumnNumber() As LongPublic Property Get DataType() As wmDataTypeConstants
Possible DataTypeconstants are:
wmDataTypeConstants Description
wmFormTypeText Any alphanumeric characters
wmFormTypeNumber Numeric characters only (no decimals)
wmFormTypeBoolean Yor Nor Xor space( ); see Flags property
wmFormTypeCurrency A currency amount with 2 decimal places
wmFormTypeDate Date in the format mm/dd/yyyy
wmFormTypePercent Percentage in the form 8.5(not .085)
wmFormTypeDecimal Numeric value with decimal places
wmFormTypeSignature Signature field (user must type password)
wmFormTypeMemo Multiple lines of variable-length text
Public Property Get DefaultValue() As StringPublic Property Get FieldName() As String
Public Property Get Flags() As wmFormField FlagsConstants
Possible Flagsconstants:
wmFormFieldFlagsConstants Description
wmFormFieldFlagsRequired Field must contain data.
wmFormFieldFlagsDisplayOnly Contents cannot be edited.
wmFormFieldFlagsNoEcho Contents are hidden from the user.
wmFormFieldFlagsUpperCase All characters are forced to uppercase.
wmFormFieldFlagsRightJustify Contents are right justified.
wmFormFieldFlagsAutoClear Contents is cleared when first character is
typed.
wmFormFieldFlagsAutoAdvance Cursor is automatically advanced to the
next field when this field is full.
wmFormFieldFlagsGroupTab Defines the beginning of a tab group.
wmFormFieldFlagsRetainZeros Leading zeros are retained.
wmFormFieldFlagsYesNo If field is type Boolean, use Yand N.
wmFormFieldFlagsVerify Field data is verified against previous data.
7/23/2019 Client Work Manager Integration
53/158
Client Work Manager ActiveX Interface
8206 3637-000 245
wmFormFieldFlagsConstants Description
wmFormFieldFlagsScratch Contents are not saved.
wmFormFieldFlagsValueList Field contains a value list.
Public Property Get HelpText() As String
Public Property Get ImageEditRect() As wmRectanglePublic Property Get ImageOCRRect() As wmRectanglePublic Property Get ImagePageNumber() As Long
Public Property Get IndexName() As StringPublic Property Get Length() As Long
Public Property Get Prompt() As StringPublic Property Get RangeHigh() As String
Public Property Get RangeLow() As StringPublic Property Get RowNumber() As LongP