InProc Integration Overview

◷ Reading Time: 3 minutes

Integration

Integration is as simple as:

  1. Referencing Runtime
  2. 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)

This is for legacy version of FlexRule Runtime. Please do not use this method for version 8.0 onward.

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:

  1. Using Runner CommandHandler
  2. Using RuntimeEngine

If RuntimeEngine is used directly, you require to handle more details in your code.

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

  1. Running Decision table that has Term in its conditions instead of an expression
  2. Using Natural Language that uses a 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.

Updated on May 18, 2020

Was this article helpful?

Related Articles