Business Rules Scripting

From RemObjects Software

Jump to: navigation, search

This is a Data Abstract Feature topic
Feel free to add your notes to this topic below.



Business Rules Scripts provide the option to define specific rules and actions to be taken on the client to validate data input, without having to hard-code this logic into the client application.

With business rules scripts, the server can provide the business logic in form of Pascal language scripts as part of the schema, which will then be executed on the client using RemObjects Pascal Script 3.0 (included with Data Abstract).

This allows business rules to dynamically be updated on the server over time, without having to redeploy updated clients - all the client's need to do is use TDARemoteDataAdapter.FillScript or TDADataTable.LoadScript to download the latest scripts - for example on application startup.

Editing Scripts

Schema Modeler™ provides a special dialog for editing business rules scripts for a particular table, accessible by right-clicking the table and choosing Business Rules or clicking the Business Rules button in the toolbar.

The Business Rules Editor dialog provides a code editor with Pascal syntax highlighting for writing the actual script, and three drop-downs that allow you to easily add new code elements:

  • Events shows a list of all available event handlers (comparable to those of the TDADataTable or a standard Delphi TDataset). Selecting any item form the menu will insert a new method body that can be filled with code for the event.
  • Variables shows a list of all Data Abstract-specific variables available to the script. This includes Table for accessing properties and methods of the entire table, and all individual fields defined for the data table.
  • Actions, finally, shows a list of commonly used actions, such as ShowMessage() to show a message notification, and Abort() to abort the current process.

Of course, any code constructs available in Pascal Script can be used in these scripts, and you can register custom classes, methods and variables to be accessed form your script, if needed.

Please refer to the Pascal Script 3.0 documentation for more details.

Please note that client side business rules script should never be used as the only means to enforce business logic, as they are executed on the client and therefore outside of the control of the server application. Malicious or compromised clients could modify the scripts, or simply omit execution altogether.

The server should always enforce data integrity and business logic, as well.

See Also


Product: RemObjects Data Abstract
Current version: Data Abstract 'Vinci' (5.0)

ListsGlossaryFeaturesHow ToDriversComponentsToolsSamplesArticlesArchitectureIssues

Personal tools