Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Name of Parameter not being honored. #581

Open
khPhoenix opened this issue Feb 12, 2024 · 2 comments
Open

Custom Name of Parameter not being honored. #581

khPhoenix opened this issue Feb 12, 2024 · 2 comments

Comments

@khPhoenix
Copy link

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.

@abbasc52
Copy link
Contributor

@khPhoenix can you share MyParam class definition?

@khPhoenix
Copy link
Author

khPhoenix commented Feb 20, 2024

@abbasc52

public class MyParam
{
    public string? Value1 { get; set; }
    public string? Value2 { get; set; }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants