Application Development
Application Development
FileNET
Application Developer’s
Guide
Release 3.0
9810995-004
Visual WorkFlo
August 1998
Related Documents 13
Conventions 14
Education 15
1 Application Development 17
Business Process 18
As-is Business Process 18
To-be Business Process 20
High-volume Sites with Robot Tasks 20
Low-volume Sites 20
Design Considerations 33
Server-side or Client-side Application 34
Push or Pull (Passive or Active) 34
Passive 35
Active 36
Instruction Sheet: a Process Map 38
Workflow View 39
Development Environment 40
Creative, Administrative, and Active Work Performer
Interface with the API OLE Server 40
Passive Interface with the API OLE Server 42
Passive Interface with Active Access 43
Syntax 45
Direct OLE Server Interface 46
Data Type Map
Visual WorkFlo to Visual Basic 5.0 46
Data Type Map
C/C++ Direct Interface to C/C++ Interface Through Wrapper 46
Interface through a OLE Wrapper DLL 47
Array 47
Direct Interface with the OLE Server 47
OLE Wrapper DLL Interface 48
Parameter Direction Mode 48
Return Value - Success Status (RetVal) 49
Handle as an Input Parameter 49
LogonHandle 50
Handle 50
Logon 52
Visual WorkFlo Session 52
VW_Logon( ) 53
VW_LogonEx( ) 53
SLU Requirement 53
Recovery 54
Security 54
2 Client-side Application 55
Procedure Directory 55
Work Creation 56
Creative Application Development 61
Work Performer Comparison 63
Work Administration 64
Administrative Application Development 64
Query 64
Rapid Access Development 66
Administrative Calls to the API 128
Work Performer Comparison 145
Compilation 189
Work Performer on the AIX 190
VW_GetField 326
VW_GetFieldNames 330
VW_GetFieldSize 332
VW_GetFloat 334
VW_GetFPNumber 336
VW_GetHandleType 338
VW_GetInteger 339
VW_GetIsolatedRegion 340
VW_GetMachineId 341
VW_GetOperationName 342
VW_GetOperationNameSize 343
VW_GetParameterMode 344
VW_GetQueueNames 346
VW_GetString 348
VW_GetStringSize 350
VW_GetTime 352
VW_GetWobSignature 354
VW_GetWorkClassNames 355
VW_GetWorkObjectLockStatus 357
VW_GetWorkObjectName 359
VW_GetWorkPerformerClassNames 361
VW_GetWorkPerformerHandle 364
VW_GetWorkQueueDepth 365
VW_LeaveWork 366
VW_LockWorkObject 367
VW_LogMessage 370
VW_Logoff 372
VW_Logon 373
VW_LogonEx 376
VW_LogQueryBegin 381
VW_LogQueryEnd 383
VW_LogQueryNextRecords 384
VW_NextWorkObjectToBrowse 388
VW_QQueryBegin 390
VW_QQueryEnd 398
VW_QQueryNextLockedWorkObject 399
VW_QQueryNextWorkObject 401
VW_QsCreateQuerySpecifier 403
VW_QsFreeQuerySpecifier 414
VW_QueueGetStats 415
VW_RaiseException 419
VW_ReportToWork 421
VW_RosterGetStats 423
VW_SequencedWait 428
VW_SequencedWobFetch 437
VW_SetArray 439
VW_SetArrayPtr 441
VW_SetBoolean 444
VW_SetField 446
VW_SetFloat 448
VW_SetFPNumber 450
VW_SetInteger 452
VW_SetString 454
VW_SetTime 456
VW_TerminateWorkObject 458
VW_UnBind 460
VW_UnlockAndDispatch 461
VW_UnlockWorkObject 462
VW_WobQueryCreate 463
VW_WobQueryEnd 468
VW_WobQueryExecute 469
VW_WobQueryGetAccessHandle 472
VW_WobQueryGetWorkObjectName 475
VW_WobQueryInstrSheet 477
VW_WobQueryOperation 479
VW_WobQueryWorkPerformerClass 481
Index 497
a. After project analysis, planners may use the terms “as-is” and “to-
be” in asking the developer to transition their (as-is) business pro-
cess into a (to-be) business process.
Related Documents
Several documents support Visual WorkFlo Release 3.0. This Visual
WorkFlo Application Developer’s Guide and each of the following are
online manuals on the FileNET Panagon Visual WorkFlo Documenta-
tion CD:
Conventions
Visual WorkFlo documentation uses the following conventions:
Education
FileNET offers introductory and advanced classes for system adminis-
trators, developers, managers, and support personnel. The classes
combine lecture and lab to provide both conceptual understanding of
the FileNET system and practice in its operation.
Local 714.966.3412
(Orange County, California)
Mike Calvert
Director of Documentation
FileNET Corporation (Phone) 714.966.3449
3565 Harbor Boulevard (FAX) 714.850.5859
Costa Mesa, CA 92626-1420 (E-mail) calvert@filenet.com
This can access the Visual WorkFlo API through the RAD controls.
Business Process
The application developer’s design and construction responsibility be-
gins once project analysis has produced the business process, a dia-
gram that shows current, “as-is” workflow requirements. The developer
uses the as-is business process to determine where and how to incor-
porate Visual WorkFlo into a to-be business process.
Agents at headquarters
Headquarters
☎ Agent
☎ Agent
High-volume ☎ Agent
Remote Office
☎ Agent Independent
Modest-volume
Remote Office
Low-volume Sites
Volume is low enough at one remote office and at the independent
agent’s office that agents at these sites can rely on headquarters’ Vi-
sual WorkFlo software, rather than install it on site. They will create an
item of work locally, but will communicate with Visual WorkFlo at head-
quarters to process it.
Headquarters
☎ Agent
Visual WorkFlo
FAX
Visual WorkFlo
☎ Agent
☎ Agent WorkFlo
Connection
Independent
High-volume
Remote Office IDM Desktop
☎ Agent
Modest-volume
Remote Office
Remote Office
The to-be business process plans the use of these FileNET products
for the low-volume remote office:
• IDM Desktop
Independent Agent
The independent agent will create a Work Object and FAX it to the Vi-
sual WorkFlo system at headquarters.
Development Overview
Automate the to-be business process that requires Visual WorkFlo by
developing a Visual WorkFlo application according to the following
guidelines:
3 Decide whether your application will run on the Visual WorkFlo server
or the PC workstation. See “Server-side or Client-side Application” on
page 34.
Application Category
A Visual WorkFlo application is in one of the following categories:
• Calls APIs in the sequence shown by the blue path in “API Calling
Sequence” on page 484
• Queries a roster, log, or queue for Work Object data field informa-
tion and process status
• Calls APIs in the sequence shown by the queue query in the green
path and by the red path in “API Calling Sequence” on page 484
Predevelopment Checklist
Complete the procedures in the following Predevelopment Checklist
before you develop a Visual WorkFlo application.
R Install and configure Visual WorkFlo server software on the server and
Visual WorkFlo client software on the PC workstation and the server.
Work Classes
For further information about the Composer program, see the Visual
WorkFlo/Composer Handbook.
Once you have developed the application, but before you run it,
check that following class definition details in your code match
those defined above with Composer:
• Operations
• Data fields
• Instruction Sheets
• Index keys
R Use the Conductor program to transfer the contents of the CDL file to
the Online repository.
For further information about Conductor, see the Visual WorkFlo Instal-
lation and Administration Handbook.
3 From the Visual WorkFlo Utilities window Help menu, select Help Top-
ics, the Contents tab, and the topic Using the Utilities/Creating Work
Objects.
or
Select the Index tab, then the index entry ‘Create Work Object dialog
box’ (leave this open and refer to it as you go to step 4).
5 Select a Work Class from the choices in the Enter Work Class field.
The Work Classes are in the list because they loaded when you in-
stalled Visual WorkFlo.
6 Select the AutoClaim Work Class. Leave the default, 1, in the Enter
number to create: field. Leave the Save Messages To VWLog File box
unchecked.
Note what time it is; you will need this to later identify your Work Ob-
ject. We will look at your Work Object later; for now please proceed
with the next topic.
Soon, you will write your own application to create a Work Object and
dispatch it for processing; however, first create a Work Object using the
sample application, AutoClaim, which you installed when you installed
the Desktop Toolkit option (see Getting Started with Visual WorkFlo ).
When you launch the sample’s executable file, autoclaim.exe (in the
Samples file where you installed Visual WorkFlo, it creates work in the
Visual WorkFlo system, lets you populate some or all of a Work Ob-
ject’s data fields, then dispatches the Work Object for processing.
2 Select FileNET Logon from the Visual WorkFlo program group menu.
4 Launch Conductor.
(This is in the path where you installed Visual WorkFlo from the CD.)
The AutoSure company’s claim form displays. This is the claim form
the company’s agent fills in when a customer calls in to report an acci-
dent. FileNET used the Visual Basic 5.0 environment to develop auto-
claim.exe, which displays the form and creates a Work Object with the
information the agent enters in the form’s fields.
The form’s fields clear, indicating that Visual WorkFlo created a Work
Object with the information you entered.
Use Conductor to verify that there are two Work Objects in the work-
flow system—the one you just created by running a Visual WorkFlo ap-
plication and the one you created with a utility (see Step 7 on page 28):
In the left pane of the Conductor window, Work Classes, you see a list
of Work Classes (with Work Class selected).
2 Select AutoClaim, since that is the Work Class the autoclaim.exe used
as the template for your Work Object.
Work Objects in the AutoClaim Work Class, among which is the value
you typed into the AutoSure claim form, in the Insured’s Name
field (S. Kahr in the step 8 table, above)
AutoClaim uses the value the agent enters in the Insured’s Name field
as the Work Object ID.
Left column, Field Names: A list of the names of data fields defined in
the AutoClaim Work Class
Center column, Field Type: A list of the data type of each field named
in the left column
Right column, Initial Value: A list of the default value of each data field
named in the left column
Left column, Field Name: A list of the names of data fields in the
S Kahr Work Object
Right column, Current Value: A list of the values in each data field
named in the left column (look for the values you typed into the fields in
the AutoSure claim form)
4 From the Work Objects list, select the Work Object, aName.
Remember the Work Object you created with the Work Object Creator
utility? The utility assigned it default values. Look In the right-hand col-
umn, Current Value, of the Admin tab for the value that corresponds
with the data field named swcInsuredName. The default value there is
aName.
Design Considerations
Design of a Visual WorkFlo application reflects the developer’s deci-
sions regarding the following:
• User participation
- The user creates the Work Object with a Visual WorkFlo pro-
gram or application.
• Workflow view
• Development environment
Visual WorkFlo
Server
Visual WorkFlo
Server Software
Server-side PC Workstation
Visual WorkFlo
Application
Client-side
Visual WorkFlo
Application
• Passive
Passive
A passive Work Performer is the better option when an application is to
reside on the PC workstation and its task processing can run unat-
tended. When you choose a passive Work Performer the following
occur:
• Visual WorkFlo, rather than the user, selects the next Work Object
and pushes it into process. It maps the Work Object’s data fields to
parameters of the Work Performer’s Operations.
• The user, via the Visual WorkFlo program, Performer, starts and
stops the passive Work Performer which communicates with Visual
WorkFlo through a dynamic link library (DLL) that is an adaptor.
Passive Work Performers run only on the PC workstation, where
Performer resides.
See Performer help and“Adaptor Use” on page 147 for more infor-
mation.
Active
There are two types of active Work Performer:
• Can browse Work Queues and pull the next Work Object for pro-
cessing, rather than working on the next Work Object Visual Work-
Flo pushes to it
Visual WorkFlo can process the first step of this Instruction Sheet with-
out human intervention; a passive Work Performer can receive into its
Operation parameters the data field information of the next Work Ob-
ject Visual WorkFlo selects. However, the second step requires an esti-
mator’s review before Visual WorkFlo can further process the Work
Object, so an active Work Performer is the choice for that step.
Workflow View
The user may need a custom view of the workflow (to check the status
of a claim and respond to a customer inquiry, for example). Conductor
affords various views of the workflow and the developer can write an
administrative application to further customize. See “Work Administra-
tion” on page 64 for guidelines.
Development Environment
Visual WorkFlo supports an application developed in one of the follow-
ing (see the diagrams, below):
• Advanced C/C++ or other code that can interface directly with the
Visual WorkFlo OLE Automation server
OLE client
Creative/administrative Creative/administrative
application or active application or active Work
Work Performer Performer in C/C++ or other
in Visual Basic, code that can use a
Power Builder, etc. C-language DLL
OLE client
Header file for C/C++
API-library
DLL interface SVCAPI.H
(OLE wrapper)
VWAPI.DLL
OLE server
API
OLE Automation
executable
VWAPISRV.EXE
The preceding diagram shows how a C/C++ developer can use the
OLE wrapper DLL to access OLE Automation.
OLE server
OLE client
Visual WorkFlo/Performer
Passive Interface with the OLE Server
For context, the above diagram shows the relationship of the adaptors
with the FileNET-provided application, Trigger 1, and the Visual WorkFlo
program, Performer, through the library, VWPERF.DLL.
1.The number of Triggers there are is the number of passive Work Performers that can
perform simultaneously. Trigger polls queues for work, then hands work off to a Work
Performer. See Visual WorkFlo Technical Notes for details.
cess the APIs as well as to perform other tasks. (See the Visual Work-
Flo RAD/Controls Online Tutorial.)
OLE server
OLE client
Passive Work Performer
in Visual Basic, Active Work Performer
Power Builder, etc. in Visual Basic, Power
Builder, C/C++,
or other code
OLE client
OLE Adaptor
VWOLEADP.DLL
Visual WorkFlo/Performer
Passive Interface with Active Access
See “API Association by Task Group” on page 254 for call grouping by
task.
“The APIs” on page 262 details the work each API performs, the rela-
tionship of the API with other APIs and Visual WorkFlo software, data
type reference, and performance tips.
Syntax
Application syntax, such as data type, direction mode, and array han-
dling, depends on the development environment (see “Development
Environment” on page 40). Each API detail in “The APIs” on page 262
lists the parameter data type to use with Visual Basic 5.0 (in direct OLE
server interface) or with code that interfaces with the server through
the OLE wrapper DLL.
lowing table, as it compares with syntax for the C/C++ application that
uses the OLE wrapper DLL.
Array
The manner in which your application interfaces with the OLE server
determines the type of array you pass as a parameter.
that its elements can be of various data types. (The array is “heteroge-
neous.”)
The Visual Basic Object Browser lists an array’s parameter name with-
out a data type and, because a Visual Basic application does not use
the OLE wrapper DLL, the Object Browser shows no array length pa-
rameter.
VW_Integer
VW_Float
VW_String
VW_Boolean
VW_Time
In Data flows from the parameter to the Work Object data field.
Out Data flows from the Work Object data field to the parameter.
Inout Data flows from the parameter to the Work Object data field,
then from the Work Object data field to the parameter.
LogonHandle
The APIs, VW_LogonEx( ) and VW_Logon( ), return the unique
logon ID, LogonHandle, establishing an application as a Visual
WorkFlo application and allocating resources for its use.
Handle
Many of the API details show the generic parameter, Handle, as input.
To determine what Handle identifies, check its source in the following
table. A call to VW_GetHandleType( ) returns the type of a handle.
Return to If you linked to the following table from an API detail and wish to return
API Detail to the detail, please do one of the following:
• Select Bookmark and Page from your View menu, then double-
click on the API name.
Source Handle
VW_ReportToWork( ) WorkPerformerHandle
VW_CreateWorkObject( ) NewWorkObjectHandle
VW_GetAccessHandle( ) WobAccessHandle
or
VW_WobQueryGetAccess
Handle( ) for an access handle
Some application code may use an index, such as one of the following,
to find a Work Object:
Logon
Please see the Visual WorkFlo Installation and Administration Hand-
book for details on Visual WorkFlo logon.
VW_Logon( )
Running an application that calls VW_Logon( ) causes Visual WorkFlo
to prompt the user for valid user name and password. Once it has
these, Visual WorkFlo establishes a session for that user on the
VWService and in the isolated region defined in the VW.INI file.
VW_LogonEx( )
Running an application that calls VW_LogonEx( ) causes Visual Work-
Flo to establish a session without prompting the user for information, if
the developer provides this information in the API’s UserName , Pass-
word, VWServiceName, and IsolatedRegion input parameters.
Once it has these, Visual WorkFlo establishes a session for that user
on the VWService and in the isolated region of the user’s choice. If the
valid user provides no input to the VWService or IsolatedRegion pa-
rameters, Visual WorkFlo establishes the session on the VWService in
the isolated region defined in the VW.INI file.
SLU Requirement
Session logon with VW_LogonEx( ) in a server-side application uses
a SLU.
Recovery
Recovery options depend on the design of your application. For exam-
ple, if your Work Performer executes non-Visual WorkFlo tasks as well
as Visual WorkFlo Operations, you can leave a Work Object locked
during a query, rather than leaving it unlocked and having the Work
Performer go on to another task that depends on the values in the
Work Object. (In this way, you can inspect it, before the Work Per-
former goes to the next task.) Recovery options follow:
Recovery setting
in Composer Result
Automatic The Work Performer locks the Work Object for a query.
The Work Object crashes and is in recovery state. Vi-
sual WorkFlo assumes the work is lost, leaves the
Work Object data fields unchanged, and unlocks the
Work Object.
Manual The Work Performer locks the Work Object for a query.
The Work Object crashes and is in recovery state. Vi-
sual WorkFlo assumes the work is lost, leaves the
Work Object data fields unchanged and leaves the
Work Object locked.
Security
Visual WorkFlo manages security by controlling access to your appli-
cations. See the Visual WorkFlo/Composer Handbook for further de-
tails.
• Optimize performance
Procedure Directory
Begin directly with procedures by selecting one of the following, or con-
tinue reading for background.
Work Creation
A Visual WorkFlo application develops work in the workflow system, al-
lowing you to create a Work Object and fill in or change the data in its
fields. (Compare this with using the Visual WorkFlo Work Object Cre-
ator utility to create a Work Object with default information only.)
errorCode=VWServer.VW_LogonEx(“SysAdmin”,”SysAd-
min”,”VWService0:server:FileNET”,1,LogonHandle)
errorCode=VWServer.VW_CreateWorkObject
(LogonHandle,”AutoClaim”,NewWorkObjectHandle)
errorCode=VWServer.VW_DispatchWorkObject
(NewWorkObjectHandle)
errorCode=VWServer.VW_Logoff(LogonHandle)
Set VWServer=Nothing
End Sub
(See the form that displayed when you ran the sample application, au-
toclaim.exe in Step 6 on page 29.)
The following three lines assign data type to parameters the applica-
tion uses in calls to the API:
The following line causes Visual Basic to create an instance of the ob-
ject class OLE server, VWApiSrv.VWApiSrv.
errorCode=VWServer.VW_LogonEx(“SysAdmin”,”SysAd-
min”,”VWService0:server:FileNET”,1,LogonHandle)
VW_LogonEx( ) Method (function) that logs the user onto a server and a
VWService and makes the application a Visual WorkFlo
application
This manual also calls the method, which is a function of
the Visual WorkFlo API, an “API.”
See “Logon” on page 52 for information about logging onto
Visual WorkFlo.
“SysAdmin” String the developer input to the API’s parameters, User-
Name and Password
“VWService0: Components of the three-part value that the developer in-
server:FileNET” put to the API parameter, VWServiceName, in the form:
"<ServiceName>:<Domain>:<Organization>"
VWService0
Name of the VWService the developer specified in
ServiceName
server
Name of the server the developer specified in Domain
FileNET
Name of the organization the developer specified in Orga-
nization
LogonHandle Name of the parameter through which this API returns the
logon handle, LogonHandle
Use LogonHandle as input in your application’s calls to
subsequent APIs.
Following are three calls to APIs to create a Work Object, dispatch the
Work Object to the first queue, and disconnect the application from the
VWService.
errorCode=VWServer.VW_CreateWorkObject
(LogonHandle,”AutoClaim”,NewWorkObjectHandle)
errorCode=VWServer.VW_DispatchWorkObject
(NewWorkObjectHandle)
errorCode=VWServer.VW_Logoff(LogonHandle)
The following lines clean up the server object, left in memory, and end
the application.
Set VWServer=Nothing
End Sub
4 Between the two lines, mentioned in item 3, copy the sample in “Visual
WorkFlo Work Object Creation” on page 56. (Note that the first and
last lines of the sample are already provided.)
While you are developing code, you can look up a Visual Basic param-
eter data type, as follows:
- From the Project menu of the Project1- Microsoft Visual Basic [de-
sign] - [Object Browser] window, select References.
- Click OK.
- From the Members of ‘VWApiSrv’ pane, select the API for which
you wish to view Visual Basic parameter data types.
See the following for information about data type for Visual Basic and
other development environments:
- Visual Basic Object Browser data type (in the center column of
each API detail table)
“Locator” on page 242 for an alphabetical list of APIs that links you
to a specific API’s details
Once you do this, a Form1 window displays in front of your code. Close
it. Note what time it is (to help identify the Work Object later).
6 Look at the workflow with Conductor, viewing the Work Objects in the
AutoClaim Work Class (you specified “AutoClaim” in the WorkClass-
Name parameter of the VW_CreateWorkObject API).
• The one you created with the AutoClaim sample application form
The Work Object you created with this code has the default value
aName; you can distinguish it by the time you created it (see the
Current Value to the right of the swcStartTime Field Name).
Work Administration
Once you have created work in the system, check its progress and ad-
minister it with an administrative application. In our AutoClaim sample,
an agent of the AutoSure company would use an administrative appli-
cation to check the status of a claim’s processing when a customer
calls to enquire. AutoSure’s developer could write an administrative ap-
plication that customizes the view of the workflow for the claim pro-
cessing department manager, for example.
Query
The application queries one of the following:
Roster
Log
Queue
Roster
Make a roster query to determine whether a Work Object is in process
(see “Sample Roster Query” on page 130 for an example). Compare
the following:
Log
Query the log for event records saved on the server (see “Sample Log
Query” on page 135). The user can query the log to determine which
Operations Visual WorkFlo completed on a Work Object. (Compare
this to using the trace log of API activity, saved on the PC.)
Queue
Make a queue query, using a query specifier to access a Work Object.
(See “Sample Queue Query” on page 139.) Once you access the Work
Object’s data fields in this way, you can:
2 If the claim is for less than a pre-set amount of money and the cus-
tomer has valid insurance, AutoSure pays the claim. An unattended
workstation prints a letter and a check.
4 The field estimator examines the claim and estimates the amount of
damage. At the same time (in parallel), the medical reviewer examines
the medical records and estimates amount of medical expense.
5 An adjustor then reviews the field estimate and medical review data
and determines whether AutoSure should settle the claim.
• Review the reports and other collateral produced by the field esti-
mator and medical examiner to determine whether AutoSure can
settle the claim.
Trap errors
Check logon status
Populate lists
Lock, unlock, and dispatch Work Objects
Customize control activation
3 In the Open Image or CDL File dialog box, select and open Auto-
Claim.cdl in:
C:\Program Files\FileNet\Vw\Samples\
This transfers the contents of the .cdl file to the Online Repository.
Once the transfer is complete, you see the same thing in the destina-
tion windows that you see in the source windows.
6 Close Conductor.
2 Create several Work Objects with the Index form that displays:
- Fill in the fields with your own data and click Submit.
This populates the Online Repository with meaningful data you can
use while developing with the sample application.
3 Click Exit to close the above Index Auto Claim form (which ends Auto-
Claim.exe).
2 In the New Project window, double-click the Standard EXE icon to be-
gin development of an executable.
3 Click near the borders of the forms and use their “handles” to enlarge
the them (so that you have enough space to work in them).
In the Controls tab of the Components window, Visual Basic lists all
controls registered in the Windows operating system. (When you in-
stalled Visual WorkFlo, the Visual WorkFlo/RAD controls automatically
registered; so, they display in this list.)
Before clicking OK, inspect the toolbar so that you can compare the
way it looks now with the way it will look after selecting these compo-
nents.
3 Click OK.
An icon for each of the above controls now displays in the toolbar. (As
with other components in the toolbar, you can see which icon repre-
sents which control by pausing the cursor momentarily over each until
its label displays.)
1 Click a RAD control icon once, move the cursor onto Form1, and draw
a square with it where you want the control to appear, using the “Adjus-
tor’s IN Basket Application” on page 73 as a model for sizing and posi-
tioning.
Repeat for the other two controls until your application looks similar to
the following:
Play button
2 Check to see that you are still logged onto Visual WorkFlo (FileNET
Logon on the Programs/FileNET Panagon Visual Work Flo menu),
then click on the Play button to run your new application.
3 Stop the application, for now, by closing Form1 with its upper-right-
hand-corner X button.
The two lines of procedure code that display support the Refresh
method, a method shared by all of the RAD controls, which updates a
control’s data, retrieves data associated with the control in the data-
base, and immediately displays the data.
The Project1-Form1 (Code) window now displays code for two proce-
dures: Refresh and VWError. The two lines of error code display as fol-
lows:
End Sub
3 Between the above two lines of code, displayed for the VWError proce-
dure, key in the following code:
ErrorMessages=FNVWRUNWorkPerfClassList1.CompletionStatusList
If UBound(ErrorMessages) >= LBound(ErrorMessages) Then
MsgBox (“FNVWRUNWorkPerfClassList1_VWError” & Chr$(13) & “ErrorType:” _
& ErrorType & Chr$(13) & “ErrorCode:” & ErrorCode & Chr$(13) & _
“CompletionStatusList ErrorMessage:” & Chr$(13) & _
ErrorMessages(UBound(ErrorMessages)))
End If
• ErrorType
0 Unknown
1 Control-specific
2 VW_API
3 Common
4 OLE exception
5 OLE display exception
• ErrorCode
Each control has code in its own VWError event that displays the Error-
Type and ErrorCode and checks the CompletionStatusList for mes-
sages.
The user can then check the CompletionStatusList to read the text of
the error message.
4 Repeat steps 1-3 for the FileNET VW Machine ID Indicator and the
FileNET VW Isolated Region Indicator controls, substituting
MachineID1 and IsolatedRegion1, respectively, for
WorkPerfClassList1.
Tip At step 3, copy the added code from one and paste it into the other,
substituting the control-specific information.
rad1.frm
RAD.vbp
Later, we will see the result of adding the error trapping code.
Tip Should you need to suspend your work on rad1.frm and log off of Vi-
sual WorkFlo and Visual Basic, return to work on the form by logging
back on, then selecting:
So, if an API call fails while the application loads, neither of the above
cause a VWError event. However, each writes to its own Completion-
StatusList property in such an event. So, you can check the text mes-
sage in that property to see logon status.
1 Click on the Work Performer Class List control window to select it, then
press the F1 key.
The FileNet VW Work Performer Class List Control help page displays.
Note that this control has properties, methods, and events (as do all of
the controls).
A help page displays links to lists of properties this control shares with
other Visual WorkFlo/RAD controls.
5 While still on the step 4 description page, click the box to the left ot
Events, then the CommonControlEvents link.
6 Close the help pages and return to your Form1 work, where the Work
Performer Class List control is still selected.
End Sub
9 Enter the following code between the lines of code displayed in step 8
(copy the code you added to the VW_Error procedure, then edit it):
Addition of this code to the Form_Load procedure for the Work Per-
former Class List and Work Class List controls causes Visual WorkFlo
to check for an error message in the CompletionStatusList. If an API
call fails while the application is loading, the above code causes Visual
WorkFlo to display the message that is in the CompletionStatusList.
3 Click OK.
4 Click the control icon (you just added to the toolbox) once, move the
cursor onto Form1, and draw a square with it where you want the con-
trol to appear, using the “Adjustor’s IN Basket Application” on page 73
as a model for sizing and positioning.
Note that Visual WorkFlo populates all but the RAD control you added
in step 4.
The adjustor will want to select one or more Work Performer Class
names (now displayed in the Work Performer Class List control win-
dow) and see a list of Work Objects associated with those Work Per-
former Classes displayed in the Work Obj List By WP Class window
you just added. (If you click on one of the Work Performer Class names
at this point, the Work Object list remains blank, you get an error, and
code displays; you have to end the program and close the code win-
dow to return to work on your rad1.frm).
Add code to the Work Performer Class List control that gives it a proce-
dure to follow when the adjustor makes or changes a selection in its
list:
3 Between the two lines that display, enter code so that the result looks
like the following:
Now, when the adjustor selects a Work Performer Class from the list,
here is what happens:
5 In the Work Performer Class List control, scroll to and click Mainframe-
Activities.
The Work Objects you created, starting with Step 1 on page 71, are
still associated with the MainframeActivities Work Performer Class.
The names of these Work Objects now populate the Work Object List
by Work Performer Class control window; they and their lock status dis-
play there.
Leave checked those controls that are already checked and click OK.
3 Click the control icon (you just added to the toolbox) once, move the
cursor onto Form1, and draw a square with it where you want the con-
trol to appear, using the “Adjustor’s IN Basket Application” on page 73
as a model for sizing and positioning.
The adjustor will use your application to see a list of values in a Work
Object’s fields, first selecting the Work Object from the populated Work
Object List by Work Performer Class. So, add code to this control’s Se-
lectionChanged procedure to tell Visual WorkFlo what to do when the
selection is made (what to do upon the SelectionChanged event).
6 Between the two lines that display, enter code so that the result looks
like the following:
Now, when the adjustor selects a Work Object from the list, here is
what happens:
8 From the Work Performer Class List, click on the name of a Work Per-
former that contains Work Objects (MainframeActivities).
Visual WorkFlo populates the Field Values List with the Work Object’s
field values and changes the Work Object’s LockStatus to Locked by
<Machine ID>.
Visual WorkFlo populates the Field Values List with this Work Object’s
field values and changes the Work Object’s LockStatus to Locked by
<Machine ID>. The Field Values List now displays the fields of this
Work Object, only, but LockStatus now displays as locked for both
Work Objects.
12 In the Work Performer Class List control, scroll to and click Mainframe-
Activities.
The Work Objects you created, starting with Step 1 on page 71, are
still associated with the MainframeActivities Work Performer Class.
The names of these Work Objects now populate the Work Object List
by Work Performer Class control window; they and their lock status dis-
play there.
The additional code causes Visual WorkFlo to unlock all Work Objects
locked by this application and refresh the display before the adjustor
makes another selection. In this adjustor’s IN-basket sample, the appli-
cation identifies a locked Work Object by its OperationHandle, which is
one element in an array of OperationHandles in the SelectedLocked-
OperationIds property of the FileNET VW Work Object List by Work
Performer Class control.
The additional code causes Visual WorkFlo to unlock all Work Objects
locked by this application and refresh the display before the adjustor
makes another selection. In this adjustor’s IN-basket sample, the appli-
cation identifies a locked Work Object by its OperationHandle, which is
one element in an array of OperationHandles in the SelectedItems
property of the FileNET VW Work Performer Class List control.
4 In the upper-left list box (Objects list) select General and in the upper-
right list box, select Declarations.
Sub DisplayFailures( )
For i=(UBound(ErrorMessages)-ObjectsFailed+1) To UBound(ErrorMessages)
MsgBox(“This is the DisplayFailures procedure triggered by FailedObjects.” & _
Chr$(13) & Chr$(13) & ErrorMessages(i))
Next i
End Sub
When the method completes successfully for all Work Objects, the re-
turn value is zero. If the method fails, the return value is the number of
Work Objects on which it fails. Visual WorkFlo writes failures to the
CompletionStatusList property of the FileNET VW Work Obj List By
WP Class control. The code added in this step causes Visual WorkFlo
to display the entry in the CompletionStatusList for each failed Work
Object.
The adjustor will use our sample IN basket application for these admin-
istrative tasks:
• Select work
In addition to checking and reporting the status of work the adjustor ac-
cesses work and assigns it for processing, at which point it hands the
work off to a Work Performer application. AutoClaim sample code sup-
ports a queue for each of two Instructions: one for claim assignment,
the other for collateral review.
The adjustor will list Work Objects and their fields, as we have dis-
cussed in the above procedures, then pull a Work Object from the
Work Queue to assign it to a person or process.
This code is the first step in providing the adjustor access to an active
Work Performer with which to pull the Work Object. The code in this
step:
Set WPObject=CreateObject(“AdjAssign.Operations” )
The active Work Performer, in this case, will use OLE Automation (as
an OLE client) and invoke the passive Work Performer AdjustorAssign,
which is an OLE server.
Source code for the work assignment passive Work Performer that the
AutoClaim sample supports is in:
C:\Program Files\FileNet\Vw\Samples\AdjAssign.exe
4 Add the following code after the declarations to create a function that
removes quotes from string data before the application passes it to the
AdjAsssign.Operations object:
5 Before the End Function line of the above RemoveQuotes function add
the following code, which uses the function to evaluate and assign data
returned by the RetrieveItemValueByName method:
sClaimNumber=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-
ByName(“soprClaimNumber”))
sClaimAmount=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-
ByName(“soprClaimAmount”))
sClaimDate=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-
ByName(“soprClaimDate”))
sInsuredsName=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-
ByName(“soprInsuredsName”))
sIBusinessPhone=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-
ByName(“soprIBusinessPhone”))
sStatus=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValueByName(“sopr
Status”))
sInjury=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-ByName(“sopr
Injury”))
sEstimatorDocsComplete=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItem
ValueByName(“soprEstimatorDocsComplete”))
sPhysicianDocsComplete=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItem
ValueByName(“soprPhysicianDocsComplete”))
6 After the step 5 code, add the following to invoke, pass data to, and re-
ceive data from a passive Work Performer:
‘Invoke WP Operation.
Result =WPObject.ScheduleEstimatorAndMR(sClaimNumber, _
sClaimAmount, _
sClaimDate, _
sInsuredsName, _
sIBusinessPhone
sStatus, _
sInjury, _
sEstimatorDocsComplete, _
sPhysicianDocsComplete)
If Result=True Then
ErrorCode=FNVWRUNFieldValuesList1.UpdateItemValueByName(“soprEstimatorDocs
Complete”, Chr(39) & sEstimatorDocsComplete & Chr(39))
ErrorCode=FNVWRUNFieldValuesList1.UpdateItemValueByName(“soprPhysicianDocs
Complete”, Chr(39) & sPhysicianDocsComplete & Chr(39))
This checks to see that the Work Performer Operation was successful,
then updates the Work Performer’s parameters. It replaces single
quotes (Chr(39)) around the string before passing the string back to
the Work Performer Operation parameter.
‘Check to see that all unlocked and dispatched Work Objects completed the method.
ObjectsFailed=FNVWRUNWorkObjListByWPClass1.UnlockAndDispatch(False)
If ObjectsFailed<>0 Then
ErrorMessages=FNVWRUNWorkObjListByWPClass1.CompletionStatusList
Call DisplayFailures
End If
End If
FNVWRUNFieldValuesList1.Clear
cmdAssign.Enabled=False
End Sub
Code that enables the adjustor to review the claim is similar to that you
added to enable work assignment.
‘Dimension parameters.
Dim iPriority As String
Dim sClaimNumber As String
Dim fClaimAmount As Double
Dim sClaimDate As String
Dim sInsuredsName As String
Dim sIBusinessPhone As String
Dim sStatus As String
Dim sInjury As String
Dim sEstimatorDocsComplete As String
Dim sPhysicianDocsComplete As String
Dim I, J, K As Integer
iPriority=CLng(FNVWRUNFieldValuesList1.RetrieveItemValueByName(“ioprPriority”))
sClaimNumber=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-
ByName(“soprClaimNumber”))
sClaimAmount=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-
ByName(“soprClaimAmount”))
sClaimDate=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-
ByName(“soprClaimDate”))
sInsuredsName=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-
ByName(“soprInsuredsName”))
sIBusinessPhone=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-
ByName(“soprIBusinessPhone”))
sStatus=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValueByName(“sopr
Status”))
sInjury=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItemValue-ByName(“sopr
Injury”))
sEstimatorDocsComplete=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItem
ValueByName(“soprEstimatorDocsComplete”))
sPhysicianDocsComplete=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItem
ValueByName(“soprPhysicianDocsComplete”))
sEstimatorDocInfo=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItem
ValueByName(“soprEstimatorDocInfo”))
’For I=0 To 1
‘ VsEstimatorDocInfo(I)=TsEstimatorDocInfo
‘ MsgBox VsEstimatorDocInfo(I)
‘Next I
sEstimatorDocImages=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItem
ValueByName(“soprEstimatorDocImages”))
‘For J=0 To 2
‘ VsEstimatorDocImages(J)=sEstimatorDocImages(J)
‘ MsgBox VsEstimatorDocImages(J)
‘Next J
sPhysicianDocInfo=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItem
ValueByName(“soprPhysicianDocInfo”))
‘For K=0 To 1
‘ VsPhysicianDocInfo(K)=sPhysicianDocInfo(K)
‘ MsgBox VsPhysicianDocInfo(K)
‘Next K
sPhysicianDocImages=RemoveQuotes(FNVWRUNFieldValuesList1.RetrieveItem
ValueByName(“soprPhysicianDocImages”))
For L=0 To 1
‘ VsPhysicianDocImages(L)=sPhysicianDocImages(L)
‘ MsgBox VsPhysicianDocImages(L)
‘Next L
‘Invoke WP Operation
Result =WPObject.ScheduleEstimatorAndMR(sClaimNumber, _
sClaimAmount, _
sClaimDate, _
sInsuredsName, _
sIBusinessPhone
sStatus, _
sInjury, _
sEstimatorDocsComplete, _
sPhysicianDocsComplete, _
sEstimatorDocInfo, _
sEstimatorDocImages, _
sPhysicianDocInfo, _
sPhysicianDocImages)
If Result=True Then
ErrorCode=FNVWRUNFieldValuesList1.UpdateItemValueByName(“soprStatus”, Chr(39)
& sStatus & Chr(39))
ErrorCode=FNVWRUNFieldValuesList1.UpdateItemValueByName(“foprClaimAmount”,
fClaimAmount)
Check to see that all unlocked and dispatched Work Objects completed the method.
ObjectsFailed=FNVWRUNWorkObjListByWPClass1.UnlockAndDispatch(False)
If ObjectsFailed<>0 Then
ErrorMessages=FNVWRUNWorkObjListByWPClass1.CompletionStatusList
Call DisplayFailures
End If
End If
FNVWRUNFieldValuesList1.Clear
cmdReview.Enabled=False
End Sub
Source code for the work review passive Work Performer that the Auto-
Claim sample supports is in:
C:\Program Files\FileNet\Vw\Samples\AdjReview.exe
Follow the procedures below so that the Assign Claim and Review
Claim buttons will be active only when Work Objects are selected for
assignment or review.
1 In the code window for the FileNET VW Work Performer Class List
control add the following code at the end of the SelectionChanged pro-
cedure:
‘Set Assign and Review buttons to false when adjustor selects a new WP Class.
cmdAssign.Enabled=False
cmdReview.Enabled=False
2 In the code window for the FileNET VW Work Object List by Work Per-
former Class control add the following code at the end of the Selection-
Changed procedure:
The user selects a Work Class to see a list of Work Objects that are in
the Work Class and the contents of the Work Object fields. The appli-
cation also displays the name of the Work Performer Class, Instruction
Sheet, current Operation, and lock status associated with the selected
Work Object.
3 In the Controls tab, check the box to the left of the following FileNET Vi-
sual WorkFlo/RAD controls:
5 Drag and drop the controls onto the form, using the “Customer Service
Application” on page 113, as a guide to size and location of each con-
trol.
7 Enter error trapping code in each control, including failures during the
Form_Load event (Visual WorkFlo logon API failure).
The ClassName property must contain a valid Work Class name in or-
der for Visual WorkFlo to populate the Work Object List by Work Class.
When the user selects a Work Class, Visual WorkFlo writes the selec-
tion to the SelectedItems property of the Work Class List control. Each
element of the SelectedItems array (Variant data type) is the name of a
selected Work Class and element zero of the array is the first Work
Class selected.
that has been locked by other means, this application does not display
and it triggers a VWError event.
10 Enter the following code to set the FieldValuesList controls to not edit-
able:
FNVWRUNFieldValuesList1.IsEditable=False
FNVWRUNFieldValuesList2.IsEditable=False
FNVWRUNFieldValuesList3.IsEditable=False
‘Generate the Field Values list.
FNVWRUNFieldValuesList1.VWHandle=WobAccessHandle
FNVWRUNFieldValuesList1.Refresh
FNVWRUNFieldValuesList2.VWHandle=WobAccessHandle
FNVWRUNFieldValuesList2.FieldNames=FieldsToDisplay
FNVWRUNFieldValuesList2.Refresh
14 Add the followng code to display only one field in a third FieldVal-
uesList:
FieldsToDisplay(0)=”swcPhysicianDocsComplete”
FNVWRUNFieldValuesList3.VWHandle=WobAccessHandle
FNVWRUNFieldValuesList3.FieldNames=FieldsToDisplay
FNVWRUNFieldValuesList3.Refresh
15 Add the followng code to pass the WobAccessHandle of the Work Ob-
ject from the Work Object List by Work Class SelectedAccessHandles
property and to refresh the display.
16 Add the followng code to assign QueryHandle (the Work Class ID) to
the QueryHandle property of the FileNET VW Current Operation Sta-
tus control:
WOCurrOpStatus1.QueryHandle=FNVWRUNWorkObjListByWkClass1.QueryHandle
QueryCountIndices=FNVWRUNWorkObjListByWPClass1.SelectedQueryCountIndices
If UBound(QueryCountIndices) > =LBound(QueryCountIndices) Then
WOCurrOpStatus1.WorkObject=QueryCountIndices(0)
End If
WOCurrOpStatus1.Refresh
End Sub
18 In the Controls tab, check the box to the left of the following FileNET Vi-
sual WorkFlo/RAD controls:
Controls in step 3
Eight command buttons
One text box
Use the “Manager’s Application” on page 121 as a guide to size and lo-
cation of each item.
20 Enter error trapping code in each control, including failures during the
Form_Load event (Visual WorkFlo logon API failure).
21 Enter error trapping code for possible multiple Work Object failure.
See details in Step 5 on page 98. (Note this page’s number, so that
you may easily return to it.)
Manager’s Application
1 Enter code in the Click procedure of the Update Graph button, as fol-
lows:
This begins the code that populates the Queue Depth Graph and
clears previous entries. Using a Click, rather than a SelectionChanged,
event holds execution of the code until the manager has selected all
Work Performer Classes of interest.
WPClassNames=FNVWRUNWorkPerfClassList1.SelectedItems
The AddWPClass method of the Queue Depth control adds Work Per-
former Classes and watermark thresholds to a graph; the RemoveWP-
Class method removes these. The above code adds a selected Work
Performer Class name, refreshes the graph, adds the next selected
Work Performer Class name, refreshes the graph, etc. This method’s
parameters are WPClassName, LowWaterThreshold, and HighWater-
Threshold (WPClassName, -1, and 10, respectively, in the above
code).
Tip Click once in the Queue Depth control window, then press F1, to re-
view online help regarding the AddWPClass and RemoveWPClass
methods, thresholds, and alarms.
1 Add the following code to the Click procedure of the Apply to Work Ob-
ject List command button:
• Enables the Next Work Queue button, if there is more than one se-
lection
2 Add the following code to the same click procedure to disable the Next
Work Queue button when the manager selects another Work Per-
former Class:
Add the following code to the Click procedure of the Unlock Selected
Item command button:
The Unlock method in the above code acts only upon a selected Work
Object that the current instance of the application locked. The code un-
locks Work Objects while they are in the queue and the Unlock method
returns a value that is the number of Work Objects that failed to un-
lock.. If the value of the Unlock method’s ConfirmAction parameter is
true, the code displays a “Yes/No” dialog box that asks for confirmation
of an action to be taken in response to this.
Add the following code to the Click procedure of the Lock Selected Op-
eration command button:
The Lock method in the above code locks the Work Performer Opera-
tion associated with a selected Work Object. It returns a value that is
the number of Work Objects that failed to lock.. If the value of the Lock
method’s ConfirmAction parameter is true, the code displays a “Yes/
No” dialog box that asks for confirmation of an action to be taken in re-
sponse to this.
Add the following code to the Click procedure of the Dispatch Selected
Item command button:
The UnLock method returns a value that is the number of Work Ob-
jects that failed to unlock.. If the value of the UnLock method’s Confir-
mAction parameter is true, the code displays a “Yes/No” dialog box that
asks for confirmation of an action to be taken in response to this.
Add the following code to the Click procedure of the Terminate Se-
lected Item command button:
The Terminate method returns a value that is the number of Work Ob-
jects that failed to unlock.. If the value of the method’s ConfirmAction
parameter is true, the code displays a “Yes/No” dialog box that asks for
confirmation of an action to be taken in response to this.
Samples\Source Code\CustInquiry.vbp
A form, such as that on the following page, displays. (This figure dis-
plays data in the form’s fields for illustration.)
• Use the claimant’s name to query the system, to see whether there
is a claim in progress for the claimant (query a roster for a Work
Object by Work Class and Work Object ID)
• Query the log for records, based on the claimant’s name or on the
claim number, if the roster query results in no match (indicating that
the claim is no longer in the workflow)
In the Customer Inquiry form, the agent enters the claimant’s name in
the Name of Insured field. In Visual Basic, view the source code of the
CustInquiry.vbp project to see the subroutine, cmdQuery_Click( ),
which launches when the agent then clicks Query.
The following sample code enables the agent to complete the five
steps above.
Once Visual WorkFlo finds the Work Object, it retrieves the claim num-
ber from the Work Object’s claim number field.
2 Set the system to not lock the Work Object to the developer’s worksta-
tion, by setting LockForUpdate to false.
LockForUpdate = 0
3 Begin a query in the Work Class of the Work Object of interest, identi-
fying this Work Class in WorkClassName.
WobQueryHandle),
“VW_WobQueryCreate”)
4 Limit the query to finding a single Work Object, rather than listing all of
the Work Objects in a Work Class:
5 Match and count the Work Objects that meet the Work Class name
and Work Object ID criteria—now in WobQueryHandle:
QueryCountLimit = 0
Each Work Object matched and counted now has a batch index (a
QueryCountIndex). Select the Work Object of interest and use its Que-
ryCountIndex as input in step 6 code.
6 If there is no match:
Skip the remaining steps of the roster query and begin a log
query (because the Work Object is not in the workflow, but you may
find a record of it in the log if it has already been processed.) See
“Sample Log Query” on page 135.
If there is a match:
Access the Work Object by identifying it with its QueryCountIndex (as
generated in step 5) and locking it to the developer’s workstation by
setting LockForUpdate to true.
Next QueryIndex
Call check (VWServer.VW_WobQueryEnd(WobQueryHandle),
“VW_WobQueryEnd”)
If you had no match in step 5 of the roster query, you also had no Work
Object from which to retrieve a claim number. In this case, make a log
query that searches for the claimant’s name to determine whether
there is a record of the Work Object. (If processing of the Work Object
is already complete, there are log records on it.)
In the above line of code, WobTag represents either the name or the
claim number on which your application is to query the log.
3 Initialize variables:
QuerySpecifierIndexKey = “F_LogWobTag”
QuerySpecifierMinimumValues = Array(WobTag)
QuerySpecifierMinimumEqual = 1
QuerySpecifierMaximumValues = Array(WobTag)
QuerySpecifierMaximumEqual = 1
4 Create a query specifier, using the input parameters to limit the query
to records of interest:
errorCode = VWServer.VW_QsCreateQuerySpecifier
(LogonHandle,
QuerySpecifierHandle,
QuerySpecifierIndexKey,
QuerySpecifierMinimumValues,
QuerySpecifierMinimumEqual,
QuerySpecifierMaximumValues,
QuerySpecifierMaximumEqual,
QuerySpecifierFilter,
QuerySpecifierFilterSubstitutionVariables)
If (errorCode <> 0) Then
errorError = VWServer.VW_GetErrorMessage
(errorCode, errMsg)
MsgBox Str$ (errorCode) & “, “ & errMsg
End if
MaximumRecordsToRead = 100
Done = 0
one of the set data APIs--see “Set Data” on page 492 for choices]
one of the get data APIs--see “Get Data” on page 494 for choices]
See “Queue Query API Calling Sequence” on page 392 for the rela-
tionship of queue query APIs.
2 Declare variables:
3 Initialize variables:
QuerySpecifierIndexKey = F_WobNum
QuerySpecifierMinimumValues = Array(WobTag)
QuerySpecifierMinimumEqual = 1
QuerySpecifierMaximumValues = Array(WobTag)
4 Create a query specifier, using the input parameters to limit the query
to records of interest:
errorCode = VWServer.VW_QsCreateQuerySpecifier
(LogonHandle,
QuerySpecifierHandle,
QuerySpecifierIndexKey,
QuerySpecifierMinimumValues,
QuerySpecifierMinimumEqual,
QuerySpecifierMaximumValues,
QuerySpecifierMaximumEqual,
QuerySpecifierFilter,
QuerySpecifierFilterSubstitutionVariables)
If (errorCode <> 0) Then
errorError = VWServer.VW_GetErrorMessage
(errorCode, errMsg)
MsgBox Str$ (errorCode) & “, “ & errMsg
End if
6 Access an unlocked Work Object that meets the search criteria, now in
QueueQueryHandle.
8 Get and set data in the Work Object’s data fields (see “Get Data” on
page 494 and “Set Data” on page 492 to link to API details).
Work Performance
Design your Work Performer to carry out Operations that correspond to
Instructions on the Instruction Sheet of a Work Class. The Work Per-
former changes information in the Work Object data fields via the Op-
eration’s parameters. For example, have an Operation of your Work
Performer call an API, input data to the API through the Operation’s pa-
rameters and the API’s input parameters, and change the Work Object
data fields with the API’s output parameters.
Since you are following the guidelines in this chapter, you have chosen
to run the application on the PC workstation. So, you may make the
user’s participation in work sequence active or passive. (See “Push or
Pull (Passive or Active)” on page 34 for definition.)
Passive
Generally, the user launches Performer and Performer starts and stops
a passive Work Performer. Performer resides on the PC workstation,
so, passive Work Performers run, unattended, on the PC workstation.
Adaptor Use
Visual WorkFlo/Performer and the passive Work Performer communi-
cate through an adaptor. See “Passive Interface with Active Access”
on page 43 for details.
- Run regedit.
- In the Find What box, type the name of the executable (for exam
ple, mfwp.exe.).
- In the value data field of the Edit String box, type the correct path
and click OK.
The New Project window displays. If you were developing a new pas-
sive Work Performer, you would double-click on the ActiveX EXE icon
in the New tab to begin your work.
3 In the Look in: field of the Existing tab, open the AutoClaim Mainframe
Work Performer project, Mfwp.
This is in the directory where you installed Visual WorkFlo, in the path:
/Samples/Source Code/Mfwp/Mfwp.vbp
The window label is Project - mfwp, but to access it from the View
menu, you would select Project Explorer.
If you were developing a new Work Performer, you would add this
class module name yourself, by selecting Add Class Module from
Note that the developer will use this class module name in step 7 of
the Visual WorkFlo setup, below.
2 From the File menu, select Open and click Yes when the dialog box
asks you “...Continue?”
3 In the Look in: field of the Open Image or CDL File window, open Sam-
ples\AutoClaim.cdl, which is in the directory where you installed Visual
WorkFlo.
5 In the Work Performer Classes pane (upper left), scroll down and se-
lect MainframeActivities.
Microsoft calls this Executable Script name the progID. The progID
must be in the Windows registry so that Visual WorkFlo/Performer
can launch an instance of the passive Work Performer. Performer’s
launch of this Visual Basic OLE server causes automatic recording
of the progID in the Windows registry. If a progID does not record
to the registry, Performer returns the error, Co-creation.
An NT user sets the path to an OLE server executable file with the
System dialog in the Control Panel.
8 Minimize Composer and view the Visual Basic window you opened in
step 3.
A B
C D
D
B
In the MFWP project, the value in the Name: field and the public
function name are RetrieveClaimInformation (see the items
marked “A”).
• Insert your code where the sample says “VB code here.”
RetrieveClaimInformation = True
Application Test
Before you run your new application, test it according to the following
procedures.
2 Load the Work Performer source code (the .vbp file for a Visual Basic
project).
7 In the Work Performer Name: field, type the name of the Work Per-
former (MFWP for the example) and click Add.
Performer tries to launch the Work Performer Executable Script, but in-
stead uses the Work Performer you launched in the development envi-
ronment in step 4, above.
Performer locks a Work Object and passes its parameters to the pas-
sive Work Performer Operation. The break points you set allow you to
step through and examine the Work Performer.
• Write a 32-bit passive Work Performer that uses the DLL adaptor.
1 Before developing the DLL, the user or developer calls it with the pro-
gram, Visual WorkFlo/Composer, as follows:
• Enter the DLL adaptor name in the Properties editor of the Work
Performer Class browser as VWDLLADP.DLL.
• Check that the script name (entered in the same editor) is the
name of the DLL that contains the Operations the Work Performer
will execute.
• Check that each Operation name exactly matches the name of the
entry point of the DLL the Work Performer will call.
• Call functions so that they return no value (they have “void” re-
sults).
• Export all callable functions and check that they have proper Win-
dows pre- and post-ambles.
Visual WorkFlo C
integer long
float double
boolean BOOL (int or long)
string char far *, points to null terminated string
time FN_time_typ (long)
C Visual WorkFlo
long far * integer
double far * float
BOOL far * (int or long far *) boolean
char **HGLOBAL far * string
FN_time_typ far * (long far *) time
Procedures
Procedures for developing with this conversion follow:
1 Write the passive Work Performer so that it stores the result values via
the passed-in pointers.
2 Allocate string data and return a pointer to the memory where the
string data is stored.
Active
The user or developer, rather than Performer, starts and stops an ac-
tive Work Performer. For information about the active Work Performer
as a design choice, see “Active” on page 36.
An active Work Performer can be an OLE client and use the services
of an OLE server. See “Creative, Administrative, and Active Work Per-
former Interface with the API OLE Server” on page 40 and “Passive In-
terface with Active Access” on page 43 for details.
The New Project window displays. If you were developing a new active
Work Performer, you would double-click on the Standard EXE icon in
the New tab to begin your work.
2 Since we are using an example that installed with Visual WorkFlo, click
on the Existing tab (to review development details of a project in the
AutoClaim sample).
3 In the Look in: field of the Existing tab, open the AutoClaim Estimator
Assigns Work Performer project, EstAssigns.
This is in the directory where you installed Visual WorkFlo, in the path:
/Samples/Source Code/EstAssigns/EstAssigns.vbp
The developer selected the Standard EXE icon in the New tab to de-
velop this sample; so, that is the value that appears in the Project Type:
field, above. The developer’s selection of Standard EXE set up the ac-
tive Work Performer so that can be an OLE client when it compiles.
The window label is Project - EstAssigns (to access it from the View
menu, you would select Project Explorer).
2 From the File menu, select Open and click Yes when the dialog box
asks you “...Continue?”
3 In the Look in: field of the Open Image or CDL File window, open Sam-
ples\AutoClaim.cdl, which is in the directory where you installed Visual
WorkFlo.
5 From the Work Performer Classes pane in the upper left, select Esti-
mator Assignments.
6 From the Operations pane in the upper right, select the EstimatorPick
Operation. The following screen displays.
4 The following code illustrates how the Visual Basic active Work Per-
former accesses the Operation parameters defined in Composer:
5 Compare the screens of steps 3 and 4, above, with that of the Com-
poser Operation Definition tab in Visual WorkFlo Setup step 6.
• If we call an API to set data, the data direction mode must be out or
inout.
• If we call an API to get and set data, the data direction mode must
be inout.
Application Test
Before you run your new Work Performer, test it according to the fol-
lowing procedures. Also, see “Debugging the Application” on page 177
for reference.
1 Check whether there are any Work Objects in the queue that the Work
Performer can read (a filter may prevent the reading of some, for exam-
ple).
Value
Returned Status
TRUE Visual WorkFlo copies the inout and out parameter values
into the Work Object and dispatches the Work Object to
the next Instruction.
FALSE Visual WorkFlo does not copy the inout and out parameter
values into the Work Object and it calls the Malfunction In-
struction Sheet to process the Work Object.
RetrieveClaimInformation = True
See the following example of this in the next-to-last line of code above
Step 3 on page 158.
Exceptions thrown
Errors returned
Calls to APIs
To enable SVCAPI trace logging, set the LogToFile entry in the client
workstation’s VW.INI file or in the server’s vwclient.ini file to 1.
Contrast this type of logging with event logging, described in the details
of “VW_LogMessage” on page 370.
Running NDump
When you run ndump.exe from the Samples directory, it displays the
following window:
The window caption displays the name of the Work Performer and the
path and name of the output file.
The File menu has two options, Log file or Exit, as shown in the follow-
ing screen:
Select Log file to specify the filename and location of the dump output.
Either no lines or one line per Work Object data field prints after the
first line, above. This sample shows a line of output for each Visual
WorkFlo data type.
Performance Optimization
Optimize performance by incorporating the following practices into de-
velopment of your Visual WorkFlo application:
Reuse
An advantage of the Work Performer application is that you may design
it for reuse. Rather than run it once with exact Work Object data field
names (as you would an administrative application), you can design it
with Operations that have parameters, to which Visual WorkFlo can
map Work Object data fields repeatedly.
FileNET recommends that you keep a list, such as the following, handy
during development to track this information for each parameter:
WP_autoclaim: SampleWP_1
Operation Granularity
Granularity is the amount of work accomplished by a Work Performer
Operation. A small-grained Operation is one that does little, such as
displaying a print dialog box for user input. A large-grained Operation
performs logically related business steps, such as providing forms into
which a loan officer enters customer and loan data, then calculating a
payment schedule based on that data.
Validation Checking
Design a Visual WorkFlo application to validate data fields, Operation
parameters, and Work Queue fields before it uses them. Have it verify
that numeric values are within the acceptable range and that a string is
null only when expected.
Sequenced Mode
See “VW_SequencedWait” on page 428 for a discussion of sequenced
mode. Note that although a passive Work Performer does not call the
Go to Select one of the following, if you wish to begin directly with procedures
Procedures for developing a Visual WorkFlo application that runs on the server:
You are developing an application that will either use the C-language
DLL , SVCAPI.DLL, or interface directly with the API OLE server,
VWAPISRV.EXE. This Work Performer application is active, in that you
predetermine in its code the sequence in which Visual WorkFlo will
process Work Objects, before you run it on the Visual WorkFlo server.
(Compare this to an active Work Performer you run on the PC worksta-
tion, where you determine the sequence, but can interrupt the Work
Performer to change the sequence.)
On the server, WAL uses the client area of memory, which is sepa-
rate from the memory used by the server software. A firewall pro-
tects server software in the event of a server-side application
anomaly. A server-side application (which resides in the client
area, on the same side of the firewall as WAL) uses BIN, IN-
CLUDES, and SHOBJ directories that are parallel to those used by
the server software on the opposite side of the firewall. (A client-
side application, that is an application that resides on the PC work-
station, uses the WAL on the PC client.)
See the Visual Work Flo Installation and Administration Handbook and
the Visual WorkFlo Glossary for information about the following Visual
WorkFlo initialization files:
Compilation
Compile a server-side active Work Performer with the following:
Includes in /fnsw/client/include
Libraries in /fnsw/client/shobj
VWSample
Unattended
vwsample.c
vwmksample
vwsample.cdl
These are on the client PC, where you installed Visual WorkFlo, in this
directory:
Samples\AIX_Sample\
vwsample.c
vwmksample
chmod +x filename
For filename, substitute the name of your script file. (In the case of this
sample, it is vwmksample.)
The application uses this script as the basis for compilation. Your com-
piler may require a script that is slightly different from the sample, but
the script must:
The first line of sample code, above, creates the object file. The sec-
ond line links the object file to other object files in the application and
creates an executable (vwsample*, in this case).
This sets up include files and indication of whether the code runs suc-
cessfully:
#include <stdio.h>
#include <string.h>
#include <svcapi.h>
#define success 0
void print_usage(void)
{
printf ("\
Usage: vwsample {-c <wcname> | -q <wpcname> [-a] }\n\
-m <wpcname> | -g <wpcname>\n\
where '-c <wcname>' creates a work object of work class '<wcname>'.\n\
\n\
'-q <wpcname>' reads a work object from the queue of work\n\
performer class '<wpcname>' and dispatches it to the next\n\
queue according to the instruction sheet.\n\
'-a' indicates repeat for all work objects in queue.\n\
\n\
'-m <wpcname>' indicates to perform some miscellaneous API calls.\n\
\n\
'-g <wpcname>' perform get and sets on a work object from the queue\n\
of work performer class '<wpcname>'\n\
");
}
if (error)
{
printf("Got an error during %s.\n", procName);
VW_GetErrorMessage(error, message);
printf("The error is: %s \n", message);
return -1;
}
else
printf("%s was successful.\n", procName);
return 0;
}
error = VW_DispatchWorkObject(newWobId);
if ( print_return("VW_DispatchWorkObject", error) < 0)
return -1;
return 0;
}
See “Locator” on page 242 for a link to details regarding API calls,
such as those in the above code to VW_CreateWorkObject( ) and VW_
DispatchWorkObject( ).
{
VW_QueueHandle workQueueId;
VW_ActiveWPHandle workPerformerId;
VW_BrowseHandle browseId;
VW_BrModHandle browseModHandle=0;
VW_QueueElementHandle queueElementId
VW_OperationHandle operationId;
VW_OperationNameType operationName;
unsigned long workObjectCount;
VW_Error error=success;
if (workObjectCount < 1)
{
if (doAll)
return -1;
}
while (workObjectCount) {
workObjectCount--;
error = VW_NextWorkObjectToBrowse(browseId, &queueElementId);
if ( print_return("VW_NextWorkObjectToBrowse", error) < 0)
return -1;
error = VW_UnlockAndDispatch(operationId);
if ( print_return("VW_UnlockAndDispatch", error) < 0)
return -1;
if (!doAll)
break;
}
error = VW_EndBrowsingWorkQueue(browseId);
if ( print_return("VW_EndBrowsingWorkQueue", error) < 0)
return -1;
error = VW_LeaveWork(workPerformerId);
if ( print_return("VW_LeaveWork", error) < 0)
return -1;
error = VW_DetachFromWorkQueue(workQueueId);
if ( print_return("VW_DetachFromWorkQueue", error) < 0) return -1;
return 0;
}
{
VW_QueueHandle workQueueId;
VW_ActiveWPHandle workPerformerId;
VW_BrowseHandle browseId;
VW_BrModHandle browseModHandle=0;
VW_QueueElementHandle queueElementId
VW_OperationHandle operationId;
VW_OperationNameType operationName;
VW_Handle workerHandle
VW_WobAccessHandle wobAccessHandle
VW_Integer theInteger
VW_Boolean theBoolean
VW_String theString
unsigned long workObjectCount;
unsigned int theSize
VW_Error error=success;
if (workObjectCount < 1)
{
if (doAll)
return -1;
}
while (workObjectCount) {
workObjectCount--;
error = VW_NextWorkObjectToBrowse(browseId, &queueElementId);
if ( print_return("VW_NextWorkObjectToBrowse", error) < 0)
return -1;
theString = (char*)malloc(theSize+1);
error = VW_GetString(wobAccessHandle, "xstring", theString);
if ( print_return("VW_GetString", error) < 0)
{
return -1;
}
else
{
printf("The string is %s.", theString);
printf("\n");
}
free(theString);
if (!doAll)
break;
}
error = VW_EndBrowsingWorkQueue(browseId);
if ( print_return("VW_EndBrowsingWorkQueue", error) < 0)
return -1;
error = VW_LeaveWork(workPerformerId);
if ( print_return("VW_LeaveWork", error) < 0)
return -1;
error = VW_DetachFromWorkQueue(workQueueId);
if ( print_return("VW_DetachFromWorkQueue", error) < 0)
return -1;
return 0;
}
{
VW_MachineIdNameType machineId;
VW_IsolatedRegionType isolatedRegion;
long workQueueDepth;
VW_Error error=success;
return 0;
The final segment of the vwsample.c code is the main routine, which
logs on and off of Visual WorkFlo and uses the above procedures:
if (argv[1][0] != ‘-’)
{
print_usage()
return -1;
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] != '-')
{
print_usage();
return -1;
}
switch (argv[i][1])
{
case 'q':
case 'c':
case 'm':
case 'g':
if (i + i >= argc)
{
print_usage();
return -1;
}
className = argv[i+1];
i++;
break;
case 'a':
doAll = TRUE;
break;
default:
print_usage();
break;
}
}
if ( className == NULL )
{
print_usage();
return -1;
}
{
print_usage();
return -1;
}
if ( dqWob(logonID, className, doAll) < 0)
{
VW_Logoff(logonID);
return -1;
}
}
else if (argv[1][1] == 'm')
{
if (className == NULL)
{
print_usage();
return -1;
}
if (Misc(logonID, className) < 0)
return -1;
}
else if (argv[1][1] == 'g')
{
if (className == NULL)
{
print_usage();
return -1;
}
>vwsample -c SimpleWP
VW_LogonEx was successful.
VW_CreateWorkObject was successful.
VW_DispatchWorkObject was successful.
VW_Logoff was successful.
Program completed successfully.
>vwsample -q WPSample
VW_LogonEx was successful.
VW_AttachToWorkQueue was successful.
VW_ReportToWork was successful.
VW_BeginBrowsingWorkQueue was successful.
VW_NextWorkObjectToBrowse was successful.
VW_LockWorkObject was successful.
VW_GetOperationName was successful.
The operation name is: InputString
VW_UnlockAndDispatch was successful.
VW_EndBrowsingWorkQueue was successful.
VW_LeaveWork was successful.
VW_DetachFromWorkQueue was successful.
VW_Logoff was successful.
Program completed successfully.
>vwsample -m WPSample
VW_LogonEx was successful.
VW_GetMachineId was successful.
The machine id is: 6
VW_GetIsolatedRegion was successful.
The isolated region is: 89
VW_GetWorkQueueDepth was successful.
The work queue depth is: 1
>vwsample -g WPSample
VW_LogonEx was successful.
VW_AttachToWorkQueue was successful.
VW_ReportToWork was successful.
VW_BeginBrowsingWorkQueue was successful.
VW_NextWorkObjectToBrowse was successful.
VW_LockWorkObject was successful.
VW_GetOperationName was successful.
The operation name is: InputString
VW_GetAccessHandle was successful.
VW_GetIntegerwas successful.
The integer is 23.
VW_GetBoolean was successful.
The boolean is 1.
VW_GetStringSize was successful.
The string size is 6.
VW_GetString was successful.
The string is apples.
VW_SetInteger was successful.
VW_SetString was successful.
VW_SetBoolean was successful.
VW_FreeAccessHandle was successful.
VW_EndBrowsingWorkQueue was successful.
VW_LeaveWork was successful.
VW_DetachFromWorkQueue was successful.
VW_Logoff was successful.
Program completed successfully.
unattended.c
AIX_Build
unattended
These are on the client PC, where you installed Visual WorkFlo, in this
directory:
Samples\AIX_Unattended
2 Transfer the step 1 files from the CD into a directory on the server, us-
ing ftp, for example.
This is on the client PC, where you installed Visual WorkFlo, in this di-
rectory:
Samples\AutoClaim\
chmod +x filename
For filename, substitute the (case-sensitive) name of your script file. (In
the case of this sample, it is AIX_Build.)
5 Write a script file with code similar to that in AIX_Build, as shown be-
low:
The application uses this script as the basis for compilation. Your com-
piler may require a script that is slightly different from the sample, but
the script must:
The first line of sample code, above, creates the object file. The sec-
ond line links the object file to other object files in the application and
creates an executable (unattended*, in this case).
#include <stdio.h>
#include <string.h>
#include <signal.h>
#ifdef _WIN32
#include <stdlib.h>
#define sleep _sleep
#define SECONDS 1000
#else
#define SECONDS 1
#include <unistd.h>
#endif
#include <svcapi.h>
#include <vwerrors.h>
/* Default Constants */
#define IDLE_POLLING_INTERVAL "10"
#define USERID "SysAdmin"
#define PASSWD "SysAdmin"
#define SERVICE "VWService0"
#define DOMAIN "IDMIS_SERVER"
#define ORGANIZATION "FileNet"
#define REGION "1"
void interrupt_handler();
int print_return();
int operation_createvoucher();
int operation_correspondence();
int processobject();
void browseloop();
int init();
void quit();
void usage();
extern void exit();
int aborted = 0;
int verbose = 0;
int loud = 1;
int idleTime = 0;
if (error)
{
printf("Got an error during %s.\n", procName);
VW_GetErrorMessage(error, message);
printf("The error is: %s \n", message);
return -1;
}
else
if ( verbose )
printf(" %s was successful.\n", procName);
return 0;
}
int operation_createvoucher()
{
char insuredsName[40];
VW_Float claimAmount;
printf("\n\n-------------------------------------------------------------\n");
printf(" PAY THE CLAIM\n\n");
printf(" Pay to the order of: %s\n\n", insuredsName);
printf(" Amount: $%6.2f\n\n\n", claimAmount);
printf("-------------------------------------------------------------\n\n");
}
int operation_correspondence()
{
char insuredsName[40];
char claimNumber[40];
char status[40];
printf("\n\n-------------------------------------------------------------\n");
printf(" CORRESPONDENCE\n\n");
printf(" To: %s\n\n", insuredsName);
printf(" Regarding\n");
printf(" Claim: %s\n\n", claimNumber);
printf(" Disposition\n");
printf(" of Claim: %s\n\n", status);
printf(" Should you have any questions about\n");
printf(" the disposition of this claim please\n");
printf(" contact our claims office at 800/555-3333.\n\n");
printf("-------------------------------------------------------------\n\n");
int processobject()
{
char operationName[20];
int operation = 0;
int failed_operation = 0;
if ( strcmp(operationName, "CreateVoucher") == 0 )
operation = 1;
if ( strcmp(operationName, "Correspondence") == 0 )
operation = 2;
switch (operation)
{
case 1:
if ( operation_createvoucher() < 0)
failed_operation = 1;
break;
case 2:
if ( operation_correspondence() < 0)
failed_operation = 1;
break;
default:
if (loud)
printf("Undefined Operation\n");
failed_operation = 1;
}
if ( failed_operation )
{
error = VW_UnlockWorkObject(operationId);
operationId = 0;
if ( print_return("VW_UnlockWorkObject", error) < 0)
return -1;
}
else
{
error = VW_UnlockAndDispatch(operationId);
operationId = 0;
if ( print_return("VW_UnlockAndDispatch", error) < 0)
return -1;
}
return 0;
}
void browseloop()
{
unsigned long workObjectCount = 0;
int nowork = 0;
if (loud)
printf("Processing Started\n");
while ( 1 )
{
if (aborted)
quit();
if ( browseId )
{ error = VW_EndBrowsingWorkQueue(browseId);
print_return("VW_EndBrowsingWorkQueue", error);
browseId = 0;
}
if ( nowork )
{
if (loud)
printf(" Idle for %d seconds\n", idleTime);
sleep(idleTime * SECONDS);
}
}
August 1998 Panagon Visual WorkFlo Application Developer’s Guide 222
Server-side Application
Compilation
}
int init(char* UserID, char* Password, char* VWService, VW_IsolatedRegionType Region)
{
if (loud)
{
printf("\nWorkPerformer Initializing\n");
printf(" UserID=%s\n", UserID);
printf(" VWService=%s\n", VWService);
printf(" Region=%d\n\n", Region);
}
error = VW_LogonEx(UserID, Password, VWService, Region, &logonHandle);
if ( print_return("VW_LogonEx", error) < 0)
{
logonHandle = 0;
return -1;
}
return 0;
}
void quit ()
{
if ( operationId )
{
error = VW_UnlockWorkObject(operationId);
print_return("VW_UnlockWorkObject", error);
operationId = 0;
}
if ( browseId )
{ error = VW_EndBrowsingWorkQueue(browseId);
print_return("VW_EndBrowsingWorkQueue", error);
browseId = 0;
}
if ( workPerformerHandle )
{ error = VW_LeaveWork(workPerformerHandle);
print_return("VW_LeaveWork", error);
workPerformerHandle = 0;
}
if ( queueHandle )
{ error = VW_DetachFromWorkQueue(queueHandle);
print_return("VW_DetachFromWorkQueue", error);
queueHandle = 0;
}
if ( logonHandle )
{ error = VW_Logoff(logonHandle);
print_return("VW_Logoff", error);
logonHandle = 0;
}
exit (1);
}
void help()
{
printf("\nThis program processes the Unattended WorkPerfomer Class\n");
printf("of the Visual WorkFlo AutoClaim demo.\n\n");
printf("It performs two operations:\n");
printf(" Correspondence: Prints a letter to the stdout\n");
printf(" CreateVoucher: Prints a voucher to stdout\n\n");
printf("The program will poll the queue every [i] seconds looking for work.\n");
printf("When work is found in the queue all Work Object will be processed\n");
printf("until the queue is empty.\n\n");
usage();
}
void usage()
{
printf("\nusage: unattended -u [userid] -p [password] -s [VWService]\n");
printf(" -d [domain] -o [organization] -r [region]\n");
printf(" -i [idle polling interval]\n");
printf(" -v verbose mode -q quiet mode -h help\n\n\n");
/* Set Defaults */
{
if (aborted)
quit();
fc = argv[i][0];
if (fc == ’-’) /* leading minus is optional */
{
fc = argv[i][1];
if ( fc == NULL )
usage();
}
switch (fc)
{
case ’u’:
if ( (i + 1) == argc )
usage();
strcpy(userid,argv[++i]);
break;
case ’p’:
if ( (i + 1) == argc )
usage();
strcpy(passwd,argv[++i]);
break;
case ’s’:
if ( (i + 1) == argc )
usage();
strcpy(service,argv[++i]);
break;
case ’d’:
if ( (i + 1) == argc )
usage();
strcpy(domain,argv[++i]);
break;
case ’o’:
if ( (i + 1) == argc )
usage();
strcpy(organization,argv[++i]);
break;
case ’r’:
if ( (i + 1) == argc )
usage();
strcpy(region,argv[++i]);
break;
case ’i’:
if ( (i + 1) == argc )
usage();
strcpy(polling,argv[++i]);
break;
case ’v’:
verbose = 1;
break;
case ’q’:
loud = 0;
break;
case ’h’:
help();
break;
default:
usage();
break;
}
}
iregion = atoi(region);
idleTime = atoi(polling);
strcat(vwservice, service);
strcat(vwservice, ":");
strcat(vwservice,domain);
strcat(vwservice,":");
strcat(vwservice,organization);
browseloop();
Compiler/Runtime Compatibility
Running Work Performers on the HP requires patches for the HP aC++
compiler. Minimum compiler and runtime versions are as follows:
VWSample
Unattended
vwsample.cpp
makefile
vwsample.cdl
These are on the client PC, where you installed Visual WorkFlo, in this
directory:
Samples\HPUX_Sample\
vwsample.cpp
makefile
3 For the HP aC++ compiler, use makefile, which you transfered in step
2, as the basis for compilation. The contents of makefile follow:
CC = /opt/aCC/bin/aCC
LD = /opt/aCC/lbin/ld
CLNTSHOBJ = /fnsw/client/shobj
TARGET = vwsample
OBJECTS_LIST = vwsample.o
all : $(TARGET)
$(TARGET) : $(OBJECTS_LIST)
$(CLNTPGMLINK) -o $(TARGET) $(OBJECTS_LIST)
.cpp.o:
$(CC) $(CFLAGS) -D_ANSI_C_SOURCE -z -g -DVW_SERVER -I/fnsw/
client/include -c $<
VW_LAST_LIB = -lvwcppv
VW_CLIENT_LIBS = -lvwalloc \
-lvwfnbase \
-lvwperobj \
-lvwdbi \
-lvwexpr \
-lvwsystem \
-lvwruncom \
-lvwrunsvc \
-lvwapi \
-lvwmemry
FN_CLIENT_LIBS = \
-lASH -lBES -lBESr -lCDCD -lCKS -lCOR -lCSM -lCSMr -lDTI \
-lFFI -lFP -lGLO -lINX -lINXD -lINXr -lNCH -lNCHr \
-lNLT -lODF -lPRI -lPRIr -lPRS -lPSI -lQMA -lSC -lSEC -lSECr -lSMM \
-lSQI -lSSU -lSysV -lTPI -lWQS -lI64
clean:
rm -rf $(OBJECTS_LIST) $(TARGET)
TARGET = vwsample
List your source files to the right of the equal sign, in the line of the
makefile that reads:
OBJECTS_LIST = vwsample.o
This script uses HP ANSI C++ compiler (aCC), rather than the CC
(cfront) compiler.
#include <stdio.h>
#include <string.h>
#include <svcapi.h>
#include <stdlib.h>
#define TRUE 1
#define FALSE 0
#define success 0
void print_usage(void)
unattended.cpp
makefile
unattended
These are on the client PC, where you installed Visual WorkFlo, in this
directory:
Samples\HPUX_Unattended
2 Transfer the step 1 files from the CD into a directory on the server, us-
ing ftp, for example.
This is on the client PC, where you installed Visual WorkFlo, in this di-
rectory:
Samples\AutoClaim\
4 For the HP aC++ compiler, use makefile, which you transfered in step
2, as the basis for compilation. The contents of makefile follow:
CC = /opt/aCC/bin/aCC
LD = /opt/aCC/lbin/ld
CLNTSHOBJ = /fnsw/client/shobj
TARGET = unattended
OBJECTS_LIST = unattended.o
all : $(TARGET)
$(TARGET) : $(OBJECTS_LIST)
$(CLNTPGMLINK) -o $(TARGET) $(OBJECTS_LIST)
.cpp.o:
$(CC) $(CFLAGS) -D_ANSI_C_SOURCE -z -g -DVW_SERVER -I/fnsw/
client/include -c $<
VW_LAST_LIB = -lvwcppv
VW_CLIENT_LIBS = -lvwalloc \
-lvwfnbase \
-lvwperobj \
-lvwdbi \
-lvwexpr \
-lvwsystem \
-lvwruncom \
-lvwrunsvc \
-lvwapi \
-lvwmemry
FN_CLIENT_LIBS = \
-lASH -lBES -lBESr -lCDCD -lCKS -lCOR -lCSM -lCSMr -lDTI \
-lFFI -lFP -lGLO -lINX -lINXD -lINXr -lNCH -lNCHr \
-lNLT -lODF -lPRI -lPRIr -lPRS -lPSI -lQMA -lSC -lSEC -lSECr -lSMM \
-lSQI -lSSU -lSysV -lTPI -lWQS -lI64
clean:
rm -rf $(OBJECTS_LIST) $(TARGET)
TARGET = unattended
List your source files to the right of the equal sign, in the line of the
makefile that reads:
OBJECTS_LIST = unattended.o
This script uses HP ANSI C++ compiler (aCC), rather than the CC
(cfront) compiler.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <signal.h>
#ifdef _WIN32
#include <stdlib.h>
#define sleep _sleep
#define SECONDS 1000
#else
#define SECONDS 1
#include <unistd.h>
#endif
#include <svcapi.h>
#include <vwerrors.h>
Locator
Click on an API name in the locator table, below, to view the details of
the API.
Return to If you link to an API detail, then wish to return to this locator, scroll to
this Locator the end of the API detail and click on “Locator” .
Calling Sequence
The order in which an application calls APIs depends on its category,
as follows. The chart, “API Calling Sequence” on page 484 shows the
sequence.
Functional Groups
The developer typically uses APIs in groups that are associated by
task.
API Pairs
Always call the following APIs as a pair. The first of the pair allocates
Visual Workflo resources for the task and the second frees these re-
sources when the task is complete:
VW_LogonEx( )
VW_Logoff( )
VW_Logon( )
VW_Logoff( )
VW_CreateWorkObject( )
VW_DispatchWorkObject( )
VW_WobQueryCreate( )
VW_WobQueryEnd( )
VW_QsCreateQuerySpecifier( )
VW_QsFreeQuerySpecifier( )
VW_QQueryBegin( )
VW_QQueryEnd( )
VW_LogQueryBegin( )
VW_LogQueryEnd( )
VW_WobQueryGetAccessHandle( )
VW_WobQueryFreeAccessHandle( )
VW_AttachToWorkQueue( )
VW_DetachFromWorkQueue( )
VW_ReportToWork( )
VW_LeaveWork( )
VW_BrmCreateBrowseModifier( )
VW_BrmFreeBrowseModifier( )
VW_BeginBrowsingWorkQueue( )
VW_EndBrowsingWorkQueue( )
VW_GetAccessHandle( )
VW_FreeAccessHandle( )
VW_LockWorkObject( )
VW_UnlockWorkObject( )
VW_LogonEx
VW_Logon
VW_Logoff
VW_CreateWorkObject
VW_DispatchWorkObject
Logging
Use these logging APIs to develop and debug applications:
VW_LogMessage
VW_LogQueryBegin
VW_LogQueryNextRecords
VW_LogQueryEnd
Consider processing time and space when calling these APIs with an
application that runs daily.
Statistics
Call the following for statistics:
Sequenced Mode
Call these APIs to use sequenced mode processing, minimizing trans-
action between the PC workstation and server:
VW_SequencedWait
VW_Call
VW_SequencedWobFetch
Queue Handling
Use the following APIs to:
VW_FreeAccessHandle
VW_GetAccessHandle
VW_WobQueryGetAccessHandle
VW_BindToUser
VW_GetBindings
VW_UnBind
VW_WobQueryCreate
VW_WobQueryExecute
VW_WobQuery
WorkPerformerClass
VW_WobQueryOperation
VW_WobQueryInstrSheet
VW_WobQueryEnd
VW_GetOperationName
VW_GetOperationNameSize
VW_GetWorkPerformerHandle
VW_GetWobSignature
Data Access
Use the following to get or set the values in:
• An Operation parameter
VW_FreeArrayPtr
VW_GetArrayPtr
VW_GetArraySize
VW_GetBoolean
VW_GetDataType
VW_GetDataTypeArray
VW_GetFloat
VW_GetInteger
VW_GetString
VW_GetStringSize
VW_GetTime
VW_SetArrayPtr
VW_SetBoolean
VW_SetFloat
VW_SetInteger
VW_SetString
VW_SetTime
Error Handling
Call the following to handle exceptions while an application runs:
VW_CheckVersionCompatibility
VW_CurrentException
VW_GetErrorMessageSize
VW_GetErrorMessage
VW_RaiseException
VW_TerminateWorkObject
• Examples
• Link to the API Locator, an alphabetized list of the APIs, which in-
cludes an overview of each API and a link to its details
The APIs
The details of each Visual WorkFlo API follow.
Summary of the This API returns the amount of money you have in your savings account.
result of making
the call
This API returns in NumberOfDollars the amount of money in an account, given the
Result of Call account holder’s name, which you supply in the string, DeveloperName.
Tip Use the output of this API as input to the VW_RetireEarly( ) API, to determine whether
you may give notice at the office.
C typedef is the
parameter data
type in an
typedef VW_Error(VWAPIENTRY* VW_SampleDetailProcType)
application that
uses the OLE (VW_LogonHandle,
wrapper DLL or VW_AccountNameType,
the DLL adaptor VW_Float FAR *);
VW_AttachToWorkQueue
ErrorCode = VW_AttachToWorkQueue (LogonHandle, QueueName,
QueueHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
LogonHandle long VW_LogonEx( )
or
VW_Logon
• System Queue
Result of Call Upon calling this API, a Visual WorkFlo application becomes a active
Work Performer. This API returns QueueHandle, which identifies the
Work Queue of the Work Performer Class to which an active Work
Performer belongs or the System Queue you name in the
string, QueueName .
Tips Call this (once for each queue you wish to browse) when you start an
active Work Performer.
Example
See Also:
“VW_BrmCreateBrowseModifier” on page 274
VW_BeginBrowsingWorkQueue
ErrorCode = VW_BeginBrowsingWorkQueue (WorkPerformerHandle,
MaxWorkObjectCount, BrowseModifierHandle, BrowseSessionHan-
dle, WorkObjectCount)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
WorkPerformerHandle long VW_ReportToWork( )
WorkObjectCount long
Summary This API establishes a browse session in a specific Work Queue and
reports the number of Work Objects available in that queue for
browsing.
Result of Call Browsing follows default or modified Work Queue rules. This API re-
turns the following:
• BrowseSessionHandle
• WorkObjectCount:
Where:
Tips A call to this API takes a snapshot of the queue; subsequent change in
the queue is not reflected in results from associated VW_
BeginBrowsingWorkQueue( ) calls.
Example
ErrorCode = VWServer.VW_Logon(LogonHandle)
If ErrorCode <> 0 Then
Error handling code
End If
ErrorCode = VWServer.VW_AttachToWorkQueue ( _
LogonHandle, _
"WPClass", _
WorkQueueHandle)
If ErrorCode <> 0 Then
Error handling code
End If
ErrorCode = VWServer.VW_ReportToWork ( _
WorkQueueHandle, _
WorkPerformerHandle)
MaxWorkObjectCount = 1
ErrorCode = VWServer.VW_BeginBrowsingWorkQueue( _
WorkPerformerHandle, _
BrowseSessionHandle, _
MaxWorkObjectCount, _
WorkObjectCount, _
BrowseModifierHandle)
If WorkObjectCount = 0 Then
MsgBox "There are no available Work Objects in
the queue."
End
End If
If ErrorCode <> 0 Then
Error handling code
End If
ErrorCode = VWServer.VW_NextWorkObjectToBrowse( _
BrowseSessionHandle, _
QueueElementHandle)
If ErrorCode <> 0 Then
Error handling code
End If
See Also:
“VW_BrmCreateBrowseModifier” on page 274
VW_BindToUser
ErrorCode = VW_BindToUser (Handle, UserName)
Visual Basic
Object Browser
Input Data Type Source
Handle, as one of these: long
OperationHandle VW_LockWorkObject( )
WobAccessHandle VW_WobQueryGetAccess
Handle
or
VW_GetAccessHandle
Result of Call This API restricts processing of the Work Object identified by Handle to
the user whose name you specify in UserName in one of the following
ways:
For example, the name of a Work Class field that holds a three-part
user name (It must meet the general guidelines for expressions;
see Composer help for details.)
• Empty string("")
This causes the Work Object to bind to the next user that accesses
it. (Compare this with binding to a machine.)
See Also:
“VW_GetAccessHandle” on page 304
VW_BrmCreateBrowseModifier
ErrorCode = VW_BrmCreateBrowseModifier (QueueHandle, Browse-
ModifierHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
QueueHandle long VW_AttachToWorkQueue( )
Summary This API creates a browse modifier object with which to override the
default Work Queue rules.
Result of Call This API uses Work Queue identification in QueueHandle to return the
browse modifier object, BrowseModifierHandle.
VW_BrmSetPreSelect-Rule( )
VW_BrmSetSelectRule( )
VW_BrmSetSortRules( )
VW_BrmSetLockFilter( )
See Also:
The Visual WorkFlo/Composer Handbook for more information about
the rules and allowable expressions
VW_BrmFreeBrowseModifier
ErrorCode = VW_BrmFreeBrowseModifier (BrowseModifierHandle)
Visual Basic
Object Browser
Input Data Type Source
BrowseModifierHandle long VW_
BrmCreateBrowseModifier( )
Summary This API frees the resources that were allocated by VW_BrmCreate-
BrowseModifier( ) for the browse modifier object.
Result of Call This API frees the resources that were allocated by VW_BrmCreate-
BrowseModifier( ) for the browse modifier object identified by Browse-
ModifierHandle. It invalidates BrowseModifierHandle and has no effect
on previously started browse sessions that used the same modifier ob-
ject.
See Also:
The Visual WorkFlo/Composer Handbook for more information about
rules and allowable expressions
VW_BrmSetLockFilter
ErrorCode = VW_BrmSetLockFilter (BrowseModifierHandle,
LockFilter)
Visual Basic
Object Browser
Input Data Type Source
BrowseModifierHandle long VW_
BrmCreateBrowseModifier( )
Result of Call This API specifies whether to show locked Work Objects in the browse
session identified by BrowseModHandle. Provide in LockFilter a filter
type that enables you to view locked objects, as follows:
Each call to this API overwrites the effect of previous calls. It overrides
default pre-selection rules only when BrowseModifierHandle identifies
a specific browse modifier object.
Tips This API does not return locked Work Objects only.
See Also:
The Visual WorkFlo/Composer Handbook for more information about
rules and allowable expressions
VW_BrmSetPreSelectRule
ErrorCode = VW_BrmSetPreSelectRule (BrowseModifierHandle, Pre-
SelectionRuleExpression)
Visual Basic
Object Browser
Input Data Type Source
BrowseModifierHandle long VW_
BrmCreateBrowseModifier( )
Summary This API enables the developer to specify one of the following in a
browse modifier object:
Result of Call This API enables the developer to specify with the string, PreSelection-
RuleExpression, one of the following in the browse modifier object
identified by BrowseModifierHandle:
See Also:
The Visual WorkFlo/Composer Handbook for more information about
the pre-selection rule and allowable expressions
VW_BrmSetSelectRule
ErrorCode = VW_BrmSetSelectRule (BrowseModifierHandle, Selec-
tionRuleExpression)
Visual Basic
Object Browser
Input Data Type Source
BrowseModifierHandle long VW_
BrmCreateBrowseModifier( )
Summary This API enables the developer to specify one of the following in a
browse modifier object:
Result of Call This API enables the developer to specify with the string, SelectionRu-
leExpression , one of the following in the browse modifier object identi-
fied by BrowseModifierHandle:
See Also:
The Visual WorkFlo/Composer Handbook for more information about
the selection rule and allowable expressions
VW_BrmSetSortRules
ErrorCode = VW_BrmSetSortRules (BrowseModifierHandle, Sort
RuleCount, SortRuleExpressions[ ])
Visual Basic
Object Browser
Inputa Data Type Source
BrowseModifierHandle long VW_
BrmCreateBrowseModifier( )
SortRuleExpression[ ] Developer
a. In an application that uses the OLE wrapper DLL, input the addi-
tional parameter, SortRuleLengths[ ]. Direct OLE server interface
uses the SAFEARRAY (see “Direct Interface with the OLE Server”
on page 47 for more information).
Summary This API enables the developer to specify a set of sort rules, such as
one of the following, in a browse modifier object:
Result of Call This API enables the developer to specify with the array, SortRuleEx-
pressions[], one of the following sets of sort rules in the browse modi-
fier object identified by BrowseModifierHandle:
Tips To override the default sort rules, you must call this API against a spe-
cific browse modifier object—you must have previously called VW_
BrmCreateBrowseModifier( ).
1.The SortRuleLengths[] array must have an entry for each entry in SortRuleExpres-
sions[].
Example
wpName = "VBCalc"
SortRules(0) = "SerialNumber"
SortRuleLengs(0) = 40
ErrorCode = VWApiSrv.VW_Logon(logonId)
ErrorCode = VWApiSrv.VW_AttachToWork-
Queue(logonId, wpName, wqId)
ErrorCode = VWApiSrv.VW_ReportToWork(wqId, wpId)
ErrorCode = VWApiSrv.VW_BrmCreateBrowseModi-
fier(wqId, brModHandle)
ErrorCode = VWApiSrv.VW_BrmSetSortRules(brModHan-
dle, SortRules, SortRuleLengs)
ErrorCode = VWApiSrv.VW_BeginBrowsingWork-
Queue(wpId, browseId, 0, browseCount,
➥brModHandle)
ErrorCode = VWApiSrv.VW_NextWorkObject-
ToBrowse(browseId, qeId)
ErrorCode = VWApiSrv.VW_EndBrowsingWork-
Queue(browseId)
ErrorCode = VWApiSrv.VW_LeaveWork(wpId)
ErrorCode = VWApiSrv.VW_DetachFromWorkQueue(wqId)
ErrorCode = VWApiSrv.VW_Logoff(logonId)
End Sub
See Also:
The Visual WorkFlo/Composer Handbook for more information about
sort rules and allowable expressions
“Direct Interface with the OLE Server” on page 47 if your C/C++ appli-
cation interfaces directly with the OLE server
VW_Call
ErrorCode = VW_Call (OperationHandle, InstructionSheetName )
Visual Basic
Object Browser
Input Data Type Source
OperationHandle long VW_LockWorkObject( )
Result of Call This API causes Visual WorkFlo to follow the steps of the Instruction
Sheet you specify in InstructionSheetName in processing the Work
Object from the Work Performer Operation identified by
OperationHandle.
VW_Call( ) VW_RaiseException( )
Saves changes made to the Work Disregards changes made to the
Object data fields Work Object data fields
Preserves timers (both active and in- Disables all active timers
active)
Leaves a Work Object that is in se- Causes a Work Object that is in se-
quenced mode in that mode quenced mode to exit that mode
Records nothing in the log table Logs an event in the log table if the
event logging option Work Object
Exception is enabled
See Also:
“VW_LockWorkObject” on page 367
VW_CheckVersionCompatibility
ErrorCode = VW_CheckVersionCompatibility (MajorVersionNumber,
MinorVersionNumber, CurrentMajorVersionNumber, CurrentMinorVer-
sionNumber)
Visual Basic
Object Browser
Input/Output Data Type Source
MajorVersionNumber long Developer
CurrentMajorVersion long
Number
CurrentMinorVersion long
Number
Summary This API checks that the version of your APIs is compatible with the
current version of APIs.
Result of Call This API returns the current major and minor version numbers in Cur-
rentMajorVersionNumber and CurrentMinorVersionNumber, re-
spectively. You must allocate sufficient memory to accommodate
these.
This provide values with which to compare the major and minor version
numbers of the APIs you are using, MajorVersionNumber and Minor-
VersionNumber, respectively.
If the major version number of your APIs is different from that returned
or if the minor version number of your APIs is less than that returned,
the versions are incompatible.
VW_CreateWorkObject
ErrorCode = VW_CreateWorkObject (LogonHandle, WorkClassName,
NewWorkObjectHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
LogonHandle long VW_LogonEx( )
or
VW_Logon
Summary This API creates a Work Object of a specified Work Class, using the
default data field values set in the class definition.
Result of Call This API creates a Work Object of the Work Class you specify in the
string, WorkClassName, using these:
• LogonHandle
Note The name “WorkObject” was a valid entry for the WorkClassName in-
put parameter in previous Visual WorkFlo releases. However, it is no
longer valid.
This API returns the ID, NewWorkObjectHandle, for the newly created
Work Object and begins the following series of calls, associated with
Work Object Applications:
VW_CreateWorkObject( )
VW_SetXXX( )
VW_DispatchWorkObject( )
See Also:
“VW_DispatchWorkObject” on page 298
VW_CurrentException
ErrorCode = VW_CurrentException (OperationHandle, ExceptionDe-
scriptor)
Visual Basic
Object Browser
Input/Output Data Type Source
OperationHandle long AVW_LockWorkObject( )
ExceptionDescriptor string
Summary This API returns the name of the most recently raised exception and a
text description of the exception condition.
Result of Call This API names and describes in ExceptionDescriptor the most re-
cently raised exception, identified by OperationHandle, which returned
to an active Work Performer that called VW_LockWorkObject( ).
#define VW_MAXEXCEPTIONNAMELEN];
#define VW_MAXEXCEPTIONDESCLEN];
typedef struct
{
char Name[VW_MAXEXCEPTIONNAMELEN];
char Desc[VW_MAXEXCEPTIONDESCLEN];
} VW_ExceptionDescriptor;
See Also:
“VW_LockWorkObject” on page 367
VW_DetachFromWorkQueue
ErrorCode = VW_DetachFromWorkQueue (QueueHandle)
Visual Basic
Object Browser
Input Data Type Source
QueueHandle long VW_AttachToWorkQueue( )
Result of Call This API frees the resources that were allocated by VW_AttachToWork
Queue( ) for the queue identified by QueueHandle. It invalidates any
further use of QueueHandle.
Call it once for each queue browsed, before the Work Performer shuts
down.
See Also:
“VW_AttachToWorkQueue” on page 264
VW_DispatchWorkObject
ErrorCode = VW_DispatchWorkObject (NewWorkObjectHandle)
Visual Basic
Object Browser
Input Data Type Source
NewWorkObjectHandle long VW_CreateWorkObject( )
Result of Call This API dispatches the new Work Object, identified by NewWorkOb-
jectHandle, to the first queue that the Instruction Sheet in its Work
Class definition specifies. Always call it after calling VW_
CreateWorkObject( ).
See Also:
“VW_CreateWorkObject” on page 293
VW_EndBrowsingWorkQueue
ErrorCode = VW_EndBrowsingWorkQueue (BrowseSessionHandle)
Visual Basic
Object Browser
Input Data Type Source
BrowseSessionHandle long VW_
BeginBrowsingWorkQueue( )
Result of Call This API frees the resources that were allocated to BrowseSession-
Handle by a call to VW_BeginBrowsingWorkQueue( ). It invalidates
BrowseSessionHandle and any associated QueueElementHandle.
However, it neither releases nor invalidates an Operation handle ob-
tained during the browse session associated with BrowseSessionHan-
dle.
See Also:
“VW_BeginBrowsingWorkQueue” on page 267
VW_FreeAccessHandle
ErrorCode = VW_FreeAccessHandle (WobAccessHandle, SaveUp-
dates, SkipCurrentInstruction, Reserved)
Visual Basic
Object Browser
Input Data Type Source
WobAccessHandle long VW_WobQueryGetAccess
Handle( )
or
VW_GetAccessHandle( )
Reserved a string
Summary This API frees the resources allocated by a call to one of the following
APIs:
VW_WobQueryGetAccessHandle( )
VW_GetAccessHandle( )
Result of Call This API frees the resources allocated to the handle
WobAccessHandle. You will have set the value of the handle in a previ-
ous call to VW_GetAccessHandle( ) or VW_WobQuery GetAccess-
Handle( ) to unlock a Work Object in a queue or not, as follows:
See Also:
“VW_GetAccessHandle” on page 304
VW_FreeArrayPtr
An application that uses the OLE wrapper DLL uses this API, rather
than VW_FreeArray( ).
Visual Basic
Object Browser
Input/Output Data Type Source
ArrayPointer Not applicable VW_GetArrayPtr ( )
VW_GetFieldNames( )
NumberOfElements VW_GetClassFieldNames( )
ArrayType Developer
Result of Call This API frees the array to which ArrayPointer points. (If ArrayPointer is
of type string, for example, this API frees all string elements in the ar-
ray.)
See Also:
“VW_GetArrayPtr” on page 309
VW_GetAccessHandle
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
QueueElementHandle long VW_
NextWorkObjectToBrowse( )
Summary This API returns a Work Object access handle that Visual WorkFlo
uses in making subsequent calls to the data access 1 APIs, then in
changing the Work Object.
Result of Call This API returns the handle WobAccessHandle to use in subsequent
calls to the data access APIs, then, in changing the Work Object identi-
fied by QueueElementHandle.
A security error returns unless the logged-on user has access rights to
Work Object and the queue. Results of the setting choice for Lock
ForUpdate follow:
Tips After locking a Work Object with this API, verify that it still fits the
search criteria you specified while locating it; the Work Object may
change between the time you find it and the time you lock it.
1.The data access APIs are those such as VW_GetInteger( ) and VW_SetFloat( ).
VW_Boolean,
VW_WobAccessHandle FAR *);
See Also:
Visual WorkFlo Installation and Administration Handbook for informa-
tion on Work Object and queue access
VW_GetArray
ErrorCode = VW_GetArray (Handle, FieldName, DataType, Array( ))
Visual Basic
Object Browser
Input/Output Data Typea Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Array( ) VARIANT
FAR*
a. If your application uses the OLE wrapper DLL, rather than inter-
faces directly with the OLE server, please see “VW_GetArrayPtr”
on page 309.
Summary This API returns in an array either the value of a parameter of the Op-
eration that is processing a Work Object or a specific field value from
one of the following:
Work Object
This is for the OLE Automation interface; so, it is not necessary to call
VW_GetArraySize( ) before calling this API and VW_FreeArrayPtr( )
after it.
Result of Call This API returns in Array( ) the value of a field or parameter in an ob-
ject1 identified by Handle, as shown in the following table. Provide, in
FieldName, the name of the field for which you seek the value.
Please supply the data type of the array elements in DataType. Possi-
ble values for this integer type parameter are:
0 Integer
1 Float
2 String
3 Boolean
4 Time
1.This is an object in the general sense, rather than a Work Object, specifically.
VW_GetArrayPtr
Applications that use the OLE wrapper DLL call this API. If your appli-
cation interfaces directly with the OLE server, please see “VW_GetAr-
ray” on page 307.
Visual Basic
Object Browser
Input/Output Data Typea Source
Handle Not applicable See “Handle” on page 50 for
the various sources and types
of Handle.
FieldName Developer
DataType Developer
Array( )
NumberOfElements
a. If your application interfaces directly with the OLE server, rather
than uses the OLE wrapper DLL, please see “VW_GetArray” on
page 307.
Summary This API returns in an array either the value of a parameter of the Op-
eration that is processing the Work Object or a specific field value from
one of the following:
It also returns the number of elements in the array. Before you call it,
call VW_GetArraySize( ); afterwards, free the array pointer with a call
to VW_FreeArrayPtr( ).
Result of Call This API returns in ArrayPointer the value of a field or parameter in an
object 1 identified by Handle, as shown in the following table. Provide, in
FieldName, the name of the field for which you seek the value and, in
DataType, the data type of the field’s data.
Tips This API, rather than the caller, allocates the necessary memory and
returns the array pointer to the caller. If the returned array is of type
string, then the array elements are of type VW_String.
1.This is an object in the general sense, rather than a Work Object, specifically.
See Also:
“VW_FreeArrayPtr” on page 303
VW_GetArraySize
Call this API to use the C-language OLE wrapper DLL in obtaining the
size of an array before calling VW_GetArrayPtr( ).
Visual Basic
Object Browser
Input/Output Data Typea Source
Handle Not applicable See “Handle” on page 50 for
the various sources and types
of Handle.
FieldName Developer
NumberOfElements
a. If your application interfaces directly with the OLE server, rather
than uses the OLE wrapper DLL, please see “VW_GetArray” on
page 307.
Call this API to obtain the size of an array before calling VW_
GetArrayPtr( ).
Handlea Array
WorkPerformerHandle Active Work Performer data field name
QueueElementHandle Work Queue field name
OperationHandle Parameter of the Operation process-
ing the Work Object
WobAccessHandle Work Object data field name
a.See “Handle” on page 50 for the various sources and types of Handle.
See Also:
“VW_FreeArrayPtr” on page 303
1.This is an object in the general sense, rather than a Work Object, specifically.
VW_GetBindings
ErrorCode = VW_GetBindings (Handle, UserName, MachineId)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
UserName string
MachineId string
Summary This API returns the name of the user to whom a Work Object is bound
and the ID of the workstation to which the Work Object is bound.
Result of Call This API returns in UserName the name of the user to whom the Work
Object (identified by Handle, below) is bound and, in MachineId, the
ID of the workstation to which that Work Object is bound, as follows:
VW_UserNameType FAR,
VW_MachineIdType FAR);
VW_GetBoolean
ErrorCode = VW_GetBoolean (Handle, FieldName, Value)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Value integer
Result This API returns in Value a parameter value that is of type boolean.
Specify in FieldName the field or parameter name in the object identi-
fied by Handle, for which you seek the boolean value, as follows:
Handle Value
WorkPerformerHandle Work Performer data field name
QueueElementHandle Work Queue field name
OperationHandle Parameter in the current Operation
WobAccessHandle Work Object data field name
VW_FieldNameType
VW_Boolean FAR *);
VW_GetClassFieldNames
ErrorCode = VW_GetClassFieldNames (LogonHandle, ClassName,
ArrayPointer)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
LogonHandle long VW_LogonEx( )
or
VW_Logon
Array Variant
Summary This API lists the names of data fields in a specific Work Class or Work
Performer Class and, for the C interface, the number of data field
names in the class.
Result of Call This API returns strings in the array Array or ArrayPointer, each of
which is the name of a data field in the class you specify in Class-
Name.
Tips This API allocates memory for the pointer; you must free it with VW_
FreeArrayPtr( ). (Provide VW_STRINGTYPE as the ArrayType input
parameter in that call.)
See Also:
“VW_FreeArrayPtr” on page 303
VW_GetDataType
ErrorCode = VW_GetDataType (Handle, FieldName, FieldType)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
FieldType long
Summary This API returns the Visual WorkFlo data type of a field or parameter.
Result of Call This API returns in FieldType a parameter value that is the type of
data in the field you specify in FieldName. It can be one of the follow-
ing:
0 Integer
1 Float
2 String
3 Boolean
4 Time
5 Array
6 Variant
7 Variant array
VW_GetDataTypeArray
ErrorCode = VW_GetDataTypeArray (Handle, FieldName, FieldType)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
FieldType long
Result of Call This API returns in FieldType a parameter value that indicates the
data type of the elements in the array that is the field you specify in
FieldName. The field belongs to the object identified by Handle, as fol-
lows:
VW_GetErrorMessage
ErrorCode = VW_GetErrorMessage (ErrorCode, ErrorMessage)
Visual Basic
Object Browser
Input/Output Data Type Source
ErrorCode long API calls that have an error
ErrorMessage string
Result of Call This API returns in ErrorMessage the error message text that corre-
sponds to the code in ErrorCode. ErrorMessage is a pointer to a writ-
able location in memory.
Status (Return This is the number of bytes that copy to ErrorMesssage, excluding the
Value) null character. Zero returns if ErrorCode is not valid.
See Also:
“VW_GetErrorMessageSize” on page 325
VW_GetErrorMessageSize
ErrorCode = VW_GetErrorMessageSize (ErrorCode)
Visual Basic
Object Browser
Input Data Type Source
ErrorCode long API calls that have an error
Result of Call This API returns (in the status return value, below, rather than as out-
put) the size of the error message string that corresponds to the code
in ErrorCode. Before calling VW_GetErrorMessage( ), call this to de-
termine the amount of memory you must allocate for the string.
Status (Return This is the number of bytes that copy to ErrorMesssage (see “VW_
Value) GetErrorMessage” on page 324), excluding the null character. Zero re-
turns if ErrorCode is not valid.
See Also:
“VW_GetErrorMessage” on page 324
VW_GetField
ErrorCode = VW_GetField (Handle, FieldName, Value)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Value string
From an application that uses the OLE wrapper DLL, call it after you
call VW_GetFieldSize( ) so that you know the amount of memory to al-
locate for the field value.
Result of Call This API returns in the string Value the value of a field you identify in
FieldName. The field belongs to the object identified by Handle, as fol-
lows:
To return the name of a system field, input one of the queue or log field
names listed below to FieldName.
Queue field:
F_WobNum
F_WorkSpaceId
F_Locked
F_LockMachine
F_LockUser
F_LockTime
F_BindPending
F_BoundUser
F_BoundMachine
F_Tag
F_UniqueId
F_OperationId
F_WorkClassId
F_EnqueueTime
F_CreateTime
F_InstrSheetId
F_WorkOrderId
F_SortOrder
F_Operation
F_WorkObjectName
F_Class
This API can return the value of any of the above system fields, but
do not input the highlighted fields to the QuerySpecifierIndexKey
parameter in a previous call to VW_QsCreateQuerySpecifier( ).
(Visual WorkFlo automatically appends F_UniqueId to the index
key.)
Log field:
F_WobNum
F_SeqNumber
F_UserId
F_EventType
F_PermWorkSpaceId
F_TempWorkSpaceId
F_WorkObjectNumber
F_WorkClassId
F_ParentWorkObjNum
F_MachineId
F_WPClassId
F_WPOperationId
F_InstrSheetId
F_AuthWorkOrderId
F_Duration
F_WorkObjectTag
F_Text
Tips From an application that uses the OLE wrapper DLL, call VW_
GetFieldSize( ) before calling this API, to learn the amount of memory
you must allocate for the returned string.
VW_FieldNameType,
VW_String);
See Also:
“VW_GetFieldSize” on page 332
VW_GetFieldNames
ErrorCode = VW_GetFieldNames (Handle, FieldNames)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
FieldNames Variant
ArrayPointer Not applicable VW_FreeArrayPtr( )
Result of Call This API returns strings in the array FieldNames or the array Array-
Pointer (in the case of an application that uses the OLE wrapper DLL)
each of which is the name of a parameter or field in the object identi-
fied by Handle, as follows:
Tips For applications that use the OLE wrapper DLL, this API allocates
memory for ArrayPointer, but you must free the array by calling VW_
FreeArrayPtr( ) when you no longer need it. (Provide VW_STRING-
TYPE to that API as the ArrayType input parameter.)
See Also:
“VW_FreeArrayPtr” on page 303
VW_GetFieldSize
ErrorCode = VW_GetFieldSize (Handle, FieldName, Size)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Size long
Result of Call This API returns in the string Size the size (in bytes) of the value in the
field you specify in FieldName. The field belongs to the object identified
by Handle, as follows:
See Also:
“VW_GetField” on page 326
VW_GetFloat
ErrorCode = VW_GetFloat (Handle, FieldName, Value)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Value double
Result of Call This API returns in Value a parameter value that is of type double. It
returns the data as a 16-byte, floating-point decimal.
Handle Field
WorkPerformerHandle Active Work Performer data field name
QueueElementHandle Work Queue field name
OperationHandle Parameter of the Operation process-
ing the Work Object
WobAccessHandle Work Object data field name
VW_FieldNameType
VW_Float FAR *);
VW_GetFPNumber
ErrorCode = VW_GetFPNumber (Handle, FieldName, Value)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Value
Result of Call This API returns in Value a parameter value that is of type floating
point. It returns the data as a 16-byte, floating-point decimal. It differs
from VW_GetFloat (see “VW_GetFloat” on page 334), in that it re-
quires WorkFlo Application Libraries.
Handle Field
WorkPerformerHandle Active Work Performer data field name
QueueElementHandle Work Queue field name
OperationHandle Parameter of the Operation process-
ing the Work Object
WobAccessHandle Work Object data field name
VW_GetHandleType
ErrorCode = VWServer.VW_GetHandleType (Handle, HandleType)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
HandleType long
Result of Call This API returns in HandleType the type of the handle identified by the
input Handle.
VW_GetInteger
ErrorCode = VW_GetInteger (Handle, FieldName, Value)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Value long
Result of Call This API returns in Value a parameter value that is of type integer.
Specify in FieldName the field or parameter name in the object identi-
fied by Handle, for which you seek the integer value, as follows:
Handle Field
WorkPerformerHandle Active Work Performer data field name
QueueElementHandle Work Queue field name
OperationHandle Parameter of the Operation process-
ing the Work Object
WobAccessHandle Work Object data field name
VW_GetIsolatedRegion
ErrorCode = VW_GetIsolatedRegion (LogonHandle, IsolatedRegion)
Visual Basic
Object Browser
Input/Output Data Type Source
LogonHandle long VW_LogonEx( )
or
VW_Logon
IsolatedRegion long
Result of Call This API uses LogonHandle to identify in IsolatedRegion the isolated
region in which you are working.
See Also:
“VW_Logon” on page 373
VW_GetMachineId
ErrorCode = VW_GetMachineId (LogonHandle, MachineId)
Visual Basic
Object Browser
Input/Output Data Type Source
LogonHandle long VW_LogonEx( )
or
VW_Logon
MachineId string
Result of Call This API uses LogonHandle to identify in MachineId the workstation to
which you are logged on and on which you are running the application.
See Also:
“VW_Logon” on page 373
VW_GetOperationName
ErrorCode = VW_GetOperationName (QueueElementHandle, Opera-
tionName)
Visual Basic
Object Browser
Input/Output Data Type Source
QueueElementHandle long VW_NextWorkObject
ToBrowse( )
OperationName string
Result of Call This API returns in OperationName the name of the next Operation
that will process the Work Object identified by QueueElementHandle.
OperationName identifies the read-only name of this Operation and it
points to a writable location in memory.
See Also:
“VW_GetOperationNameSize” on page 343
VW_GetOperationNameSize
ErrorCode = VW_GetOperationNameSize (QueueElementHandle,
Size)
Visual Basic
Object Browser
Input/Output Data Type Source
QueueElementHandle long VW_NextWorkObject
ToBrowse( )
Size long
Result of Call This API returns in Size the number of bytes in the name of the next
Operation that will process the Work Object identified by QueueEle-
mentHandle. Call it before calling VW_GetOperationName( ) to deter-
mine the amount of space you must allocate for the name.
See Also:
“VW_GetOperationName” on page 342
VW_GetParameterMode
ErrorCode = VW_GetParameterMode (Handle, ParameterName, Di-
rection)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Direction long
Summary This API returns the direction in which data passes in an active Work
Performer Operation parameter or field: 0 is in,1 is out, and 2 is in and
out (inout).
Result of Call This API returns in Direction the direction of the active Work Per-
former Operation parameter you identify in ParameterName. The direc-
tion is one of the following:
Handle identifies the Work Object for which the Operation is current, as
follows:
VW_GetQueueNames
ErrorCode = VW_GetQueueNames (LogonHandle, QueueNames)
Visual Basic
Object Browser
Input/Output Data Type Source
LogonHandle long VW_LogonEx( )
or
VW_Logon
QueueNames Variant
NumberOfElements Not applicable
Summary This API lists the names of Work Queues and System Queues in the
Online repository. For the C interface it also returns the number of
queues.
Result of Call This API lists in the array QueueNames the names of Work Queues
and System Queues in the Online repository. This API returns:
• For OLE wrapper DLL interface, the number of strings in the array,
in NumberOfElements
Tips This API allocates memory for QueueNames (and returns the array
pointer to the caller), but you must free the array by calling VW_
See Also:
“VW_GetWorkPerformerClassNames” on page 361 for comparison
VW_GetString
ErrorCode = VW_GetString (Handle, FieldName, Value)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Value string
Summary This API returns a parameter value that is of type string. Call it after
calling VW_GetStringSize( ), so you will know the amount of space you
must allocate for the string.
Result of Call This API returns in Value a parameter value that is of type string.
Specify in FieldName the field or parameter name in the object identi-
fied by Handle, for which you seek the string value, as follows:
Handle Value
WorkPerformerHandle Active Work Performer data field name
QueueElementHandle Work Queue field name
OperationHandle Parameter of the Operation process-
ing the Work Object
WobAccessHandle Work Object data field name
See Also:
“VW_GetStringSize” on page 350
VW_GetStringSize
ErrorCode = VW_GetStringSize (Handle, FieldName, Size)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Size long
Result of Call This API returns in Size the number of bytes in a string of the object
identified by Handle.
See Also:
“VW_GetString” on page 348
VW_GetTime
ErrorCode = VW_GetTime (Handle, FieldName, Value)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Value long
Result of Call This API returns in Value a parameter or field value that is of type time.
It expresses the number of seconds that have passed since midnight,
January 1, 1970 Coordinated Universal Time (UTC, formerly Green-
wich Mean Time).
Handle Value
WorkPerformerHandle Active Work Performer data field name
QueueElementHandle Work Queue field name
OperationHandle Parameter of the Operation process-
ing the Work Object
WobAccessHandle Work Object data field name
Tips A time value is a 32-bit long and, as such, can specify a time that is no
earlier than August 16 21:26:41, 1906 and no later than January 13
12:53:20, 2038.
VW_GetWobSignature
ErrorCode = VW_GetWobSignature (Handle, WobSignature)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle, as one of the fol- long
lowing:
QueueElementHandle VW_NextWorkObjectTo
Browse( )
OperationHandle VW_LockWorkObject( )
WobAccessHandle VW_GetAccessHandle( )
or
VW_WobQueryGetAcces
Handle( )
WobSignature string
Result of Call This API returns in the string WobSignature the signature that
uniquely identifies a Work Object in the VWService. Handle identifies
the Work Object.
VW_GetWorkClassNames
ErrorCode = VW_GetWorkClassNames (LogonHandle, WorkClass-
Names, IncludeInternalClasses)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
LogonHandle long VW_LogonEx( )
or
VW_Logon
Summary This API lists in an array the names and, for the C interface, the num-
ber of Work Classes in the Online repository. You can list and count all
class names or only the names of classes you defined.
Select which Work Class names to list and count with the following set-
ting:
IncludeInternalClasses = true
All Work Classes in the Online repository
IncludeInternalClasses = false
All user-defined Work Classes in the Online repository
(This excludes system Work Classes.)
Tips This API allocates memory for WorkClassNames, but you must free
the array by calling VW_FreeArrayPtr( ) when you no longer need it.
(Provide VW_STRINGTYPE to that API as the ArrayType input param-
eter.)
VW_GetWorkObjectLockStatus
ErrorCode = VW_GetWorkObjectLockStatus (Handle,
LockStatus, MachineId)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
LockStatus long
MachineId string
Result of Call This API indicates in LockStatus whether a Work Object is locked
and, if it is, identifies in MachineId the workstation on which it is
locked, as follows:
VW_GetWorkObjectName
ErrorCode = VW_GetWorkObjectName (Handle, WorkObjectName)
Visual Basic
Object Browser
Input/Output Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
WorkObjectName string
Result of Call This API returns in WorkObjectName the name of the Work Object
identified by Handle, as follows:
See Also:
Visual WorkFlo Technical Notes to compare the Work Object name
with the Work Object ID, the Work Object tag, and the Work Object
number
VW_GetWorkPerformerClassNames
ErrorCode = VW_GetWorkPerformerClassNames (LogonHandle,
WorkPerformerClassNames, IncludeInternalClasses)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
LogonHandle long VW_LogonEx( )
or
VW_Logon
Summary This API lists the names and, for the C interface, the number of Work
Performer Classes in the Online repository. You can list and count all
Work Performer Class names or only the names of classes you de-
fined.
Select which Work Performer Class names to list and count with the
following setting:
IncludeInternalClasses = true
All Work Performer Classes in the Online repository
IncludeInternalClasses = false
All user-defined Work Performer Classes in the Online repository
(This excludes system classes.)
Tips If you set IncludeInternalClasses to true, this API returns the names of
Work Performer Classes, which is to say it returns the names of Work
Queues, with the exception of the WorkPerformerObject class (the
base Work Performer Class). Although that is a Work Performer Class,
there is no associated Work Queue.
See Also:
“VW_GetQueueNames” on page 346 to obtain a list of all queues, in-
cluding System Queues
VW_GetWorkPerformerHandle
ErrorCode = VW_GetWorkPerformerHandle (OperationHandle,
WorkPerformerHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
OperationHandle long VW_LockWorkObject( )
VW_LogMessage( )
See Also:
“VW_LockWorkObject” on page 367
VW_GetWorkQueueDepth
ErrorCode = VW_GetWorkQueueDepth (LogonHandle, QueueName,
QueueDepth)
Visual Basic
Object Browser
Input/Output Data Type Source
LogonHandle long VW_LogonEx( )
or
VW_Logon
QueueDepth long
Result of Call This API returns in QueueDepth the number of Work Objects in the
queue you name in QueueName. The number includes all Work Ob-
jects in that queue—locked, unlocked, bound, and unbound Work Ob-
jects.
VW_LeaveWork
ErrorCode = VW_LeaveWork (WorkPerformerHandle)
Visual Basic
Object Browser
Input Data Type Source
WorkPerformerHandle long VW_ReportToWork( )
VW_
GetWorkPerformerHandle( )
Result of Call This API invalidates and frees the resources allocated to WorkPerform-
erHandle and any of these associated handles:
BrowseSessionHandle
QueueElementHandle
OperationHandle
Tips Call this API once for each queue browsed before shutdown of the
Work Performer.
See Also:
“VW_GetWorkPerformerHandle” on page 364
VW_LockWorkObject
ErrorCode = VW_LockWorkObject (QueueElementHandle, Operation-
Handle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
QueueElementHandle long VW_
NextWorkObjectToBrowse( )
Summary This API locks a Work Object so that the caller can perform the current
Operation.
Result of Call This API locks the Work Object (in a Work Queue during a browse ses-
sion) identified by QueueElementHandle, so that the caller can perform
the current Operation. Visual WorkFlo cannot lock this Work Object
again until after a call to VW_UnlockAndDispatch( ) or VW_
UnlockWorkObject( ). The returned OperationHandle remains valid
until after a call to one of these:
VW_UnlockAndDispatch( )
VW_UnlockWorkObject( )
VW_LeaveWork( )
See Also:
“VW_BindToUser” on page 272
VW_LogMessage
ErrorCode = VW_LogMessage (WorkPerformerHandle, UserDefined-
Message, LoggingOption)
Visual Basic
Object Browser
Input Data Type Source
WorkPerformerHandle long VW_ReportToWork( )
Summary The calling Work Performer uses this API to log a user-defined mes-
sage for a specific event logging option.
Message Length
The message may be up to the maximum number of bytes long speci-
fied in the SVCAPI.H file as VW_MAXMESSAGELEN. (This is 80
bytes.)
Logging Option
The logging option must be on (it must be set = 1 with Composer) in
the Work Performer’s log vector and in the system log vector. Only the
following options are valid:
Tips Compare the event logging provided by this API with trace logging for
debugging.
See Also:
The Visual WorkFlo Installation and Administration Handbook for more
information about trace and event logging
VW_Logoff
ErrorCode = VW_Logoff (LogonHandle)
Visual Basic
Object Browser
Input Data Type Source
LogonHandle long VW_LogonEx( )
or
VW_Logon
Result of Call This API invalidates LogonHandle. Call it once before Work Performer
shutdown.
See Also:
“VW_Logon” on page 373
VW_Logon
ErrorCode = VW_Logon (LogonHandle)
Visual Basic
Object Browser Destination
Output Data Type (partial list)
LogonHandle long VW_AttachToWorkQueue( )
VW_CreateWorkObject( )
VW_Logoff( )
VW_LogQueryBegin( )
VW_
QsCreateQuerySpecifier( )
VW_WobQueryCreate( )
Result of Call A call to this API makes an application a Visual WorkFlo application. It
returns the unique logon ID, LogonHandle to the caller for use in sub-
sequent API calls if the caller previously used FileNET Logon and re-
sponded with the right user name and password. Otherwise, it causes
Visual WorkFlo to prompt for these.
Before you call this API, compare its results with those of calling the
VW_LogonEx( ) API.
For a 32-bit application, Visual WorkFlo API calls are now provided by
an OLE server, VWAPISRV.EXE. The OLE server loads at the time of
the first API call (when the application calls VW_Logon( ). Visual Work-
Flo also loads at this time. This may cause the loading of the VW_
Logon( ) call to appear slightly slower than expected (due to simulta-
neous loading of Visual WorkFlo), but initial loading of the application
is faster, because Visual WorkFlo has already loaded.
The OLE server unloads upon a call to VW_Logoff( ). Should you call
VW_Logon( ), VW_Logoff( ), then VW_Logon( ) again, there would be
a delay with the second VW_Logon( ) call because the OLE server
would have unloaded with the VW_Logoff( ) call and must now reload.
We recommend that you call VW_Logon( ) once at startup of your ap-
plication and that you call VW_Logoff( ) once at shutdown.
Example
See Also:
The Visual WorkFlo Installation and Administration Handbook
VW_LogonEx
ErrorCode = VW_LogonEx (UserName, Password, VWServiceName,
IsolatedRegion, LogonHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
UserName string Developer
Use this API, rather than VW_Logon( ), to run an active Work Per-
former on the server. Use it in client-side or server-side applications.
Result of Call This API returns the unique logon ID, LogonHandle to the caller for
use in subsequent API calls. It logs the user, whom you specify in
UserName and protect with the password in Password, onto the
VWService you name in VWServiceName and gives the user access
to the following:
"<ServiceName>:<Domain>:<Organization>"
VWServiceName
This allows the user to run more than one application in more than one
VWService and/or in more than one isolated region.
The following results when you specify an empty string (““), the name
of a server that is down, or an invalid value in VWServiceName :
The OLE server loads when the application calls VW_LogonEx( ). Vi-
sual WorkFlo also loads at this time. This may cause the loading of the
VW_LogonEx( ) call to appear slightly slower than expected (due to si-
multaneous loading of Visual WorkFlo), but initial loading of the appli-
cation is faster, because Visual WorkFlo has already loaded.
The OLE server unloads upon a call to VW_Logoff( ). Should you call
VW_LogonEx( ), VW_Logoff( ), then VW_LogonEx( ) again, there
would be a delay with the second VW_LogonEx( ) call because the
OLE server would have unloaded with the VW_Logoff( ) call and must
now reload. FileNET recommends that you call VW_LogonEx( ) once
at startup of your Work Performer and that you call VW_Logoff( ) once
at shutdown.
Example
See Also:
“VW_Logoff” on page 372
VW_LogQueryBegin
ErrorCode = VW_LogQueryBegin (LogonHandle, QuerySpecifierHan-
dle, LogQueryHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
LogonHandle long VW_LogonEx( )
or
VW_Logon
Summary This API creates and initializes a query session on log records.
Result of Call This API returns the handle LogQueryHandle, with which the user
may begin a query session on records logged for the query object
specified by the handle, QuerySpecifierHandle, or on all records
logged (if the value of QuerySpecifierHandle is nil).
The type of log query you make depends on the system-defined index
key you input to the QuerySpecifierIndexKey parameter in the previous
call to VW_QsCreateQuerySpecifier( ), as follows:
Tips After the log query, call the API, VW_LogQueryEnd( ), to free the asso-
ciated resources.
See Also:
“VW_LogQueryNextRecords” on page 384
VW_LogQueryEnd
ErrorCode = VW_LogQueryEnd (LogQueryHandle)
Visual Basic
Object Browser
Input Data Type Source
LogQueryHandle long VW_LogQueryBegin( )
Result of Call This API frees the handle, LogQueryHandle, releasing the resources
that were allocated by calling the API, VW_LogQueryBegin( ).
See Also:
“VW_LogQueryBegin” on page 381
VW_LogQueryNextRecords
ErrorCode = VW_LogQueryNextRecords (LogQueryHandle, Maxi-
mumRecordsToRead, LogRecords, Done)
Visual Basic
Object Browser
Input/Output Data Type Source
LogQueryHandle long VW_LogQueryBegin( )
LogRecords Variant
Done integer
Summary This API returns records logged for the specified query object or all
records logged (if the log query handle specifies no query object).
The records in the strings are those that Visual WorkFlo logged on the
query object identified by LogQueryHandle. If LogQueryHandle identi-
fies no object, all records return in LogRecords. The records in each
string are field values, each separated by a comma, that return in the
following parameter order:
8/15/1998 13:45:33,140,,SysAdmin:marge:FileNET,,,
7cfde85a86161d189ad10005a3d201\5,,Autoclaim,Unattended,Claim-
Assessment, CreateVoucher,,4,Patricia,
on the query object (Done = true) or whether there are further records
to retrieve (Done = false).
See Also:
“VW_LogQueryBegin” on page 381
VW_NextWorkObjectToBrowse
ErrorCode = VW_NextWorkObjectToBrowse (BrowseSessionHandle,
QueueElementHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
BrowseSessionHandle long VW_
BeginBrowsingWorkQueue( )
Result of Call This API returns the handle QueueElementHandle on a Work Object
in the queue the user is browsing. BrowseSessionHandle identifies the
queue.
VW_EndBrowsingWorkQueue( )
VW_LeaveWork( )
Example
See Also:
“VW_BeginBrowsingWorkQueue” on page 267
VW_QQueryBegin
ErrorCode = VW_QQueryBegin (QuerySpecifierHandle, QueueName,
QueueQueryOptions, BatchSize, QueueQueryHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
QuerySpecifierHandle long VW_
QsCreateQuerySpecifier( )
Summary This API starts a query in a specific queue by returning a queue query
handle. The query reads the data of one or more Work Objects, ac-
cording to your parameter specifications.
It allows you the option of locking Work Objects in the same step that
you query them, thereby optimizing performance.
Result of Call This API starts a query in the queue you name in QueueName by re-
turning the queue query handle QueueQueryHandle. The query
reads the data of the Work Object(s), according to the following:
A queue query follows the sequence of calls shown in the diagram be-
low.
“VW_QQueryBegin”
VW_QQ_WANT_TO_LOCK No “VW_QQueryNextWorkObject”
specified in QueueQueryOptions?
Yes “VW_LockWorkObject”
“Get Data”
“VW_QQueryNextLockedWorkObject”
“VW_UnlockAndDispatch”
“VW_QQueryEnd”
You may apply one or more of the following query options with Queue-
QueryOptions:
Option
Value in QueueQueryOptions code Result
VW_QQ_NO_OPTIONS 0x0 If specified:
All values are false
If not:
Reads only unlocked Work Objects
If not:
Reads only unbound Work Objects
Option
Value in QueueQueryOptions code Result
VW_QQ_READ_UNWRITABLE 0 x 4 If specified:
Reads writable and unwritable Work
Objects
If not:
Reads only writable Work Objects
VW_QQ_WANT_TO_LOCK 0 x 8 If specified:
Locks the Work Objects to which
handles returned from the call to
VW_QsCreateQuerySpecifier( )
Use QueueQueryHandle in subse-
quent call to VW_
QQueryNextLockedWorkObject( ).
If not:
Use QueueQueryHandle in subse-
quent call to VW_
QQueryNextWorkObject( ).
Visual WorkFlo moves the data of four Work Objects from the specified
queue to your workstation memory. At this point, you call VW_QQue-
ryNextWork Object( ) and access the first of the four Work Objects in
the batch, as shown in the preceding diagram and the following se-
quence.
Call VW_QsCreateQuerySpecifier( )
Call VW_QQueryBegin(4)
[Visual WorkFlo returns the handles of Work Objects 1-4 (of 40), mak-
ing their data available.]
Call:
VW_QQueryNextWorkObject( )
to return queue element handle 1 of 40
VW_QQueryNextWorkObject( )
to return queue element handle 2 of 40
VW_QQueryNextWorkObject( )
to return queue element handle 3 of 40
VW_QQueryNextWorkObject( )
to return queue element handle 4 of 40
VW_QQueryNextWorkObject( )
to return queue element handle 5 of 40
[Visual WorkFlo makes the data of another batch of 4 available without
your having to again call VW_QQueryBegin( ).]
In both cases above, the system could retrieve fewer than BatchSize,
were system resource use high. However, the application would be
aware of this only if the Work Objects were locked upon query.
Tips This API allows you the option of locking Work Objects in the same
step that you query them, thereby optimizing system performance.
After the queue query, call the API, VW_QQueryEnd( ), to free the as-
sociated resources.
See Also:
“VW_BeginBrowsingWorkQueue” on page 267 for comparison
VW_QQueryEnd
ErrorCode = VW_QQueryEnd (QueueQueryHandle)
Visual Basic
Object Browser
Input Data Type Source
QueueQueryHandle long VW_QQueryBegin( )
Result of Call This API frees the resources allocated by calling the VW_
QQueryBegin( ). If the previous call to VW_QQueryBegin( ) received
VW_QQ_WANT_TO_LOCK as input to its QueueQueryOptions (infor-
mation returned in QueueQueryHandle), this API unlocks the Work
Objects Visual WorkFlo locked for that call, provided they were not al-
ready unlocked or dispatched.
See Also:
“VW_QQueryBegin” on page 390
VW_QQueryNextLockedWorkObject
ErrorCode = VW_QQueryNextLockedWorkObject (QueueQueryHan-
dle, OperationHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
QueueQueryHandle long VW_QQueryBegin( )
Result of Call This API returns in OperationHandle the handle of the Operation that
will process the next Work Object, identified by QueueQueryHandle,
which returned in the batch queried by VW_QQueryBegin( ).
See Also:
“VW_QQueryBegin” on page 390
VW_QQueryNextWorkObject
ErrorCode = VW_QQueryNextWorkObject (QueueQueryHandle,
QueueElementHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
QueueQueryHandle long VW_QQueryBegin( )
Result of Call This API returns in QueueElementHandle the handle of the next Work
Object, identified by QueueQueryHandle, returned in the batch queried
by VW_QQueryBegin( ).
See Also:
“VW_QQueryBegin” on page 390
VW_QsCreateQuerySpecifier
ErrorCode = VW_QsCreateQuerySpecifier (LogonHandle,
QuerySpecifierHandle, QuerySpecifierIndexKey, QuerySpecifierMini-
mumValues, QuerySpecifierMinimumEqual, QuerySpecifierMaximum-
Values, QuerySpecifierMaximumEqual, QuerySpecifierFilter,
QuerySpecifierFilterSubstitutionVariables)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
LogonHandle long VW_LogonEx( )
or
VW_Logon
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
QuerySpecifierFilter string Developer
Summary This API returns a query specifier handle to use in retrieving, for exam-
ple:
Result of Call This API returns the query specifier handle QuerySpecifierHandle to
use in retrieving records.
Filtering
If you wish to further limit the query, input a legal SQL “where” clause
subexpression to QuerySpecifierFilter.
FieldName > ‘’
FieldName = ‘’
FieldName < ‘’
For example, you could filter out Work Objects that have a user-defined
queue field “priority” with a value of “low.”
Queue Query
For queue query, the index key must include at least one user-defined
Work Queue field and it may include system-defined Work Queue
fields.
User-defined. Input the index key the user defined in the Work Per-
former Class with the Composer program.
F_WobNum
F_WorkSpaceId
F_Locked
F_LockMachine
F_LockUser
F_LockTime
F_BindPending
F_BoundUser
F_BoundMachine
F_Tag
F_OperationId
F_WorkClassId
F_EnqueueTime
F_CreateTime
F_InstrSheetId
F_WorkOrderId
F_SortOrder
If you input a system-defined index key to find Work Object data, use
one of the following:
Log Query
If you input a system-defined index key to find a log record, use one of
the following:
If the number of elements, n, in the array is less than the number of in-
dex key fields, then its missing elements, by definition, represent those
fields at the end of the index key. Visual WorkFlo ignores such missing
fields when it limits the query.
Examples
Suppose a manager assigns each employee a list of customers. So,
each Work Object (for example, an auto insurance claim) for which the
manager’s department is responsible is associated with an employee
and a customer. Each Work Object, therefore, has an EmployeeName
field and a CustomerName field. The Visual WorkFlo user builds an in-
dex key for the Work Object, using Visual WorkFlo/Composer, that
contains the fields EmployeeName and CustomerName, then names
the index key “EmplCust.”
Case 1:
QuerySpecifierMinimumEqual true
QuerySpecifierMaximumEqual true
Case 2:
QuerySpecifierMinimumEqual true
QuerySpecifierMaximumEqual false
Case 3:
QuerySpecifierMinimumEqual false
QuerySpecifierMaximumEqual false
The type of an array element must be the same as that of its index key
counterpart.
VW_Boolean,
char FAR *,
VW_VariantArray *);
See Also:
“VW_LogQueryBegin” on page 381
VW_QsFreeQuerySpecifier
ErrorCode = VW_QsFreeQuerySpecifier (QuerySpecifierHandle)
Visual Basic
Object Browser
Input Data Type Source
QuerySpecifierHandle long VW_
QsCreateQuerySpecifier( )
Result of Call This API frees the handle, QuerySpecifierHandle, releasing the re-
sources that were allocated by calling the API, VW_
QsCreateQuerySpecifier( ).
See Also:
“VW_QQueryBegin” on page 390
VW_QueueGetStats
ErrorCode = VW_QueueGetStats (LogonHandle, QueueClassName,
StartTime, EndTime, TimeUnit, QueueStatistics)
Visual Basic
Object Browser
Input/Output Data Type Source
LogonHandle long VW_LogonEx( )
or
VW_Logon
QueueStatistics Variant
Result of Call This API returns in the array, QueueStatistics, the statistics Visual
WorkFlo collected on the queue you name in QueueClassName during
the period you specify between QueueStartTime and QueueEndTime.
The period begins with the first sample Visual WorkFlo takes following
the actual time you specify in QueueStartTime. It ends with the first
sample Visual WorkFlo takes following the actual time you specify in
QueueEndTime .
QueueClassName
QueueStartTime
QueueEndTime
See Also:
“VW_LogQueryBegin” on page 381 for comparison
VW_RaiseException
ErrorCode = VW_RaiseException (OperationHandle, ExceptionName,
ExceptionDescription)
Visual Basic
Object Browser
Input Data Type Source
OperationHandle long VW_LockWorkObject( )
Call this, rather than VW_Call( ), when you wish to reject the values in
a Work Object’s data fields, say, for error recovery and reporting.
Result of Call This API causes an exception-handling Instruction Sheet to execute for
the Work Object on which the Operation identified by OperationHandle
is current. Supply the name of the exception handling Instruction Sheet
in the string ExceptionName and the description of the exception in the
string ExceptionDescription .
VW_RaiseException( ) VW_Call( )
Disregards changes made to the Saves changes made to the Work
Work Object data fields Object data fields
Disables all active timers Preserves timers (both active and in-
active)
Causes a Work Object that is in se- Leaves a Work Object that is in se-
quenced mode to exit that mode quenced mode in that mode
Logs an event in the log table if the Records nothing in the log table
logging vector option, Work Object
Exception is on
See Also:
“VW_Call” on page 288
VW_ReportToWork
ErrorCode = VW_ReportToWork (WorkQueueHandle, WorkPerformer-
Handle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
WorkQueueHandle long VW_AttachToWorkQueue( )
Result of Call This API, along with a previous call to VW_AttachToWorkQueue( ), es-
tablishes a Visual WorkFlo application as a Work Performer.
Tips Call this API once for each queue browsed after startup of the Work
Performer.
Example
See Also:
“VW_AttachToWorkQueue” on page 264
VW_RosterGetStats
ErrorCode = VW_RosterGetStats (LogonHandle, RosterClassName,
RosterStartTime, RosterEndTime, RosterTimeUnit, RosterStatistics)
Visual Basic
Object Browser
Input/Output Data Type Source
LogonHandle long VW_LogonEx( )
or
VW_Logon
RosterStatistics
Result of Call This API returns in the array, RosterStatistics, the statistics Visual
WorkFlo collected on the roster you name in RosterClassName during
the period you specify between RosterStartTime and RosterEndTime.
The period begins with the first sample Visual WorkFlo takes following
the time you specify in RosterStartTime . It ends with the first sample
Visual WorkFlo takes following the time you specify in RosterEndTime .
RosterClassName
RosterStartTime
RosterEndTime
See Also:
“VW_LogQueryBegin” on page 381 for comparison
VW_SequencedWait
ErrorCode = VW_SequencedWait (LogonHandle, Timeout, Done)
Visual Basic
Object Browser
Input/Output Data Type Source
LogonHandle long VW_LogonEx( )
or
VW_Logon
Done integer
Summary This API reports whether there are any sequenced mode Work Object
data in client workstation memory.
Use this API to control the number of sequenced mode Work Object
data in workstation memory and to minimize transaction between the
workstation and server.
Result of Call This API reports in the boolean Done whether there is any sequenced
mode Work Object data in the caller’s workstation memory.
In Box Example
Suppose that you have a queue of Work Objects (a Work Queue) on a
server that are waiting to be processed—an “in box” queue. You could
run a Work Performer (call it InBox) from your workstation that would
browse the In Box queue for eligible Work Objects, then prompt the
user to select from among them. After the InBox Work Performer dis-
patched the user-selected Work Object, Visual WorkFlo would move
the Work Object’s data to the user’s workstation (local) memory, at
which point, the Work Object could be placed into sequenced mode.
The Instruction Sheet for our InBox application would look similar to
this:
Operation InBox
Operation InBox
To Operation B
From Operation A
InBox Master
Work Performer Work Performer A Work Performer B
Work Work
1 LOCAL Object 5 Object 9
MEMORY data data
WORKSTATION
3 7
SERVER
Sequenced Mode
Begin End
InBox
Master Work Performer
The timeout period for this call is independent of the timeout peri-
ods for calls by Work Performers A and B.
• Repeats this instruction after user has waited for enough Work Ob-
ject data to clear local memory
System Instruction
BeginSequencedMode
Visual WorkFlo moves the data of the selected Work Object from the
server into the user’s workstation local memory and locks it there. (3)
Work Performer A
Work Performer B
After this instruction, Visual WorkFlo inserts the Work Object into the
normal, unlocked state and VW_SequencedWobFetch( ) may no
longer fetch its data.
See Also:
“VW_SequencedWobFetch” on page 437
VW_SequencedWobFetch
ErrorCode = VW_SequencedWobFetch (WorkPerformerHandle, Time-
out, OperationHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
WorkPerformerHandle long VW_ReportToWork( )
Result of Call This API returns OperationHandle, the handle to the current Opera-
tion of the Work Performer identified by WorkPerformer on a locked
Work Object in sequenced mode, if any of the Work Object’s data ap-
pears in local workstation memory before the number of milliseconds
you specify in Timeout lapses.
This is the only way to obtain the Operation handle when a Work Ob-
ject is in sequenced mode.
It has the advantage over browsing that it accesses only local memory.
See Also:
“VW_LockWorkObject” on page 367 for comparison
VW_SetArray
ErrorCode = VW_SetArray (Handle, FieldName, Array[ ], DataType)
Visual Basic
Object Browser
Input Data Type Source
Summary This API sets an array of values into a specified field (for the OLE Auto-
mation interface).
Result of Call This API sets the values you specify in Array[] into the field you name
in FieldName. The field is in the object identified by Handle, as shown
in the following table:
• In Array[]
Location of the memory you have allocated for the array, which you
obtained by calling VW_GetArray( )
• In DataType
See Also:
“VW_GetArray” on page 307
VW_SetArrayPtr
Summary This API sets an array of values into a specified field (for applications
that use the OLE wrapper DLL).
Visual Basic
Object Browser
Input Data Type Source
FieldName Developer
ArrayPtr Developer
NumberOfElements Developer
DataType Developer
a. Handle must be other than QueueElementHandle; this API cannot
set values into the data field of an unlocked Work Object.
Result of Call This API sets the values you specify in ArrayPointer into the field you
name in FieldName. The field is in the object identified by Handle, as
shown in the following table:
• In ArrayPointer
• In NumberOfElements
These may be fewer than the elements in the Visual WorkFlo array.
• In DataType
See Also:
“VW_FreeArrayPtr” on page 303
VW_SetBoolean
ErrorCode = VW_SetBoolean (Handle, FieldName, Value)
Visual Basic
Object Browser
Input Data Type Source
Result of Call This API sets the boolean value you specify in Value into the field you
name in FieldName. This field is in the object identified by Handle, as
follows:
VW_SetField
ErrorCode = VW_SetField (Handle, FieldName, Value)
Visual Basic
Object Browser
Input Data Type Source
Result of Call This API sets the value you specify in Value into the field you name in
FieldName. The field belongs to the object identified by Handle, as fol-
lows:
VW_SetFloat
ErrorCode = VW_SetFloat (Handle, FieldName, Value)
Visual Basic
Object Browser
Input Data Type Source
Result of Call This API sets the double value you specify in Value into the field you
name in FieldName. This field is in the object identified by Handle, as
follows:
VW_SetFPNumber
ErrorCode = VW_SetFPNumber (Handle, FieldName, Value)
Visual Basic
Object Browser
Input Data Type Source
Value Developer
a. Handle must be other than QueueElementHandle; this API cannot
set values into the data field of an unlocked Work Object.
Summary This API sets a value of type 16-byte decimal floating point into a field.
A call to it requires the WorkFlo Application Libraries.
Result of Call This API sets the floating-point decimal you specify in Value into the
field you name in FieldName. This field is in the object identified by
Handle, as follows:
VW_SetInteger
ErrorCode = VW_SetInteger (Handle, FieldName, Value)
Visual Basic
Object Browser
Input Data Type Source
Result of Call This API sets the integer you specify in Value into the field you name in
FieldName. This field is in the object identified by Handle, as follows:
VW_FieldNameType,
VW_Integer);
VW_SetString
ErrorCode = VW_SetString (Handle, FieldName, Value)
Visual Basic
Object Browser
Input Data Type Source
Result of Call This API sets the string you specify in Value into the field you name in
FieldName. This field is in the object identified by Handle, as follows:
VW_FieldNameType,
VW_String);
VW_SetTime
ErrorCode = VW_SetTime (Handle, FieldName, Value)
Visual Basic
Object Browser
Input Data Type Source
Summary This API sets a value of type time into a field. Express the time in sec-
onds since midnight January 1, 1970 Coordinated Universal
Time (UTC).
Result of Call This API sets the number of seconds you specify in Value into the field
you name in FieldName. This field is in the object identified by Handle,
as follows:
Tips A time value is a 32-bit long and, as such, can specify a time that is no
earlier than August 16 21:26:41, 1906 and no later than January 13
12:53:20, 2038.
VW_TerminateWorkObject
ErrorCode = VW_TerminateWorkObject (Handle)
Visual Basic
Object Browser
Input Data Type Source
Handle long See “Handle” on page 50 for
the various sources and types
of Handle.
Result of Call This API terminates the Work Object identified by Handle, as follows:
Event Result
Work Object termination The Terminate Instruction Sheet exe-
cutes, then Visual WorkFlo removes the
Work Object from the Online repository.
A second termination of the Work Visual WorkFlo immediately removes
Object before completion of the Ter- the Work Object from the Online reposi-
minate Instruction Sheet tory (without waiting for completion of the
Terminate Instruction Sheet.
WobAccessHandle or Operation- Visual WorkFlo reroutes the Work Object
Handle identifies a Work Object un- immediately and invalidates Handle.
der a active Work Performer
Operation
See Also:
“VW_LockWorkObject” on page 367
VW_UnBind
ErrorCode = VW_UnBind (Handle)
Visual Basic
Object Browser
Input Data Type Source
Handle, as one of these: long
OperationHandle VW_BindToUser( )
or
VW_LockWorkObject( )
WobAccessHandle
VW_WobQueryGetAccess-
Handle
or
VW_GetAccessHandle
Result of Call This API ends the binding restriction placed on processing of the Work
Object identified by Handle.
See Also:
“VW_BindToUser” on page 272
VW_UnlockAndDispatch
ErrorCode = VW_UnlockAndDispatch (OperationHandle)
Visual Basic
Object Browser
Input Data Type Source
OperationHandle long VW_LockWorkObject( )
Result of Call This API unlocks the Work Object identified by OperationHandle, up-
dates it with any Operation parameters that have returned from data
access1 APIs, and dispatches it to the next Work Queue. It invalidates
OperationHandle.
See Also:
“VW_LockWorkObject” on page 367
VW_UnlockWorkObject
ErrorCode = VW_UnlockWorkObject (OperationHandle)
Visual Basic
Object Browser
Input Data Type Source
OperationHandle long VW_LockWorkObject( )
Result of Call This API unlocks the Work Object identified by OperationHandle, dis-
cards any operation parameters that have returned from data access1
APIs, and leaves it in the Work Queue, unchanged since a call to VW_
LockWorkObject( ) locked it. It invalidates OperationHandle.
See Also:
“VW_LockWorkObject” on page 367
VW_WobQueryCreate
ErrorCode = VW_WobQueryCreate (LogonHandle, WorkClassName,
WobQueryHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
LogonHandle long VW_LogonEx( )
or
VW_Logon
Summary This API creates a query handle to access either of the following:
• Work Objects that are in a specific Work Class and have a specific
Work Object ID value or Work Object number
Note If you specify Work Object number, you need not know which queue
the Work Object is in.
Result of Call This API returns the query handle WobQueryHandle, to use with the
following Work Object query.
• FieldName
An empty string ("“) you provide as a place-holder for the Work Ob-
ject ID
or
Work Object number (as a string), if you are searching for a Work
Object by its number
WorkClassName
VW_WobQueryCreate( )
VW_SetString( )
Work Object ID or number
QueryCountLimit WobQueryHandle
VW_WobQueryExecute( )
QueryCount
3 Call VW_WobQueryExecute( ).
If you called a data access API (steps 1 and 2), the following occur:
- They have the Work Object ID or Work Object number set into
WobQueryHandle by VW_SetString( ).
WorkClassName
VW_WobQueryCreate( )
WobQueryHandle WobQueryHandle
QueryCountLimit
VW_WobQueryExecute( )
QueryCount
Example:
See “Administrative Application Development” on page 64 for sample
code.
See Also:
“VW_WobQueryEnd” on page 468
VW_WobQueryEnd
ErrorCode = VW_WobQueryEnd (WobQueryHandle)
Visual Basic
Object Browser
Input Data Type Source
WobQueryHandle long VW_WobQueryCreate( )
Result of Call This API invalidates WobQueryHandle and frees the resources associ-
ated with it. Call it to release resources allocated by VW_
WobQueryCreate( ).
See Also:
“VW_WobQueryCreate” on page 463
VW_WobQueryExecute
ErrorCode = VW_WobQueryExecute (WobQueryHandle,
QueryCountLimit, QueryCount)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
WobQueryHandle long VW_WobQueryCreate( )
or
VW_SetXXX( )a
Summary This API executes the Work Object query that began with a call to VW_
WobQueryCreate( ). It matches and counts Work Objects, up to a de-
veloper-specified maximum. An index number resulting from the count
may be used in subsequent calls to APIs to find information on a spe-
cific Work Object.
Result of Call This API matches and counts Work Objects identified by WobQuery-
Handle, up to the maximum number you specify in QueryCountLimit,
as follows:
Resulting Count
Specified by WobQueryHandle (output as QueryCount)
A Work Class name only All Work Objects in the Work Class
A Work Class name and a Work Ob- Work Objects that are in the Work Class
ject ID value that have a specific Work Object ID value
Please see “VW_WobQueryCreate” on
page 463 for information on inclusion of
the Work Object ID value.
Tips Before calling VW_WobQueryEnd( ), you can call this API repeatedly
to refresh the list of matching Work Objects.
See Also:
“VW_WobQueryCreate” on page 463
VW_WobQueryGetAccessHandle
ErrorCode = VW_WobQueryGetAccessHandle (WobQueryHandle,
QueryCountIndex, LockForUpdate, WobAccessHandle)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
WobQueryHandle long VW_WobQueryCreate( )
Summary This API returns an access handle to use in changing a Work Object,
with a call to a data access APIs, such as VW_GetInteger( ) or VW_
SetFloat( ).
Result of Call This API returns the access handle WobAccessHandle for use in sub-
sequent calls to the data access APIs when you want to change a
Work Object.
Security
A security error returns unless the logged-on user has access rights to
the Work Object and the queue. Results of the setting choice for Lock-
ForUpdate follow:
See Also:
“VW_BindToUser” on page 272
VW_WobQueryGetWorkObjectName
ErrorCode = VW_WobQueryGetWorkObjectName (WobQueryHan-
dle, QueryCountIndex, WorkObjectName)
Visual Basic
Object Browser
Input/Output Data Type Source
WobQueryHandle long VW_WobQueryCreate( )
WorkObjectName string
Result of Call This API returns in WorkObjectName the name of the Work Object
identified by WobQueryHandle, using QueryCountIndex as a match to
the Work Object query. Call VW_WobQueryExecute( ), prior to calling
this API, to determine the QueryCountIndex of the Work Object. See
“Work Object Index Number” on page 470.
See Also:
“VW_WobQueryCreate” on page 463
VW_WobQueryInstrSheet
ErrorCode = VW_WobQueryInstrSheet (WobQueryHandle, Query-
CountIndex, InstructionSheetName)
Visual Basic
Object Browser
Input/Output Data Type Source
WobQueryHandle long VW_WobQueryCreate( )
InstructionSheetName string
Result of Call This API returns in InstructionSheetName the name of the Instruction
Sheet that Visual WorkFlo is executing to process the Work Object you
identify with QueryCountIndex.
See Also:
“VW_WobQueryCreate” on page 463
Getting Started with Visual WorkFlo for more information about In-
struction Sheets
VW_WobQueryOperation
ErrorCode = VW_WobQueryOperation (WobQueryHandle,
QueryCountIndex, OperationName)
Visual Basic
Object Browser
Input/Output Data Type Source/Destination
WobQueryHandle long VW_WobQueryCreate( )
Result of Call This API returns in OperationName the name of the Operation that
will next process the Work Object you specify with QueryCountIndex.
See Also:
“VW_WobQueryCreate” on page 463
VW_WobQueryWorkPerformerClass
ErrorCode = VW_WobQueryWorkPerformerClass (WobQueryHandle,
QueryCountIndex, WorkPerformerClassName)
Visual Basic
Object Browser
Input/Output Data Type Source
WobQueryHandle long VW_WobQueryCreate( )
WorkPerformerClass string
Name
Summary Use this API to determine which Work Queue a particular Work Object
is in.
Result of Call This API returns in WorkPerformerClassName the name of the Work
Performer Class associated with the Work Queue in which is the Work
Object you specify with QueryCountIndex .
This API uses the following input to identify the Work Object:
• WobQueryHandle
This limits the query to certain Work Objects in a Work Class. See
“VW_WobQueryCreate” on page 463 for more information.
See Also:
“VW_WobQueryCreate” on page 463
Go to
“Set Data” on page 492 Go to “Begin Queue Query” on page 490
Go to
“Create Work Object Query” on page 491
[Listed alphabetically:]
“VW_CheckVersionCompatibility” on page 291
“VW_GetClassFieldNames” on page 318
“VW_GetIsolatedRegion” on page 340
“VW_GetMachineId” on page 341
“VW_GetQueueNames” on page 346
“VW_GetWorkClassNames” on page 355
“VW_GetWorkPerformerClassNames” on page 361
“VW_GetWorkQueueDepth” on page 365
“VW_QueueGetStats” on page 415
“VW_RosterGetStats” on page 423
“VW_SequencedWait” on page 428
ACTIVE WORK PERFORMER
VW_QQ_WANT_TO_LOCK
specified in QueueQueryOptions? No
[Listed alphabetically]
“VW_WobQueryInstrSheet” on page 477
“VW_WobQueryOperation” on page 479
“VW_WobQueryWorkPerformerClass” on page 481
Set Data
[Listed Alphabetically]
“VW_SetArray” on page 439
“VW_SetArrayPtr” on page 441
“VW_SetBoolean” on page 444
“VW_SetField” on page 446
“VW_SetFloat” on page 448
“VW_SetFPNumber” on page 450
“VW_SetInteger” on page 452
“VW_SetTime” on page 456
“VW_SetString” on page 454
Return to:
Get Data
[Listed alphabetically]
“VW_GetArray” on page 307
“VW_GetBoolean” on page 316
“VW_GetDataType” on page 320
“VW_GetDataTypeArray” on page 322
“VW_GetFieldNames” on page 330
“VW_GetFloat” on page 334
“VW_GetFPNumber” on page 336
“VW_GetHandleType” on page 338
“VW_GetInteger” on page 339
“VW_GetTime” on page 352
Return to
“API Calling Sequence” on page 484 (NewWorkObjectHandle)
“Attach to a Work Queue” on page 486 (WorkPerformerHandle)
Administrative or Active Work Performer Application
Get Data
Work Objects
accessing, APIs for 259
binding, APIs for 259
creating (example) 56
creating, APIs for 255
customizing 28
Work Performers
active
for OLE servers 167
opting for 36
choosing passive or active 34
Composer set up 145
Operation reusability 182
passive
converting to OLE automation
client 147
opting for 35
returning data to DLL adaptors 165
VWDLLADP adaptor usage 163
writing to OLE server 148
Work Queue fields
number of 184
WorkFlo Application Library (WAL)
memory areas of 189
workflow view
customizing 39