From FlexRule Wiki
Jump to: navigation, search


Integration is as simple as:

  1. Referencing assemblies
  2. Using the RuntimeEngine type to load and execute logic (i.e., rules, flow, decision, NL, etc.)

Referencing Assemblies

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 in FlexRule requires two simple steps:

  1. Creating a Runtime Engine instance
  2. Calling the engine by providing values for input parameters (if required)

More details

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

    // do stuff 
 catch(Exception ex) 
    string error = FlexRule.ExceptionCenter.GetExceptionString(ex); 
    // send this error when required

The error variable has details information of full rule execution stack trace.

Use Glossary

Business glossaries must be referenced as part of your rule execution if

  1. Running Decision table that has Term in its conditions instead of expression
  2. Using Natural Language that uses business glossary to introduce terms

More details

Modeling Logic

There are many different ways to model business logic (i.e., rules, decisions, flows, etc.). For more details please check Logic.