Skip to content

Return Fired rules actions results.#34

Open
slitayem wants to merge 2 commits into
venmo:masterfrom
slitayem:master
Open

Return Fired rules actions results.#34
slitayem wants to merge 2 commits into
venmo:masterfrom
slitayem:master

Conversation

@slitayem

Copy link
Copy Markdown

No description provided.

Comment thread business_rules/engine.py
actions_results[method_name] = method(**params)

return dict((method_name, actions_results[method_name]) for method_name
in actions_results.keys() if actions_results.get(method_name))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if None is expected result from method? you should not filter None value

@bhargavrpatel

bhargavrpatel commented Jan 5, 2020

Copy link
Copy Markdown

I am wondering if there is still interest in seeing this one through (edit: I am happy to create a separate PR if not). This is a valid use case. One alternative approach here would be to return a tuple in all cases. The first element is the result bool, the second is the output. This would allow us to consider None as a valid result.

@jreeter

jreeter commented Nov 14, 2020

Copy link
Copy Markdown

@bhargavrpatel We also have a need for this use case. Ideally, though we could return a business description with the resulting value. My initial ideas were to tag the conditions with a unique id, these ids could be linked to descriptions end users could understand. We essentially want end users to understand how the engine arrived at the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants