Ryan Price
Blink Reaction
@liberatr
Orlando, FL
April 11-12, 2015
Faves: Theatre, Pottery, Photography, Podcasts, Beer, Coworking, Mentoring, and Open Source
art & technology
community & work
[lash-ing] verb
1. to secure items together in a somewhat rigid manner
Dries Buytaert
when this happens
if this is true
perform this action
before I leave for work
if there are dark clouds in the sky
bring the umbrella from the hall
after I leave for work
if the day is not Friday
get credit card from wallet
purchase coffee with credit card
if the time is before 8:45am
when this happens
if both of these are true
set up this data
perform this action with data
Woah, not sure what this rule does...
I can edit this "Test" message though.
What Event?
Saving a node
What Condition?
If it's unpublished
What Action?
Delete the comments
Until we learn to use "Loop", we have to delete comments one-by-one
/admin/config/workflow/rules/reaction/add
When this happens...
I have an event
Add a Condition for Unpublished
What about
"unpublished"?
I want the opposite of published
Event and Condition
I Need an Action to Perform
There is no Action
referring to Comments
Comments are
Entities, though
What is all of this?
TODO
What is all of this?
I can drill down into a Node and one comment at a time
Event, Condition and Action
...but only deletes the first comment
I'll add a Loop
Drill down to comment list
Change "Current List Item" to
something more meaningful to this rule
Delete Entity needs to be nested under Loop
Don't forget to Save!
Still one more edit needed
Drill down to comment list
Change "Current List Item" to
something more meaningful to this rule
The Finished Rule
Loop over and Delete the right way
1
2
3
4
5
Send email to these users
Run another Rule on these Nodes
Notice, there is no "Event" in a component
Rules Components
Views Bulk Operations
Drupal Commerce
Entityform
Site building based on Drupal 8 core integration wins
Admin UI usability improvements
Simple Views Bulk operations in core
Reusable components
Plug-in based architecture & fully object-oriented code
Rules data selector for tokens, contexts and other use cases
Typed data widgets & formatters
Embeddable Rules UI components to integrate actions & conditions
Evolved developer experience
Unified DX based on Drupal 8 plug-in system
Symfony 2 event system integration
Deployable config via CMI
at DropBucket.org, the Drupal Pastebin
https://www.drupal.org/project/rules
Create Components
The "Event" is Cron
ex. Reminder: You haven't edited your profile in a year
https://www.drupal.org/project/views_bulk_operations
Create Components
Edit View "Bulk Operations" Field and add your Component
Make sure you have a "Node" Parameter
(or whatever Entity your view pulls)
https://www.drupal.org/project/maillog
Show me the emails
Log all messages
Reroute instead of sending
https://www.drupal.org/project/rules_forms
Event: When a form is being validated
Invalidate a form before it gets saved
Validate fields, display custom messages
Don't need to use Form API
Used by Resource Conflict
https://www.drupal.org/project/resource_conflict
Check if an event is in the same room at the same time
Use Taxonomy Terms for "rooms"
Can invalidate the form, so it won't be saved if a conflict exists
https://www.drupal.org/project/workflow
React to changes in Workflow State
e.g. Draft, In Progress, Needs Review, etc.
https://www.drupal.org/project/cache_actions
Clear Drupal cache bins
Clear CSS/JS cache
Clear the cache of specific views
Clear the cache of specific panel pages
Clear the cache of specific mini panels
https://www.drupal.org/project/entityform
Excellent Rules support built in
Rules drive email Notifications
https://www.drupal.org/project/logintoboggan
Event when the user account is validated.
https://www.drupal.org/project/og
Events when a user is added to a group,
Joins/Leaves a group
When group content is added
https://www.drupal.org/project/rules_repeated_events
My preferred means of creating recurring events.
Good example of Provided vs Parameter
https://www.drupal.org/project/context_rules
Event when a Context is activated,
from the Context module
Ryan Price
Blink Reaction
@liberatr