Skip to content

Question: would it make sense to be able to add a fact whose functions can be called without a fact prefix #173

@tpihl

Description

@tpihl

Is your feature request related to a problem? Please describe.
I really like the functions we can put in rules. But based on the actual rule engine implementatiton it may make sense to be able to add more functions not related to a fact (since there is no fact data, only functions).

I'm currently using facts like "helper" or "action" or similar, but it really remove some of the readability/flow in the rule. One example from one of my "then" sections where "helper" only raise questions when the rule is read by humans:

fact1.Data1 = helper.CalculateSomethingMakeingSenseInThisRuleengine(fact1.Data2)

or in a "with" statement

helper.EstimatedValueOf(fact1) > 7

Describe the solution you'd like
fact1.Data1 = CalculateSomethingMakeingSenseInThisRuleengine(fact1.Data2)

EstimatedValueOf(fact1) > 7

Describe alternatives you've considered
Not really, only a question on possible improved readability and simplification of rules (by adding some magic)

Additional context
Same context as my other question #172

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions