Checking the rules without executing Do blocks

Skip to first unread message

Ramin Naderi

Apr 18, 2020, 9:22:36 AM4/18/20
to NRules Users
I would like to separate conditions from actions because in my scenario sometimes I need to only check the matching of terms then get user confirmation before executing.
Is there any solution ?

Sergiy Nikolayev

Apr 18, 2020, 10:09:09 PM4/18/20
to NRules Users
You have several options.
1. You can break up the rule using forward chaining. Your rule would forward chain a new fact indicating the desired action, and also trigger a confirmation with the user. As soon as the user issues a confirmation, that confirmation would be inserted into the session as another fact. Then another rule would match the confirmation, as well as the fact yielded by the first rule, and trigger the desired action
2. Another option is to use action interceptor. Implement your own action interceptor, and you get full control over action execution.

Let me know if this answers your question.
Reply all
Reply to author
0 new messages