Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialized sessions should create a get-alphas-fn if provided #230

Closed
WilliamParker opened this issue Oct 14, 2016 · 2 comments
Closed

Comments

@WilliamParker
Copy link
Collaborator

In the non-serialization path the :get-alphas-fn is created in the compiler. [1, 2] When clara.rules.engine/assemble is called it expects a user-provided get-alphas-fn to be wrapped already. [3] The durability namespace calls through to the wrapper functionality when it uses the default get-alphas-fn [4, 5] but it does not wrap a user-provider get-alphas-fn. The user would need to use the private create-get-alphas-fn in the compiler to provide a working custom get-alphas-fn. Otherwise Clara would call a user-provided function directly expecting it to return alpha nodes, which it wouldn't do. The way Clara uses the user-provided function to create a get-alphas-fn is an internal implementation detail that should not be exposed in this way.

  1. https://github.com/rbrush/clara-rules/blob/0.13.0-RC2/src/main/clojure/clara/rules/compiler.clj#L1639
  2. https://github.com/rbrush/clara-rules/blob/0.13.0-RC2/src/main/clojure/clara/rules/compiler.clj#L1530
  3. https://github.com/rbrush/clara-rules/blob/0.13.0-RC2/src/main/clojure/clara/rules/engine.cljc#L1569
  4. https://github.com/rbrush/clara-rules/blob/master/src/main/clojure/clara/rules/durability.clj#L433
  5. https://github.com/rbrush/clara-rules/blob/master/src/main/clojure/clara/rules/durability.clj#L404
@mrrodriguez
Copy link
Collaborator

I'll just fix this in the #228

It's highly related to changes there anyways.

@WilliamParker
Copy link
Collaborator Author

Closing since this was fixed by @mrrodriguez in https://github.com/rbrush/clara-rules/pull/228/files

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

No branches or pull requests

2 participants