-
Notifications
You must be signed in to change notification settings - Fork 570
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
ActionContext is not able to get the actual value assigned from the rules #390
Comments
Hi @vprabhu81, this is intended behavior, context does not automatically get evaluated. Can you provide the context on what you are trying to achieve? |
I have these parameters passed into the rule engines, On success or failure I would need to retireve those data set to send notifications. I am bit surprised though because I see that in the sample below we do pass the expressions as an input |
@abbasc52 : Just wanted to check with you if got a chance to look at the sample provided |
Hi @vprabhu81 , assuming you want to create a custom action, context is passed as is and needs to be parsed at the custom action code RulesEngine/src/RulesEngine/Actions/ExpressionOutputAction.cs Lines 21 to 22 in a74f73a
The ruleparser is a public class and can be used to evaluate expressions If you just want to return an object , just use outputExpression and set the object there
|
How do I Inject the RuleExpressionParser into my custom action? while registering the custom actions in RESettings, I will not have the rule engine instance yet, Is there an example I can refer to? I tried the second approach as I just need the object in the custom action Unfortunately I still get it as string at the receiving end |
Hi @abbasc52 I found the answer on UnitTests Name: "OutputExpression"
See here I hope this snippet can be added to the docs. |
Hi,
Here is a snippet where we pass certain parameters on success and failure methods.

Now I was expecting the underlying value in my action context but instead I get the value in string like "Device.Id".

I tried a simple arithematic equation like "20*2" that too is being received as a string
The text was updated successfully, but these errors were encountered: