Creating efficient rules when migrating from Webcore

Some of us who are new coming over from Webcore will certainly have questions about creating efficient rules while migrating during the next couple of weeks.

My question is not only about nesting If statements and multiple triggers, but most importantly if I’m thinking about the execution of the rule in the most efficient manner. In this basic webcore piston, I’m triggering it three times a week and making a determination one of those times based on odd/even week numbers.

I’ve figured out how to pull in the week number and determine odd/even, but I’m not certain if I’m thinking about how to nest the ifs correctly. Does my rule below seem to be the most efficient – or is there another way to think about it?

Thanks!
Jason

Yes, that seems like a perfectly reasonable approach.

I would note that the IF Conditions natively have the ability to restrict to the day of week without having to call the /date endpoint… but since you ultimately want to use the week number to determine if it’s odd or even on Friday, it probably doesn’t hurt anything (just a slight extra overhead on Monday and Thursday, but I doubt it would be noticeable).

Thanks for sharing the use-case too! As we’re planning on introducing math and date features as first-class features in the Rule Engine, it’s helpful to see examples of how people are using these feature from the lab environment!

Got it, I missed the day option in the IF statement.

Will update to the most efficient path.

1 Like