using System.Collections.Generic;
using RulesEngine.Models;
public enum SecurityRoles
public static void Main()
var serializer = new JsonSerializer();
serializer.Formatting = Formatting.Indented;
var workflow = new WorkflowRules{
WorkflowName = "EnumWorkflowTest",
Expression = "SecurityRoles.None.ToString() == \"None\""
var workflowAsStr = JsonConvert.SerializeObject(workflow,new JsonSerializerSettings { Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore });
Console.WriteLine("Workflow");
Console.WriteLine(workflowAsStr);
var settings = new ReSettings{
CustomTypes = new Type[]{typeof(SecurityRoles)}
var re = new RulesEngine.RulesEngine(new []{workflowAsStr},null,settings);
var input = new RuleParameter("myInput",new {
var resultList = re.ExecuteAllRulesAsync("EnumWorkflowTest",input).Result;
Console.WriteLine("*********************************************");
Console.WriteLine("results");
Console.WriteLine(JsonConvert.SerializeObject(resultList,new JsonSerializerSettings { Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore }));