Writing and Debugging Rules
Business rules are the heart of AppBase. They are responsible for manipulating and retrieving structured data, working with unstructured data, and defining business logic throughout the application. Users can call rules and events from other rules, scheduled tasks, or from an outside system through REST. A business rule is a short program written by hand, generated automatically, or designed using a wizard/builder. How a rule is implemented is often one of the primary factors in performance. For example, the complexity and dependency of the data will strongly affect the performance. A business user can design rules without any coding, but a developer should review whether they are the best choice before an application is considered to be production-ready.
Debugging is the process of identifying and resolving problems in software applications. Debugging is essential for ensuring the quality of software and ensuring that applications are operated in an effective and efficient manner. Debugging rules are important in order to follow when debugging software applications.
This article covers writing and debugging rules in AppBase Studio. Rules are a powerful way to modularize your code, and they can help you to track your code's state and to verify your assumptions.
Definition
A Business Rule defines business-related logic such as business object operations (create, modify, delete, select), making business decisions, data validation, integration with other systems, routing objects such as documents and forms through workflow, and more. In AppBase, business rules are used extensively throughout the entire system. In any case type where specific business logic must be applied to the system, it is usually defined as a business rule.
For example, business rules are used:
- For data collection, data input, and editing;
- To define actions that occur when a user clicks a specific button or hyperlink;
- When business objects are created or modified, or the scheduler can initiate rule execution;
- Within workflows to enforce business logic in different stages of business process execution;
- To place information into the appropriate places in the system when different channels capture information;
- To identify captured information and link it to other pieces of information in the system (indexing);
- Executing user interface actions when the user navigates through his or her desktop application.
The following table describes the kinds of implementation that rules can have:
Type of Rule | Description |
---|---|
PL/SQL | These rules are written in PL/SQL, and their purpose is to work with structured data. They get executed against the relational database where business object data is stored. The code should be compatible with Oracle 11g. |
C# | These rules are written in C# .NET 3.5 and executed in AppBase in an isolated context. These are multi-purpose rules for designing advanced business logic. |
DLL Extensions | These are written outside AppBase and compiled using a third-party product such as Visual Studio. They provide an ability to extend the functionality of AppBase that is often outside the possibilities of just using PL/SQL and C# rules. |