which actually reminds me of another question I had - is there a global scope accessible somewhere? It would be very handy for declaring constants (val). I’ve noticed I cannot access Items in the rule file scope (ie variables declared at the top of the file - not within the rule scope).
To answer your specific questions, the answer is no. You cannot create your own classes and use them in Rules DSL. There is no global context somewhere. Well, that last part isn’t strictly true. You do have access to a global context: Items.