Skip to content

When/where should I act on the results of a session? #275

Answered by snikolayev
marked23 asked this question in Q&A
Discussion options

You must be logged in to vote

@marked23 there is no prescribed way how to use the rules engine. It is not true that rules should not "produce output" until after the Fire method exits. You can have rules actually do something in the actions, and so essentially rules will affect externally-observable changes as they fire.
But you can also use the engine similar to how you are describing it. You can just insert new facts or update existing facts in the session from the rules' actions, and then query the session at the end. This SO question I think demonstrates this approach well with a validation example: https://stackoverflow.com/questions/32554222/how-to-create-a-validation-rule-with-nrules

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@marked23
Comment options

Answer selected by marked23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants