I need to run custom code whenever an Journal Article expires in Liferay (in Java).
How can I register a callback function which gets called when an Journal Article changes its state from approved to expired?
So I need to call a Java method which would receive the Article which expired as its parameter, or at least the Article's id. Any ideas?
Service Wrappers come to my mind: Everything in Liferay goes through the technical API, and with a ServiceWrapper you can intercept and enrich calls to that API.
Model Listeners work on the persisted objects themselves, but I'm more hesitant to recommend them - they're too far away from the business layer and rather on the persistence layer. I'd be very reserved putting any business logic down that layer.
Those plugin types work for any and all Entities created by Liferay's ServiceBuilder - and lucky you, Journal Article is such an entity. You'd likely look at a wrapper of JournalArticleLocalService.