Fork me on GitHub
#clara
<
2021-08-27
>
colinkahn00:08:25

I've used Clara rules a bit but am planning on doing something more complicated with it and had a question. It seems like when you start working on defining your rules you have to decide on a sort of scope for your session. I was curious if sessions have any way of composing? Let's say I decide I want to handle some subset of rules in its own session and then apply that to many of some type in a parent session. Is that possible?

ethanc00:08:09

I don't think that Clara has anything like that. I would assume that one could fire the sub session, then extract data via queries to populate facts within the parent session. Though I would think that simply having a single session would be less complex

colinkahn00:08:50

Is there any general wisdom about what a session should operate on? Like let's say I had some domain for accounts, should my session be for a single account vs all accounts, which I imagine could get confusing because you're dealing with many things vs one?

ethanc01:08:36

In general, It would come down to the scope of what you are reasoning about. If all of the questions you are trying to answer, if all of them are bounded by a single account, then it would probably make sense to operate on a single rather than multi.

ethanc01:08:30

It would likely reduce the complexity of the rules, as they could implicitly assume that the facts pertain to a single accout

colinkahn01:08:49

I think in my case it's most likely the scope will be both the single and the many, at least for some parts. Which is why I was worried starting at one level would require lots of rework later to adjust the scope.

ethanc01:08:13

Going from multi to single, in theory, should be passive. Though single to multi would require rework as the implicit assumptions based on a single account would be broken

colinkahn01:08:21

Right, without the ability to compose sessions, starting at many is probably the way to go to avoid rework.

👍 9
colinkahn01:08:09

Thanks for discussing!

ethanc01:08:06

Glad to lend an ear, and hear about people using Clara

mikerod16:08:04

Yeah, I agree with Ethan overall

mikerod16:08:23

If your cases now were single account - you could go about it that way and expose queries to data from that session later that you could use for “multi account reasoning”

mikerod16:08:39

but it really depends on the case which would be more efficient or make more sense.

colinkahn18:08:13

@mikerod I’ll give that a shot too. I think the way I’ll be analyzing the data it could work, IE multiple passes through different sessions.