◷ Reading Time: 3 minutes
Integration
Integration is as simple as:
- Referencing Runtime
- Using the RuntimeEngine type to load and execute logic (i.e., rules, flow, decision, NL, etc.)
Referencing Runtime
To reference FlexRule Runtime into your application you should be using NuGet package named FlexRule.Runtime in your application.
Please visit the below site for more information:
https://www.nuget.org/packages/FlexRule.Runtime
Referencing Runtime (Legacy – Runtime Version 7 and or older)
You need to reference the following core assemblies:
- FlexRule.Core.Element.dll
- FlexRule.Core.Library.dll
- FlexRule.Engine.dll
- FlexRule.Procedure.dll
Also, based on the type of logic you may need, one or more of the following assemblies:
- FlexRule.Validation.dll: Validation, Decision, Natural Language
- FlexRule.Decisions.dll: Decision table (This requires FlexRule.Validation.dll as well)
- FlexRule.Flows.dll: Flow orchestration
- FlexRule.Flows.Workflow.dll: Workflow (This requires FlexRule.Flows.dll as well)
Load and Execution
After referencing the required assembly in your application, executing logic is possible in two different ways:
Handling Exceptions
When you load and/or execute rules, you may face some exceptions. To get a complete understanding of the exception details, you can use ExceptionCenter
try
{
// do stuff
}
catch(Exception ex)
{
string error = FlexRule.ExceptionCenter.GetExceptionString(ex);
// send support@flexrule.com this error when required
}
The error variable has detailed information on full rule execution stack trace.
Use Glossary
Business glossaries must be referenced as part of your rule execution if
- Running Decision table that has Term in its conditions instead of an expression
- Using Natural Language that uses a business glossary to introduce terms
Modeling Logic
There are many different ways to model business logic (i.e., rules, decisions, flows, etc.). For more details please check Logic.