FlowLogicEngine 1.0.0
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
dotnet add package FlowLogicEngine --version 1.0.0
NuGet\Install-Package FlowLogicEngine -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FlowLogicEngine" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FlowLogicEngine" Version="1.0.0" />
<PackageReference Include="FlowLogicEngine" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FlowLogicEngine --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FlowLogicEngine, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FlowLogicEngine@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FlowLogicEngine&version=1.0.0
#tool nuget:?package=FlowLogicEngine&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FlowLogicEngine
A flexible and lightweight logic flow engine for .NET 8, designed for IoT and automation scenarios.
Features
- ✅ Simple rule syntax:
name:condition=>action - ✅ Support for complex conditions with logical operators (
&&,||) - ✅ Support for comparison operators (
>,<,>=,<=,==,!=) - ✅ Variable substitution in actions
- ✅ Extensible architecture (custom parsers, validators, handlers)
- ✅ Rule priority support
- ✅ Enable/disable rules dynamically
- ✅ Event-driven error handling
- ✅ Async support
- ✅ Multi-targeting: Supports .NET Standard 2.0, 2.1, .NET 6.0, 8.0, 9.0, and 10.0
- ✅ Wide compatibility: Works with .NET Framework 4.6.1+, .NET Core 2.0+, .NET 5+, Xamarin, Unity
Compatibility
| Target Framework | Status |
|---|---|
| .NET Standard 2.0 | ✅ Supported |
| .NET Standard 2.1 | ✅ Supported |
| .NET 6.0 | ✅ Supported |
| .NET 8.0 | ✅ Supported |
| .NET 9.0 | ✅ Supported |
| .NET 10.0 | ✅ Supported |
| .NET Framework 4.6.1+ | ✅ Supported |
| .NET Core 2.0+ | ✅ Supported |
| Xamarin | ✅ Supported |
| Unity 2018.1+ | ✅ Supported |
See COMPATIBILITY.md for detailed compatibility information.
Installation
dotnet add package FlowLogicEngine
Quick Start
Basic Usage
using FlowLogicEngine;
using FlowLogicEngine.Core;
// Create logic flow processor with default configuration
var processor = new LogicFlowBuilder()
.UseDefaults()
.Build();
// Add rules
processor.AddLogicRule(new LogicRule("HighTemp", "temperature > 30", "SendAlert(Temperature too high: {temperature}°C)"));
processor.AddLogicRule(new LogicRule("LowBattery", "battery < 20", "LogWarning(Battery low: {battery}%)"));
// Create context data
var context = new ContextData();
context.AddFact("temperature", 35);
context.AddFact("battery", 15);
// Execute rules
processor.ExecuteLogicRules(context);
Output:
🚨 [ALERT] Temperature too high: 35°C
⚠️ [WARNING] Battery low: 15%
Load Rules from String
var rulesString = @"
HighTemperature:temperature > 30=>SendAlert(Temperature too high)
LowHumidity:humidity < 40=>SendNotification(Humidity too low)
NormalOperation:temperature <= 30 && humidity >= 40=>LogInfo(System normal)
";
var processor = new LogicFlowBuilder()
.WithRuleLoader(new StringLogicRuleLoader(rulesString))
.Build();
var context = new ContextData();
context.AddFact("temperature", 35);
context.AddFact("humidity", 38);
processor.ExecuteLogicRules(context);
Load Rules from File
var processor = new LogicFlowBuilder()
.WithRuleLoader(new FileLogicRuleLoader("rules.txt"))
.Build();
Rule Syntax
Basic Format
RuleName:condition=>action
Examples
Simple comparison:
HighTemp:temperature > 30=>SendAlert(Too hot)
Logical AND:
Comfortable:temperature >= 20 && temperature <= 26=>LogInfo(Comfortable)
Logical OR:
Alert:temperature > 35 || humidity < 20=>SendAlert(Critical condition)
Variable substitution:
Status:battery < 20=>SendNotification(Battery at {battery}%)
Supported Actions
SendAlert(message)- Send alertSendNotification(message)- Send notificationLogWarning(message)- Log warningLogInfo(message)- Log informationLogError(message)- Log error
Advanced Usage
Custom Action Handler
public class MyActionHandler : DefaultActionHandler
{
protected override void SendAlert(string message)
{
// Send to your alert system
MyAlertSystem.Send(message);
}
}
var processor = new LogicFlowBuilder()
.WithActionHandler(new MyActionHandler())
.Build();
Rule Priority
var rule1 = new LogicRule("Rule1", "value > 10", "LogInfo(Rule1)");
rule1.Priority = 1;
var rule2 = new LogicRule("Rule2", "value > 5", "LogInfo(Rule2)");
rule2.Priority = 2;
processor.AddLogicRule(rule1);
processor.AddLogicRule(rule2);
// Rule1 executes before Rule2
Error Handling
var processor = new LogicFlowBuilder().Build();
processor.RuleExecutionError += (sender, e) =>
{
Console.WriteLine($"Error in rule {e.Rule.Name}: {e.Exception.Message}");
};
processor.RuleParseError += (sender, e) =>
{
Console.WriteLine($"Parse error: {e.RuleString} - {e.Exception.Message}");
};
Use Cases
- IoT device monitoring and automation
- Business rule processing
- Event-driven workflows
- Alert and notification systems
- Data validation and transformation
Code of Conduct
This project has adopted the Contributor Covenant Code of Conduct. For more information see the Code of Conduct FAQ.
License
MIT License - see LICENSE.txt for details
Contributing
Contributions are welcome! Please read our Contributing Guide for details on how to get started.
Ways to Contribute
- Report bugs and request features
- Submit pull requests
- Improve documentation
- Share your use cases and examples
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Text.Json (>= 8.0.5)
-
.NETStandard 2.1
- System.Text.Json (>= 8.0.5)
-
net10.0
- No dependencies.
-
net6.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 199 | 12/5/2025 |