Professional Documents
Culture Documents
Work Performer Developer'S Guide: Visual Workflo For Windows
Work Performer Developer'S Guide: Visual Workflo For Windows
Work Performer Developer'S Guide: Visual Workflo For Windows
Work Performer
Developer’s Guide
Release 2.0
302010
December 1996
Costa Mesa, California 92626 Due to continuing product development, product specifications
and capabilities are subject to change without notice.
7 14 •96 6•3 40 0 Copyright 1996 FileNet Corporation. All Rights Reserved.
9810821-002
Notices
This document contains information proprietary
to FileNet Corporation (FileNet). You may not
disclose or use any proprietary information or
reproduce any part of this document without
written permission from FileNet.
Education xiv
Adaptors 8
VWOLEADP Adaptor 8
VW.INI File 9
Function Sequences 9
Active Work Performer Function Sequences 10
Command20_Click Procedure 63
Command21_Click Procedure 64
Command22_Click Procedure 64
Command23_Click Procedure 64
Command27_Click Procedure 65
Command28_Click Procedure 66
Command4_Click Procedure 66
Command5_Click Procedure 71
Command6_Click Procedure 72
Command7_Click Procedure 72
Command8_Click Procedure 73
Command9_Click Procedure 74
Form_Load Procedure 74
Form_Unload Procedure 75
VBDateToFNTime Function 75
GetBindings_Click Procedure 75
GetBindingsButton_Click Procedure 75
GetBindingsButtonLocked_Click Procedure 75
GetBindingsButtonLockedButton_Click Procedure 76
GetBindingsNextWObjButton_Click Procedure 76
GetWobSignature_Click Procedure 77
GetWobSignatureLockedButton_Click Procedure 77
UnbindUser_Click Procedure 77
UnBindUserL_Click Procedure 77
WobSignatureButton_Click Procedure 78
WobSignatureLockedButton_Click Procedure 78
GetWobSignatureNextWobjButton_Click Procedure 78
WobSignatureNextWObjButton_Click Procedure 79
C API Calls 88
VW_AttachToWorkQueue 89
VW_BeginBrowsingWorkQueue 91
VW_BindToUser 93
VW_BrmCreateBrowseModifier 94
VW_BrmFreeBrowseModifier 96
VW_BrmSetPreSelectRule 97
VW_BrmSetSelectRule 99
VW_BrmSetSortRules 101
VW_CheckVersionCompatibility 103
VW_CreateWorkObject 105
VW_CurrentException 107
VW_DetachFromWorkQueue 109
VW_DispatchWorkObject 110
VW_EndBrowsingWorkQueue 111
VW_FreeAccessHandle 112
VW_FreeArrayPtr 114
VW_GetAccessHandle 115
VW_GetArrayPtr 117
VW_GetArraySize 119
VW_GetBoolean 121
VW_GetDataType 123
VW_GetDataTypeArray 125
VW_GetErrorMessage 127
VW_GetErrorMessageSize 128
VW_GetFieldNames 129
VW_GetFloat 131
VW_GetFPNumber 133
VW_GetInteger 135
VW_GetLoggingState 137
VW_GetOperationName 139
VW_GetOperationNameSize 140
VW_GetString 141
VW_GetStringSize 143
VW_GetTime 145
VW_GetWobSignature 147
VW_GetWorkPerformerHandle 148
VW_LeaveWork 149
VW_LockWorkObject 150
VW_LogMessage 152
VW_Logoff 154
VW_Logon 155
VW_NextWorkObjectToBrowse 157
VW_RaiseException 158
VW_ReportToWork 160
VW_SetArrayPtr 161
VW_SetBoolean 163
VW_SetFloat 165
VW_SetFPNumber 167
VW_SetInteger 169
VW_SetLogCacheFlushLength 171
VW_SetLoggingState 172
VW_SetString 174
VW_SetTime 176
VW_TerminateWorkObject 178
VW_UnBind 180
VW_UnlockAndDispatch 181
VW_UnlockWorkObject 182
VW_WobQueryCreate 183
VW_WobQueryEnd 185
VW_WobQueryExecute 186
VW_WobQueryGetAccessHandle 188
VW_WobQueryInstrSheet 190
VW_WobQueryOperation 192
VW_WobQueryWorkPerformerClass 194
Glossary 247
Index 263
Describes how to write passive Work Performers that are OLE servers.
Also describes how to write active Work Performers and Visual WorkFlo-
aware programs that use OLE Automation.
Describes requirements for writing a Work Performer that uses the DLL
adaptor. Also provides an alphabetically organized reference of API
functions.
The first time we describe a new term, you'll see it in bold text. A definition for
every bolded term appears in Appendix A.
Italic type indicates the titles of books or manuals recommended for further
information.
When we refer to a session, we mean a single period of time during which you
are running the Visual WorkFlo product.
Related Publications
For more information on Visual WorkFlo, refer to these manuals:
• Installation Handbook
Education
FileNet offers introductory and advanced classes for system administrators,
developers, management, and support personnel. These classes combine
lecture and lab sessions to provide both conceptual understanding of the
FileNet system and practice in its operation. For more information on class
content and schedules, please visit the Education topics in the Services and
Support area of FileNet’s web site (www.filenet.com).
Mike Calvert
Director of Documentation
FileNet Corporation
3565 Harbor Boulevard
Costa Mesa, California 92626-1420
Phone: 714.966.2449
Fax: 714.966.7153
E-mail: calvert@filenet.com
This chapter provides general information about writing Work Performers and
using the API calls. The following topics are discussed:
Note Passive Work Performers that use the VWOLEADP adaptor must be OLE-
enabled (i.e. they must be OLE servers).
• Any program that can use the services of an OLE Automation server or
that can interface with a 16-bit C DLL
Language Adaptor
C/C++ VWDLLADP
WorkFlo Script (WFD 5.0) WFLADAPT
Visual Basic 4.0 VWOLEADP
PowerBuilder 5.0 VWOLEADP
Excel 7.0 VWOLEADP
Note that there is no 32-bit adaptor for Microsoft Word; you will need to find a
solution using the languages and adaptors listed above.
Note Passive Work Performers that use the VWOLEADP adaptor must be OLE-
enabled (i.e. they must be OLE servers).
• Any program that can use the services of an OLE Automation server or
interface with a 32-bit C DLL
You should consider the following points when designing Work Performers:
• Reusability
• Are generally suitable for unattended tasks that do not require interaction
with the user.
• Are usually started and stopped by the user, not Visual WorkFlo/
Performer. Active Work Performers associated with a role are started by
Visual WorkFlo/Performer. See the Visual WorkFlo/Performer Handbook
for more information on roles.
• Use API calls to obtain the Operation name and Work Object handle.
Searching for a Work Object or sorting the Work Objects is more efficient
when the queues are shallow because there are fewer entries to search
through or sort.
Work Queue fields are copies of Work Object data fields that are used in
entry, pre-selection, selection, and sort rules. They are also used by active
Work Performers for browsing queues.
Because Visual WorkFlo must queue work between execution of each Work
Performer Operation, small-grained Operations can result in poor
performance. However, the larger the granularity of the Operation, the more
specific and less reusable the Operation becomes.
Reusability
Whenever possible, Work Performer Operations should be reusable without
sacrificing effectiveness by making them too general. If Operations are
reusable, Work Performers are smaller and easier to maintain and
development of new business processes is faster. Remember to consider
performance implications as mentioned in the previous section.
Validation Checking
Your Work Performer should validate Work Performer data fields, Operation
parameters, and Work Queue fields before using them. Verify that numeric
values are within the acceptable ranges and strings are not unexpectedly null.
Your Work Performer should contain code for exception conditions that might
occur while processing a Work Object. Work Performers might need to call the
Malfunction Instruction Sheet to handle invalid data problems. You might also
need to create new Instruction Sheets to handle specific data errors.
We recommend that you maintain a list of these elements and keep it handy
as you develop your Work Performers. The following example shows a table
used for this purpose.
WP_Name: SampleWP_1
Visual
Parameter WorkFlo
Operation Name Native type type Mode
Operation1 Parameter_1 long integer in
Parameter_2 double float out
Parameter_3 char * string in
Parameter_4 BOOL boolean inout
Operation2 Parameter_1 long integer in
Parameter_2 BOOL boolean inout
Newly–
Passive Active created Work
Work Work Object initial Data
Language Performer Performer values Types
DLLs Yes Yes, via API Yes, via API All
calls calls
WorkFlo Script Yes Yes Yes All
OLE Yes Yes Yes None
Any language that can .DLL A directory specified in the path command in
interface with a 32-bit C DLL the AUTOEXEC.BAT file (see your Microsoft
DOS documentation for more information)
WorkFlo Script .WFL A directory designated in the Search Path in
the LOGON.CFG file (see the WorkForce
Coordinator’s Handbook for more information)
OLE server .Class1. The file name The registry is used to locate the executable
is the Work Performer file.
class name for the
OLE server.
Adaptors
Passive Work Performers use adaptors to communicate with Visual WorkFlo.
The following description of adaptors is provided for information purposes
only; it is unlikely that you will need to write an adaptor or know the details of
adaptors.
Adaptors contain four entry points: adaptorType, start, perform, and stop.
The adaptorType entry point establishes the type of this particular adaptor.
Currently, only one type of adaptor is supported: C2.
The start entry point initiates a conversation between the Visual WorkFlo
software and the Work Performer. It is responsible for loading any executable
files, DLLs, etc., necessary to run the Work Performer Operation. Once
running, this conversation continues until the stop entry point is called.
When the Work Object dispatch software determines that a Work Object
needs a particular Work Performer, it calls the perform entry point. The
adaptor can assume responsibility for getting and setting parameters or make
the Work Performer responsible for getting and setting parameters.
The stop entry point terminates the conversation initiated with the start entry
point. It disconnects the Work Performer from Visual WorkFlo and informs the
dispatch software that the Work Performer is no longer available.
VWOLEADP Adaptor
The VWOLEADP adaptor is an OLE Automation controller. The Work
Performers that use VWOLEADP are OLE Automation servers. VWOLEADP
calls the appropriate method exposed by the Work Performer, passing it all of
the required parameters.
VW.INI File
An appropriately named adaptor section is required in the VW.INI file for every
adaptor that uses DDE to communicate with Work Performers.
Each adaptor section specifies a DDE timeout that is the number of seconds
that can elapse before the DDE connection times out. This setting represents
the maximum amount of time during which the Work Performer must complete
processing the Work Object.
Each adaptor section can also specify a connect timeout value. This value
specifies the number of seconds allowed for the Work Performer to start
before failure occurs due to a DDE connection timeout.
See the Installation Handbook for Windows for more information on the
VW.INI file.
Function Sequences
This section provides diagrams showing the order in which the different APIs
must be called. The shaded boxes in the diagrams are shown in more detail in
subsequent diagrams.
The function sequence diagrams are divided into the following three
categories:
VW_Logon()
VW_AttachToWorkQueue()
VW_DetachFromWorkQueue()
VW_Logoff()
VW_ReportToWork()
VW_BrmCreateBrowseModifier()
VW_GetLoggingState() VW_BrmSetPreSelectRule()
VW_BrmSetSelectRule()
VW_BrmSetSortRules()
VW_LogMessage()
VW_BeginBrowsingWorkQueue()
VW_SetLoggingState()
VW_NextWorkObjectToBrowse()
VW_GetOperationNameSize()
VW_GetOperationName()
VW_EndBrowsingWorkQueue()
*VW_BrmFreeBrowseModifier()
VW_LockWorkObject()
VW_TerminateWorkObject()
VW_CurrentException()
VW_UnlockWorkObject()
or
VW_UnlockAndDispatch()
In any of the active Work Performer function sequence diagrams, the following
APIs can be called at any point:
• VW_GetErrorMessageSize()
• VW_GetErrorMessage()
• VW_CheckVersionCompatibility()
• VW_SetLogCacheFlushLength()
See “Data Access API Calls” on page 23 for a list of set data and get data
functions.
• Work Performers that use API calls to get and set parameters.
Adaptor Interface
VW_TerminateWorkObject()
VW_CurrentException()
VW_GetWorkPerformerHandle()
VW_GetLoggingState()
VW_SetLoggingState()
VW_RaiseException()
End of Operation
Operation Handle
from Adaptor
VW_GetOperationNameSize()
VW_GetOperationName()
Log a message
VW_RaiseException()
VW_CurrentException()
End of Operation
Function Sequences of Work Performers that use API calls to access parameters
Log a message
VW_GetWorkPerformerHandle()
VW_GetLoggingState()
VW_SetLoggingState()
VW_LogMessage()
• VW_GetErrorMessageSize()
• VW_GetErrorMessage()
• VW_CheckVersionCompatibility()
• VW_SetLogCacheFlushLength()
See “Data Access API Calls” on page 23 for a list of set data and get data
functions.
VW_Logon()
VW_CreateWorkObject()
VW_DispatchWorkObject()
VW_Logoff()
The next diagram shows the function sequence for locating a Work Object and
obtaining information about a Work Object:
VW_Logon()
VW_WobQueryCreate()
VW_WobQueryExecute()
VW_WobQueryWorkPerformerClass()
VW_WobQueryOperation()
VW_WobQueryInstrSheet()
VW_WobQueryGetAccessHandle()
*VW_FreeAccessHandle()
VW_WobQueryEnd()
VW_Logoff()
Note that you do not have to make calls to all of the query functions; you can
call one or more of the following functions:
• VW_WobQueryWorkPerformerClass()
• VW_WobQueryOperation()
• VW_WobQueryInstrSheet()
• VW_WobQueryGetAccessHandle()
This section provides a brief description of the API calls, organized into usage
categories.
This section also describes the calls in the VBSVCAPI.DLL that can be called
from a 16-bit Visual Basic Work Performer.
The Work Queue pre-selection rule is processed on the server at the time the
queue is browsed. The selection rule is processed on the client at the time the
queue is browsed, after the server has completed its processing. The sort
rules are processed as follows:
• If there are no Work Performer fields specified in any sort expressions, the
sort rules are evaluated by the client before insertion.
For more information about pre-selection rules, selection rules, and sort rules,
see the “Specify Work Queue Rules” section in the “Creating and Modifying
Work Performer Classes” chapter of the Visual WorkFlo/Composer
Handbook.
Failure to call the second function in an API pair can cause unexpected
behavior. During debugging, you might want to modify your Work Performer to
provide a button on the user interface that, when clicked, will call the
appropriate functions for the API pairs.
Message Logging
The message logging facilities can be used to help debug Work Performers.
VW_LogMessage() writes a user-defined message to the History Repository.
You can log messages to display what your Work Performer is doing or to log
serious errors.
The message is only written to the History Repository if the specified logging
option is ON (1) in both the Work Performer’s set of logging options and the
client logging vector defined in the VW.INI file. The message only stays in the
active portion of the History Repository until the Work Object is terminated, at
which time it is purged from the active repository. The message may be
moved from the active to the inactive repository depending on the options set
in Visual WorkFlo/Composer. For more information on logging, see the
“Logging Features” section in the “Creating a Visual WorkFlo Application”
chapter of the Visual WorkFlo/Composer Handbook.
You can also have each API call logged to a file. You must turn ON the
LogSvcApiCalls option in the [LogFile] section of the VW.INI file. API calls are
only logged if the LogToFile entry in the [LogFile] section is also ON. Note that
output parameters are not logged for VBSVCAPI calls.
Each API call is logged along with its input parameters when the function is
called. Each API call is also logged when the function exits, along with its
output parameters. API calls are separated by lines of equal signs (“=”) in the
log file.
For more information on logging API calls, see the Installation Handbook for
Windows.
Using NDump
NDump is a Work Performer that dumps the contents of each field in a Work
Object to the file NDUMP.LOG. The NDUMP.LOG file will need to be
periodically removed or truncated to avoid consuming large amounts of disk
space.
Before you can use NDump in an Instruction Sheet, you must create a Work
Performer class with a single Operation. For example, the Work Performer
class could be NDumpWP and the name of the Operation NDump. The
NDump Operation has no parameters.
After you have created the NDumpWP class, you must also specify the
adaptor name (NDUMP.DLL) and the executable script name (also
NDUMP.DLL) in the Properties editor tab.
See the “Creating and Modifying Work Performer Classes” chapter in the
Visual WorkFlo/Composer Handbook for more information on creating a Work
Performer class and specifying an adaptor and executable file.
The following sample output shows the NDump output for a work object of
type DelayedWO00.
string1 yes
string2
string3
time1 1/1/1995 00:01:00
boolean1 true
integer1 2
SerialNumber 2001
float1 2
LoggingVector 0
string1 yes
string2
string3
time1 1/1/1995 00:01:00
boolean1 true
integer1 2
SerialNumber 2002
float1 2
LoggingVector 0
This chapter also shows example code for active and passive Work
Performers.
Visual WorkFlo
Parameter Type OLE Data Type
Arrays Variant
String String
Time Long
Integer Long
Float Double
Boolean Boolean
After you have developed an OLE server, you must create a corresponding
Work Performer class with operations defined for each publicly exposed
method of the OLE server. See the Visual WorkFlo/Composer Handbook for
more information on creating a Work Performer Class.
The ProgId for an OLE server is used in composer to identify the Work
Performer. The ProgId is generated automatically for most development
environments. Refer to the documentation for your development environment
to determine what the ProgId will be.
Note A passive Work Performer that is an OLE server can be either an In-Process
or Out-of-Process server.
If the Work Performer returns TRUE, the inout and out parameter values are
copied back into the Work Object and the Work Object is dispatched to the
next Instruction.
If the Work Performer returns FALSE, parameter values are not copied to the
Work Object and the Work Object is routed to the Malfunction Instruction
Sheet.
copied to another work station from the one it was built on, it must be run to
register itself.
See “A Passive Work Performer that Uses OLE” on page 48 for an example of
a simple passive Work Performer that uses VWOLEADP.DLL.
To convert a Work Performer from Visual Basic 3.0 to Visual Basic 4.0:
This allows WorkFlo Controls for Visual Basic VBXs to be converted to the
new OCX controls. Forms saved in binary format cannot be converted. You
must have already loaded WorkFlo Controls for Visual Basic 5.0 to do the
conversion.
2 Load the project into Visual Basic 4.0. Allow Visual Basic to upgrade all VBXs
to OCXs.
2 Select Options from the Tools Menu, then select the Project tab. Change
StartMode from Standalone to OLE Server. Change Project Name to the
Work Performer class name defined in the image file.
4 Select Properties in the View menu. Set the Class1 properties as follows:
Name: Class1
Public: True
The names of the subroutines must be the same as the Operation names.
Parameters must be in the same order as the Visual WorkFlo Operation fields.
In parameters should be ByVal. Out and InOut parameters should be ByRef.
Visual WorkFlo Boolean types are now defined in Visual Basic as Boolean
(instead of Integer). An error will occur if the parameter types do not match.
9 Remove the Load of Visual WorkFlo form from the default form Load
procedure.
10 Define the VWServer object in a standard module file (.BAS file), as follows:
This is only required if the Work Performer makes Visual WorkFlo API calls.
This is only required when the Work Performer makes Visual WorkFlo API
calls. Do not put the CreateObject call in the Startup form or module; this will
hang Visual WorkFlo/Performer.
This allows WorkFlo Controls for Visual Basic VBXs to be converted to the
new OCX controls. Forms saved in binary format cannot be converted. You
must have already loaded WorkFlo Controls for Visual Basic 5.0 to do the
conversion.
2 Load the project into Visual Basic 4.0. Allow Visual Basic to upgrade all VBXs
to OCXs.
3 Create the OLE Automation object in the form Load procedure, as follows:
5 Remove the OLE Automation object in the form Unload procedure, as follows:
• The following API calls that have array parameters no longer have a
parameter that specifies the array length:
VW_BrmSetSortRules()
VW_CurrentException()
VW_GetFieldNames()
VW_GetArray()
VW_SetArray()
The following function definitions are from the type library source for
VWApiSrv.exe. The calls are listed in alphabetical order.
• A VW_BrmSetSortRules() example
VW_BrmSetSortRules() Example
Private Sub Form_Load()
wpName = "VBCalc"
SortRules(0) = "SerialNumber"
SortRuleLengs(0) = 40
ErrorCode = VWApiSrv.VW_Logon(logonId)
ErrorCode = VWApiSrv.VW_AttachToWorkQueue(logonId, wpName, wqId)
ErrorCode = VWApiSrv.VW_ReportToWork(wqId, wpId)
ErrorCode = VWApiSrv.VW_EndBrowsingWorkQueue(browseId)
ErrorCode = VWApiSrv.VW_LeaveWork(wpId)
ErrorCode = VWApiSrv.VW_DetachFromWorkQueue(wqId)
ErrorCode = VWApiSrv.VW_VW_Logoff(logonId)
End Sub
This figure shows the initial screen of the active Work Performer:
After you click the execute button once, the screen appears as follows:
When you click Execute a third time, the screen appears as follows:
The remainder of this section shows the active Work Performer code,
including the Execute_Click procedure that implements the three Operations.
Execute_Click Procedure
Private Sub Execute_Click()
Call check(anObject.VW_BeginBrowsingWorkQueue(reportId, browseId, 0, numObjects,
➥ browseModHandle), "VW_Logon")
theStatusLine.Caption = opName
theListBox.Clear
Next Index
End If
anInteger = anInteger + 1
Call check(anObject.VW_SetInteger(lockId, "anInteger", anInteger), "VW_SetInteger")
aBoolean = aBoolean + 1
Call check(anObject.VW_SetBoolean(lockId, "aBoolean", aBoolean), "VW_SetBoolean")
aFloat = aFloat + 1
Call check(anObject.VW_SetFloat(lockId, "aFloat", aFloat), "VW_SetFloat")
aTime = aTime + 1
Call check(anObject.VW_SetTime(lockId, "aTime", aTime), "VW_SetTime")
ReDim anIntegerArray(0)
anIntegerArray(0) = 9
Call check(anObject.VW_SetArray(lockId, "anIntegerArray", anIntegerArray, 0),
➥ "VW_SetArray")
ReDim aBooleanArray(0)
aBooleanArray(0) = 9
Call check(anObject.VW_SetArray(lockId, "aBooleanArray", aBooleanArray, 3),
➥ "VW_SetArray")
ReDim aFloatArray(0)
aFloatArray(0) = 9
Call check(anObject.VW_SetArray(lockId, "aFloatArray", aFloatArray, 1), "VW_SetArray")
ReDim aTimeArray(0)
aTimeArray(0) = 9
Call check(anObject.VW_SetArray(lockId, "aTimeArray", aTimeArray, 4), "VW_SetArray")
ReDim aStringArray(0)
aStringArray(0) = "xxx"
Call check(anObject.VW_SetArray(lockId, "aStringArray", aStringArray, 2), "VW_SetArray")
End If
End Sub
check Procedure
Private Sub check(ByVal errorCode As Long, ByVal message As String)
If (errorCode <> 0) Then
'Static errMsg As String * 255
Dim errMsg As String
Dim errorError As Long
errorError = anObject.VW_GetErrorMessage(errorCode, errMsg)
MsgBox message & ", " & Str$(errorCode) & ", " & errMsg
End If
End Sub
Form_Load Procedure
Private Sub Form_Load()
Set anObject = CreateObject("VWApi.Srv")
End Sub
Form_Unload Procedure
Private Sub Form_Unload( Cancel As Integer)
End Sub
This figure shows the Workflow Instruction Sheet for the OLETest Work Class:
The remainder of this section shows the code for the three Operations.
dataIn Function
Public Function dataIn(ByVal anInteger As Long,
➥ByVal aBoolean As Boolean,
➥ByVal aTime As Long,
➥ByVal aFloat As Double,
➥ByVal aString As String,
➥ByVal anIntegerArray As Variant,
➥ByVal aBooleanArray As Variant,
➥ByVal aTimeArray As Variant,
➥ByVal aFloatArray As Variant,
➥ByVal aStringArray As Variant) As Boolean
Form1.theListBox.Clear
Next Index
dataIn = True
End Function
dataInOut Procedure
Public Sub dataInOut(ByRef anInteger As Long,
➥ByRef aBoolean As Boolean,
➥ByRef aTime As Long,
➥ByRef aFloat As Double,
➥ByRef aString As String,
➥ByRef anIntegerArray As Variant,
➥ByRef aBooleanArray As Variant,
➥ByRef aTimeArray As Variant,
➥ByRef aFloatArray As Variant,
➥ByRef aStringArray As Variant)
Form1.theListBox.Clear
aFloat = aFloat + 1
End Sub
dataOut Procedure
Public Sub dataOut(ByRef anInteger As Long,
➥ByRef aBoolean As Boolean,
➥ByRef aTime As Long,
➥ByRef aFloat As Double,
➥ByRef aString As String,
➥ByRef anIntegerArray As Variant,
➥ByRef aBooleanArray As Variant,
➥ByRef aTimeArray As Variant,
➥ByRef aFloatArray As Variant,
➥ByRef aStringArray As Variant)
anInteger = anInteger + 1
aTime = aTime + 1
aFloat = aFloat + 1
ReDim anIntegerArray(1)
For Index = 0 To UBound(anIntegerArray)
anIntegerArray(Index) = 9
Next Index
ReDim aBooleanArray(1)
For Index = 0 To UBound(aBooleanArray)
aBooleanArray(Index) = True
Next Index
ReDim aTimeArray(1)
For Index = 0 To UBound(aTimeArray)
aTimeArray(Index) = 9
Next Index
ReDim aFloatArray(1)
For Index = 0 To UBound(aFloatArray)
aFloatArray(Index) = 9
Next Index
ReDim aStringArray(1)
For Index = 0 To UBound(aStringArray)
aStringArray(Index) = "xyz"
Next Index
Form1.theListBox.Clear
End Sub
cmdGetNextLetter_Click Procedure
Private Sub cmdGetNextLetter_Click()
If lockId <> 0 Then
Call check(anObject.VW_UnlockAndDispatch(lockId), "VW_UnlockAndDispatch")
lockId = 0
Call check(anObject.VW_EndBrowsingWorkQueue(browseId),
➥"VW_EndBrowsingWorkQueue")
WordObject.FileClose 2
End If
WordObject.EditGoto "CustAddress1"
WordObject.Insert CustAddress1
WordObject.EditGoto "CustAddress2"
WordObject.Insert CustAddress2
WordObject.EditGoto "CityStateZip"
WordObject.Insert CityStateZip
WordObject.EditGoto "LoanNum"
WordObject.Insert LoanNum
WordObject.EditGoto "CustName"
WordObject.Insert CustName
WordObject.EditGoto "MonthlyPay"
WordObject.Insert Str(MonthlyPay)
Else 'txtOperation.Text = "Denial"
Call check(anObject.VW_GetInteger(lockId, "ioprDenyReasonCode", DenyReasonCode),
➥"VW_GetInteger")
WordObject.FileOpen "c:\vw demos\loanapp\workperf\active\winword\rejctltr.doc"
WordObject.EditGoto "CustAddress1"
WordObject.Insert CustAddress1
WordObject.EditGoto "CustAddress2"
WordObject.Insert CustAddress2
WordObject.EditGoto "CityStateZip"
WordObject.Insert CityStateZip
WordObject.EditGoto "CustName"
WordObject.Insert CustName
WordObject.EditGoto "ReasonCode"
WordObject.Insert Str(DenyReasonCode)
End If
Else
txtOperation.Text = "No letters waiting."
End If
End Sub
Form_Load Procedure
Private Sub Form_Load()
Set anObject = CreateObject("VWApi.Srv")
Call check(anObject.VW_Logon(logonId), "VW_Logon")
Call check(anObject.VW_AttachToWorkQueue(logonId, "Letters", wqId),
➥"VW_AttachToWorkQueue")
Call check(anObject.VW_ReportToWork(wqId, reportId), "VW_ReportToWork")
Form_Unload Procedure
Private Sub Form_Unload(Cancel As Integer)
If lockId <> 0 Then
Call check(anObject.VW_UnlockAndDispatch(lockId), "VW_UnlockAndDispatch")
lockId = 0
Call check(anObject.VW_EndBrowsingWorkQueue(browseId),
➥"VW_EndBrowsingWorkQueue")
WordObject.FileClose 2
End If
check Procedure
Private Sub check(ByVal errorCode As Long, ByVal message As String)
If (errorCode <> 0) Then
'Static errMsg As String * 255
Dim errMsg As String
Dim errorError As Long
errorError = anObject.VW_GetErrorMessage(errorCode, errMsg)
MsgBox message & ", " & Str$(errorCode) & ", " & errMsg
End If
End Sub
check Procedure
Private Sub check(ByVal errorCode As Long, ByVal message As String)
If (errorCode <> 0) Then
Static errMsg As String
Dim errorError As Long
errorError = apisrv.VW_GetErrorMessage(errorCode, errMsg)
MsgBox message & ", " & Str$(errorCode) & ", " & errMsg
'Stop
End If
End Sub
BindToUser_Click Procedure
Private Sub BindToUser_Click()
Dim theUserName As String
Command1_Click Procedure
Private Sub Command1_Click()
Command1.Enabled = False
brModHandle = 0
Dim success As Double
Command2.Enabled = True
Command7.Enabled = True
Command27.Enabled = True
Command8.Enabled = False
Command9.Enabled = False
End Sub
Command11_Click Procedure
Private Sub Command11_Click()
Dim success As Double
Dim anInteger As Long
Dim aFloat As Double
Dim theString As String
Dim aString As String
lock_ForUpdate = LockForUpdate.Value
End If
End Sub
Command13_Click Procedure
Private Sub Command13_Click()
Dim anInteger As Long
Dim aString As String
' Get an Integer Field
Call check(apisrv.VW_GetInteger(wobAccessHandle, "integerA", anInteger), "VW_GetInteger")
aString = Str$(anInteger)
MsgBox "The integer is: " & aString
End Sub
Command14_Click Procedure
Private Sub Command14_Click()
Dim OutputIntegerArray As Variant
' Get an Integer Array Field
ReDim OutputIntegerArray(2) As Long
OutputIntegerArray(0) = 0
OutputIntegerArray(1) = 0
OutputIntegerArray(2) = 0
Call check(apisrv.VW_GetArray(wobAccessHandle, "arrayA", OutputIntegerArray, 0),
➥"VW_GetArray")
Dim intArrayString As String
intArrayString = "{"
Dim i
For i = 0 To 2
intArrayString = intArrayString + Str$(OutputIntegerArray(i)) + " "
Next i
intArrayString = intArrayString + "}"
MsgBox "The integer array is : " & intArrayString
End Sub
Command16_Click Procedure
Private Sub Command16_Click()
Dim aFloat As Double
Dim aString As String
' Get a Float Field
Call check(apisrv.VW_GetFloat(wobAccessHandle, "floatA", aFloat), "VW_GetFloat")
aString = Str$(aFloat)
MsgBox "The float is: " & aString
End Sub
Command17_Click Procedure
Private Sub Command17_Click()
Dim OutputStringArray As Variant
' Get a string array field
ReDim OutputStringArray(2) As String
OutputStringArray(0) = ""
OutputStringArray(1) = ""
OutputStringArray(2) = ""
Call check(apisrv.VW_GetArray(wobAccessHandle, "stringArray", OutputStringArray, 2),
➥"VW_GetArray")
Dim theArrayString As String
theArrayString = "{"
Dim j
For j = 0 To 2
theArrayString = theArrayString + OutputStringArray(j) + " "
Next j
theArrayString = theArrayString + "}"
MsgBox "The string array is : " & theArrayString
End Sub
Command18_Click Procedure
Private Sub Command18_Click()
Dim aString As String
' Get a String Field
Call check(apisrv.VW_GetString(wobAccessHandle, "stringA", aString), "VW_GetString")
MsgBox "The string is: " & aString
End Sub
Command19_Click Procedure
Private Sub Command19_Click()
Dim aString As String
Dim anInteger As Integer
Dim success As Double
' Change an integer field
aString = InputBox("Input integer", "VBStr (active)")
anInteger = Val(aString)
success = apisrv.VW_SetInteger(wobAccessHandle, "integerA", anInteger)
If success <> 0 Then
MsgBox "SetInteger failed: error code = " & Str$(success)
End If
End Sub
Command2_Click Procedure
Private Sub Command2_Click()
Dim success As Double
Dim browseCount As Long
Dim more As Double
Dim count As Integer
Dim serviceName As String
Dim strA As String, intA As Long
more = 0
count = 0
While (more = 0) And (count < 10) And (success = 0)
count = count + 1
more = apisrv.VW_NextWorkObjectToBrowse(browseId, workObjectIds(count))
If (more = 0) Then
Call check(apisrv.VW_GetOperationName(workObjectIds(count), serviceName),
➥"GetOperationName")
' Call check(VB_VW_GetString(workObjectIds(count), "stringA", strA),
➥"VB_VW_GetString")
' Call check(VW_GetInteger(workObjectIds(count), "integerA", intA), "VW_GetInteger")
List1.AddItem serviceName
End If
Wend
Command3.Enabled = True '
Command6.Enabled = True
Command8.Enabled = True
Command9.Enabled = True
Command11.Enabled = False
Command27.Enabled = False
Command28.Enabled = False
End Sub
Command20_Click Procedure
Private Sub Command20_Click()
Dim theString As String
Dim success As Double
' Change a string field
theString = InputBox("Input string", "VBStr (active)")
Call check(apisrv.VW_SetString(wobAccessHandle, "stringA", theString), "VW_SetString")
End Sub
Command21_Click Procedure
Private Sub Command21_Click()
Dim aString As String
Dim aFloat As Double
Dim success As Double
' Change a float field
aString = InputBox("Input float", "VBStr (active)")
aFloat = CDbl(aString)
Call check(apisrv.VW_SetFloat(wobAccessHandle, "floatA", aFloat), "VW_SetFloat")
End Sub
Command22_Click Procedure
Private Sub Command22_Click()
Dim InputIntegerArray As Variant
' Change an Integer array
ReDim InputIntegerArray(2) As Long
InputIntegerArray(0) = anInteger
InputIntegerArray(1) = anInteger + 1
InputIntegerArray(2) = anInteger + 12
Call check(apisrv.VW_SetArray(wobAccessHandle, "arrayA", InputIntegerArray, 0),
➥"VW_SetArray")
End Sub
Command23_Click Procedure
Private Sub Command23_Click()
Dim InputStringArray As Variant
' Change a string array
ReDim InputStringArray(2) As String
InputStringArray(0) = Str$(aFloat)
InputStringArray(1) = theString
InputStringArray(2) = Str$(anInteger)
Call check(apisrv.VW_SetArray(wobAccessHandle, "stringArray", InputStringArray, 2),
➥"VW_SetArray")
End Sub
Command27_Click Procedure
Private Sub Command27_Click()
Dim success As Double
Dim browseCount As Long
Dim count As Long
Dim theOperationName As String * 20
Command28_Click Procedure
Private Sub Command28_Click()
Dim success As Double
Call check(apisrv.VW_WobQueryEnd(wobQueryHandle), "VW_WobQueryEnd")
List1.Clear
Command2.Enabled = True
Command3.Enabled = False
Command6.Enabled = False
Command28.Enabled = False
Command11.Enabled = False
Command8.Enabled = False
'Command9.Enabled = False
End Sub
Command4_Click Procedure
Private Sub Command4_Click()
Dim success As Double
Else
MsgBox "OutputString: " & outputString
End If
Else
MsgBox "Unsupported service"
End If
ExitError:
Command4.Enabled = False
End Sub
Command5_Click Procedure
Private Sub Command5_Click()
Dim success As Double
Dim serviceComplete As Integer
serviceComplete = Check1.Value
Command6_Click Procedure
Private Sub Command6_Click()
Dim success As Double
success = apisrv.VW_EndBrowsingWorkQueue(browseId)
If success = 0 Then
List1.Clear
Command2.Enabled = True
Command27.Enabled = True
Command3.Enabled = False
Command6.Enabled = False
Command8.Enabled = False
'Command9.Enabled = False
Else
MsgBox "EndBrowsingWorkQueue failed: error code = " & Str$(success)
End If
End Sub
Command7_Click Procedure
Private Sub Command7_Click()
Dim success As Double
success = apisrv.VW_LeaveWork(workerId)
If success = 0 Then
List1.Clear
Command1.Enabled = True
Command3.Enabled = False
Command2.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Command8.Enabled = False
Command9.Enabled = False
Command27.Enabled = False
Else
MsgBox "LeaveWork failed: error code = " & Str$(success)
End If
Call check(apisrv.VW_DetachFromWorkQueue(queueId), "VW_DetachFromWorkQueue")
Call check(apisrv.VW_Logoff(loginId), "VW_Logoff")
End Sub
Command8_Click Procedure
Private Sub Command8_Click()
lock_ForUpdate = LockForUpdate.Value
If List1.ListIndex < 0 Then
MsgBox "You must first select a workObject."
Else
workObjectIndex = CLng(List1.ListIndex + 1)
Call check(apisrv.VW_GetAccessHandle(workObjectIds(workObjectIndex), lock_ForUpdate,
➥wobAccessHandle), "VW_GetAccessHandle")
Command8.Enabled = False
Command11.Enabled = False
Command13.Enabled = True
Command14.Enabled = True
Command15.Enabled = True
Command16.Enabled = True
Command17.Enabled = True
Command18.Enabled = True
Command19.Enabled = True
Command20.Enabled = True
Command21.Enabled = True
Command22.Enabled = True
Command23.Enabled = True
Command24.Enabled = True
BindToUser.Enabled = True
UnbindUser.Enabled = True
End If
End Sub
Command9_Click Procedure
Private Sub Command9_Click()
save_Updates = SaveUpdates.Value
skip_CurrentInstruction = SkipCurrentInstruction.Value
Call check(apisrv.VW_FreeAccessHandle(wobAccessHandle, save_Updates,
➥skip_CurrentInstruction, "next instr"), "VW_GetAccessHandle")
Command8.Enabled = True
Command9.Enabled = True
Command13.Enabled = False
Command14.Enabled = False
Command15.Enabled = False
Command16.Enabled = False
Command17.Enabled = False
Command18.Enabled = False
Command19.Enabled = False
Command20.Enabled = False
Command21.Enabled = False
Command22.Enabled = False
Command23.Enabled = False
Command24.Enabled = False
BindToUser.Enabled = False
UnbindUser.Enabled = False
End Sub
Form_Load Procedure
Private Sub Form_Load()
Set apisrv = CreateObject("VWApi.Srv")
End Sub
Form_Unload Procedure
Private Sub Form_Unload(Cancel As Integer)
Set apisrv = Nothing
End
End Sub
VBDateToFNTime Function
Private Function VBDateToFNTime(vbDate)
VBDateToFNTime = DateDiff("s", "1-Jan-70", vbDate)
End Function
GetBindings_Click Procedure
Private Sub GetBindings_Click()
End Sub
GetBindingsButton_Click Procedure
Private Sub GetBindingsButton_Click()
Dim theUserName As String
Dim theMachineId As String
GetBindingsButtonLocked_Click Procedure
Private Sub GetBindingsButtonLocked_Click()
Dim theUserName As String
Dim theMachineId As String
MsgBox (theMachineId)
End Sub
GetBindingsButtonLockedButton_Click Procedure
Private Sub GetBindingsButtonLockedButton_Click()
Dim theUserName As String
Dim theMachineId As String
GetBindingsNextWObjButton_Click Procedure
Private Sub GetBindingsNextWObjButton_Click()
Dim success As Double
Dim exName As String
Dim exDesc As String
Dim theUserName As String
Dim theMachineId As String
GetWobSignature_Click Procedure
Private Sub GetWobSignature_Click()
Dim wobSignature As String
wobSignature = "None"
Call check(apisrv.VW_GetWobSignature(wobAccessHandle, wobSignature),
➥"VW_GetWobSignature")
MsgBox (wobSignature)
End Sub
GetWobSignatureLockedButton_Click Procedure
Private Sub GetWobSignatureLockedButton_Click()
Dim wobSignature As String
wobSignature = "None"
Call check(apisrv.VW_GetWobSignature(lockId, wobSignature), "VW_GetWobSignature")
MsgBox (wobSignature)
End Sub
UnbindUser_Click Procedure
Private Sub UnbindUser_Click()
Call check(apisrv.VW_UnBind(wobAccessHandle), "VW_UnBind WObjQuery")
End Sub
UnBindUserL_Click Procedure
Private Sub UnBindUserL_Click()
Call check(apisrv.VW_UnBind(lockId), "VW_UnBind Locked WObj")
End Sub
WobSignatureButton_Click Procedure
Private Sub WobSignatureButton_Click()
Dim wobSignature As String
wobSignature = "None"
Call check(apisrv.VW_GetWobSignature(wobAccessHandle, wobSignature),
➥"VW_GetWobSignature")
MsgBox (wobSignature)
End Sub
WobSignatureLockedButton_Click Procedure
Private Sub WobSignatureLockedButton_Click()
Dim wobSignature As String
wobSignature = "None"
Call check(apisrv.VW_GetWobSignature(lockId, wobSignature), "VW_GetWobSignature")
MsgBox (wobSignature)
End Sub
GetWobSignatureNextWobjButton_Click Procedure
Private Sub GetWobSignatureNextWobjButton_Click()
Dim success As Double
Dim exName As String
Dim exDesc As String
Dim wobSignature As String
If List1.ListIndex < 0 Then
MsgBox "You must first select a workObject."
Else
workObjectIndex = CLng(List1.ListIndex + 1)
Call check(apisrv.VW_GetWobSignature(workObjectIds(workObjectIndex), wobSignature),
➥"VW_GetWobSignature")
MsgBox (wobSignature)
End If
End Sub
WobSignatureNextWObjButton_Click Procedure
Private Sub WobSignatureNextWObjButton_Click()
Dim success As Double
Dim exName As String
Dim exDesc As String
Dim wobSignature As String
• the data conversion that occurs between ‘C’ data types and Visual
WorkFlo data types.
We assume you are familiar with the ‘C’ programming language. We also
assume you have a basic understanding of the Visual WorkFlo concepts
relating to Work Performers and their Operations.
Note SVCAPI.LIB files are provided for Microsoft C and Borland C compilers. If you
are using a different compiler, refer to the user guide for your compiler to
determine how to create a compatible .LIB file from the Borland DLLs.
The cdecl calling convention is used. All functions called return no value (that
is, have “void” results). All callable functions must be exported and have
proper Windows pre- and post-ambles. All parameters are passed in the order
declared during authoring; the names of the parameters are not used in the
actual call, so can be anything that the author wishes. Your code should
include svcapi.h.
To author calls to a DLL, enter the adaptor name (in the Properties editor of
the Work Performer class browser in Visual WorkFlo/Composer) as
VWDLLADP.DLL.
The script name (entered in the same editor) must be the name of the DLL
that contains the Operations to call. Each Operation name must exactly match
the name of the entry point of the DLL that is to be called.
When result parameters are returned from the Work Performer to this adaptor,
the parameters passed in are of the following types:
The Work Performer must store the result values via the passed in pointers.
Strings must have the data allocated via HeapAlloc using the default process
heap (obtained by a call to GetProcessHeap) and the pointer to the memory
area returned (the string must be null terminated).
Inout parameters are passed as result (out) parameters above, except that
the values are all filled in. It is legitimate for strings and arrays to be different
lengths upon return than those that are passed in.
2 Do all the normal things to convert your DLL to 32-bits; refer to the
documentation from your compiler vendor.
3 Use the cdecl calling convention for all entry points called by the DLL adaptor
(instead of the “far pascal” calling convention).
5 Pointers are now used for strings and arrays instead of handles. Strings
should be passed as char * for input parameters and char ** for output
parameters. Arrays should be passed as pointers to the element type for input
parameters and pointers to pointers to the element type for output
parameters. For example, an array of integers would be passed as int * for
input and int ** for output and an array of strings would be passed as char **
for input and char *** for output.
6 All ints are now 4 bytes long which means that all ints and booleans are
passed as 4 bytes, as are the number of elements for arrays. Make sure that
your DLL code is not using shorts for int or boolean parameters.
You will need to create a .def file and add it to the project (if using the IDE) or
add it to your link line (if using a makefile). See the documentation on the IDE
or tlink32 for more information.
The .def file must have an EXPORTS section with lines similar to the
following:
EXPORTS
MyFunction1=_MyFunction1
MyFunction2=_MyFunction2
Note the the two sides of the equal sign are identical, except that the right-
hand side has an underscore. This is instead of using __export (or _export) in
the source files.
In addition, the .def file might need the following items in it before the
EXPORTS section:
*InterestRate = G_Interest;
G_MonthlyPayment = (double)(((unsigned long)(G_MonthlyPayment *
100 + 0.50)) / 100.00);
*MonthlyPayment = G_MonthlyPayment;
*LoanDuration = G_LoanDuration;
FreeProcInstance(lpProcPaymentInfo);
}
switch (message) {
case WM_INITDIALOG: /* message: initialize dialog box */
{
sprintf(PrincipalAmtStr, "%.2f", G_PrincipalAmt);
SetWindowText(GetDlgItem(hDlg, IDD_PrincipalAmount),
(LPSTR) PrincipalAmtStr);
SendMessage(GetDlgItem(hDlg, IDD_Duration30),
BM_SETCHECK, 1, 0L); // default to 30 year
G_LoanDuration = 30;
ShowPayments(hDlg, G_PrincipalAmt);
return (TRUE);
}
case WM_COMMAND: /* message: received a command */
{
if (wParam == IDD_PaymentGrid && HIWORD (lParam) == LBN_SELCHANGE) {
hwndList = GetDlgItem(hDlg, IDD_PaymentGrid);
n = SendMessage (hwndList, LB_GETCURSEL, 0, 0L) ;
if (SendDlgItemMessage(hDlg, IDD_Duration30, BM_GETCHECK, 0, 0))
G_LoanDuration = 30;
else
G_LoanDuration = 15;
if (G_LoanDuration == 30)
G_MonthlyPayment = MonthlyPayments30Array[n+1];
else
G_MonthlyPayment = MonthlyPayments15Array[n+1];
G_Interest = InterestRateArray[n+1];
return (TRUE);
}
else if (wParam == IDD_OKButton3) { /* "OK" box selected? */
hwndList = GetDlgItem(hDlg, IDD_PaymentGrid);
n = SendMessage (hwndList, LB_GETCURSEL, 0, 0L) ;
if (n == LB_ERR) {
MessageBox(hDlg, "Please select an item first", "Error", MB_OK);
SetFocus(hwndList);
return (FALSE);
}
EndDialog(hDlg, TRUE); /* Exits the dialog box */
return (TRUE);
}
else if (wParam == IDD_Duration15) {
C API Calls
On the pages that follow, you’ll find detailed descriptions of each call,
including its syntax, each of its parameters, and the return value. The calls are
organized alphabetically.
Note 16-bit active Work Performers use SVCAPI.DLL. 32-bit active Work
Performers use VWAPI.DLL. Do not use DLLs other than SVCAPI.DLL or
VWAPI.DLL; use of other DLLs may cause errors.
VW_AttachToWorkQueue
This function establishes a Work Queue for an active Work Performer.
VW_AttachToWorkQueue() should be called once (for each queue being
browsed) when the Work Performer is started.
Syntax:
VW_Error FAR PASCAL VW_AttachToWorkQueue
(VW_LogonHandle logonId,
VW_ClassNameType
lpszWorkPerformerClassName,
VW_QueueHandle *workQueueId);
Input Parameters:
VW_LogonHandle logonId
Logon Id returned from VW_Logon().
VW_ClassNameType lpszWorkPerformerClassName
Supplied by the programmer. Name of the Work Performer
class whose Work Queue is to be browsed.
Output Parameters:
VW_QueueHandle * workQueueId
Identifies a Work Queue in subsequent calls to
VW_ReportToWork().
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_AttachToWorkQueueProcType)
(VW_LogonHandle,
VW_ClassNameType,
VW_QueueHandle *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_BeginBrowsingWorkQueue
This function establishes a browse session of the Work Queue associated
with workPerformerId. The returned browseId remains valid until a call to
VW_EndBrowsingWorkQueue() or VW_LeaveWork().
If browseModHandle is set to zero, default rules for the Work Queue are in
effect, otherwise the modified rules contained in the browse modifier object
associated with browseModHandle are used. For more information, see
“VW_BrmCreateBrowseModifier” on page 94.
Note This call takes a snapshot of the queue contents; any subsequent changes to
the queue are not reflected in results from associated
VW_BeginBrowsingWorkQueue() calls.
When you finish browsing the Work Queue, you must call VW_End-
BrowsingWorkQueue() to free the resources associated with browseId.
Syntax:
VW_Error FAR PASCAL VW_BeginBrowsingWorkQueue
(VW_ActiveWPHandle workPerformerId,
VW_BrowseHandle * browseId,
unsigned long maxWorkObjectCount,
unsigned long * workObjectCount,
VW_BrModHandle browseModHandle);
Input Parameters:
VW_ActiveWPHandle workPerformerId
Identifies the calling Work Performer. Obtained by a call to
VW_ReportToWork().
VW_BrModHandle browseModHandle
Handle to a browse modifier. Obtained by a call to VW_Brm-
CreateBrowseModifier().
Output Parameters:
VW_BrowseHandle * browseId
Identifies the browse session. Used in subsequent calls to
VW_NextWorkObjectToBrowse() and VW_EndBrowsing-
WorkQueue().
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_BeginBrowsingWorkQueueProcType)
(VW_ActiveWPHandle,
VW_BrowseHandle *,
unsigned long,
unsigned long *,
VW_BrModHandle);
VW_BindToUser
This function restricts processing of the Work Object to the user specified by
the lpszUserName parameter.
Syntax:
VW_Error FAR PASCAL VW_BindToUser(VW_Handle wobHandle,
VW_UserNameType lpszUserName);
Input Parameters:
VW_Handle wobHandle
Identifies a Work Object. Can be an operationId returned
from VW_LockWorkObject() or a locked wobAccessHandle
returned from VW_WobQueryGetAccessHandle() or
VW_GetAccessHandle().
VW_UserNameType * lpszUserName
Specifies the three-part NCH user name to which the Work
Object processing is to be restricted.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_BindToUserProcType)
(VW_Handle,
VW_UserNameType);
VW_BrmCreateBrowseModifier
This function creates a browse modifier object. Browse modifier objects are
independent of Work Performers and browse sessions, and can override the
default behavior of a Work Queue’s rules.
Syntax:
VW_Error FAR PASCAL VW_BrmCreateBrowseModifier(
VW_QueueHandle workQueueId,
VW_BrModHandle * browseModHandle);
Input Parameters:
VW_QueueHandle workQueueId
Identifies a Work Queue. Obtained by a call to
VW_AttachToWorkQueue().
Output Parameters:
VW_BrModHandle * browseModHandle
Used in subsequent calls to VW_BrmSetPreSelectRule(),
VW_BrmSetSelectRule(), VW_BrmSetSortRules(), and
VW_BrmFreeBrowseModifier().
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error(FAR PASCAL *VW_BrmCreateBrowseModifierProcType)
(VW_QueueHandle,
VW_BrModHandle *);
VW_BrmFreeBrowseModifier
This function frees the resources that were allocated by VW_BrmCreate-
BrowseModifier() for the browse modifier object identified by browseMod-
Handle. This function invalidates browseModHandle and has no effect on
previously started browse sessions using the same modifier object.
Syntax:
VW_Error FAR PASCAL VW_BrmFreeBrowseModifier
(VW_BrModHandle browseModHandle);
Input Parameters:
VW_BrModHandle browseModHandle
Handle to a browse modifier object. Obtained by a call to
VW_BrmCreateBrowseModifier().
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error(FAR PASCAL *VW_BrmFreeBrowseModifierProcType)
(VW_BrModHandle browseModHandle);
VW_BrmSetPreSelectRule
This function allows you to specify a pre-select rule in the browse modifier
object identified by browseModHandle. You can make this call repeatedly to
overwrite the effect of previous calls. To override the default pre-select rule,
you must call this function against a specific browse modifier object.
For more information about the pre-select rule and allowable expressions, see
the “Specify Work Queue Rules” section in the “Creating and Modifying Work
Performer Classes” chapter of the Visual WorkFlo/Composer Handbook.
Syntax:
VW_Error FAR PASCAL VW_BrmSetPreSelectRule
(VW_BrModHandle browseModHandle,
char * preSelectRuleExpr);
Input Parameters:
VW_BrModHandle browseModHandle
Handle to a browse modifier object. Obtained by a call to
VW_BrmCreateBrowseModifier().
char * preSelectRuleExpr
Supplied by the programmer. The pre-select rule expression
to override the default pre-select rule. If this parameter is an
empty string, it indicates that any authored pre-selection rule
is to be ignored.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error(FAR PASCAL *VW_BrmSetPreSelectRuleProcType)
(VW_BrModHandle,
char *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_BrmSetSelectRule
This function allows you to specify a select rule in the browse modifier object
identified by browseModHandle. You can make this call repeatedly to
overwrite the effect of previous calls. To override the default select rule, you
must call this function against a specific browse modifier object.
For more information about the select rule and allowable expressions, see the
“Specify Work Queue Rules” section in the “Creating and Modifying Work
Performer Classes” chapter of the Visual WorkFlo/Composer Handbook.
Syntax:
VW_Error FAR PASCAL VW_BrmSetSelectRule
(VW_BrModHandle browseModHandle,
char * selectRuleExpr);
Input Parameters:
VW_BrModHandle browseModHandle
Handle to a browse modifier object. Obtained by a call to
VW_BrmCreateBrowseModifier().
char * selectRuleExpr
Supplied by the programmer. The select rule expression to
override the default select rule. If this parameter is an empty
string, it indicates that any authored selection rule is to be
ignored.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error(FAR PASCAL *VW_BrmSetSelectRuleProcType)
(VW_BrModHandle,
char *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_BrmSetSortRules
This function allows you to specify a set of sort rules in the browse modifier
object identified by browseModHandle. You can make this call repeatedly to
overwrite the effect of previous calls. To override the default sort rules, you
must call this function against a specific browse modifier object.
For more information about sort rules and allowable expressions, see the
“Specify Work Queue Rules” section in the “Creating and Modifying Work
Performer Classes” chapter of the Visual WorkFlo/Composer Handbook.
Syntax:
VW_Error FAR PASCAL VW_BrmSetSortRules
(VW_BrModHandle browseModHandle,
unsigned int sortRuleCount,
char * sortRuleExpressions[],
unsigned int sortRuleLengths[]);
Input Parameters:
VW_BrModHandle browseModHandle
Handle to a browse modifier object. Obtained by a call to
VW_BrmCreateBrowseModifier().
char * sortRuleExpressions[]
Supplied by the programmer. Array of sort rule expressions. If
the array is empty, it indicates that any authored sort rules are
to be ignored.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise returns an error code.
Function Typedef:
typedef VW_Error(FAR PASCAL *VW_BrmSetSortRulesProcType)
(VW_BrModHandle,
unsigned int,
char * [],
unsigned int []);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_CheckVersionCompatibility
This function checks that the version of the APIs being used is compatible
with the currently running version of the APIs. This function returns the current
major and minor version numbers in curMajorVersionNum and curMinor-
VersionNum respectively.
Note For comparisons of minor version numbers to work correctly, the minor
version number returned in curMinorVersionNum is a two-digit number. For
example, the minor version number for release 1.21 is 21 and for release 1.3,
it is 30. The value supplied by the programmer in minorVersionNum must be
in the same format.
Syntax:
VW_Error FAR PASCAL VW_CheckVersionCompatibility
(VW_MajorVersionType majorVersionNum,
VW_MinorVersionType minorVersionNum,
VW_MajorVersionType *curMajorVersionNum,
VW_MinorVersionType *curMinorVersionNum);
Input Parameters:
VW_MajorVersionType majorVersionNum
Supplied by the programmer.The major version number in
use by the caller.
VW_MinorVersionType minorVersionNum
Supplied by the programmer. The minor version number in
use by the caller.
Output Parameters:
VW_MajorVersionType *curMajorVersionNum
The current major version number of the API that is running.
It is the caller’s responsibility to allocate sufficient memory at
this location.
VW_MinorVersionType *curMinorVersionNum
The current minor version number of the API that is running.
It is the caller’s responsibility to allocate sufficient memory at
this location.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_CheckVersionCompatibilityProcType
(VW_MajorVersionType,
VW_MinorVersionType,
VW_MajorVersionType *,
VW_MinorVersionType *);
VW_CreateWorkObject
This function creates a Work Object of the Work Class specified by
lpszWorkClassName using the initial field values set during Work Class
definition. Returns the Id for the newly created Work Object.
You must call VW_Logon() to get the logon id (logonId) used in this function.
Note that it’s more efficient to call VW_Logon once, save the returned logonId
and use it in subsequent calls to VW_CreateWorkObject().
Syntax:
VW_Error FAR PASCAL VW_CreateWorkObject(VW_LogonHandle logonId,
VW_ClassNameType lpszWorkClassName,
VW_NewWorkObjectHandle
*newWorkObjectId);
Input Parameters:
VW_LogonHandle logonId
The logon Id returned by VW_Logon().
VW_ClassNameType lpszWorkClassName
Supplied by the programmer. The Work Class of the Work
Object to be created.
Output Parameters:
VW_NewWorkObjectHandle *newWorkObjectId
The Id of the newly created Work Object.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_CreateWorkObjectProcType)
(VW_LogonHandle,
VW_ClassNameType,
VW_NewWorkObjectHandle *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_CurrentException
This function returns a structure containing the name of the most recently
raised exception and a text description of the exception condition.
Syntax:
VW_Error FAR PASCAL VW_CurrentException(VW_Handle objectId,
VW_ExceptionDescriptor * exDesc);
Input Parameters:
VW_Handle objectId
The operationId of a passive or active Work Performer. The
operation Id is returned by VW_LockWorkObject() (active
Work Performer) or is obtained from the adaptor (passive
Work Performer).
Output Parameters:
VW_ExceptionDescriptor * exDesc
Contains the name and description of a Work Object’s current
exception. Structure must be allocated by the caller.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_CurrentExceptionProcType)
(VW_Handle,
VW_ExceptionDescriptor *);
Structure Definition:
#define VW_MAXEXCEPTIONNAMELEN];
#define VW_MAXEXCEPTIONDESCLEN];
typedef struct
{
char Name[VW_MAXEXCEPTIONNAMELEN];
char Desc[VW_MAXEXCEPTIONDESCLEN];
} VW_ExceptionDescriptor;
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_DetachFromWorkQueue
This function frees any resources allocated to the workQueueId returned from
VW_AttachToWorkQueue(). workQueueId is invalid after this call. Call
VW_DetachFromWorkQueue() once (for each queue being browsed) before
the Work Performer is shut down.
Syntax:
VW_Error FAR PASCAL VW_DetachFromWorkQueue
(VW_QueueHandle workQueueId);
Input Parameters:
VW_QueueHandle workQueueId
Identifies the Work Queue. Returned by
VW_AttachToWorkQueue().
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_DetachFromWorkQueueProcType)
(VW_QueueHandle);
VW_DispatchWorkObject
This function dispatches the Work Object identified by newWorkObjectId into
the WorkObjectDispatcher Work Queue.
Syntax:
VW_Error FAR PASCAL VW_DispatchWorkObject
(VW_NewWorkObjectHandle newWorkObjectId);
Input Parameters:
VW_NewWorkObjectHandle newWorkObjectId
The Work Object Id returned from VW_CreateWorkObject().
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_DispatchWorkObjectProcType)
(VW_NewWorkObjectHandle);
VW_EndBrowsingWorkQueue
This function releases and invalidates all resources allocated to browseId or
any Work Object Ids associated with it.
Syntax:
VW_Error FAR PASCAL VW_EndBrowsingWorkQueue
(VW_BrowseHandle browseId);
Input Parameters:
VW_BrowseHandle browseId
Id of a browse session obtained by a call to VW_Begin-
BrowsingWorkQueue(). browseId is invalid after a call to this
function.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL * VW_EndBrowsingWorkQueueProcType)
(VW_BrowseHandle);
VW_FreeAccessHandle
This function frees the access handle returned from VW_WobQueryGet-
AccessHandle() or VW_GetAccessHandle(). If lockForUpdate was set to true
when the access handle was obtained, VW_FreeAccessHandle() unlocks the
Work Object in the Work Queue.
Syntax:
VW_Error FAR PASCAL VW_FreeAccessHandle
(VW_WobAccessHandle wobAccessHandle,
VW_Boolean saveUpdates,
VW_Boolean skipCurrentInstruction,
VW_InstrSheetNameType Reserved);
Input Parameters:
VW_WobAccessHandle wobAccessHandle
An access handle obtained by a call to VW_WobQueryGet-
AccessHandle() or VW_GetAccessHandle().
VW_Boolean saveUpdates
Supplied by the programmer. Has no effect if lockForUpdate
was not true when the access handle was obtained. If true, all
updates to the Work Object are saved; otherwise, updates
are discarded.
VW_Boolean skipCurrentInstruction
Supplied by the programmer. Has no effect if lockForUpdate
was not true when the access handle was obtained. If true,
the current Instruction of the Work Object is set to ‘completed’
and the Work Object is routed to the next Instruction.
VW_InstrSheetNameType Reserved
For future use.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_FreeAccessHandleProcType)
(VW_WobAccessHandle,
VW_Boolean,
VW_Boolean);
VW_FreeArrayPtr
This function frees the array pointed to by arrayPtr, which is an array pointer
returned by VW_GetArrayPtr() or VW_GetFieldNames(). If arrayPtr is of type
string, this function frees all string elements in the array.
Syntax:
VW_Error FAR PASCAL VW_FreeArrayPtr(VW_ArrayPtrType *arrayPtr,
long numElements,
VW_DataType arrayType);
Input Parameters:
VW_ArrayPtrType *arrayPtr
Pointer to the array to be freed. Obtained by a call to
VW_GetArrayPtr() or VW_GetFieldNames().
long numElements
Number of elements in the array. Obtained by a call to
VW_GetArrayPtr() or VW_GetFieldNames().
VW_DataType arrayType
Supplied by the programmer. Identifies the data type of the
array.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_FreeArrayPtrProcType)
(VW_ArrayPtrType *,
long,
VW_DataType);
VW_GetAccessHandle
This function returns an access handle for a Work Object that is used in
subsequent calls to the data access functions (such as VW_GetInteger() or
VW_SetFloat()). The access handle can be used to make changes to the
Work Object.
Note After locking a Work Object with VW_GetAccessHandle(), you might want to
verify that it still fits the search criteria you specified when locating the Work
Object. The Work Object could have been changed between the time you
located it and the time you locked it.
You must call VW_FreeAccessHandle() when you finish with the access
handle.
Syntax:
VW_Error FAR PASCAL VW_GetAccessHandle
(VW_QueueElementHandle queueElementId,
VW_Boolean lockForUpdate,
VW_WobAccessHandle *wobAccessHandle);
Input Parameters:
VW_QueueElementHandle queueElementId
Identifies a Work Object in the Work Queue. Obtained by a
call to VW_NextWorkObjectToBrowse().
VW_Boolean lockForUpdate
Supplied by the programmer. If true, the Work Object is
locked in the Work Queue. If the Work Object is not locked,
the returned handle can only be used to read fields from the
Work Object.
Output Parameters:
VW_WobAccessHandle *wobAccessHandle
Returned access handle.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetAccessHandleProcType)
(VW_QueueElementHandle,
VW_Boolean,
VW_WobAccessHandle *);
VW_GetArrayPtr
If objectId is the handle of a passive or active Work Performer, this function
returns the value of the Work Performer field identified by lpszFieldName.
It is not the caller’s responsibility to allocate memory for the array. This
function 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.
Syntax:
VW_Error FAR PASCAL VW_GetArrayPtr (VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_ArrayPtrType *value,
long *numElements,
VW_DataType type);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) The operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A Work Object field name.
VW_DataType type
The data type to be returned by VW_GetArrayPtr().
Output Parameters:
VW_ArrayPtrType *value
This value can represent one of the following:
i) A passive or active Work Performer field value.
ii) A Work Queue field value.
iii) An Operation parameter value.
iv) A Work Object field value.
long *numElements
The number of elements in the array.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetArrayPtrProcType)
(VW_Handle,
VW_FieldNameType,
VW_ArrayPtrType *,
long *,
VW_DataType);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetArraySize
Call this function when you need to obtain the size of an array before calling
VW_GetArrayPtr(). In most cases, there is no need to call VW_GetArraySize()
because VW_GetArrayPtr() allocates memory and returns the array size. Use
this call when you need the size of an array before calling a DLL, such as
VBSVCAPI, that uses the data received from VW_GetArrayPtr().
Syntax:
VW_Error FAR PASCAL VW_GetArraySize(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
long *elements);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) An operationId of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A Work Object field name.
Output Parameters:
long *elements
Returns the number of elements in the array.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetArraySizeProcType)
(VW_Handle,
VW_FieldNameType,
long *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetBoolean
This function returns a parameter value containing data of type boolean from
a field determined by the objectId parameter.
Syntax:
VW_Error FAR PASCAL VW_GetBoolean(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_Boolean *value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) The operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iv) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A Work Object field name.
Output Parameters:
VW_Boolean *value
Returned value.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetBooleanProcType)
(VW_Handle,
VW_FieldNameType,
VW_Boolean *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetDataType
This function returns the data type of the specified field from an object
determined by objectId.
Syntax:
VW_Error FAR PASCAL VW_GetDataType(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_DataType *type);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer. Obtained by a call to
VW_GetWorkPerformerHandle() (passive Work Performer) or
VW_ReportToWork() (active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) The operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iv) A newly-created Work Object. Obtained by a call to
VW_CreateWorkObject().
v) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A field name in a newly created Work Object.
v) A Work Object field name.
Output Parameters:
VW_DataType *type
Identifies the data type of the specified field.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetDataTypeProcType)
(VW_Handle,
VW_FieldNameType,
VW_DataType *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetDataTypeArray
This function returns the data type of the array elements. Use this call when
VW_GetDataType() has returned a type of array.
Syntax:
VW_Error FAR PASCAL VW_GetDataTypeArray(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_DataType *type);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer. Obtained by a call to
VW_GetWorkPerformerHandle() (passive Work Performer) or
VW_ReportToWork() (active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) The operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iv) A newly-created Work Object. Obtained by a call to
VW_CreateWorkObject().
v) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A field name in a newly created Work Object.
v) A Work Object field name.
Output Parameters:
VW_DataType *type
Identifies the data type of the array.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetDataTypeArrayProcType)
(VW_Handle,
VW_FieldNameType,
VW_DataType *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetErrorMessage
This function returns the error message text corresponding to errorCode.
Syntax:
unsigned FAR PASCAL VW_GetErrorMessage(VW_Error errorCode,
VW_MessageType lpszMessage);
Input Parameters:
VW_Error errorCode
Specifies an error code returned by an API call.
Output Parameters:
VW_MessageType lpszMessage
Identifies the error message string. This parameter is a
pointer to a writable location in memory.
Return Value:
Returns the number of bytes copied to lpszMessage excluding the NULL
character. Returns zero if errorCode is invalid.
Function Typedef:
typedef unsigned (FAR PASCAL *VW_GetErrorMessageProcType)
(VW_Error,
VW_MessageType);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetErrorMessageSize
This function returns the size (in bytes) of the error message string
corresponding to errorCode. Call VW_GetErrorMessageSize() to determine
the amount of memory you need to allocate before calling VW_GetError-
Message().
Syntax:
unsigned FAR PASCAL VW_GetErrorMessageSize(VW_Error errorCode);
Input Parameters:
VW_Error errorCode
Specifies an error code returned by an API call.
Output Parameters:
None.
Return Value:
Returns the size of the error message string, excluding the NULL character.
Returns zero if errorCode is invalid.
Function Typedef:
typedef unsigned (FAR PASCAL * VW_GetErrorMessageSizeProcType)
(VW_Error);
VW_GetFieldNames
This function returns a string array that contains the names of all fields in the
object identified by objectId.
The caller is not responsible for allocating memory for the array. This function
allocates the necessary memory and returns a pointer to the array.
The caller must free the returned array by calling VW_FreeArrayPtr(). The
array elements are of type VW_String.
Syntax:
VW_Error FAR PASCAL VW_GetFieldNames(VW_Handle objectId,
VW_ArrayPtrType *value,
long *numElements);
Input Parameters:
VW_Handle objectId
Identifies the operationId of a passive Work Performer.
Output Parameters:
VW_ArrayPtrType *value
The list of parameters within an Operation.
long *numElements
The number of elements in the array.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetFieldNamesProcType)
(VW_Handle,
VW_ArrayPtrType *,
long *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetFloat
This function returns data of type double from a field determined by the
objectId parameter. The returned data type is in a 16-byte decimal floating
point number format.
You can call VW_GetFloat() from either an active or passive Work Performer.
Syntax:
VW_Error FAR PASCAL VW_GetFloat (VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_Float *value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) The operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iv) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A Work Object field name.
Output Parameters:
VW_Float *value
Returned value.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL VW_GetFloatProcType)
(VW_Handle,
VW_FieldNameType,
VW_Float *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetFPNumber
This function returns a parameter value containing data from a field
determined by the objectId parameter. The returned data type is in a 16-byte
decimal floating point number format.
Note You need the WorkFlo Application Libraries to use this call.
Syntax:
VW_Error FAR PASCAL VW_GetFPNumber(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_FPNumber value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) The operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iv) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A Work Object field name.
Output Parameters:
VW_FPNumber value
Returned value.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetFPNumberProcType)
(VW_Handle,
VW_FieldNameType,
VW_FPNumber);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetInteger
This function returns data of type integer from a field determined by the
objectId parameter.
Syntax:
VW_Error FAR PASCAL VW_GetInteger(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_Integer *value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) The operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject().
iv) An access handle for a Work Object obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A Work Object field name.
Output Parameters:
VW_Integer *value
Returned value.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL * VW_GetIntegerProcType)
(VW_Handle,
VW_FieldNameType,
VW_Integer *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetLoggingState
This function returns the state of the specified logging option of the active or
passive Work Performer identified by objectId. If loggingOption contains zero,
this function does nothing and returns zero.
Syntax:
VW_Error FAR PASCAL VW_GetLoggingState(VW_Handle objectId,
VW_LogOption loggingOption,
VW_Boolean *loggingState);
Input Parameters:
VW_Handle objectId
Identifies the handle of a passive or active Work Performer.
Obtained by a call to VW_ReportToWork() (active Work
Performer) or VW_GetWorkPerformerHandle() (passive Work
Performer).
VW_LogOption loggingOption
Supplied by the programmer. Specifies which Work Performer
logging option to retrieve. Valid values are as follows:
1 WorkPerformer Creation
2 WorkPerformer Terminate
3 WorkPerformer Debugging
4 WorkPerformer System Message
5 WorkPerformer General Message
Options 6 - 8 are unavailable
9 WorkObject Creation
10 WorkObject Terminate
11 WorkObject Exceptions
12 WorkObject Debugging
13 WorkObject System Message
14 WorkObject General Message
Output Parameters:
VW_Boolean *loggingState
Identifies the state of the specified logging option. This
parameter can contain one of the following values:
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetLoggingStateProcType)
(VW_Handle,
VW_LogOption,
VW_Boolean *);
VW_GetOperationName
This function returns the name of the next Operation required by the Work
Object identified by objectId.
You must allocate sufficient space for the operation name before calling this
function. Call VW_GetOperationNameSize() to determine the amount of
memory required.
Syntax:
VW_Error FAR PASCAL VW_GetOperationName(VW_Handle objectId,
VW_OperationNameType lpszOperationName);
Input Parameters:
VW_Handle objectId
Identifies a VW_QueueElementHandle or a
VW_OperationHandle.
Output Parameters:
VW_OperationNameType FAR lpszOperationName
Identifies the read only name of the next Operation required
by the specified Work Object. It points to a writable location in
memory.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetOperationNameProcType)
(VW_Handle,
VW_OperationNameType);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetOperationNameSize
This function returns the size (in bytes) of the Operation name of the Work
Object identified by objectId. Call this function before calling VW_Get-
OperationName().
Syntax:
VW_Error FAR PASCAL VW_GetOperationNameSize(VW_Handle objectId,
unsigned int *size);
Input Parameters:
VW_Handle objectId
Identifies a VW_QueueElementHandle or a
VW_OperationHandle.
Output Parameters:
unsigned int *size
The size of the string (in bytes).
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetOperationNameSizeProcType)
(VW_Handle,
unsigned int *);
VW_GetString
This function returns a parameter value containing data of type string from a
field determined by the objectId parameter.
You can call VW_GetString() from either an active or passive Work Performer.
Syntax:
VW_Error FAR PASCAL VW_GetString (VW_Handle objectId,
VW_FieldNameType lpszFieldName,
char *value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) The operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or
VW_LockWorkObject() (active Work Performer).
iv) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A Work Object field name.
Output Parameters:
char * value
Returned value.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetStringProcType)
(VW_Handle,
VW_FieldNameType,
char *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetStringSize
This function returns the length in bytes of the specified string field. Call this
function before calling VW_GetString().
Syntax:
VW_Error FAR PASCAL VW_GetStringSize(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
unsigned int *size);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) The operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iv) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A Work Object field name.
Output Parameters:
unsigned int * size
Indicates the size, in bytes, of the string.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL VW_GetStringSizeProcType)
(VW_Handle,
VW_FieldNameType,
unsigned int *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetTime
This function returns data of type time from a field determined by the objectId
parameter. The time specifies the number of seconds since midnight, January
1, 1970 Coordinated Universal Time (UTC, formerly Greenwich Mean Time).
Note Time values are stored as 32-bit longs. Therefore, a time value can specify a
time from 1970 to 2060.
You can call VW_GetTime() from either an active or passive Work Performer.
Syntax:
VW_Error FAR PASCAL VW_GetTime(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_Time *value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) An enqueued Work Object. Obtained by a call to
VW_NextWorkObjectToBrowse().
iii) The operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iv) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) A Work Queue field name.
iii) An Operation parameter name.
iv) A Work Object field name.
Output Parameters:
VW_Time *value
Returned value. The number of seconds since midnight
January 1, 1970 Coordinated Universal Time.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetTimeProcType)
(VW_Handle,
VW_FieldNameType,
VW_Time *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_GetWobSignature
This function returns a string containing the signature for the Work Object.
The signature uniquely identifies the Work Object in this WorkFlo system.
Syntax:
VW_Error FAR PASCAL VW_GetWobSignature(VW_Handle wobHandle,
VW_WobSignatureType lpszWobSignature);
Input Parameters:
VW_Handle wobHandle
Identifies a Work Object. Can be a queueElementId returned
from VW_NextWorkObjectToBrowse(), an operationId
returned from VW_LockWorkObject(), or a wobAccess-
Handle returned from VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
Output Parameters:
VW_WobSignatureType lpszWobSignature
The signature of the Work Object specified by wobHandle.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
VW_Error (FAR PASCAL *VW_GetWobSignatureProcType)
(VW_Handle,
VW_WobSignatureType);
VW_GetWorkPerformerHandle
This function returns the handle of the Work Performer associated with the
specified VW_OperationHandle. The handle can be from either a passive or
an active Work Performer.
Syntax:
VW_Error FAR PASCAL VW_GetWorkPerformerHandle
(VW_OperationHandle operationHandle,
VW_Handle *workerHandle);
Input Parameters:
VW_OperationHandle operationHandle
Identifies a locked Work Object.
Output Parameters:
VW_Handle *workerHandle
Identifies a Work Performer for purposes of calling APIs that
can accept a VW_PassiveWPHandle or a VW_ActiveWP-
Handle.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_GetWorkPerformerHandleProcType)
(VW_OperationHandle,
VW_Handle *);
VW_LeaveWork
This function releases the caller as an active Work Performer. Frees any
resources allocated to workPerformerId and any associated browseIds,
queueElementIds, and operationIds. This function invalidates all such Ids. You
must call this function to free resources allocated by VW_ReportToWork().
Syntax:
VW_Error FAR PASCAL VW_LeaveWork
(VW_ActiveWPHandle workPerformerId);
Input Parameters:
VW_ActiveWPHandle workPerformerId
Identifies the calling Work Performer. Obtained by a call to
VW_ReportToWork().
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_LeaveWorkProcType)
(VW_ActiveWPHandle);
VW_LockWorkObject
This function locks the Work Object identified by queueElementId. Once
locked, its current Operation can be performed. The OperationHandle can be
used in subsequent calls to data access functions, such as VW_GetInteger()
or VW_SetInteger(), as well as calls to VW_UnlockWorkObject() and
VW_UnlockAndDispatch().
Syntax:
VW_Error FAR PASCAL VW_LockWorkObject
(VW_QueueElementHandle queueElementId,
VW_OperationHandle *operationId);
Input Parameters:
VW_QueueElementHandle queueElementId
Identifies a Work Object in the Work Queue from a browse
session. Obtained by a call to
VW_NextWorkObjectToBrowse().
Output Parameters:
VW_OperationHandle *operationId
Identifies a locked Work Object whose current Operation is to
be performed by the caller.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_LockWorkObjectProcType)
(VW_QueueElementHandle,
VW_OperationHandle *);
VW_LogMessage
This function logs a user-defined message lpszMessage to the History
Repository. The specified logging option must be ON (1) in both the Work
Performer’s set of logging options and the logging vector defined in the VW.INI
file.
Syntax:
VW_Error FAR PASCAL VW_LogMessage(VW_Handle objectId,
VW_MessageType lpszMessage,
VW_LogOption loggingOption);
Input Parameters:
VW_Handle objectId
Identifies the handle of a passive or active Work Performer.
Obtained by a call to VW_ReportToWork() (active Work
Performer) or VW_GetWorkPerformerHandle() (passive Work
Performer).
VW_MessageType lpszMessage
Supplied by the programmer. Specifies the user-defined
message, which must not exceed VW_MAXMESSAGELEN
bytes (defined in the SVCAPI.H file).
VW_LogOption loggingOption
Supplied by the programmer. Specifies the logging option for
which lpszMessage will be logged.
3 VW_WPDebugOption
4 VW_WPSystemOption
5 VW_WPMiscOption
12 VW_WODebugOption
13 VW_WOSystemOption
14 VW_WOMiscOption
31 VW_USER1Option
32 VW_USER2Option
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_LogMessageProcType)
(VW_Handle,
VW_MessageType,
VW_LogOption);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_Logoff
This function invalidates the logonId returned from VW_Logon(). You must call
this function to release resources allocated by VW_Logon(). VW_Logoff()
should be called once before the Work Performer is shut down.
Syntax:
VW_Error FAR PASCAL VW_Logoff(VW_LogonHandle logonId);
Input Parameters:
VW_LogonHandle logonId
The logon Id returned by VW_Logon().
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_LogoffProcType)
(VW_LogonHandle);
VW_Logon
This function returns a logon Id used in subsequent API calls. VW_Logon()
should be called once when the Work Performer is started.
You must call VW_Logoff() to free the resources associated with logonId.
Note For 32-bit Work Performers, the Visual WorkFlo API calls are now provided by
an OLE server. The OLE server is loaded when the first API call is made (i.e.
when VW_Logon() is called); Visual WorkFlo is also loaded at this time. You
might notice that the VW_Logon() call is a little slower due to Visual WorkFlo
being loaded, but the initial loading of the application will be faster because
Visual WorkFlo is not loaded at that time.
The OLE server is also unloaded when the last call to VW_Logoff() is made. If
you call VW_Logon(), VW_Logoff(), and then VW_Logon() again, there will
also be a delay with the second VW_Logon() call because the OLE server
was unloaded when VW_Logoff() was called and must be reloaded. We
recommend that you call VW_Logon() once at the beginning of your Work
Performer and call VW_Logoff() once at the end.
Syntax:
VW_Error FAR PASCAL VW_Logon(VW_LogonHandle *logonId);
Input Parameters:
None.
Output Parameters:
VW_LogonHandle *logonId
A unique logon Id. logonId must be properly allocated by the
caller prior to being passed to this function. The caller must
also free logonId. If an error occurs, this parameter will
contain zero.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_LogonProcType)
(VW_LogonHandle *);
VW_NextWorkObjectToBrowse
This function returns a queueElementId, used to reference a Work Object in
the Work Queue being browsed. queueElementId remains valid until a call to
VW_EndBrowsingWorkQueue() or VW_LeaveWork() is made.
Syntax:
VW_Error FAR PASCAL VW_NextWorkObjectToBrowse
(VW_BrowseHandle browseId,
VW_QueueElementHandle *queueElementId);
Input Parameters:
VW_BrowseHandle browseId
Identifies a browse session. Obtained by a call to
VW_BeginBrowsingWorkQueue().
Output Parameters:
VW_QueueElementHandle *queueElementId
Identifies an enqueued Work Object. Used in subsequent
calls to VW_LockWorkObject() and data access functions
such as VW_GetInteger() or VW_GetFloat().
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL * VW_NextWorkObjectToBrowseProcType)
(VW_BrowseHandle,
VW_QueueElementHandle *);
VW_RaiseException
This function calls an exception handling Instruction Sheet for the Work
Object identified by objectId.
Syntax:
VW_Error FAR PASCAL VW_RaiseException(VW_Handle objectId,
VW_ExceptionNameType lpszExceptionName,
VW_MessageType lpszDescription);
Input Parameters:
VW_Handle objectId
Identifies an operation Id of a passive or active Work
Performer. Obtained by a call to VW_LockWorkObject()
(active Work Performer) or from the adaptor (passive Work
Performer).
VW_ExceptionNameType lpszExceptionName
Supplied by the programmer. Name of the Instruction Sheet
to call.
VW_MessageType lpszDescription
Supplied by the programmer. Description of the exception.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_RaiseExceptionProcType)
(VW_Handle,
VW_ExceptionNameType,
VW_MessageType);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_ReportToWork
This function establishes the caller as an active Work Performer. The returned
workPerformerId remains valid until a call to VW_LeaveWork() is made. You
must call VW_LeaveWork() to free resources associated with workPer-
formerId.
Syntax:
VW_Error FAR PASCAL VW_ReportToWork
(VW_QueueHandle workQueueId,
VW_ActiveWPHandle *workPerformerId);
Input Parameters:
VW_QueueHandle workQueueId
Identifies the workQueueId. Obtained by a call to VW_Attach-
ToWorkQueue().
Output Parameters:
VW_ActiveWPHandle * workPerformerId
Identifies a Work Performer. Used in subsequent calls to
VW_BeginBrowsingWorkQueue() and VW_LeaveWork().
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_ReportToWorkProcType)
(VW_QueueHandle,
VW_ActiveWPHandle *);
VW_SetArrayPtr
This function sets field values into an array determined by the objectId
parameter.
If objectId is the Id of a passive or active Work Performer, this function sets the
value in the field identified by lpszFieldName in the specified Work Performer.
Syntax:
VW_Error FAR PASCAL VW_SetArrayPtr (VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_ArrayPtrType value,
long numElements,
VW_DataType type);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork) (active Work Performer).
ii) The Operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iii) A newly-created Work Object. Obtained by a call to
VW_CreateWorkObject().
iv) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) An Operation parameter name.
iii) A field name in the newly-created Work Object.
iv) A Work Object field name.
VW_ArrayPtrType value
Supplied by the programmer. Points to the caller’s allocated
memory location that contains the array, or an array pointer
returned from VW_GetArrayPtr(). It is the caller’s
responsibility to free this array pointer.
long numElements
Supplied by the programmer. Specifies the number of array
elements. Elements might be fewer than the number of
elements in the Visual WorkFlo array.
VW_DataType type
Supplied by the programmer. Data type of the array.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_SetArrayPtrProcType)
(VW_Handle,
VW_FieldNameType,
VW_ArrayPtrType,
long,
VW_DataType);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_SetBoolean
This function sets a value of type boolean into a field determined by the
objectId parameter.
If objectId is the Id of a passive or active Work Performer, this function sets the
value in the field identified by lpszFieldName in the specified Work Performer.
Syntax:
VW_Error FAR PASCAL VW_SetBoolean(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_Boolean value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) The Operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iii) A newly-created Work Object. Obtained by a call to
VW_CreateWorkObject().
iv) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) An Operation parameter name.
iii) A field name in the newly-created Work Object.
iv) A Work Object field name.
VW_Boolean value
Supplied by the programmer. A non-zero value represents
true; a zero value represents false.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_SetBooleanProcType)
(VW_Handle,
VW_FieldNameType,
VW_Time);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_SetFloat
This function sets a value of type double into a field determined by the
objectId parameter.
If objectId is the Id of a passive or active Work Performer, this function sets the
value in the field identified by lpszFieldName in the specified Work Performer.
You can call VW_SetFloat() from either an active or passive Work Performer.
Syntax:
VW_Error FAR PASCAL VW_SetFloat (VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_Float value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) The Operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iii) A newly-created Work Object. Obtained by a call to
VW_CreateWorkObject().
iv) An access handle for a Work Object obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) An Operation parameter name.
iii) A field name in the newly-created Work Object.
iv) A Work Object field name.
VW_Float value
Supplied by the programmer. The new value.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_SetFloatProcType)
(VW_Handle,
VW_FieldNameType,
VW_Float);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_SetFPNumber
This function sets a value of type floating point into a field determined by the
objectId parameter. The returned data type is in a 16-byte decimal floating
point number format.
Note You need the WorkFlo Application Libraries to use this call.
If objectId is the Id of a passive or active Work Performer, this function sets the
value in the field identified by lpszFieldName in the specified Work Performer.
Syntax:
VW_Error FAR PASCAL VW_SetFPNumber(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_FPNumber value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) The Operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iii) A newly-created Work Object. Obtained by a call to
VW_CreateWorkObject().
iv) An access handle obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) An Operation parameter name.
iii) A field name in the newly-created Work Object.
iv) A Work Object field name.
VW_FPNumber value
Supplied by the programmer. The new value.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_SetFPNumberProcType)
(VW_Handle,
VW_FieldNameType,
VW_FPNumber);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_SetInteger
This function sets a value of type integer into a field determined by the
objectId parameter.
If objectId is the Id of a passive or active Work Performer, this function sets the
value in the field identified by lpszFieldName in the specified Work Performer.
Syntax:
VW_Error FAR PASCAL VW_SetInteger(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_Integer value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) The Operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iii) A newly-created Work Object. Obtained by a call to
VW_CreateWorkObject().
iv) An access handle for a Work Object obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) An Operation parameter name.
iii) A field name in the newly-created Work Object.
iv) A Work Object field name.
VW_Integer value
Supplied by the programmer. The new value.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_SetIntegerProcType)
(VW_Handle,
VW_FieldNameType,
VW_Integer);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_SetLogCacheFlushLength
This function sets the number of entries in the Log Cache that trigger a flush.
A flush occurs when the number of entries in the PC’s Log Cache is greater
than or equal to the number in numberOfLogEntries.
For more information on logging, see the “Logging Features” section in the
“Creating a Visual WorkFlo Application” chapter of the Visual WorkFlo/
Composer Handbook.
Syntax:
VW_LogCacheSize FAR PASCAL VW_SetLogCacheFlushLength
(VW_LogCacheSize numberOfLogEntries);
Input Parameters:
VW_LogCacheSize numberOfLogEntries
Supplied by the programmer. Specifies the new maximum
number of entries allowed in the Log Cache.
Output Parameters:
None.
Return Value:
Returns the previous maximum number of cache entries.
Function Typedef:
typedef VW_LogCacheSize (FAR PASCAL
*VW_SetLogCacheFlushLengthProcType)
(VW_LogCacheSize);
VW_SetLoggingState
This function sets the value of loggingState in the specified loggingOption of
the Work Performer identified by objectId.
Note that Visual WorkFlo reserves logging option zero for its exclusive use. If
loggingOption is zero, this function returns success (zero).
The new logging state is AND-ed with the logging vector in the VW.INI file.
Therefore, if the logging option is set to OFF in the VW.INI file, setting the
logging option to ON with VW_SetLoggingState() has no effect.
Syntax:
VW_Error FAR PASCAL VW_SetLoggingState(VW_Handle objectId,
VW_LogOption loggingOption,
VW_Boolean loggingState);
Input Parameters:
VW_Handle objectId
Identifies the handle of a passive or active Work Performer.
Obtained by a call to VW_ReportToWork() (active Work
Performer) or VW_GetWorkPerformerHandle() (passive Work
Performer).
VW_LogOption loggingOption
Supplied by the programmer. Specifies which Work Performer
logging option to set. The following logging options are valid:
1 WorkPerformer Creation
2 WorkPerformer Terminate
3 WorkPerformer Debugging
4 WorkPerformer System Message
5 WorkPerformer General Message
Options 6 - 8 are unavailable
9 WorkObject Creation
10 WorkObject Terminate
11 WorkObject Exceptions
12 WorkObject Debugging
13 WorkObject System Message
14 WorkObject General Message
15 WorkObject Abnormal Termination
Options 16 - 20 are unavailable
21 WO/WP Begin Operation
22 WO/WP Request Next Operation
23 WP/WO Service Complete
Options 24 - 30 are unavailable
31 WP/WO User Defined
32 WP/WO User Defined
VW_Boolean loggingState
Supplied by the programmer. Specifies whether the new
logging state is ON (1) or OFF (0).
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_SetLoggingStateProcType)
(VW_Handle,
VW_LogOption,
VW_Boolean);
VW_SetString
This function sets a value of type string into a field determined by the objectId
parameter.
If objectId is the Id of a passive or active Work Performer, this function sets the
value in the field identified by lpszFieldName in the specified Work Performer.
You can call VW_SetString() from either an active or passive Work Performer.
Syntax:
VW_Error FAR PASCAL VW_SetString (VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_String value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) The Operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iii) A newly-created Work Object. Obtained by a call to
VW_CreateWorkObject().
iv) An access handle for a Work Object obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) An Operation parameter name.
iii) A field name in the newly-created Work Object.
iv) A Work Object field name.
VW_String value
Supplied by the programmer. The new value.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_SetStringProcType)
(VW_Handle,
VW_FieldNameType,
VW_String);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_SetTime
This function sets a value of type time into a field determined by the objectId
parameter. A time is specified as the number of seconds since midnight
January 1, 1970 Coordinated Universal Time (UTC).
Note Time values are stored as 32-bit longs. Therefore, a time value can specify a
time from 1970 to 2060.
If objectId is the Id of a passive or active Work Performer, this function sets the
value in the field identified by lpszFieldName in the specified Work Performer.
You can call VW_SetTime() from either an active or passive Work Performer.
Syntax:
VW_Error FAR PASCAL VW_SetTime(VW_Handle objectId,
VW_FieldNameType lpszFieldName,
VW_Time value);
Input Parameters:
VW_Handle objectId
Identifies one of the following:
i) A passive or active Work Performer handle. Obtained by a
call to VW_GetWorkPerformerHandle() (passive Work
Performer) or VW_ReportToWork() (active Work Performer).
ii) The Operation Id of a passive or active Work Performer.
Obtained from the adaptor (passive Work Performer) or a call
to VW_LockWorkObject() (active Work Performer).
iii) A newly-created Work Object. Obtained by a call to
VW_CreateWorkObject().
iv) An access handle for a Work Object obtained by a call to
VW_GetAccessHandle() or
VW_WobQueryGetAccessHandle().
VW_FieldNameType lpszFieldName
Supplied by the programmer. Identifies one of the following:
i) A passive or active Work Performer field name.
ii) An Operation parameter name.
iii) A field name in the newly-created Work Object.
iv) A Work Object field name.
VW_Time value
Supplied by the programmer. The new value. The number of
seconds since midnight January 1, 1970 Coordinated
Universal Time (UTC).
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_SetTimeProcType)
(VW_Handle,
VW_FieldNameType,
VW_Time);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_TerminateWorkObject
This function terminates the Work Object being processed by the Work
Performer identified by objectId.
Syntax:
VW_Error FAR PASCAL VW_TerminateWorkObject(VW_Handle objectId);
Input Parameters:
VW_Handle objectId
Identifies the operationId of an active or passive Work
Performer. Obtained by a call to VW_LockWorkObject()
(active Work Performer) or from the adaptor (passive Work
Performer).
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL * VW_TerminateWorkObjectProcType)
(VW_Handle);
VW_UnBind
This function ends any restrictions on the Work Object identified by
wobHandle.
Syntax:
VW_Error FAR PASCAL VW_UnBind(VW_Handle wobHandle);
Input Parameters:
VW_Handle wobHandle
Identifies a Work Object. Can be an operationId returned
from VW_LockWorkObject() or a locked wobAccessHandle
returned from VW_WobQueryGetAccessHandle() or
VW_GetAccessHandle().
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_UnBindProcType) (VW_Handle);
VW_UnlockAndDispatch
This function unlocks the Work Object identified by operationId. It also
updates the Work Object with any Operation parameters returned via data
access functions, and dispatches the Work Object to the next Work Queue
indicated by its Instruction Sheet. Call this function when you finish
processing a Work Object locked by a call to VW_LockWorkObject().
Syntax:
VW_Error FAR PASCAL VW_UnlockAndDispatch
(VW_OperationHandle operationId);
Input Parameters:
VW_OperationHandle operationId
Identifies a locked Work Object. Obtained by a call to
VW_LockWorkObject(). operationId is invalid after a call to
this function.
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_UnlockAndDispatchProcType)
(VW_OperationHandle);
VW_UnlockWorkObject
This function unlocks the Work Object identified by operationId. The Work
Object is unlocked and remains in the Work Queue. operationId is invalid after
a call to this function. Any Operation parameters returned via data access
functions are discarded (i.e., any changes made to the Operation parameters
are discarded). Call this function to unlock and leave unchanged a Work
Object locked by a call to VW_LockWorkObject().
Syntax:
VW_Error FAR PASCAL VW_UnlockWorkObject
(VW_OperationHandle operationId);
Input Parameters:
VW_OperationHandle operationId
Identifies a locked Work Object. Obtained by all call to
VW_LockWorkObject().
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_UnlockWorkObjectProcType)
(VW_OperationHandle);
VW_WobQueryCreate
This function creates a WorkObjectQuery object for the Work Class specified
by workClassName. WorkObjectQuery objects are used to access information
about Work Objects of a specific Work Class and Work Object ID.
It is the caller’s responsibility to call the data access function that corresponds
to the data type of the Work Object ID field name. Note that VW_SetFP-
Number() is not supported for Work Object queries.
Syntax:
VW_Error FAR PASCAL VW_WobQueryCreate(VW_LogonHandle logonId,
VW_ClassNameType workClassName,
VW_WobQueryHandle *wobQueryHandle);
Input Parameters:
VW_LogonHandle logonId
Logon Id returned from VW_Logon().
VW_ClassNameType workClassName
Supplied by the programmer. Name of the Work Class.
Output Parameters:
VW_WobQueryHandle * wobQueryHandle
The handle to the WorkObjectQuery object.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error(FAR PASCAL *VW_WobQueryCreateProcType)
(VW_LogonHandle,
VW_ClassNameType,
VW_WobQueryHandle *);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_WobQueryEnd
This function frees resources associated with the Work Object identified by
wobQueryHandle. It also invalidates wobQueryHandle.
Syntax:
VW_Error FAR PASCAL VW_WobQueryEnd
(VW_WobQueryHandle wobQueryHandle);
Input Parameters:
VW_WobQueryHandle wobQueryHandle
Handle to the WorkObjectQuery object. Obtained by a call to
VW_WobQueryCreate().
Output Parameters:
None.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_WobQueryEndProcType)
(VW_WobQueryHandle);
VW_WobQueryExecute
This function executes the Work Object query associated with wobQuery-
Handle. You must call one of the data access functions (such as VW_Set-
Integer()) prior to calling this function for the specified Work Object query.
Syntax:
VW_Error FAR PASCAL VW_WobQueryExecute
(VW_WobQueryHandle wobQueryHandle,
unsigned int maxQueryCount,
unsigned int * queryCount);
Input Parameters:
VW_WobQueryHandle wobQueryHandle
Handle to the WorkObjectQuery object. Obtained by a call to
VW_WobQueryCreate().
Output Parameters:
unsigned int * queryCount
Count of Work Objects found. This value will be less than or
equal to maxQueryCount.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL *VW_WobQueryExecuteProcType)
(VW_WobQueryHandle,
unsigned int,
unsigned int *);
VW_WobQueryGetAccessHandle
This function returns an access handle to be used in subsequent calls to the
data access functions (such as VW_GetInteger() or VW_SetFloat()). Use the
access handle when making changes to the Work Object.
You must call VW_FreeAccessHandle() when you finish with the access
handle.
Syntax:
VW_Error FAR PASCAL VW_WobQueryGetAccessHandle
(VW_WobQueryHandle wobQueryHandle,
unsigned int queryIndex,
VW_Boolean lockForUpdate,
VW_WobAccessHandle *wobAccessHandle);
Input Parameters:
VW_WobQueryHandle wobQueryHandle
Handle to the WorkObjectQuery object. Obtained by a call to
VW_WobQueryCreate().
VW_Boolean lockForUpdate
Supplied by the programmer. If true, the Work Object is
locked in the Work Queue. If the Work Object is not locked,
the returned handle can only be used to read fields from the
Work Object.
Output Parameters:
VW_WobAccessHandle *wobAccessHandle
Returned access handle.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error (FAR PASCAL
*VW_WobQueryGetAccessHandleProcType)
(VW_WobQueryHandle,
unsigned int,
VW_Boolean,
VW_WobAccessHandle *);
VW_WobQueryInstrSheet
This function returns the name of the Instruction Sheet that is currently
processing the Work Object identified by wobQueryHandle.
Syntax:
VW_Error FAR PASCAL VW_WobQueryInstrSheet
(VW_WobQueryHandle wobQueryHandle,
unsigned int queryIndex,
VW_InstrSheetNameType instrSheetName);
Input Parameters:
VW_WobQueryHandle wobQueryHandle
Handle to the WorkObjectQuery object. Obtained by a call to
VW_WobQueryCreate().
Output Parameters:
VW_InstrSheetNameType instrSheetName
The name of the Instruction Sheet currently processing the
Work Object.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error(FAR PASCAL *VW_WobQueryInstrSheetProcType)
(VW_WobQueryHandle,
unsigned int,
VW_InstrSheetNameType);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_WobQueryOperation
This function returns the name of the next Operation that will process the
Work Object identified by queryIndex. You must call VW_WobQueryExecute()
before calling this function.
Syntax:
VW_Error FAR PASCAL VW_WobQueryOperation
(VW_WobQueryHandle wobQueryHandle,
unsigned int queryIndex,
VW_OperationNameType operationName);
Input Parameters:
VW_WobQueryHandle wobQueryHandle
Handle to the WorkObjectQuery object. Obtained by a call to
VW_WobQueryCreate().
Output Parameters:
VW_OperationNameType operationName
Name of the next Operation that will process the specified
Work Object.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error(FAR PASCAL *VW_WobQueryOperationProcType)
(VW_WobQueryHandle,
unsigned int,
VW_OperationNameType);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
VW_WobQueryWorkPerformerClass
This function returns the name of the Work Performer in whose Work Queue
the Work Object identified by queryIndex is located.
Syntax:
VW_Error FAR PASCAL VW_WobQueryWorkPerformerClass
(VW_WobQueryHandle wobQueryHandle,
unsigned int queryIndex,
VW_ClassNameType workerClassName);
Input Parameters:
VW_WobQueryHandle wobQueryHandle
Handle to the WorkObjectQuery object. Obtained by a call to
VW_WobQueryCreate().
Output Parameters:
VW_ClassNameType workerClassName
Work Performer class name in whose Work Queue the
specified Work Object is located.
Return Value:
Returns VW_Success if successful. Otherwise, returns an error code.
Function Typedef:
typedef VW_Error(FAR PASCAL
*VW_WobQueryWorkPerformerClassProcType)
(VW_WobQueryHandle,
unsigned int,
VW_ClassNameType);
See Also:
See “VWAPISRV API Calls” on page 34 for information about parameters to
VWAPISRV API calls.
This chapter describes how to write Work Performers that use the WorkFlo
Script adaptor, the data conversion that occurs between WorkFlo Script data
types and Visual WorkFlo data types, and the purpose of each of the Visual
WorkFlo handles that are returned by the WorkFlo Script calls.
This chapter also describes the WorkFlo Script Language calls that you can
use with Visual WorkFlo. These calls fall into one of the following categories:
• Queue Management
• Field Manipulation
This chapter assumes you are familiar with the WorkFlo Script Language. For
more information refer to the WorkFlo Script Developer’s Guide. We also
assume you have a basic understanding of the Visual WorkFlo concepts
relating to Work Performers and their Operations.
You must include the file VW.WFI in any WorkFlo scripts used in conjunction
with Visual WorkFlo.
All parameters are passed to the Work Performer from Visual WorkFlo using
the names declared during authoring. The mode of the operation parameters
(in, out, inout) must match the input/output declaration of the WorkFlo
procedure’s parameters.
Arrays of these types are also supported. The adaptor passes an array of a
Visual WorkFlo data type as an array of the corresponding WorkFlo Script
data type.
Returned strings and arrays can be different lengths than their original input
length.
Active calls belong in any WorkFlo script that forms an active Work Performer.
These calls typically access Work Queue contents, manipulate data fields,
and log messages. They use F_WorkPerformerHandle.
Passive calls belong in any WorkFlo script that forms a passive Work
Performer. They establish the handle—F_OperationHandle—used in the
exception and termination calls.
Parameter Passing
Regardless of the mode of the Work Performer, parameter values move
between the script and the Work Object. Operation parameters use the
names declared during the definition process (in the Operation Definition
editor of the Work Performer browser). The parameter direction (in, out, inout)
must match that of the WorkFlo procedure’s parameters (input, output, input
output).
The following diagram shows the Workflow Instruction Sheet associated with
the code sample that follows the diagram. In the code sample, the ShowPay-
mentProc procedure is called from the VWGetWork procedure when the
Operation name for the Work Object is ShowPayment.
-- Constants
DEBUGMODE : const boolean = false; -- set this to true to activate
-- "display popup" debug statements
FORMFILE : const string = "loandemo.frm";
TAB : const string = repeat(" ",5);
-- Global variables
Error : number;
Terminator : selection;
TermShift : number;
i : number;
WorkObjectIDs : handle[];
SelectedWorkObject : number;
VWLogonHandle : handle;
PurchaseAmount : number;
-------------------------------------------------------------------
-- ShowPaymentProc procedure
--
-- This procedure displays the Payment Information form and prompts
-- the user to select an interest rate and loan term.
-------------------------------------------------------------------
ShowPaymentProc : procedure;
input LockHandle : handle;
MonthlyPaymentSelection : string;
PaymentInfoFormHandle : handle;
PaymentGridSel : number[1];
SelectedRow : number;
i : number;
j : number;
p : number;
Interest : number;
InterestStr : string;
InterestRateArray : number[];
MonthlyPayments15Array : number[];
MonthlyPayments30Array : number[];
MonthlyPaymentsArray : string[];
NumRows : number;
Yrs15Amt : number;
Yrs15RadioBtn : boolean;
Yrs15AmtStr : string;
Yrs30Amt : number;
Yrs30RadioBtn : boolean;
Yrs30AmtStr : string;
beginproc
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "In ShowPaymentProc, about to open form" wait foruser;
endif;
Yrs15Amt := 0;
Yrs30Amt := 0;
Yrs15RadioBtn := false;
Yrs30RadioBtn := false;
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "Got the fields, about to calculate payments" wait foruser;
endif;
-- The code below calculates payments and interest for 15 and 30 years
for i := 1 to NumRows do
Interest := (AdjustableRate + ((i-1) * .25)) / 1200;
p := (1 + Interest);
Yrs15Amt := (1 + Interest);
Yrs30Amt := (1 + Interest);
for j := 1 to 179 do
Yrs15Amt := Yrs15Amt * p;
endfor;
for j := 1 to 359 do
Yrs30Amt := Yrs30Amt * p;
endfor;
MonthlyPayments15Array[i] := PrincipalAmount * (Interest / (1 - (1 / Yrs15Amt)));
MonthlyPayments30Array[i] := PrincipalAmount * (Interest / (1 - (1 / Yrs30Amt)));
InterestRateArray[i] := AdjustableRate + ((i-1) * .25);
MonthlyPaymentsArray[i] := InterestStr+"%"+TAB+Yrs15AmtStr+TAB+Yrs30AmtStr;
endfor;
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "Payments are calculated, about to execute form" wait foruser;
endif;
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "Selection number is: ", PaymentGridSel[1] wait foruser;
endif;
SelectedRow := PaymentGridSel[1];
InterestRate := InterestRateArray[SelectedRow];
if Yrs15RadioBtn = true
then
MonthlyPayment := MonthlyPayments15Array[SelectedRow];
LoanDuration := 15;
elsif Yrs30RadioBtn = true
then
MonthlyPayment := MonthlyPayments30Array[SelectedRow];
LoanDuration := 30;
endif;
MonthlyPayment := int(MonthlyPayment*100+0.5)/100;
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "Interest Rate: ",InterestRate," Monthly Payment: ",MonthlyPayment,"
Loan Duration: ",LoanDuration wait foruser;
display popup "About to Set Fields in the Work Object." wait foruser;
endif;
-- Use the selected values and set the corresponding data fields in the Work Object.
Error := call "VW Set Fields"
set (F_VWHandle := LockHandle,
LoanDuration := LoanDuration,
InterestRate := InterestRate,
MonthlyPayment := MonthlyPayment);
endif;
exitproc;
endif;
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "About to Return the Work Object." wait foruser;
endif;
displayerror Error;
endproc;
-------------------------------------------------------------------
-- VWGetWork procedure
--
--This procedure gets Work Objects from Visual WorkFlo.
-- It handles initiating the conversation with Visual WorkFlo,
--getting the Work Objects out of the queue, and calling a WorkFlo
--procedure based on the Operation to perform.
-------------------------------------------------------------------
VWGetWork : procedure;
beginproc
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "In VWGetWork, about to Open Work Session" wait foruser;
endif;
-- After attaching to a Work Queue, the active Work Performer must register
-- with the system as an active Work Performer, specifying the Work Performer class
-- to register as. A handle for the Work Performer is returned.
Error := call "VW Open Work Session"
set (F_WorkQueueHandle := QueueHandle)
get (WPHandle := F_WorkPerformerHandle);
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "In VWGetWork, about to Open Browse Session and
Browse the Work Queue" wait foruser;
endif;
-- Begin browsing the Work Queue. Pass the handle from "VW Open Work Session" and
-- the maximum number of Work Objects that you want to look at (0 indicates all).
-- You get back a handle to the browse session, and also the number of Work
-- Objects in this queue.
-- If there are still Work Objects in the queue that can be processed
if NumWorkObjects > 0
then -- proceed with all the code
-- Loop through all the Work Objects in the queue (pass it the browse handle)
-- and get back the next Operation that that Work Object is queued for, get
-- values from the Work Object data fields, and get an object handle for each
-- object and fill some arrays with this information.
for i := 1 to NumWorkObjects do
Error := call "VW Browse Work Queue"
set (F_BrowseHandle := BrowseHandle)
get (OperationName := F_OperationName,
WorkObjectHandle := F_ObjectHandle,
CustName := CustName,
MonthlySalary := MonthlySalary);
if Error <> F_Success
then
displayerror Error;
exitproc;
endif;
WorkObjectList[i] :=
CustName+TAB+convert(MonthlySalary,string)+TAB+OperationName;
WorkObjectIDs[i] := WorkObjectHandle;
endfor;
-- Display the list of Work Objects to the user and get back their selection
-- in the variable SelectedWorkObject.
-- DisplayInBasket also allows the user to click on a button called ExitProgram
-- that is used here to determine if the program should break out of
-- this procedure.
if ExitProgram = true
then
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "User selected Exit, about to cleanup and exit program."
wait foruser;
endif;
-- cleanup handles
Error := call "VW Close Browse Session"
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "Browsed the Work Queue, about to Fetch the Work Object"
wait foruser;
endif;
-- When you know the Work Object that the user selected, you must "fetch" the
-- Work Object (which marks it as locked in the queue) so nobody else can access it.
-- Up to that point, the list is merely a snapshot of what was in the queue when the
-- browse was performed. Once the object is fetched, you can manipulate its Work
-- Object data field values.
-- Pass the Work Object that was selected by referencing the cell in the array
-- of Work Object Handles (here it is WorkObjectIDs[SelectedWorkObject]).
-- When you fetch the Work Object, you get a LockHandle back that you can use
-- to reference that fetched Work Object until you Return the Work Object.
-- You also get back the next Operation that this Work Object is queued for
-- in OperationName.
displayerror Error;
exitproc;
endif;
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "The Work Object has been fetched successfully and is locked."
wait foruser;
display popup "Operation Name is: ",OperationName wait foruser;
endif;
if OperationName = "GetCustomerInfo"
then
Error := call GetCustInfoProc
set (LockHandle := LockHandle);
if Error <> F_Success
then
displayerror Error;
endif;
elsif OperationName = "GetLoanInfo"
then
Error := call GetLoanInfoProc
set (LockHandle := LockHandle);
if Error <> F_Success
then
displayerror Error;
endif;
elsif OperationName = "ShowPayment"
then
-- End browsing the work queue and free the browse handle.
WorkObjectList := WorkObjectListNull;
-- When the program exits, it must cleanup and let Visual WorkFlo
-- know it is leaving. Call "VW Close Work Session" to free
-- the WorkPerformerHandle (WPHandle in this case) and
--”VW Detach From Work Queue” to free the queue handle.
then
displayerror Error;
exitproc;
endif;
endproc;
-- Constants
DEBUGMODE : const boolean = false; -- set this to true to activate
-- "display popup" debug statements
FORMFILE : const string = "loandemo.frm";
TAB : const string = repeat(" ",5);
-- Global variables
Error : number;
Terminator : selection;
TermShift : number;
-------------------------------------------------------------------
-- ShowPayment procedure
--
-- This procedure displays the Payment Information form and prompts
-- the user to select an interest rate and loan term.
-------------------------------------------------------------------
ShowPayment : procedure;
-- The above are the operation parameters that are passed in or sent out
-- of this procedure from/to the Visual WorkFlo Work Performer Operation
-- parameters which get/set the data fields in the Work Object.
MonthlyPaymentSelection : string;
PaymentInfoFormHandle : handle;
PaymentGridSel : number[1];
SelectedRow : number;
i : number;
j : number;
p : number;
Interest : number;
InterestStr : string;
InterestRateNumArray : number[];
MonthlyPayments15Array : number[];
MonthlyPayments30Array : number[];
MonthlyPaymentsArray : string[];
NumRows : number;
Yrs15Amt : number;
Yrs15RadioBtn : boolean;
Yrs15Str : string;
Yrs30Amt : number;
Yrs30RadioBtn : boolean;
Yrs30Str : string;
TempStr1 : string;
beginproc
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "In ShowPayment, about to open form" wait foruser;
endif;
Yrs15Amt := 0;
Yrs30Amt := 0;
Yrs15RadioBtn := false;
Yrs30RadioBtn := false;
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "About to calculate payments" wait foruser;
endif;
-- The code below calculates payments and interest for 15 and 30 years
Yrs30Amt := (1 + Interest);
for j := 1 to 179 do
Yrs15Amt := Yrs15Amt * p;
endfor;
for j := 1 to 359 do
Yrs30Amt := Yrs30Amt * p;
endfor;
MonthlyPayments15Array[i] := PrincipalAmt * (Interest / (1 - (1 / Yrs15Amt)));
MonthlyPayments30Array[i] := PrincipalAmt * (Interest / (1 - (1 / Yrs30Amt)));
InterestRateNumArray[i] := AdjustableRate + ((i-1) * .25);
MonthlyPaymentsArray[i] := InterestStr+"%"+TAB+Yrs15Str+TAB+Yrs30Str;
endfor;
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "Payments are calculated, about to execute form" wait foruser;
endif;
PrincipalAmount := PrincipalAmt,
Yrs30RadioBtn := true,
F_DisableFieldList := "PrincipalAmount")
get (Yrs15RadioBtn := Yrs15RadioBtn,
Yrs30RadioBtn := Yrs30RadioBtn,
PaymentGridSel := PaymentGrid,
Terminator := F_Terminator,
TermShift := F_TerminatorShifts);
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "Selection number is: ", PaymentGridSel[1] wait foruser;
endif;
SelectedRow := PaymentGridSel[1];
-- The next few lines of code set the variables that are output parameters from this
-- WorkFlo procedure. These parameters are returned as Operation parameters to
-- Visual WorkFlo and update the data fields in the Work Object.
InterestRate := InterestRateNumArray[SelectedRow];
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "Interest Rate: ",InterestRate," Monthly Payment: ",MonthlyPayment,"
Loan Duration: ",LoanDuration wait foruser;
endif;
MonthlyPayment := int(MonthlyPayment*100+0.5)/100;
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "TempStr1: ",TempStr1," Monthly Payment: ",
MonthlyPayment wait foruser;
endif;
displayerror Error;
-- for debugging, set the DEBUGMODE constant at the top of the program.
if DEBUGMODE = true
then
display popup "When you click on OK, the WorkFlo procedure/operation ends."
wait foruser;
endif;
endproc;
-------------------------------------------------------------------
-- MAIN procedure
-- This is the Main procedure. It has no code to execute. It is here
-- so you can compile this script from the WorkFlo debugger/compiler
-- without having to set Execution Options to Compile Only.
--
-- NOTE: A WorkFlo script written as a Passive Work Performer does
-- not need a "Main" procedure. It does not need to be able
-- to run from the WorkFlo compiler/debugger (it only needs
-- to compile successfully). It's sort of like a .DLL in Windows
-- (a reusable set of subroutines that can be called at runtime).
-- You can't step through procedures called as operations in a
-- Passive Work Performer because the script is in WorkFlo runtime
-- mode. For this reason, there is a constant at the top of this
-- program called DEBUGMODE. If it is set to true, it will display
-- popup messages to tell you which part of the procedure is
-- currently executing. If it is set to false, no display popups
-- will appear.
-- You could have Main call each of the other procedures (you
-- may need to prompt for input before calling some of the
-- procedures) in order to test/debug the calls before using them
-- as WorkPerformer operations.
-------------------------------------------------------------------
Main : procedure;
beginproc
-- Nothing to do, just here to let you compile easier.
endproc;
Note that you only need to call “VW Logon” once per WorkFlo script, not once
per Visual WorkFlo call. To terminate a Visual WorkFlo session properly, you
must call “VW Logoff.” Failure to do so will prevent Visual WorkFlo DLLs and
resources from being released.
Use the “VW Attach To Work Queue” and “VW Open Work Session” calls to
start up and register an active Work Performer. Until the script executes these
calls, the Visual WorkFlo application has no knowledge of the Work
Performer’s existence. The handle returned from “VW Open Work Session”
identifies an active Work Performer instance and is used in many other calls.
You must call “VW Open Work Session” before attempting to browse through
Work Queues—until you establish F_WorkPerformerHandle, you have no
access to the Work Queues. When finished with Visual WorkFlo processing,
you must call “VW Close Work Session” to release resources.
To establish a handle to the Work Queue you want to browse, call “VW Attach
To Work Queue.” When you are finished with the Work Queue, you must call
“VW Detach From Work Queue” to release resources.
See “Complete Work Queue Processing” on page 240 for information on how
to unregister a Work Performer.
The “VW Get Work Performer Handle” call returns a handle to a passive Work
Performer, used in subsequent calls to access Work Performer fields. The
“VW Get Operation Handle” call returns a handle used in subsequent calls to
access Operation parameters.
If your procedure uses any WorkFlo call that uses the F_OperationHandle
(i.e., your procedure uses the services provided for passive Work Performers)
your procedure must include an input variable called F_OperationID of type
number. You’ll notice that the required set parameter in “VW Get Operation
Handle” is also called F_OperationID. The WorkFlo adaptor passes a value
into the variable and you set the parameter equal to the variable.
By specifying the Work Class name, you determine the type of Work Object
created. Any values assigned to the Work Object’s fields override its initial
field values, as specified in the Field Definition of the Work Object class.
Dispatch software sends the newly created Work Object to the Work Queue of
the first Instruction in its “Workflow” Instruction Sheet so that processing can
begin.
Queue Management
Each Work Performer class has its own Work Queue. All Work Performers
within the same class share the same Work Queue. Before you can select a
Work Object from the Work Queue, you must do the following in your active
Work Performer WorkFlo script:
• Establish a handle for the browse session and get a snapshot of the
number of Work Objects in the Work Queue (“VW Open Browse
Session”).
• Establish a handle for each Work Object in the Work Queue and see its
contents (“VW Browse Work Queue”).
• Provide an interface for the user to select a Work Object from the Work
Queue, or use another method to determine which Work Object(s) to
select.
Note This call takes a snapshot of the queue contents; any subsequent changes to
the queue are not reflected in results from associated “VW Browse Work
Queue” calls.
When you are finished browsing the Work Queue, you must use the “VW
Close Browse Session” call to release F_BrowseHandle.
For more information about pre-selection rules, selection rules, sort rules, and
expressions allowed for each, see the “Specify Work Queue Rules” section in
the “Creating and Modifying Work Performer Classes” chapter of the Visual
WorkFlo/Composer Handbook.
To access multiple Work Objects in the Work Queue, put the “VW Browse
Work Queue” call inside a loop. To see every returned Work Object, limit the
loop by the value of F_WorkObjectCount (returned from “VW Open Browse
Session”). To restrict the number of Work Objects seen, limit the loop by the
desired number. To avoid an error, this number must be less than
F_WorkObjectCount.
Note that only one Work Performer can lock a Work Object at a time. This call
will fail if the Work Object is already locked.
When you have finished processing a locked Work Object, call “VW Return
Work Object” to release F_ObjectHandle.
Field Manipulation
Using the calls described in this section you can set and get Work Performer
fields and Operation parameters. You can also get Work Queue fields.
You must lock a Work Object to read or write its associated Operation
parameter fields. You can read Work Queue fields, and you can read and write
Work Performer fields.
Note that when you call “VW Set Fields” or “VW Get Fields” from a passive
WorkFlo script, you can access Work Performer fields only.
The direction specified in the Operation Definition editor also affects your
access to the Operation parameters.
Summarized as follows:
You must lock a Work Object to read or write its associated Operation
parameter fields. Use the “VW Fetch Work Object” call, described on
page 231, to establish a lock handle—F_LockHandle. The parameters you
can access belong to the next Operation that will execute against the locked
Work Object.
Before you lock a Work Object you can read its fields, and you can read and
write Work Performer fields.
Note that you cannot set the values of Work Object data fields from within
WorkFlo, except when you initially create a Work Object with the “VW Create
Work Object” call.
Access Rights
VW Set Fields
VW Get Fields
Operation Completion
When you have successfully performed the Operation on a locked Work
Object, call “VW Return Work Object” with F_Unprocessed set to false. This
frees F_ObjectHandle, unlocks the Work Object, and releases it to the next
Instruction in its Instruction Sheet. It also sets parameter values in the
Operation identified by the F_OperationName parameter in the “VW Fetch
Work Object” call and sends the Work Object to its next Instruction.
Call “VW Work Object Query” to get information about a specific matching
Work Object.
Call “VW Close Object Query Session” to close the session and release the
handle.
You can only change Work Object values if F_LockForUpdate was true when
“VW Open Object Access Session” was called. Any changes you make are
saved when you call “VW Close Object Access Session”.
You use the “VW Close Object Access Session” call to save any changes
made with calls to “VW Set Fields”, free the handle returned by “VW Open
Object Access Session,” and terminate the Work Object access session.
Call “VW Close Work Session” when you want to remove the current active
Work Performer from the Visual WorkFlo application. By calling “VW Open
Work Session” again, the WorkFlo script can subsequently establish a further
session to browse Work Queues. However, be aware that multiple calls to
either “VW Open Work Session” and “VW Close Work Session” can impact
performance.
VW Free Handle
“VW Free Handle” releases the handle specified in its set clause. Use this call
to free the handle of an unlocked Work Object (F_ObjectHandle), or a Work
Performer handle (F_WorkPerformerHandle (for a passive Work Performer),
or an Operation handle (F_OperationHandle).
For more information about logging messages, see the “Logging Features”
section in the “Creating a Visual WorkFlo Application” chapter of the Visual
WorkFlo/Composer Handbook.
VW Set Attributes
Use “VW Set Attributes” to control the frequency with which the local log
cache flushes its contents. You can change the maximum number of entries
contained in the local log cache by specifying F_LogCacheFlushLength.
VW Log Message
Use “VW Log Message” to log a message for the specified event type.
VW Raise Exception
Call “VW Raise Exception” when the script encounters an exception condition.
You can specify the name of an exception handling Instruction Sheet to
process the Work Object. You can also provide a description of the exception,
for example “Account number contained null.”
This call frees the lock handle and the object handle.
You must have installed Visual WorkFlo before you can use this call.
In this example, if the parameter Err contained the error code 213, 45, 1016,
the call returns the error text “Unknown top-level field of item” into
F_ErrorText.
This glossary contains only those terms deemed specific to Visual WorkFlo. It
does not include generic computing or imaging terms.
Adaptor
FileNet-provided software that acts as a gateway between Visual WorkFlo
and the Operation software.
Authoring repository
A database table that stores all class definitions.
Bound subtree
A subtree contained within a BindToUser or BindToStation system
Instruction and an Unbind system Instruction.
Data Class
Data type.
Dispatch software
Retrieves the Work Object from the On-line repository and submits the
appropriate Work Object data fields to the Work Performer’s adaptor.
Editor
A user interface within the Browsers.
errtuple.h
A ‘C’ header file containing error constants for which you can trap in your
Work Performer code.
History repository
A database table that stores statistical information for archival purposes
and management reporting.
Inheritance
The ability to inherit properties from a parent class.
Instruction
A graphical entity on an Instruction Sheet. An Instruction represents either
a Work Performer Operation or a decision. An Instruction includes a
definition for passing data between the Work Object and the Work
Performer.
Instruction Sheet
Graphical representation of a business process. One Work Class can
contain multiple Instruction Sheets, and an Instruction Sheet can call other
Instruction Sheets.
Left pane
The work area in the upper left of Visual WorkFlo/ Composer and Visual
WorkFlo/Conductor screens. Fixed size.
Middle pane
The work area in the upper middle of Visual WorkFlo/ Conductor screens.
Fixed size.
On-line repository
A database table that stores the executable version of Work Class
definitions.
Operation
A software procedure that is a member of a Work Performer class. It
represents either system commands or user-created Work Performers,
and can be displayed as an icon within an Instruction Sheet.
Operation editor
A user interface within the Instruction Sheet where you specify the names
of Work Object fields.
Pertool
A tool used to setup the default database tables and to initialize individual
domains.
Repository
A database containing application definitions and runtime versions, as well
as statistical information.
Right pane
The work area in the upper right of Visual WorkFlo/ Composer and Visual
WorkFlo/ Conductor screens. Fixed size.
Subtree
A collection of Instructions connected to a common node.
System Instructions
Special flow- and logic-control Instructions provided by FileNet.
Transfer
The process of transferring class definitions from the Authoring repository
to the On-line repository. During this process, the definitions are compiled
into an executable format.
Visual WorkFlo
A suite of programs that provide intelligent workflow management.
Visual WorkFlo/Composer
The Visual WorkFlo application used to author the definitions for Work
Classes and Work Performers.
Visual WorkFlo/Conductor
The Visual WorkFlo application used to handle exception conditions, apply
on-the-fly updates to Work Object values and Instruction Sheets, and to
manage the flow of work through a Visual WorkFlo system.
Visual WorkFlo/Performer
The runtime version of Visual WorkFlo that enables the Work Performers
to execute their tasks.
VW.INI file
The file containing setup preferences and options for the Visual WorkFlo/
Composer, Visual WorkFlo/ Conductor, and Visual WorkFlo/Performer
environments.
Work Class
A template that defines the Work Object in terms of data fields and
Instruction Sheets.
Work Object
A transitory element that contains data, Instruction Sheets, and status.
Work Object Id
A field specified in the Properties editor of the Work Class browser. The
value in this field is referenced during a Wait for Event definition, and
displays in some panes of Visual WorkFlo/Conductor.
Work Order
The internal class name for an Instruction.
Work Performer
The entity that actually performs work. An active Work Performer can
select an entry from its Work Queue. A passive Work Performer can only
receive work from the Work Queue based on preset rules.
Work Queue
A database table where Work Objects wait until the Work Performer is
available.
Workspace
A snapshot of the On-line repository. Visual WorkFlo can maintain multiple
workspaces.
This appendix contains a description for each error tuple that can be reported
by the Visual WorkFlo API calls.
The FileNet error tuple code is a three part 32-bit unsigned long value. The
three parts are as follows:
The first 16 bits represent the Error Number, the middle 8 bits represent the
Error Function, and the last 8 bits represent the Error Category, described in
the following paragraphs.
Note The Error Message Translator can only decode error tuples from the server
side of the OLE connection. If a Work Performer calls VWAPI functions that
call VWAPISRV through OLE, error tuples from the OLE client (VWAPI in this
case) cannot be decoded by the Error Message Translator. However, there
are very few error messages that come from the client side.See the Visual
WorkFlo Utilities Handbook for more information on the Error Message
Translator.
Error Category
The Error Category code for Visual WorkFlo is 213 (decimal).
Note that if the Error Category portion of the returned error tuple does not
equal 213, it means that this error was reported by WorkForce Desktop–not
Visual WorkFlo. In this case, please refer to the appropriate WorkForce
Desktop documentation for a description of the error tuple code.
Error Function
The Error Function code indicates the exception class (type) of the error. The
following table maps the Error Function Codes to their respective exception
classes.
Error Function
Code Exception Class
1 MemoryException
2 AssertException
10 DLLException
11 NumberException
12 ErrorTupleException
13 ErrorTextException
20 SecurityException
25 PersistException
26 BtrieveException
35 PrimitiveException
36 DataClassException
45 ExprExecException
46 ExprCompException
55 SidlCompilerException
56 SmartWorkException
65 LogException
70 QueueException
75 ServicesException
80 PerformException
81 ISInterpreterException
82 WorkPerformerException
Error Numbers
The following table shows each Error Number (and its message) within each
Error Function Code. For a list of error constants and their error tuples, refer to
the errtuple.h file. This file contains a subset of the entries listed in the
following table, as well as a comment section with usage examples.
Error
Function Error
Code Number Error Message
1 1001 Uncaught exception!
1 1002 Assertion Failed (exact message depends on
assertion type).
1 1003 Maximum try nesting depth exceeded.
1 1004 Catch clause not in try block.
1 1005 Rethrow done with no previous throw.
1 1006 Not enough available memory.
1 1007 Memory request exceeded segment size.
1 1008 Could not lock memory handle.
1 1009 Can’t watch application’s memory.
1 1010 Can’t stop watching application’s memory.
1 1011 Throw performed in stack cleanup while
processing another throw.
1 1012 Not an application.
1 1013 Can’t watch global memory handle.
1 1014 Can’t stop watching global memory handle.
2 1 Assertion Failed... The exact message depends
upon the nature of the assertion failure.
10 1001 Could not load DLL.
10 1002 Could not find entry point in DLL.
11 1003 Divide by zero.
11 1004 Square root of a negative value.
11 1005 Underflow.
11 1006 Overflow.
Error
Function Error
Code Number Error Message
20 1000 You are not logged on. Please log on to the
system first.
20 1001 Missing or invalid INI file entry in Security section.
25 1001 Bad type for database column.
25 1002 Object is in multiple persistent tables.
25 1003 Bad key type for persistent dictionary.
25 1004 Object not found in cache on cache only request.
25 1005 Bad parameter for Oid constructor.
25 1006 Object is in multiple OidCores.
25 1007 Two definitions of a column have different types.
25 1008 Two definitions of an index are different.
25 1009 Use of iteration type not defined for class.
25 1010 Not a valid query clause.
25 1011 Not a valid key description.
25 1012 Missing required configuration item.
25 1013 Bad store type.
25 1014 Missing Begin/End transaction.
26 1500 Unable to open FN_FILE.DDF.
26 1501 Unable to open FN_FIELD.DDF.
26 1502 Unable to open FN_INDEX.DDF.
26 1503 Missing field definition.
26 1504 Not a valid field for index.
26 1505 Cannot find DDF table info for table.
26 1506 Cannot find DDF field info for table.
26 1507 Cannot find DDF index info for table.
26 1508 Unable to create table.
26 1509 Unable to open table.
26 1510 Bad field value type.
Error
Function Error
Code Number Error Message
26 1511 Bad field name.
26 1512 Bad type for a key.
26 1513 Unable to insert record into table.
26 1514 Bad key type for dictionary.
26 1515 Bad value type for dictionary.
26 1516 Bad Record Type for the table.
26 1517 Failed to begin a transaction.
26 1518 Unable to close table.
26 1519 Unable to create directory for Database.
26 1520 Unable to initialize Btrieve.
35 1 Unsupported primitive data type.
36 1001 Runtime class was not found.
45 1001 Invalid data type for operation.
45 1002 Invalid opcode encountered.
45 1003 Expression stack unexpectedly has too few
items.
45 1004 Expression evaluation resulted in bad stack
contents.
45 1005 Division by zero.
45 1006 Attempted to use string index/length outside of
string.
45 1007 Second and third arguments to translate function
must be same length.
45 1008 Second argument to WorkFlo substitute function
must not be empty.
45 1009 Argument to hex function must be even length
and contain all hex digits.
45 1010 Bad null type.
45 1011 Bad conversion type(s).
45 1012 Bad conversion value.
Error
Function Error
Code Number Error Message
45 1013 Unknown object type encountered.
45 1014 Opcode not yet implemented.
45 1015 Value out of range.
45 1016 Unknown work object item.
45 1017 Unknown field of item.
45 1018 Subscript out of range.
45 1019 Invalid operation on null value.
45 1020 Cannot convert value to string.
46 2001 Bad types for operand(s).
46 2002 Syntax error.
46 2003 Parser stack overflow.
46 2004 Bad space for scanner.
46 2005 No space for scanner.
46 2006 Unknown compilation error.
46 2007 Token too large.
46 2008 Push-back buffer overflow.
55 2001 Non existent DataClass.
55 2002 Syntax error.
55 2003 Parser stack overflow.
55 2004 Bad space for scanner.
55 2005 No space for scanner.
55 2006 Unknown compilation error.
55 2007 Token too large.
55 2008 Push-back buffer overflow.
56 311 Invalid WorkObject exception.
56 312 Primitive InstructionSheet not found.
56 313 Undefined WorkObject exception.
56 314 Illegal WorkObject exception.
Error
Function Error
Code Number Error Message
65 1000 Unable to create the ClientLogger timer.
65 1001 Failed to get instance of PersistentStrDictionary
for logger.
70 1001 Invalid queue name.
70 1002 Invalid message dictionary format.
70 1003 Invalid queue field type.
70 1004 Queue assertion violated.
70 1005 Bad result type for expression.
70 1006 Could not lock queue entry.
70 1007 Could not unlock queue entry.
75 1 Unknown error.
75 2 Invalid WorkClass name.
75 3 Invalid Work Object Id.
75 4 Invalid Work Object field name.
75 5 Invalid context id.
75 6 Field type mismatch.
75 7 Invalid Work Performer id.
75 8 Invalid browse id.
75 9 Browse has been exhausted.
75 10 Invalid lock id.
75 11 Cannot get an ‘Out’ parameter.
75 12 Cannot set an ‘In’ parameter.
75 13 Object type mismatch.
75 14 Invalid parameter name.
75 15 Incorrect parameter type.
75 16 Invalid object id.
75 17 Cannot set the Work Queue fields.
75 18 Invalid Work Performer class name.
Error
Function Error
Code Number Error Message
75 19 Insufficient security rights.
75 20 Out of memory.
75 21 Cannot lock memory handle.
75 23 Cannot lock the Work Object.
75 24 All active Work Performers deactivated–
ReportToWork not allowed.
75 25 Active Work Performer deactivated–
LockWorkObject not allowed.
75 26 Removal of a busy active Work Performer not
allowed.
75 27 Visual WorkFlo/Performer not responding–
ReportToWork not allowed.
75 28 Unable to establish DDE connection with Visual
WorkFlo/ Performer–ReportToWork not allowed.
75 29 Unsupported field type.
75 30 Exception already raised for Work Object.
75 31 Exception undefined for Work Object class.
75 32 Illegal raising of a Work Object exception.
75 33 Currently no exception for Work Object.
75 34 The specified bit position is not supported by
LogMessage().
75 35 Invalid WorkQueue field name.
75 36 Invalid registration id.
75 37 User access denied.
80 211 TBD
80 212 Unable to find next Work Performer.
80 213 Unable to enqueue Work Object.
80 216 Invalid object class.
80 217 Required data not found.
80 218 Requested Work Performer not found.
Error
Function Error
Code Number Error Message
80 219 Requested Work Performer not available.
80 220 No performable WorkObjects available.
80 221 WorkObject not doable by specified
WorkPerformer.
80 222 WorkQueue not found.
80 223 Adaptor type not supported.
80 224 Adaptor name not found for WorkPerformer
class.
80 225 Specified WorkPerformer class not found.
81 181 Primitive InstructionSheet unavailable.
81 182 Unsupported InstructionSheetInterpreter
service.
81 183 Malfunction InstructionSheet not defined.
82 192 WorkObject access violation.
82 193 Invalid action parameters.
82 194 WorkObject assertion violation.
82 195 WorkPerformer service failure.
82 196 WorkPerformer start failure.
82 197 WorkPerformer perform failure.
82 198 WorkPerformer stop failure.
82 199 Corrupted value returned by WorkPerformer.
82 200 Unknown DataClass returned by
WorkPerformer.
82 201 Invalid parameter returned by Work Performer–
must be subclass of dataclass in service
specification.
VW_GetErrorMessageSize 25 VW_LockWorkObject 21
C 128 C 150
VWAPISRV 36 VWAPISRV 37
VW_GetFieldNames VW_LogMessage 19
C 129 C 152
VWAPISRV 37 VWAPISRV 37
VW_GetFloat 23 VW_Logoff 18
C 131 C 154
VWAPISRV 37 VWAPISRV 37
VW_GetFPNumber VW_Logon 18
C 133 C 155
VWAPISRV 37 VWAPISRV 38
VW_GetInteger 23 VW_NextWorkObjectToBrowse 21
C 135 C 157
VWAPISRV 37 VWAPISRV 38
VW_GetLoggingState 19 VW_RaiseException 25
C 137 C 158
VWAPISRV 37 VWAPISRV 38
VW_GetOperationName 22 VW_ReportToWork 21
C 139 C 160
VWAPISRV 37 VWAPISRV 38
VW_GetOperationNameSize 22 VW_SetArray
C 140 VWAPISRV 38
VWAPISRV 37 VW_SetArrayPtr 23
VW_GetString 23 C 161
C 141 VW_SetBoolean 23
VWAPISRV 37 C 163
VW_GetStringSize 23 VWAPISRV 38
C 143 VW_SetFloat 23
VWAPISRV 37 C 165
VW_GetTime 23 VWAPISRV 38
C 145 VW_SetFPNumber
VWAPISRV 37 C 167
VW_GetWobSignature 22 VWAPISRV 38
C 147 VW_SetInteger 24
VWAPISRV 37 C 169
VW_GetWorkPerformerHandle 22 VWAPISRV 38
C 148 VW_SetLogCacheFlushLength 19
VWAPISRV 37 C 171
VW_LeaveWork 21 VWAPISRV 38
C 149 VW_SetLoggingState 19
VWAPISRV 37 C 172
VWAPISRV 38
VW_SetString 24 W
C 174 WFLADAPT.DLL 197
VWAPISRV 38 Work Object
VW_SetTime 24 changing 21, 115, 188
C 176 creation 227
VWAPISRV 38 termination 228
VW_TerminateWorkObject 25 Work Object binding API calls
C 178 VW_BindToUser 23
VWAPISRV 38 VW_UnBind 23
VW_UnBind 23 Work Object creation
C 180 function sequence 16
VWAPISRV 38 VW_CreateWorkObject 18
VW_UnlockAndDispatch 21 VW_DispatchWorkObject 18
C 181 Work Object information API calls
VWAPISRV 38 VW_GetOperationName 22
VW_UnlockWorkObject 21 VW_GetOperationNameSize 22
C 182 VW_GetWobSignature 22
VWAPISRV 39 VW_GetWorkPerformerHandle 22
VW_WobQueryCreate 24 Work Object location API calls
C 183 VW_WobQueryCreate 24
VWAPISRV 39 VW_WobQueryEnd 24
VW_WobQueryEnd 24 VW_WobQueryExecute 24
C 185 VW_WobQueryGetAccessHandle 22
VWAPISRV 39 VW_WobQueryInstrSheet 24
VW_WobQueryExecute 24 VW_WobQueryOperation 24
C 186 VW_WobQueryWorkPerformerClass 24
VWAPISRV 39 Work Performer
VW_WobQueryGetAccessHandle 22 16-bit 1
C 188 32-bit 2
VWAPISRV 39 design considerations 3
VW_WobQueryInstrSheet 24 using OLE 29
C 190 Work Performer fields
VWAPISRV 39 getting and setting 232
VW_WobQueryOperation 24 Work Queue fields
C 192 getting and setting 232
VWAPISRV 39 number of 5
VW_WobQueryWorkPerformerClass 24 Work Queues
C 194 number of 5
VWAPISRV 39 WorkFlo Script
VWAPISRV data type conversion 198
API call syntax 34 Visual WorkFlo handles 199
VWOLEADP adaptor 8, 29, 31