Simpleflow .NET
Simpleflow is an open source .NET library and a runtime engine to execute dynamic rules and workflows using intuitive and simple Simpleflow scripting language. Simpleflow allows you to pass an argument to the script and can access registered methods in the script securely. .NET methods can be registered as activities or functions with Simpleflow engine. Simpleflow is extensible to enrich or monitor the execution flow. Simpleflow is secure and efficient to run dynamic rules and workflows.
Get Started
Install package via Nuget. Using the NuGet package manager console within Visual Studio run the following command:
Install-Package Simpleflow
Try the following Simpleflow script:
using Simpleflow;
// Simpleflow Script
var script =
@"
# Declare and initialize variables
let today = $GetCurrentDateTime()
# Write rules
rule when arg.UniversalId == 2
and (arg.New or arg.Verified) then
message 'Hello, World! 🌄'
end rule
# Output
output today
message 'execution completed'
";
// Execute Script
FlowOutput result = SimpleflowEngine.Run(script,
new {UniversalId = 2, New=true, Verified=false});
// Access result
Console.WriteLine(result.Messages[0]);
var scriptExecutionTime = result.Output["today"];
Output
Hello, World! 🌄
Please see this example with most of the simpleflow script features.