Porting Rules code from Drupal 7
This guide is meant to help you convert your existing D7 Rules code into code that works with Rules in Drupal 8/9
Tools
Some useful tools for working with Rules
Events
Programming your own Events
Conditions
Programming your own Conditions
Actions
Programming your own Actions
Expressions
Programming your own Rules Expressions
Exposing custom data to Rules
How to make your custom data structures available for use in Rules
Providing global context variables
How to program your own global context provider
Defining new data filters
Data filters are plugins for the Typed Data module that are used to manipulate a token value for display
Embedded components
Embedding Rules components into your module
Migrating Rules
How to write migrations to move Reaction Rules from Drupal 7 to Drupal 8
Test cases
Providing test cases for your extensions to Rules is vital