What is the Business Rules Engine?
In most projects, we have some business rules that affect our processes and results. In our project, it is recommended to develop a rule mechanism to control all rules.
Reasons for having a rule mechanism:
- Rules can be changed many times. So if we have a rule engine, we just need to change one place, not a lot of code in the project.
- We can easily create many unit tests according to our rules.
- Our codes will be more readable.
- The engine rule will be a new layer that is separated from the other layers.
In php: I made a simple method to create a rule engine. You can use this to make one for your project:
A simple way to create a rules engine in PHP
To be successful.
source to share
In short and simple, the business rule engine is a component (middleware) with which your application communicates and delegates the execution of a business rule (or possibly other application business logic) to that component. There are many ways to communicate with this component. In general, there are two approaches: (1) compiled code references, or (2) service-based interactions. If you are on the same technology stack that a component is written, you can simply reference that component and use it. To find out exactly how you should do this, refer to the component's user manual. If you like interacting with a service, you just need to know the interface of the service. For example, if the service provides REST API, you can usea JavaScript client from its PHP application to interact with the business rules service.
source to share