Code Effects Business Rules Engine Implementation
Code Effects Rules Engine is a .NET Standard component that supports all current .NET platforms, including the latest .NET versions.
How to Download and Reference the Code Effects Rules Engine
- Log in to the Code Effects Portal using your product key.
- Click the Download Zip Archive icon located to the right of your license name. This will initiate the compilation and download your custom copy of the Code Effects Package to your drive.
- Important Note #1: Depending on your browser settings, you may see a warning stating that the files in the package may not be safe. You can safely ignore this warning.
- Locate the downloaded package and extract its files to your drive. Among other files, the extracted package includes two .NET assemblies:
- CodeEffects.Rule.Engine.Standard.dll – Declares the engine.
- CodeEffects.Rule.Common.dll – Declares objects and functionality that are shared between the engine and the editor.
- Important Note #2: If your project already references the same or a newer version of the Common assembly, do not reference it again.
- Important Note #3: Although you can reference .NET assemblies from any location on your drive, we recommend creating a local Lib folder in your project, adding your Code Effects engine assemblies to it, and referencing them from that folder. This ensures that you know exactly which assemblies are referenced and where they are located.
- Open your .NET project, right-click the References (or Dependencies) folder, and select Add Reference... (or Add Project Reference...) option.
- Add a reference to CodeEffects.Rule.Engine.Standard.dll and, if needed, CodeEffects.Rule.Common.dll from their respective locations.
- Compile and run the project.
Managing the Code Effects Monthly Subscription Implementation
If you are using the Code Effects Rules Engine under the Engine Unlimited Monthly Subscription, follow these additional steps:
- Complete all the steps listed above to reference the Standard and, optionally, the Common assembly.
- Your Code Effects package includes the codeeffects.ce license file. The engine periodically reads this file to validate your subscription. We recommend placing this file in the same location as your Code Effects engine assemblies.
-
Set the value of static property
Evaluator.LicenseFileFullPath to the full physical path to that license file before instantiating the Evaluator class:
Evaluator.LicenseFileFullPath = "C:\\MyProject\\Lib\\codeeffects.ce";
var evaluator = new Evaluator<YourSourceType>(ruleXml);
You can rename the license file or change its extension if needed. Just ensure that the value is set to the full path and correct file name.
IMPORTANT NOTE #1
- If your license file is invalid or cannot be located, the engine will throw an InvalidOperationException.
- If your project references an expired license file, all calls to the Evaluate and Filter methods will be delayed by six (6) seconds.
IMPORTANT NOTE #2
- Your license file expires every 6 (six) months and must be replaced with the latest version.
- You can download the latest license file from the Code Effects Portal by clicking the Download License File icon next to your subscription name.
- Our system attempts to notify you via email before your license file expires, but we do not guarantee these notifications.
IMPORTANT NOTE #3
- When using the Monthly Subscription, the rules engine requires read-only access to the codeeffects.ce license file.
- The engine does not write to your drive or connect to any external or internal sources for subscription validation.
If you encounter any issues with your rules engine implementation, feel free to contact us.
How to Reference the Code Effects Rule Editor
Rule Editor is a free web-based business rules authoring and management component that supports all current .NET web platforms. The list below links articles that provide details, NuGet links and code samples of implementation of Rule Editor on each platform.
Clasic ASP.NET WebForms 4.5 and below
Classic ASP.NET MVC 4.5 and below
ASP.NET 4.6 and up
ASP.NET MVC 4.6 and up
ASP.NET Core
Angular / ASP.NET Core
You can download and run demo projects that demonstrate Rule Editor and Rule Engine in action.
Note that even though Code Effects 5.0 supports older web platforms such as ASP.NET MVC 4.5, your project still has to be compiled with at least .NET Framework 4.6.2. See the Prerequisites section of each topic for details.
One of the goals of Rule Editor development is to be completely independent from particular .NET web platform, whether it's ASP.NET, MVC, Core, or any of the future web initiatives from Microsoft. Therefore, the basic steps of integration of Rule Editor in a web application has been simplified to the point where it becomes pretty much identical in all current .NET web platforms:
- Reference Rule Editor's assembly from the NuGet. Refer to the list of implementation examples above for correct NuGet links based on the web platform of your choice.
- Reference two Code Effects CSS files in your markup: CodeEffects.Common.css and one of the default theme files. This step is optional; details on Code Effects styling can be found in this topic.
- Reference the main CodeEffects.js script in your markup. This script declares the entire client-side functionality of the Rule Editor. Its API can be found in this topic.
- Finally, you need to initialize the Rule Editor. To do that you must get two sets of client settings from the server (usually on page load) and pass it to the client. You also need to declare Save, Load and Delete client functions, too, in order to be able to manage your rules. All our demo projects declare the main.js (or site.js) local script that does all that.
Post your questions on
Stackoverflow and become a part of our growing community
Loading...
Comments:
Loading...
|
|