Kevin Carwile

Basic Rules Principles - How A Rule Works

Rules operates based on a model of events, conditions, and actions (ECA'a). First an event happens, then conditions are checked, and finally, designated actions are taken. You get to decide which event a rule is triggered by, what conditions (if any) will be checked, and ultimately what actions should be taken as a result. You can create as many individual rules as needed to achieve the behaviors you want.

Rules are designed to solve most any "when... if... then..." needs on your site.

Rule Events

When you create rules, they will be attached to a specific event that will cause them to be evaluated. There are many different core events that ship with the Rules application which work with any content driven applications installed on the site; but additional events can also be added by 3rd party applications to give you specific control over features that may not be a standard suite function.

For example, if you install an app on your site that allows you to create a new content type called "Questions" which features it's own "best answer" function, then Rules will automatically make events available on the content for when it is created, edited, deleted, pinned, featured, etc. But it will not add an event for when a best answer is set for that "Question", because that is a proprietary function added by the app. Therefore the app developer would need to include a Rules extension to make that event configurable through rules.

See: Rules ECA Extension Guide

Rule Conditions

Conditions allow rules to be applied only in specific circumstances. Any rule can have zero or more conditions associated with it which will determine if the actions in the rule should be taken. Conditions can be structured into "AND" & "OR" groups if needed to set up more complex criteria.

Rules includes a lot of standard conditional checks that can be used with any app or content installed on your site. But just like with events, 3rd party applications should add their own custom conditional checks into Rules for proprietary features (such as checking if a "Question" has a best answer set).

Rule Actions

Actions are what rules "do". Any number of actions can be added to a rule, and when the rule's conditions are met, all of the actions on the rule will be taken. A lot of standard actions are built into Rules such as pinning/featuring content, changing a member's groups, creating new content, or sending an email.

As with events, 3rd parties should also add their own custom actions into Rules for site owners to use (such as setting the best answer for a "Question").

  Report Article

User Feedback

There are no comments to display.