Search in the Documentation:

JBoss Drools and event listeners

Often, as modifications of content happen, integrators will face the need to perform a specific action when an event occurs. In previous versions of Jahia, event listeners could be either written in Java classes or in JSP files, or even Groovy scripts. In version 6.5, it was replaced with a much more powerful and easier to use rule system based on JBoss Drools. An example of such a rule is given below:

rule "Image update"
salience 25
#Rebuild thumbnail for an updated image and update height/width
when
A file content has been modified
- the mimetype matches image/.*
then
Create an image "thumbnail" of size 150
Create an image "thumbnail2" of size 350
Set the property j:width of the node with the width of the image
Set the property j:height of the node with the height of the image
Log "Image updated " + node.getPath()
end

As you can see rules are similar to the English language formulation and this makes it easy for integrators to use and read. Of course the vocabulary of conditions, making it easy to respond to any event with any action.