Auto_Refresh_Constraints (Additional Parameter)

Previous Next

See Also

During development, for example, it is useful to  be able to use or test new or changed constraints without having to restart your application. In a client-server application, this can be accomplished by manually running the RefreshConstraints() method. In a web environment, Rules Service engines must be restarted.

 

You can also make use of the Auto_Refresh_Constraints additional parameter to autmatically referesh constraints. By default this parameter is set to False which results in the situation described above. If this parameter is set to True, at the beginning of each new transaction the Rules Engine will check if there have been any changes made to the constraint definitions since the last time they were read. If so, all current constraints are cleared from memory and a new set of constraints are loaded before continuing with the transaction.

 

An example of where this feature would be useful is in combination with the modules functionality. You could add a special separate module to your application where all your ‘dynamic’ or temporary constraints are stored. This module would only be used for as long as it was needed. For example, a special extra discount for certain customers for a limited period.

 

NOTE: The Auto_Refresh_Constraints parameter and the RefreshConstraints() method only affect the refreshing of constraints.  This means that if an additional table is also added, for example, and it is used in a constraint, this will result in errors.