Can I execute a rule after checking a condition?
Opened this issue · 2 comments
trinobster commented
Hi,
I need to understand if I can somehow execute a rule inside the "then" part of another rule, for example:
Define rule_b and rule_a inside a policy, but execute rule_b only if rule_a conditions are met:
rule rule_b:
then:
print('rule_b fired!')
rule rule_a:
when:
exists $classB := ClassB(property1.startswith("apple"))
then:
execute rule_b
Please, can you suggest me if there is any way I can do this?
Thank you!
nemonik commented
I haven't touch this in quite sometime and I have been meaning to rewrite
Intellect. But if you are building up a working memory of facts, you just
re-execute the rule set or another rule set.
Or may be you could recursively run the rule set from rule b... It has been
a while.
…-Michael
On Sat, Jun 23, 2018, 12:09 PM Rossana Tonoli ***@***.***> wrote:
Hi,
I need to understand if I can somehow execute a rule inside the "then"
part of another rule, for example:
Define rule_b and rule_a inside a policy, but execute rule_b only if
rule_a conditions are met:
rule rule_b:
then:
print('rule_b fired!')
rule rule_a:
when:
exists $classB := ClassB(property1.startswith("apple"))
then:
execute rule_b
Please, can you suggest me if there is any way I can do this?
Thank you!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#19>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKwGAP0jiXsTbRPvF3MIYOTl5bnxvDlks5t_mg7gaJpZM4U019j>
.
trinobster commented
Okay thank you very much for your answer!