Rules Syntax question (random)

Just curious - I noticed some people put {} around the actual rule (after the “then”). But documentation doesn’t really say you have to.

That something I should read into deeper.

I’ve not noticed that. Do you have an example you can point at?

Keeping in mind that most of the rules posted here are in the Rules DSL, the “{ }” defines a context. It is syntactically correct to use an { after the then and an } just before the end, but it is superfluous.

Put another way, the then and end explicitly defines the context for you so there is no need to use curly brackets in this case. But using them is not an error so if you want to go for it. It doesn’t break anything and some coders like to be consistent in how they represent context.

It was here

I figured if Thom did it It might be important!

As long as I’m not risking anything I guess 2 extra keystrokes saved is time saved eh!?

Thanks!

Curly brackets are not needed. Most of the time when I’m building a new rule, my steps are copy&paste&modify. My rules are with as well as without curly brackets :slight_smile:

I think, now that you pointed me to that problem, I’ll remove all brackets in my rules.

HAH!!! Not my intention to point anything out - Was just generally curious! You guys are light years beyond me so I take most of what you say for gospel!

1 Like