Fork me on GitHub
#clara
<
2019-12-10
>
Konstantinos Tzanidakis13:12:25

Hi everyone, I was hoping to get some help on seriliazing the session in Clara Rules. I am fairly new to Clara and I am trying to start by implementing the example in the docs: <http://www.clara-rules.org/docs/durability/>, for my own facts (using maps along with fact-type-fn). However, during deserialization I am getting the following error: nth not supported on this type: Element. Any ideas/suggestions would be more than welcomed.

mikerod14:12:00

@konstantinos562 (1) is it possible to share what you have? & (2) can I see the full stack trace (or the Clara-part of it) coming with this exception?

Konstantinos Tzanidakis15:12:31

@mikerod thanks a lot, I have probably figured this out, I was using maps instead of records but when I was storing the session using the serializer I was not providing the :fact-type-fn options as well as I was setting with-rulebase? to false. Most probably, because I didn't include the fact-type-fn, the deserializer was mistakenly trying to destruct the facts as "Element"s (or something like this). Thank you very much for the prompt response 🙂

mikerod15:12:28

@konstantinos562 that makes sense. Yes, the durability layer stuff can certainly be a bit complicated since you do have to do things quite specifically