||//The name of the MDB to be used. If Null is used as the first <MDB>
parameter, only the tables in CLASS_DEF.MDB are used
||//When the Rules Engine is in test mode, a variable called <Class_Name> is also created. Its value is set to a collection which contains a full
trace of the definition and evaluation of the class. When run in Production, this
variable is not created.
<MDB> behaves like the filename parameters in the Tbl_Lookup routines except that if it is Null, only the common CLASS_HIERARCHY and CLASS_PROPERTIES tables are used.
While these classes only support Properties, they feature full inheritance from base classes plus polymorphism (overriding) and allow for extending the base classes.
Open both the CLASS_HIERARCHY and CLASS_PROPERTIES tables in design mode to gain an understanding of how they define a class.
Only one instance of a particular class (object) may exist at any point in time. Classes are executed in 'Ordinal' order, with the result of each expression being assigned to a Rules Engine Variable named by PROP_LABL.
Each property has a 'Scope', which may either be "INSTANCE", or "CLASS". Properties with a scope of "CLASS" are only set when the class is first created (on the first freight bill in a batch). Those with a scope of "INSTANCE" are set every time a Class_Create() is executed (typically once per freight bill).
Class_Create() returns -1 unless a PROP_LABL of "Result" is defined. If such a PROP_LABL is defined, the value of this property is returned as the result of the Class_Create() function. (In this case, a variable with the name of "Result" is not assigned the value of the property.)
Calls to Class_Create() may be nested. That is, a property of one Class may have as its expression another call to Class_Create(). These calls may not however be recursive (they may not reference the same class).
When the Rules Engine is in test mode, a variable called <Class_Name> is also created. Its value is set to a collection which contains a full trace of the definition and evaluation of the class. It also shows the instance of the call within each bill, resulting in a full history for the bill. When run in Production, this variable is not created.
Class_Create() is implemented using a "Push" model. While slightly less flexible than a "Pull" model, it allowed for both quick implementation and execution. Property expressions are only compiled upon the first creation of the class.
In order to achieve efficiencies when creating this, implemented "Expression Spaces" which allow expressions parsed by different routines to be managed by each of those routines. This will allow for expressions pulled at run-time from different known tables to be compiled once per run and not once per bill.