You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: If such a feature already exists, appreciate if anyone can help provide usage information.
Is your feature request related to a problem? Please describe.
As a client, I want to be able to identify which rule entry within the knowledge base had its "then" condition triggered.
For example, if I want to attach a message indicating which rules were executed, currently I would need to hard-code the rule name manually.
Current way:
rule test_rule_name "test_rule_description" salience 1 {
when
1 == 1
then
Test.DoSomething("test_rule_name"); // repeated rule name here
}
Ideally, I can simply call a method that returns the rule name. For example:
rule test_rule_name "test_rule_description" salience 1 {
when
1 == 1
then
Test.DoSomething(RuleEntry.GetRuleName()); // if rule name changes, this part doesn't need to change
}
Describe the solution you'd like
A default, reserved parameter inside DataContext named "RuleEntry" that contains the rule entry struct itself (or a similar struct that provides relevant data via getter methods, to prevent modification on the rule entry itself). This should be initialised each time we start a new rule execution.
Describe alternatives you've considered
This is more of an improvement to allow better rule definition design that is in-line with DRY principle.
The text was updated successfully, but these errors were encountered:
Note: If such a feature already exists, appreciate if anyone can help provide usage information.
Is your feature request related to a problem? Please describe.
As a client, I want to be able to identify which rule entry within the knowledge base had its "then" condition triggered.
For example, if I want to attach a message indicating which rules were executed, currently I would need to hard-code the rule name manually.
Current way:
Ideally, I can simply call a method that returns the rule name. For example:
Describe the solution you'd like
A default, reserved parameter inside DataContext named "RuleEntry" that contains the rule entry struct itself (or a similar struct that provides relevant data via getter methods, to prevent modification on the rule entry itself). This should be initialised each time we start a new rule execution.
Describe alternatives you've considered
This is more of an improvement to allow better rule definition design that is in-line with DRY principle.
The text was updated successfully, but these errors were encountered: