SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
DrupalCon Paris 2009                               by Wolfgang Ziegler (fago)
                                                     and Klaus Purer (klausi)




                              Rules
       Leveraging rule based automation!




                       http://drupal.org/project/rules
About us

●   Wolfgang Ziegler (fago)
    Twitter: @the_real_fago
    Identica: @fago
    Drupal related blog: http://more.zites.net


●   Klaus Purer (klausi)
    Google Summer of Code Student 2009
    klaus.purer@gmail.com
Outline

●   Rules!? - What is it
●   Google Summer of Code
●   Use case 1: React on user inactivity
●   Use case 2: An basic editorial workflow
●   Use case 3: Extending the editorial workflow
●   What's next?
Rules !?

●   http://drupal.org/project/rules
●   define conditionally executed actions based on
    occurring events
●   a replacement with more features for the trigger
    module in core
●   the successor of the drupal 5 compatible workflow-ng
    module
●   a tool for site automation and customization
Triggered Rules

●   Triggered Rules / Reactive Rules
●   Users surfing on your Drupal site generate events.
●   When the event is triggered associated rules are
    evaluated.
●   Event – Condition – Action
●   Example:
      React when a users posts something
      → Show him a custom message!
A screenshot...
Features

●   Import / Export
●   Group and reuse rules in “Rule Sets”
●   Flexible scheduling system
●   Modular input evaluation system (Tokens, PHP, ..)
●   A well documented and solid API, which allows
    modules to
        –   provide further conditions, actions and events
        –   configure default rules and rule sets
Summer of Code 2009

                  ●   “Rules Monkey Project”
                  ●   Enhancement and
                      extension of Rules
                  ●   New Rules Forms module
                  ●   More possibilities for
                      Rules scheduler
                  ●   Tutorials
                  ●   Many small fixes here
                      and there ...
Rules Forms Support

●   Manipulate/Customize any form on your Drupal site
●   Events:
        –   Form is being built
        –   Form is being validated
        –   Form is being submitted
●   Condition:
        –   Form element has value
Rules Forms Support (2)

●   Actions:
        –   Hide a form element
        –   Disable a form element
        –   Adjust weight of a form element
        –   Set the default value of a form element
        –   Set the redirect target of the form
        –   Insert prefix/suffix HTML
        –   Set a form error
Rules Tutorials

●   Documentation on http://drupal.org/node/298482
●   Tutorials for Rules Scheduler and Rules Forms support
●   They provide a step-by-step guide and instructions
●   Tutorial 1: On login redirect to the user's account page
●   Tutorial 2: Publish content exactly 24 hours after it was
    created
●   Tutorial 3: Publish content based on a CCK date field
●   Tutorial 4: Publish and unpublish content regularly on
    some week days (scheduling loops)
●   Tutorial 5: Editorial workflow with Rules
React on user inactivity

●   Use event: “User has logged in”
●   Rule Sets for:
         –   Notify the user by e-mail
         –   Blocking the user
●   Upon login:
         –   Schedule the notification and remove any
               previous scheduled tasks
●   When notifying:
         –   Schedule blocking the user
A basic editorial workflow (1)

●   User roles:
              “Editor”, “Publisher”

●   Editor:
         –    Creates and edits content, but is not able to
                publish it.
●   Publisher:
         –    Reviews content and publishes it.
A basic editorial workflow (2)

●   CCK field “workflow (Draft | Published) for pages
●   Content permissions
         –   Only publisher may edit the workflow field
●   Both roles may edit any pages.
●   Simple View: Moderation queue for Publisher
●   Pages are unpublished by default
    → Use a Rule to really publish them when the workflow
      field is set to “Published”.
Site building with Rules

●   Quickly build new functionality or customize your site
    by adding some rules
●   Import/Export helps staging your rules to production
    sites and allows you to share your rules with others!
●   Easily execute custom short code snippets with rules!
●   Write new functionality by exposing new conditions,
    actions, events, …
●   Exporting rules to a module
         –   Do it manually
         –   Use “Features” support (WIP)
Developing with Rules

●   Helps optimizing code reuse!
        –   added events, conditions and actions can be
              used wherever possible!
●   Eases and speeds up development!
        –   Don't care where to get your variables from -
             just specify what you need and use it!
●   Minimizes the need of custom code!
●   Eases major release upgrades:
        –   Just upgrade rules and any custom rules
              integration!
Hints & Suggestions (1)

●   Use flags to trigger Rules
         –   http://drupal.org/project/flag
●   Test Rules with “Debugging” enabled

●   Avoid token replacements in often evaluated conditions
         –   Use separate conditions, if possible.
         –   Move the condition using tokens down
Hints & Suggestions (2)

●   When changing content prefer the event
    “Content is going to be saved”
     in contrast to
    “After content has been updated”


    → Avoid saving content twice!
    → Use “Content is new” condition to distinguish
    between creation and update.
What's next? (1)

●   Working on Rules 2.0
●   Drupal 7 compatible + backport to Drupal 6


●   Improved API (Modular, OOP, ...)
●   Support for Lists and Loops
●   Human readable Rules-Export
●   Web-Service support!
        –   Use Rules to invoke remote services!
        –   Provide services by configuring Rule-Sets!
What's next? (2)

●   Transformations Integration
         –   Module to transform data!
         –   http://drupal.org/project/transformations
         –   By Jakob Petsovits (jpetso)
         –   Uses Pipelines + Operations for a pluggable
              Import / Export
         –   CSV, XML, Drupal Data Support
●   Build a transformation pipeline and use it in your Rules
●   Want to invoke a remote service with a different data
    structure?
Any questions?

Mais conteúdo relacionado

Mais procurados

Drupal Camp Sthml 09
Drupal Camp Sthml 09Drupal Camp Sthml 09
Drupal Camp Sthml 09Pelle Wessman
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-BryanLearningTech
 
React native: building native iOS apps with javascript
React native: building native iOS apps with javascriptReact native: building native iOS apps with javascript
React native: building native iOS apps with javascriptPolidea
 
Parallel builds in Eclipse IDE workspace - EclispeCon Europe 2018
Parallel builds in Eclipse IDE workspace - EclispeCon Europe 2018Parallel builds in Eclipse IDE workspace - EclispeCon Europe 2018
Parallel builds in Eclipse IDE workspace - EclispeCon Europe 2018Mickael Istria
 
Power up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShiftPower up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShiftShekhar Gulati
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshareRakesh Sukumar
 
Intoduction to React
Intoduction to ReactIntoduction to React
Intoduction to ReactRubizza
 

Mais procurados (7)

Drupal Camp Sthml 09
Drupal Camp Sthml 09Drupal Camp Sthml 09
Drupal Camp Sthml 09
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
 
React native: building native iOS apps with javascript
React native: building native iOS apps with javascriptReact native: building native iOS apps with javascript
React native: building native iOS apps with javascript
 
Parallel builds in Eclipse IDE workspace - EclispeCon Europe 2018
Parallel builds in Eclipse IDE workspace - EclispeCon Europe 2018Parallel builds in Eclipse IDE workspace - EclispeCon Europe 2018
Parallel builds in Eclipse IDE workspace - EclispeCon Europe 2018
 
Power up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShiftPower up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShift
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 
Intoduction to React
Intoduction to ReactIntoduction to React
Intoduction to React
 

Destaque

Drupal Presentation for CBEID
Drupal Presentation for CBEIDDrupal Presentation for CBEID
Drupal Presentation for CBEIDStraight North
 
DrupalCon 2010 Developer Summit Lightning Talk: Multiple Menu Parents
DrupalCon 2010 Developer Summit Lightning Talk: Multiple Menu ParentsDrupalCon 2010 Developer Summit Lightning Talk: Multiple Menu Parents
DrupalCon 2010 Developer Summit Lightning Talk: Multiple Menu Parentsjeremystoller
 
Drupalcamp Simpletest
Drupalcamp SimpletestDrupalcamp Simpletest
Drupalcamp Simpletestlyricnz
 
DrupalCon 2010 Developer Summit Lightning Talk: Content Moderation
DrupalCon 2010 Developer Summit Lightning Talk: Content ModerationDrupalCon 2010 Developer Summit Lightning Talk: Content Moderation
DrupalCon 2010 Developer Summit Lightning Talk: Content Moderationjeremystoller
 
Lucius Websystems Drupal Startersdag
Lucius Websystems Drupal StartersdagLucius Websystems Drupal Startersdag
Lucius Websystems Drupal StartersdagLuciuswebsystems
 
Drupal Uitgebreide Starters Training
Drupal Uitgebreide Starters TrainingDrupal Uitgebreide Starters Training
Drupal Uitgebreide Starters TrainingLuciuswebsystems
 
Capital Camp Bundle Publishing and Workflow Presentation
Capital Camp Bundle Publishing and Workflow PresentationCapital Camp Bundle Publishing and Workflow Presentation
Capital Camp Bundle Publishing and Workflow PresentationBalance Interactive
 
Updating Your Website to Drupal 7
Updating Your Website to Drupal 7Updating Your Website to Drupal 7
Updating Your Website to Drupal 7Acquia
 
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...Julia Kulla-Mader
 
CapitalCamp DC 2012: Taxonomy
CapitalCamp DC 2012: TaxonomyCapitalCamp DC 2012: Taxonomy
CapitalCamp DC 2012: TaxonomyNatalya Minkovsky
 
Testing In Drupal
Testing In DrupalTesting In Drupal
Testing In DrupalRyan Cross
 
What Can Drupal Do For You?
What Can Drupal Do For You?What Can Drupal Do For You?
What Can Drupal Do For You?Aubrey Sambor
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Anil Sagar
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To DrupalLauren Roth
 

Destaque (20)

Drupal Presentation for CBEID
Drupal Presentation for CBEIDDrupal Presentation for CBEID
Drupal Presentation for CBEID
 
DrupalCon 2010 Developer Summit Lightning Talk: Multiple Menu Parents
DrupalCon 2010 Developer Summit Lightning Talk: Multiple Menu ParentsDrupalCon 2010 Developer Summit Lightning Talk: Multiple Menu Parents
DrupalCon 2010 Developer Summit Lightning Talk: Multiple Menu Parents
 
Drupalcamp Simpletest
Drupalcamp SimpletestDrupalcamp Simpletest
Drupalcamp Simpletest
 
DrupalCon 2010 Developer Summit Lightning Talk: Content Moderation
DrupalCon 2010 Developer Summit Lightning Talk: Content ModerationDrupalCon 2010 Developer Summit Lightning Talk: Content Moderation
DrupalCon 2010 Developer Summit Lightning Talk: Content Moderation
 
Lucius Websystems Drupal Startersdag
Lucius Websystems Drupal StartersdagLucius Websystems Drupal Startersdag
Lucius Websystems Drupal Startersdag
 
Drupal Uitgebreide Starters Training
Drupal Uitgebreide Starters TrainingDrupal Uitgebreide Starters Training
Drupal Uitgebreide Starters Training
 
Capital Camp Bundle Publishing and Workflow Presentation
Capital Camp Bundle Publishing and Workflow PresentationCapital Camp Bundle Publishing and Workflow Presentation
Capital Camp Bundle Publishing and Workflow Presentation
 
Drupalcampatl d7
Drupalcampatl d7Drupalcampatl d7
Drupalcampatl d7
 
Drupal for Programmers
Drupal for ProgrammersDrupal for Programmers
Drupal for Programmers
 
Updating Your Website to Drupal 7
Updating Your Website to Drupal 7Updating Your Website to Drupal 7
Updating Your Website to Drupal 7
 
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
 
CapitalCamp DC 2012: Taxonomy
CapitalCamp DC 2012: TaxonomyCapitalCamp DC 2012: Taxonomy
CapitalCamp DC 2012: Taxonomy
 
Building Community
Building CommunityBuilding Community
Building Community
 
Drupal and RDF
Drupal and RDFDrupal and RDF
Drupal and RDF
 
DrupalCon 2011 Highlight
DrupalCon 2011 HighlightDrupalCon 2011 Highlight
DrupalCon 2011 Highlight
 
Testing In Drupal
Testing In DrupalTesting In Drupal
Testing In Drupal
 
What Can Drupal Do For You?
What Can Drupal Do For You?What Can Drupal Do For You?
What Can Drupal Do For You?
 
Hello Drupal
Hello DrupalHello Drupal
Hello Drupal
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
 

Semelhante a Praes

Drupal Architecture and functionality
Drupal Architecture and functionality Drupal Architecture and functionality
Drupal Architecture and functionality Ann Lam
 
Drupal project-rules
Drupal project-rulesDrupal project-rules
Drupal project-rulesSTIinnsbruck
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master BuilderPhilip Norton
 
Rules for Fools: The Rules Module
Rules for Fools: The Rules ModuleRules for Fools: The Rules Module
Rules for Fools: The Rules ModuleWill Hall
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingStanislav Osipov
 
Hong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8thHong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8thWong Hoi Sing Edison
 
Moodle Development Best Pracitces
Moodle Development Best PracitcesMoodle Development Best Pracitces
Moodle Development Best PracitcesJustin Filip
 
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdfLupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdfWolfgangZiegler6
 
Warsaw MuleSoft Meetup #13.pptx
Warsaw MuleSoft Meetup #13.pptxWarsaw MuleSoft Meetup #13.pptx
Warsaw MuleSoft Meetup #13.pptxPatryk Bandurski
 
MuleSoft_Meetup_Brisbane_2022-06-01_SonarQube_CataloguingAPIs.pptx
MuleSoft_Meetup_Brisbane_2022-06-01_SonarQube_CataloguingAPIs.pptxMuleSoft_Meetup_Brisbane_2022-06-01_SonarQube_CataloguingAPIs.pptx
MuleSoft_Meetup_Brisbane_2022-06-01_SonarQube_CataloguingAPIs.pptxBrianFraser29
 
OpenERP R&D
OpenERP R&DOpenERP R&D
OpenERP R&DOdoo
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and moreAcquia
 
Dolibarr - Whats new in 14.0 - Webinare 2021
Dolibarr - Whats new in 14.0 - Webinare 2021Dolibarr - Whats new in 14.0 - Webinare 2021
Dolibarr - Whats new in 14.0 - Webinare 2021Laurent Destailleur
 
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...DataScienceConferenc1
 
jBPM5 - The Evolution of BPM Systems
jBPM5 - The Evolution of BPM SystemsjBPM5 - The Evolution of BPM Systems
jBPM5 - The Evolution of BPM SystemsJBUG London
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice frameworkFabrice Sznajderman
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineElasTest Project
 

Semelhante a Praes (20)

Drupal Architecture and functionality
Drupal Architecture and functionality Drupal Architecture and functionality
Drupal Architecture and functionality
 
Drupal project-rules
Drupal project-rulesDrupal project-rules
Drupal project-rules
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
Rules for Fools: The Rules Module
Rules for Fools: The Rules ModuleRules for Fools: The Rules Module
Rules for Fools: The Rules Module
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 
Hong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8thHong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8th
 
Moodle Development Best Pracitces
Moodle Development Best PracitcesMoodle Development Best Pracitces
Moodle Development Best Pracitces
 
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdfLupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
 
Warsaw MuleSoft Meetup #13.pptx
Warsaw MuleSoft Meetup #13.pptxWarsaw MuleSoft Meetup #13.pptx
Warsaw MuleSoft Meetup #13.pptx
 
MuleSoft_Meetup_Brisbane_2022-06-01_SonarQube_CataloguingAPIs.pptx
MuleSoft_Meetup_Brisbane_2022-06-01_SonarQube_CataloguingAPIs.pptxMuleSoft_Meetup_Brisbane_2022-06-01_SonarQube_CataloguingAPIs.pptx
MuleSoft_Meetup_Brisbane_2022-06-01_SonarQube_CataloguingAPIs.pptx
 
AngularJS
AngularJSAngularJS
AngularJS
 
Drupal Flyover, CMS Expo
Drupal Flyover, CMS ExpoDrupal Flyover, CMS Expo
Drupal Flyover, CMS Expo
 
OpenERP R&D
OpenERP R&DOpenERP R&D
OpenERP R&D
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
Dolibarr - Whats new in 14.0 - Webinare 2021
Dolibarr - Whats new in 14.0 - Webinare 2021Dolibarr - Whats new in 14.0 - Webinare 2021
Dolibarr - Whats new in 14.0 - Webinare 2021
 
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
 
jBPM5 Developer Guide Presentation JBUG London
jBPM5 Developer Guide Presentation JBUG LondonjBPM5 Developer Guide Presentation JBUG London
jBPM5 Developer Guide Presentation JBUG London
 
jBPM5 - The Evolution of BPM Systems
jBPM5 - The Evolution of BPM SystemsjBPM5 - The Evolution of BPM Systems
jBPM5 - The Evolution of BPM Systems
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice framework
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipeline
 

Mais de Drupalcon Paris

The State Of Rdf In Drupal 7
The State Of Rdf In Drupal 7The State Of Rdf In Drupal 7
The State Of Rdf In Drupal 7Drupalcon Paris
 
Web Typography Fundamentals
Web Typography FundamentalsWeb Typography Fundamentals
Web Typography FundamentalsDrupalcon Paris
 
State Of Drupal September 2009
State Of Drupal September 2009State Of Drupal September 2009
State Of Drupal September 2009Drupalcon Paris
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Drupalcon Paris
 
Presentation Edipresse Experience Drupalcon
Presentation Edipresse Experience DrupalconPresentation Edipresse Experience Drupalcon
Presentation Edipresse Experience DrupalconDrupalcon Paris
 
Enterprise Sitemanagement 2
Enterprise Sitemanagement 2Enterprise Sitemanagement 2
Enterprise Sitemanagement 2Drupalcon Paris
 
Field Api Drupalcon Paris
Field Api Drupalcon ParisField Api Drupalcon Paris
Field Api Drupalcon ParisDrupalcon Paris
 
How To Contribute To Drupal Drupal - DrupalCon Paris
How To Contribute To Drupal Drupal - DrupalCon ParisHow To Contribute To Drupal Drupal - DrupalCon Paris
How To Contribute To Drupal Drupal - DrupalCon ParisDrupalcon Paris
 

Mais de Drupalcon Paris (15)

The State Of Rdf In Drupal 7
The State Of Rdf In Drupal 7The State Of Rdf In Drupal 7
The State Of Rdf In Drupal 7
 
Web Typography Fundamentals
Web Typography FundamentalsWeb Typography Fundamentals
Web Typography Fundamentals
 
Taxonomy Everywhere
Taxonomy EverywhereTaxonomy Everywhere
Taxonomy Everywhere
 
State Of Drupal September 2009
State Of Drupal September 2009State Of Drupal September 2009
State Of Drupal September 2009
 
Sketching
SketchingSketching
Sketching
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
Rd Fa In Drupal
Rd Fa In DrupalRd Fa In Drupal
Rd Fa In Drupal
 
Localize Drupal Org
Localize Drupal OrgLocalize Drupal Org
Localize Drupal Org
 
Presentation Edipresse Experience Drupalcon
Presentation Edipresse Experience DrupalconPresentation Edipresse Experience Drupalcon
Presentation Edipresse Experience Drupalcon
 
20minutes Quart
20minutes Quart20minutes Quart
20minutes Quart
 
Enterprise Sitemanagement 2
Enterprise Sitemanagement 2Enterprise Sitemanagement 2
Enterprise Sitemanagement 2
 
Field Api Drupalcon Paris
Field Api Drupalcon ParisField Api Drupalcon Paris
Field Api Drupalcon Paris
 
Drupalcon2009 Heuer3
Drupalcon2009 Heuer3Drupalcon2009 Heuer3
Drupalcon2009 Heuer3
 
Danbri Drupalcon Export
Danbri Drupalcon ExportDanbri Drupalcon Export
Danbri Drupalcon Export
 
How To Contribute To Drupal Drupal - DrupalCon Paris
How To Contribute To Drupal Drupal - DrupalCon ParisHow To Contribute To Drupal Drupal - DrupalCon Paris
How To Contribute To Drupal Drupal - DrupalCon Paris
 

Praes

  • 1. DrupalCon Paris 2009 by Wolfgang Ziegler (fago) and Klaus Purer (klausi) Rules Leveraging rule based automation! http://drupal.org/project/rules
  • 2. About us ● Wolfgang Ziegler (fago) Twitter: @the_real_fago Identica: @fago Drupal related blog: http://more.zites.net ● Klaus Purer (klausi) Google Summer of Code Student 2009 klaus.purer@gmail.com
  • 3. Outline ● Rules!? - What is it ● Google Summer of Code ● Use case 1: React on user inactivity ● Use case 2: An basic editorial workflow ● Use case 3: Extending the editorial workflow ● What's next?
  • 4. Rules !? ● http://drupal.org/project/rules ● define conditionally executed actions based on occurring events ● a replacement with more features for the trigger module in core ● the successor of the drupal 5 compatible workflow-ng module ● a tool for site automation and customization
  • 5. Triggered Rules ● Triggered Rules / Reactive Rules ● Users surfing on your Drupal site generate events. ● When the event is triggered associated rules are evaluated. ● Event – Condition – Action ● Example: React when a users posts something → Show him a custom message!
  • 7. Features ● Import / Export ● Group and reuse rules in “Rule Sets” ● Flexible scheduling system ● Modular input evaluation system (Tokens, PHP, ..) ● A well documented and solid API, which allows modules to – provide further conditions, actions and events – configure default rules and rule sets
  • 8. Summer of Code 2009 ● “Rules Monkey Project” ● Enhancement and extension of Rules ● New Rules Forms module ● More possibilities for Rules scheduler ● Tutorials ● Many small fixes here and there ...
  • 9. Rules Forms Support ● Manipulate/Customize any form on your Drupal site ● Events: – Form is being built – Form is being validated – Form is being submitted ● Condition: – Form element has value
  • 10. Rules Forms Support (2) ● Actions: – Hide a form element – Disable a form element – Adjust weight of a form element – Set the default value of a form element – Set the redirect target of the form – Insert prefix/suffix HTML – Set a form error
  • 11. Rules Tutorials ● Documentation on http://drupal.org/node/298482 ● Tutorials for Rules Scheduler and Rules Forms support ● They provide a step-by-step guide and instructions ● Tutorial 1: On login redirect to the user's account page ● Tutorial 2: Publish content exactly 24 hours after it was created ● Tutorial 3: Publish content based on a CCK date field ● Tutorial 4: Publish and unpublish content regularly on some week days (scheduling loops) ● Tutorial 5: Editorial workflow with Rules
  • 12. React on user inactivity ● Use event: “User has logged in” ● Rule Sets for: – Notify the user by e-mail – Blocking the user ● Upon login: – Schedule the notification and remove any previous scheduled tasks ● When notifying: – Schedule blocking the user
  • 13. A basic editorial workflow (1) ● User roles: “Editor”, “Publisher” ● Editor: – Creates and edits content, but is not able to publish it. ● Publisher: – Reviews content and publishes it.
  • 14. A basic editorial workflow (2) ● CCK field “workflow (Draft | Published) for pages ● Content permissions – Only publisher may edit the workflow field ● Both roles may edit any pages. ● Simple View: Moderation queue for Publisher ● Pages are unpublished by default → Use a Rule to really publish them when the workflow field is set to “Published”.
  • 15. Site building with Rules ● Quickly build new functionality or customize your site by adding some rules ● Import/Export helps staging your rules to production sites and allows you to share your rules with others! ● Easily execute custom short code snippets with rules! ● Write new functionality by exposing new conditions, actions, events, … ● Exporting rules to a module – Do it manually – Use “Features” support (WIP)
  • 16. Developing with Rules ● Helps optimizing code reuse! – added events, conditions and actions can be used wherever possible! ● Eases and speeds up development! – Don't care where to get your variables from - just specify what you need and use it! ● Minimizes the need of custom code! ● Eases major release upgrades: – Just upgrade rules and any custom rules integration!
  • 17. Hints & Suggestions (1) ● Use flags to trigger Rules – http://drupal.org/project/flag ● Test Rules with “Debugging” enabled ● Avoid token replacements in often evaluated conditions – Use separate conditions, if possible. – Move the condition using tokens down
  • 18. Hints & Suggestions (2) ● When changing content prefer the event “Content is going to be saved” in contrast to “After content has been updated” → Avoid saving content twice! → Use “Content is new” condition to distinguish between creation and update.
  • 19. What's next? (1) ● Working on Rules 2.0 ● Drupal 7 compatible + backport to Drupal 6 ● Improved API (Modular, OOP, ...) ● Support for Lists and Loops ● Human readable Rules-Export ● Web-Service support! – Use Rules to invoke remote services! – Provide services by configuring Rule-Sets!
  • 20. What's next? (2) ● Transformations Integration – Module to transform data! – http://drupal.org/project/transformations – By Jakob Petsovits (jpetso) – Uses Pipelines + Operations for a pluggable Import / Export – CSV, XML, Drupal Data Support ● Build a transformation pipeline and use it in your Rules ● Want to invoke a remote service with a different data structure?