diff --git a/.mise.toml b/.mise.toml index 80048e18..31cf3c1a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,4 +1,4 @@ -[plugins] +[alias] clojure = "https://github.com/asdf-community/asdf-clojure.git" [tools] java = "graalvm-22.3.1+java11" diff --git a/CHANGELOG.md b/CHANGELOG.md index 13321b82..e36d8a8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ This is a history of changes to k13labs/clara-rules. +# 1.5.1 +* do not break inspection if no accumulated facts are found + # 1.5.0 * revert thread local use and replace with dynamic vars for safely using virtual threads. * upgrade deps, update infinite loop tests with latest futurama library. diff --git a/src/main/clojure/clara/rules/engine.clj b/src/main/clojure/clara/rules/engine.clj index 5d0cbf4e..c58d3b83 100644 --- a/src/main/clojure/clara/rules/engine.clj +++ b/src/main/clojure/clara/rules/engine.clj @@ -1381,8 +1381,11 @@ ;; This being the case, we can use the downstream token to find out what binding key-value pairs were used ;; to create the token "stream" of which it is part. (let [join-bindings (-> token :bindings (select-keys (get-join-keys this))) - fact-bindings (-> token :bindings (select-keys new-bindings))] - (first (mem/get-accum-reduced memory this join-bindings (merge join-bindings fact-bindings)))))) + fact-bindings (-> token :bindings (select-keys new-bindings)) + accum-reduced (mem/get-accum-reduced memory this join-bindings (merge join-bindings fact-bindings))] + (if (not= accum-reduced ::mem/no-accum-reduced) + (first accum-reduced) + [])))) (defn- filter-accum-facts "Run a filter on elements against a given token for constraints that are not simple hash joins."