OOP in rules or import own class

hallo, i know this is known as open topic…

but i can’t thing that nobody uses advances rules in a way like oop.

So , if anybody can give me a tip how to do iit it would be great

grretings

were you able to figure out how to create a class inside a rule? in my case i want to define a simple structure. if you were able to import your own class, did you put a jar file somewhere for it to work?

Scripted automation has been available in OH for ~5 years. It is currently included with the new rule engine.

https://openhab-scripters.github.io/openhab-helper-libraries/index.html