microsoft / RulesEngine

A Json based Rules Engine with extensive Dynamic expression support
https://microsoft.github.io/RulesEngine/
MIT License
3.47k stars 528 forks source link

Using inputFilter and additionalInputs functionality issues #578

Closed hdgao22222 closed 5 months ago

hdgao22222 commented 5 months ago

"Actions": { "OnSuccess": { "Name": "EvaluateRule", "Context": { "WorkflowName": "inputWorkflow", "ruleName": "GiveDiscount10Percent", "inputFilter": ["input2"], //will only pass input2 from existing inputs,scopedparams to the chained rule "additionalInputs":[ // will pass a new input named currentDiscount with the result of the expression to the chained rule { "Name": "currentDiscount", "Expression": "input1.TotalBilled * 0.9" } ] } } }

Follow the above instructions to add configuration and use. It is found that it does not work. Finally, debug the source code and find that the program only reads

The values of WorkFlowName and ruleName are entered into the data dictionary, and the program checks the ActionContext data type dictionary to see if there are inputFilter and additionalInputs configurations. This is incorrect. When ActionContext is correct, it means there are inputFilter and additionalInputs configurations. The program no longer calls EvaluateRuleAction but instead calls the ExpressionOutPutAction function. Please ask the author to check if there is a bug, modify

hdgao22222 commented 5 months ago

How to correct it, please reply. If it is the problem I am using, please tell me the correct method