Your SlideShare is downloading. ×
0
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Break the-rules
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Break the-rules

288

Published on

All you need to know is "If X then Y" and Rules. Code less do more. Easy interface, more control for admin, integration with workflows and mails. What more can you ask for ? …

All you need to know is "If X then Y" and Rules. Code less do more. Easy interface, more control for admin, integration with workflows and mails. What more can you ask for ?
CCK, Views and Panels have been rightly called as the trilogy of Drupal. But there is more to it. It's actually the Quartet. And Rules is the lesser known module among the quartet. But for those who know Rules, Rules Rock I mean Rules Rule ;) So first lets learn Rules and then break them.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
288
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Break The Rules gokul @azrisolutions.com
  • 2. AGENDA <ul><li>Me and my company </li></ul><ul><li>Introduction to Rules </li></ul><ul><li>Rules : What it can and what it can't do </li></ul><ul><li>Paradigm Shift : Think Triggers and actions </li></ul><ul><li>Rules settings and configurations </li></ul><ul><li>Best practices in using Rules </li></ul><ul><li>Coding with Rules in mind </li></ul><ul><li>Issues with Rules </li></ul><ul><li>Questions ???? </li></ul>
  • 3. ‘ Me’ Bangalore
  • 4. More about ‘Me’ <ul><li>I have worked on Java for close two years. </li></ul><ul><li>Looked into Drupal for the first time for a hobby project. </li></ul><ul><li>Most of my learning was through the community. </li></ul><ul><li>Left a well-paying job at Mindtree and joined a small company to learn Drupal. </li></ul><ul><li>And here I am </li></ul>
  • 5. My Company <ul><li>We are based in </li></ul><ul><li>We code on </li></ul><ul><li>We build products & solutions using </li></ul>
  • 6. What Rules can Do? <ul><li>If there a new article that is created </li></ul><ul><li>Then send a mail to the author saying that it is sent for approval process. </li></ul><ul><li>Send a mail to the editor saying that the article is waiting for his approval. </li></ul><ul><li>Auto-publish the node if the editor doesn't approve in three days time. </li></ul>
  • 7. What Rules can't Do? <ul><li>If you are getting bored with your girlfriend or if she is not sexy any more, dump her and start searching for a new girlfriend. </li></ul>
  • 8. Where rules stand
  • 9. Triggers and actions www.ifttt.com
  • 10. Ifttt.com = Rules for the Web
  • 11. Hooks <ul><li>A programming technique, used in Drupal, allows modules to “hook into” the flow of execution. </li></ul><ul><li>Hooks are a kind of triggers themselves. </li></ul>
  • 12. Triggers <ul><li>Drupal's way of saying something significant has happened. A node has been created, updated or deleted. A user has registered, logged in, logged out and so on. </li></ul>
  • 13. Define your own Trigger <ul><li>ProDrupal </li></ul>
  • 14. Actions <ul><li>Tell Drupal what it should do when something important has happened(when something has been triggered). </li></ul>
  • 15. Define your own actions
  • 16. Rules Homepage
  • 17. Create a new rule
  • 18. Configure the Rule
  • 19. After the Configurations
  • 20. Workflow + Rules
  • 21. Issues with Rules <ul><li>Rules modules is known to have few issues with the entities of Drupal 7 </li></ul><ul><li>Since Rules module uses the admin interface, your business logic can be distributed in admin interface and code. </li></ul><ul><li>Debugging can sometimes be a nightmare. </li></ul>
  • 22. Rules of thumb - 1 <ul><li>Paradigm Shift : Think of user cases in terms of actions and triggers. </li></ul><ul><li>Keep the triggers and actions free from business logic. </li></ul><ul><li>Rules will take care of business logic and will work as glue for actions and trigger based on the Rules defined. </li></ul>
  • 23. Rules of thumb - 2 <ul><li>MODULARITY : Keep the actions and trigger as atomic as possible. This will help in reuse of the actions and triggers </li></ul><ul><li>STRONG COHESION : Keep the rules with similar functionality together and make it a Rule Set. </li></ul><ul><li>WEAK COUPLING : Just know what an action performs. Don't depend on how the actions is performed or the sequence of event within a particular action. </li></ul>
  • 24. Rules of thumb - 3 <ul><li>The major advantage with Rules is configurability and more access to the site admins. So keep the labels meaningful. Site admin should be able to read it like a story. </li></ul><ul><li>For a particular user-case logic implementation, either use Rules or custom code. Don't mix them both. Debugging can be a nightmare. </li></ul>
  • 25. References <ul><li>http://drupal.org/project/rules </li></ul><ul><li>http://groups.drupal.org/rules </li></ul>
  • 26. Questions? Ask Gokul (that's me) Not satisfied? Ask Google Questions?

×