CacheProcessParentBranches

Cache, Process Parent Branches

Minor Business Rule

Object Name: B3500120

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This function will perform Get, Add, Update, Delete, Delete All, Get Next, Add/Update, and Terminate 
functions on the Parent Branches Cache used in the Branch Relationships Chart application P34031.


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
Standard

• '1' Get - Verifies that the input parent branch is in the cache.
• '2' Add - add a cache element. (NOT IMPLEMENTED)
• '3' Update - update a cache element. (NOT IMPLEMENTED)
• '4' Delete - delete a cache element. (NOT IMPLEMENTED)
• '5' Delete All - delete all cache elements
• '6' Get Next - retrieve the next cache element. (NOT IMPLEMENTED)
• '7' Add/Update - will add if element does not exist, will change if it does exist. (NOT 
IMPLEMENTED)

• '8' Terminate - terminate cache.
• '9' Close cursor and free data ptr. (NOT IMPLEMENTED)
• 'D' Debug Mode - Dumps the contents of the entire cache into a text file


• When action code GET is used, the function will perform a fetch from the cache for the input Parent 
Branch. If the record is not found, the Parent Branch will be added to the cache and an error code of 

'1' is returned to the calling application. If the record is found then an error code of '2' is 

returned.

1.3Special Logic

This function will create a cache named  where computer id is passed into the function on 
all calls.. 


2.Technical Specifications

Cache Layout:Cache includes all of the following fields; key fields are noted.

Data Item Data Structure DescriptionKey Field

MMCUParent BranchY


I.Perform setup functions 

A.Initialize cache to get handle.
B.If not successful, set error "032E", set Cache Error Code = '3', and return failure.

C.Set Cache Error Code = '0'

D.Set return code to success.


II.Processing Based on Mode.


A.If Cache Action Code is '1' - GET:
1.Open cursor.
2.Retrieve the first element on the cache matching the key values passed as input. 

3.If get fails set Cache Error Code = '1' And Add the Parent Branch to the Cache.

4.If get succeeds set Cache Error Code = '2'.

5.Close cursor.


B.If Cache Action Code is '5' - DELETE ALL
1.Delete all elements in the cache.
2.If delete fails, set Cache Error Code = '5'.


C.If Cache Action Code is '8' - END
1.Perform cleanup functions (Terminate cache).

D.If Cache Action Code is 'D' - DUMP
1.Dump entire cache into a text file


^

Data Structure

D3500120 - Cache, Process Parent Branches

Parameter NameData ItemData TypeReq/OptI/O/Both
szComputerIDCTIDcharNONENONE

szParentBranchMMCUcharNONENONE

A code that represents a high-level business unit. Use this code to refer to a branch or plant that might have departments or jobs, which 
represent lower-level business units, subordinate to it. For example:     o Branch/Plant (MMCU)     o Dept A (MCU)     o Dept B (MCU)     o Job 123 
(MCU) Business unit security is based on the higher-level business unit.

cCacheActionCodeEV01charNONENONE

An option that specifies the type of processing for an event.

cCacheErrorCodeERRCcharNONENONE

This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
Set Server program (XT4914).

cSuppressErrorMessageSUPPScharNONENONE

A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.        0 = allow 
runtime error message handling.        1 = suppress runtime error message handling.

szErrorMessageIDDTAIcharNONENONE

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 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

Related Functions

None

Related Tables

None