Skip to content

Custom Name of Parameter not being honored.  #581

Description

When trying to specify a custom name for a parameter we are receiving the following error:

Parameter Declaration:

var wfParams = new MyParam()
{
    Value1 = "value1",
    Value2 = "value2"
};
var rp = new RuleParameter("myValue", wfParams); 

var myWorkflow = new Workflow
{
    WorkflowName = "my_workflow",
    Rules = new List<Rule>
    {
        new Rule
        {
            RuleName = "MatchesFabrikam",
            Enabled = true,
            RuleExpressionType = RuleExpressionType.LambdaExpression,
            Expression = "myValue.Value1== \"Fabrikam\""
        }
    }
};

When the rule is evaluated the following error is received:

  Message: 
System.Exception : Could not execute rules: [MatchesFabrikam: Exception while parsing expression `myValue.Value1 == "Fabrikam"` - Enum type 'endpoint' not found]`

We're targeting .net8 and using RulesEngine 5.0.2.

Activity

  1. abbasc52 commented on Feb 19, 2024

    @abbasc52

    Karissa Hanberg (@khPhoenix) can you share MyParam class definition?

  2. khPhoenix commented on Feb 20, 2024

    @khPhoenix
    Author

    Abbas Cyclewala (@abbasc52)

    public class MyParam
    {
        public string? Value1 { get; set; }
        public string? Value2 { get; set; }
    }
    
    
  3. asulwer commented on Jun 27, 2024

    @asulwer

    i added a working example and solution to my fork

  4. added 2 commits that reference this issue on May 27, 2026
  5. YogeshPraj commented on May 29, 2026

    @YogeshPraj
    Contributor

    No longer reproducible; validated in PR #729: #729

    Added explicit regression coverage in Issue581Test.cs to protect this behavior going forward.

    Verified in preview package RulesEngine 6.0.1-preview.1:
    dotnet add package RulesEngine --version 6.0.1-preview.1 --prerelease

    Closing as already fixed and covered by regression tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions