F32922ProcessRuleRangesCache

F32922 Process Rule Ranges Cache

Minor Business Rule

Object Name: B3200150

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 Rule Ranges cache. 


1.2Setup Notes and Prerequisites

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.  


• Cache Action Code
• '1' Get - retrieve the cache element.  
• '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' Close cursor

• Number of Keys 
• If the number of keys is passed as a parameter, the business function uses this value to setup 
key values for a Get, Update, Delete, Get Next, and Add/Update.  

• A zero may be passed to retrieve or update the first record or add a new element without 
re-loading the cache from the F32922 file.


1.3Special Logic
See parameter notes for special logic related to "add" mode.  A load of the cache will be performed 
using data retrieved from the Rule Ranges table (F32922) if the number of keys is not zero; a "normal" 

Add function (i.e. new cache element inserted using values passed in as input) if the number of keys 

is zero.


2.Technical Specifications

2.4Processing 

I.    Perform setup functions 
A. Initialize cache to get handle.
B. Retrieve cursor (either from data pointer or new CACHE cursor)

C.Return CACHE cursor upon requested

D. Set  DS Cache Error Code = '0';   

E. If not successful Set error "032E,"  "Error Processing Cache".


II.  Processing Based on Mode.


A.If Process Mode is "1" - GET:
1.Open cursor, reset cursor.
2.Retrieve the first element on the cache matching the key values passed as input; the 

number of keys to be used is passed in the input parameters,  If  "0" fetch first element in the 

list. 

3.Load the values from the retrieved element into the data structure to be passed back to 

the calling program. 

4.If get fails DS Cache Error Code = '6'.


B.If Process Mode is "2" - ADD. 

1.If number of keys = 0,  use same logic as mode "7".
2.If number of keys NOT = 0, perform "Load" function:

• Select all records on F32922 matching the key values passed as input; the number of keys 
to be used is passed in through input parameters.

• If File Code is "E" then retrieve both "If" code and "then" code.
• For each retrieved record, write an element to cache.

C.If Process Mode is "3" - UPDATE (same logic as mode "7").
1.Use same logic as mode "7".

D.If Process Mode is "4" - DELETE:
1.Delete all elements on the cache matching the key values passed as input.
2.If delete fails DS Cache Error Code  = '5'.


E.If Process Mode is "5" - DELETE ALL:

1.Delete all elements in the cache.
2.If delete fails DS Cache Error Code  = '5'.


F.If Process Mode is "6" - GET NEXT:
1.Retrieve the next element on the cache matching the key values passed as input (the 
cursor should have been set through a previous "Get" action, i.e. process mode "4", if number of 

keys is "0" then fetch 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 cursor and set  DS Cache Error Code = '1'.


G.If Process Mode is "7" - ADD/UPDATE:

1.Use first keys to fetch the position in CACHE.
2.If the Fetch is successful the update the CACHE with new range (value 1 & 2)
Otherwise add new record to CACHE with new range (value 1 & 2)
3.If add/update fails, set error "032E" and set DS Cache Error Code = '4'.

H.If Process Mode is "8" - END
Perform cleanup functions (Terminate cache). 

I.If  Process Mode is "9" - CLOSE CURSOR:
1.Perform close cursor.

Data Structure

D3200150 - F32922 Process Rule Ranges Cache

Parameter NameData ItemData TypeReq/OptI/O/Both
cFileCodeFCODcharNONENONE

The file code is used in the *RANGE and *VALUE file for configurations to determine if the *RANGE or *VALUE goes with a "IF" statement, a 
"THEN"statement or with an assembly inclusion rule statement.

mnParentItemNumberKITMATH_NUMERICNONENONE

The system provides for three separate item numbers.    1.   Item Number (short) - An eight-digit, computer assigned, completely 
non-significant item number.    2.   2nd Item Number - The 25-digit, free form, user defined alphanumeric item number.    3.   3rd Item Number - Another 
25-digit, free form, user defined alphanumeric item number.

szBranchPlantMCUcharNONENONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

mnRuleNumberATO#MATH_NUMERICNONENONE

The number associated with a set of cross-segment editing rules or assembly inclusion rules.

mnRuleSequenceNumberATOSMATH_NUMERICNONENONE

The Sequence number is the rule number within an edit group of cross-segment editing rules or assembly inclusion rules. You can insert a 
line within a rule to assign a new sequence number.

nNumberOfKeysINT01integerNONENONE

Number of Days in Future to Query for Responses Due. 

cCacheActionCodeEV01charNONENONE

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

cCacheCodeErrorEV01charNONENONE

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

cSuppressErrorMessageEV01charNONENONE

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

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.

mnJobNumberJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

idCursorGENLNGIDNONENONE

General purpose ID variable.

cReturnCursorEV01charNONENONE

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

szRangeValue1SRFVcharOPTNONE

The starting value of a range of numbers. In configurator, the *Range variable is used in the Values field associated with the cross-segment 
editing rules and assembly inclusion rules. Entering *Range in this field accesses the Range Revision (From Range and To Range) form. 
The *Range values represent answers to the segment referenced by the rule. You can use a UDC table to act as a filter to narrow the 
possible valid values that the logic statement will return.

szRangeValue2SRTVcharOPTNONE

The ending value of a range of numbers. In configurator, the *Range variable is used in the Values field associated with the cross-segment 
editing rules and assembly inclusion rules. Entering *Range in this field accesses the Range Revision (From Range and To Range) form. 
The *Range values represent answers to the segment referenced by the rule. You can use a UDC table to act as a filter to narrow the possible 
valid values that the logic statement will return.

szNewRangeValue1SRFVcharOPTNONE

The starting value of a range of numbers. In configurator, the *Range variable is used in the Values field associated with the cross-segment 
editing rules and assembly inclusion rules. Entering *Range in this field accesses the Range Revision (From Range and To Range) form. 
The *Range values represent answers to the segment referenced by the rule. You can use a UDC table to act as a filter to narrow the 
possible valid values that the logic statement will return.

szNewRangeValue2SRTVcharOPTNONE

The ending value of a range of numbers. In configurator, the *Range variable is used in the Values field associated with the cross-segment 
editing rules and assembly inclusion rules. Entering *Range in this field accesses the Range Revision (From Range and To Range) form. 
The *Range values represent answers to the segment referenced by the rule. You can use a UDC table to act as a filter to narrow the possible 
valid values that the logic statement will return.

jdEffectiveFromDateEFFFJDEDATEOPTNONE

A date that indicates one of the following:     o When a component part goes into effect on a bill of material     o When a routing step goes into 
effect as a sequence on the routing for an item     o When a rate schedule is in effect The default is the current system date. You can enter 
future effective dates so that the system plans for upcoming changes. Items that are no longer effective in the future can still be recorded and 
recognized in Product Costing, Shop Floor Management, and Capacity Requirements Planning. The Material Requirements Planning system 
determines valid components by effectivity dates, not by the bill of material revision level. Some forms display data based on the effectivity 
dates you enter.

jdEffectiveThruDateEFFTJDEDATEOPTNONE

A date that indicates one of the following:     o When a component part is no longer in effect on a bill of material     o When a routing step is no 
longer in effect as a sequence on the routing for an item     o When a rate schedule is no longer active The default is December 31 of the 
default year defined in the Data Dictionary for Century Change Year. You can enter future effective dates so that the system plans for upcoming 
changes. Items that are no longer effective in the future can still be recorded and recognized in Product Costing, Shop Floor Management, 
and Capacity Requirements Planning. The Material Requirements Planning system determines valid components by effectivity dates, not by 
the bill of material revision level. Some forms display data based on the effectivity dates you enter.

nIndexNumberINT01integerOPTNONE

Number of Days in Future to Query for Responses Due. 

Related Functions

None

Related Tables

F32922 Cross Segment Editing Rules - Range