FAQ: Getting Started with the new Rules API

Take a look at this