The State of Rules for D9+
(and intro to ECA)
What is Rules?
Drupal module for triggering functionality
Think of it like hooks (except with a GUI)
Or event subscribers
Events
Something in system that triggers an action to potentially run
Conditions
Validate that action is fit to run
Action
Perform some task
Why?
Create pluggable systems
Actions not hardcoded in codebase to get triggered on a specific event
More resilient actions
Actions can be more generalized
Has a GUI
Is exportable so can be in your version control system
Why not?
Building a specialized app
Slower
More dependencies
Does not mean you won't require code
Examples
Content moderation
Mark content as draft when it enters system
Unpublish
Email content admins
User registration / signs in for first time
Invite them to slack
Look at Rules
For D7 and D9
Current state of Rules
Kinda unsupported
Business Rules, TR_Rules (trimmed rules) exist but also minimally unsupported
Limited functionality compared to D7
ECA Module
https://www.drupal.org/project/eca
Event - Condition - Action
Fairly large ecosystem
Integrations with webform, groups, commerce
Not as nice GUI
External projects for improved workflows
Well supported
https://ecaguide.org/
Lets try some stuff