jruizgit / rules

Durable Rules Engine
MIT License
1.14k stars 209 forks source link

Collect post return status as dictionary #364

Closed tafteh closed 3 years ago

tafteh commented 3 years ago

Hi, I am new to durable_rules and I have the following questions. Lets say I have the following:

with ruleset('my_rullset'):
    @when_all(m.subject >= 5)
    def return_status(c): 
        return({status:pass})

a = post('my_rullset', {'subject':6})

a is a global variable, and here is defined as a dictionary which accumulatively is going to collect all the statuses returned from all rulesets.

However, when I print a I get {'sid': '0', 'id': 'sid-0', '$s': 1}. Can you please let me know: (1) if my approach is possible (2) and why I do get that response?

Thanks for the great work.

UPDATE: in the following issue, the solution is explained: https://github.com/jruizgit/rules/issues/274