Business Function Specification
Source NameB0100050DesignerC. Cox
Data Structure D0100050ProgrammerT. Edwards
Function NameCache, Process Address Book TreeSystem Code01
Function Category
Function Use
Revisions Log
DateProgrammerSAR NumberDescription
03/09/98C. Cox 2050028Created.
03/27/98T. Edwards 2050028Programming Completed
1.Functional Description
1.1Purpose
This function will perform Get, Add, Update, Delete, Delete All, Get Next, Add/Update, and Terminate functions on the Address Book Tree Cache used
in the business functions B0100049.
The calling application is responsible for loading all appropriate key values to the data structure and identifying the number of keys to use in
retrieval/update processes.
1.2 Setup Notes and Prerequisites
Cache Action Codes
'2' Add - add a cache element.
'3' Update - update a cache element.
'4' Delete - delete a cache element.
'5' Delete All - delete all cache elements
'6' Get Next - retrieve the next cache element
'7' Add/Update - will add if element does not exist, will change if it does exist.
'8' Terminate - terminate cache
'9' Release Cursor - close the input cursor
'D' Debug Mode - Dumps the contents of the entire cache into a text file.
Number of Keys
key values for a Get, Update, Delete, Get Next, and Add/Update.
A zero may be passed to retrieve, update, or delete the first record.
and SequentialFetch = '1'. This allows the calling application to use GET NEXT to fetch elements
from the cache sequentially. If GET NEXT is called until the end of the keyed cache dataset is found,
the function automatically closes the open cursor. Otherwise, the calling application is responsible
for closing the cursor using action code '9'.
'b7'b7'b7'b7'b7'b71.3Special Logic
This function creates a cache named "CUSTREE_" + Input Cache Name or Job Number.
2.Technical Specifications
2.1Parameters:
Data Item Data Structure DescriptionI/ORequiredNotes
INTLevelI/OYLevel of the Address book relative to the parent.
(Key 1 of 2)
AN8Address Book NumberI/OYAddress Book Number. (Key 2 of 2)
EV01Cache Action CodeIY'1' = Get cache element
'2' = Add element
'3' = Update element
'4' = Delete cache elements
'5' = Delete All cache elements
'6' = Get Next cache element '7' = Add/Update cache element
'8' = End cache (terminate cache) '9' = Close Cursor and Free Data Ptr
'D' = Debug Mode
EV01Cache Error CodeON'0' = Success Process
'1' = Reached End of Cache(mode 6)
'2' = Invalid Input Parameter
'3' = Failed to Create Cache
'4' = Failed to Add/Update Cache
'5' = Failed to Delete Cache
'6' = Fetch Failed(mode 1)
INT01Number of KeysIYNumber of Keys to be used in the cache process.
(Max 2)
SUPPSSuppress Error MessageIN'0'=allow runtime error message handling.
'1' = Suppress runtime error message
handling.
DTAIError Message IdON" " = Success
"032E" = Error Processing Cache
GENLNGCache Cursor PtrI/ON
EV02Sequential FetchINIf action is GET and this parm is '1', function will
pass back cursor pointer for GET NEXT operation.
JOBCache Name or Job NumberIYRequired in naming the cache.
2.2Related Tables
Table Table Description
None
2.3Related Business Functions
Source NameFunction Name
None
2.4Processing
Cache Layout:Cache includes all of the following fields; key fields are noted.
Data Item Data Structure DescriptionKey Field
AN8Address Book NumberY
INTLevelY
I.Perform setup functions
B.If not successful, set error "032E", set Cache Error Code = '3', and return failure.
C.Validate input parameters Number Of Keys, Action Code, and Comparison Flag.
D.If not valid, set error "032E", set Cache Error Code = '2', and return failure.
E.Set Cache Error Code = '0'
F.Set return code to success.
II.Processing Based on Mode.
2.Retrieve the first element on the cache matching the key values passed as input. If the input Number of Keys is zero, fetch the first
element in the cache.
3.Load the values from the retrieved element into the data structure to be passed back to the calling program.
4.If SequentialFetch = '1', return cursor pointer to calling application. Otherwise, close the cursor.
5.If get fails set Cache Error Code = '6'.
2.If add fails set error "032E", set Cache Error Code = '4', and return failure.
2.If update fails set error "032E", set Cache Error Code = '4', and return failure.
2.If the number of keys is 0, delete the first cache element.
3.If delete fails, set Cache Error Code = '5'.
E.If Cache Action Code is '5' - DELETE ALL:
2.If delete fails, set Cache Error Code = '5'.
as input (the cursor should have been set through a previous "Get" action, i.e. action code '1'. If the Number of Keys is zero then fetch
the next record without using any key).
2.Load the values from the retrieved element into the data structure to be passed back to the calling program.
3.If there are no more elements, close the cursor and set Cache Error Code = '1'.
G.If Cache Action Code is '7' - ADD/UPDATE:
2.Insert a new cache element with values from data structure.
3.If add fails set error "032E", set Cache Error Code = '4', and return failure.
2.Perform cleanup functions (Terminate cache).
2.Close cursor.
3.Free Data Ptr and Set Cache Cursor Ptr to 0.
D0100050 - Cache, Process Address Book Tree Data Structure
^
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
nLevel | INT01 | integer | REQ | BOTH |
Number of Days in Future to Query for Responses Due. | ||||
mnAddressNumber | AN8 | MATH_NUMERIC | REQ | BOTH |
A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or
| ||||
cCacheActionCode | EV01 | char | REQ | INPUT |
An option that specifies the type of processing for an event. | ||||
cCacheErrorCode | EV01 | char | OPT | NONE |
An option that specifies the type of processing for an event. | ||||
nNumberOfKeys | INT01 | integer | REQ | INPUT |
Number of Days in Future to Query for Responses Due. | ||||
cSuppressErrorMessage | SUPPS | char | OPT | NONE |
A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.
0 = allow
| ||||
szErrorMessageID | DTAI | char | OPT | NONE |
A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or
| ||||
idCacheCursorPtr | GENLNG | ID | OPT | NONE |
General purpose ID variable. | ||||
cSequentialFetch | EV02 | char | OPT | NONE |
An option that specifies the type of processing for an event. | ||||
szCacheNameOrNumber | JOB | char | REQ | INPUT |
Job Number |
None |
None |