This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-30
Channels
- # announcements (9)
- # babashka (22)
- # beginners (25)
- # calva (2)
- # cider (9)
- # clj-on-windows (15)
- # clj-otel (29)
- # clojure (73)
- # clojure-conj (4)
- # clojure-europe (69)
- # clojure-gamedev (4)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-sweden (12)
- # clojure-uk (4)
- # clojuredesign-podcast (6)
- # clojurescript (5)
- # clr (52)
- # community-development (2)
- # cursive (5)
- # datahike (3)
- # datalevin (5)
- # datascript (4)
- # datomic (14)
- # dev-tooling (13)
- # events (4)
- # gratitude (12)
- # honeysql (1)
- # hyperfiddle (15)
- # jobs (1)
- # lsp (19)
- # malli (8)
- # meander (2)
- # missionary (10)
- # off-topic (12)
- # polylith (3)
- # reagent (8)
- # reitit (2)
- # remote-jobs (1)
- # shadow-cljs (31)
- # timbre (4)
Hey, so i need a system that can examine some json and try to work out what a thing is. I'm writing my own budgeting / finance app as I don't like any I've tried, I'm at the stage where instead of putting in transactions manually I'm pulling them from by bank via open banking. However, I'd like some kind of rules to automate this. e.g. rule - transaction date: 1st of month, amount: -408.85, remitance contains "To mortgage" => createa mortgage payment transaction. rule - creditorName: "WM Morrisons" => Create a transaction for groceries. rule - transactino date: either 24 or 25th of month, amount = 100.00, create parking space rental Then I'd like to be able to specify the order the rules run in and have a default rule to capture stuff that didn't match to any rules. I want to be able to serialize these rules after creating them through my front end, so it can determine what transaction to create automatically. Anyone know of any libraries that do something like this in Clojure ?
Don't know of any libraries but what you described sounds simple enough to not have to look for any library.
A rule is a map with at least an :action
key that says what must be done if the rule matches. Other keys tell what to match against and how.
A collection of rules is a vector. The last item in there is a a map with only the :action
key so it's matched against anything.
The collection is checked in order, the traversal stops at the first match.
The only tricky part is sending the rules over the wire, but how tricky it is depends on the actions.
This might work. https://github.com/oakes/odoyle-rules
This most likely will work, but it's a full-on rule system that one has to learn. This particular case seems simple enough where implementing it on your own is both faster and easier than learning and using a rule system. Unless, of course, the OP wants to learn about such a system.
I would recommend using the Clara rules engine. It's not that difficult to start using, and there is one thing about the business rules: they always grow and surpass the capabilities of each homegrown solution.
Makes me crazy that "foundational libraries" like OpenJFX are constantly moving their minimal supported JDK to the latest ones, all so https://bugs.openjdk.org/browse/JDK-8321603 on their codebase. Shouldn't this kind of libraries try to cover as many versions as possible instead of pushing everybody to the latest constantly? All this because I had a report, related to OpenJFX publishing "invalid" poms, which doesn't work anymore with the latest maven. The OpenJFX team fixed and published it for their latest version, which only supports jdk >= 21.
This part is interesting, emphasis mine: > Additionally, there is an ongoing cost to keeping JavaFX buildable and runnable on older versions of Java, and little reason to continue to do so. I wonder why they think that.
yeah, no idea what is that about
I think the "little reason" for backwards compatibility is wrong, but no idea about costs to keeping JavaFX buildable. I see it just like they want the new fancy stuff on their code base and there is no deep thinking about the impact of their changes. An aspect I love about Clojure itself and its ecosystem
Are they assuming that if you're on an older version of Java, you'll stay using the older version of the library? In other words, if you don't update your JDK very often, you probably also don't update your dependencies either.
No clue what the current situation is, but at least around 8 years ago some companies were stuck with an older JDK due to their support contract.
Are they assuming that if you're on an older version of Java, you'll stay using the older version of the library?I think for making something like that work, for critical things, they need to keep patching and releasing patch versions of the previous major versions, which they do to some extent. But to me looks much more work than staying jdk backwards compatible for a little longer. For this particular example of breaking maven I'm not sure if some day they will release a patched version of javafx 22 or force users to move to 23, which requires jdk 21