Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@o3r/rules-engine
Advanced tools
This module provides a rule engine that can be executed on your Otter application to customize your application (translations, placeholders and configs) based on a json file generated by your CMS.
This package is an Otter Framework Module.
This module provides a rules engine that can run on your user's browser to customize the (translations, [//]: # (Should we target placeholder or the component npmjs, and we add a section on the placeholder there?) placeholders and configurations) of your application at runtime.
The rules engine interprets a list of actions to execute based on the evaluation of Rulesets and their conditions. Conditions are logical expressions relying on operators and variables we call facts.
You can store your list of Rulesets on a static JSON file.
This mechanism allows you to bring UI personalization based on runtime events without the need of a backend service. This can be useful if you want to drive dynamic behavior.
For example, you could consider leveraging this feature to display assets based on the current season or for some special events, or to drive A/B testing on your components.
You will find more information on the concepts behind the rules engine in its dedicated documentation. For a demonstration of the rules engine capabilities, you can refer to the live example in the Otter showcase.
ng add @o3r/rules-engine
[!WARNING] This module requires @o3r/core to be installed.
The package exposes the RulesEngineRunnerService
that can drive all the Otter customization-based services
in order to personalize the user experience.
On its own, the service will do nothing and will need action handlers to register with the list of supported actions
and their implementation.
Not only this allows for a better extensibility of the service, but it also keeps the number of imported module to the bare minimum for a lighter application.
Find more information on the Otter rules engine documentation.
Several examples of the rules engine usage are available on the following links:
Otter framework provides a set of code generators based on Angular schematics.
Schematics | Description | How to use |
---|---|---|
add | Include Otter rules-engine module in a library / application. | ng add @o3r/rules-engine |
rules-engine-to-component | Add rules-engine to an Otter component | ng g rules-engine-to-component |
facts-service | Generate a facts service | ng g facts-service |
operators | Generate an operator | ng g operator |
A whole section of the Otter Chrome Devtool extension is dedicated to the debug of the rules engine with a visual representation of your Rulesets and a history of the run, conditions met and actions applied.
Find more information on the tool in the Otter Chrome Devtool extension documentation and its dedicated section in the rules engine documentation.
More details regarding the way the rules engine is working can be found in the documentation.
A live example is available in the Otter Showcase Application with reference to its code source.
FAQs
This module provides a rule engine that can be executed on your Otter application to customize your application (translations, placeholders and configs) based on a json file generated by your CMS.
We found that @o3r/rules-engine demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.