take a look at the ID... at. This can be used to listen for corresponding changes and then react to them accordingly.
import de.espirit.firstspirit.agency.IDProviderEventAgent;
import de.espirit.firstspirit.event.RevisionEvent;
import de.espirit.firstspirit.event.EventInfo;
import java.util.function.Consumer;
import java.util.function.Predicate;
eventFilter = new Predicate<EventInfo>() {
boolean test(info) {
context.logInfo("EVENTAGENT-Info Objekt: " + info);
return true;
}
};
eventListener = new Consumer<RevisionEvent>() {
void accept(event) {
context.logInfo("EVENTAGENT-Event received for Revision" + event.getRevision());
context.logInfo("EVENTAGENT-Project check: " + event.getUserService().getProject().getLanguages());
changes = event.getChanges();
context.logInfo("EVENTAGENT-Event.getChanges:" + changes);
it = changes.iterator();
while (it.hasNext()) {
change = it.next();
changeInfo = change.getEventInfo();
element = change.getElement();
context.logInfo("EVENTAGENT-Event.change - INFO:" + changeInfo );
context.logInfo("EVENTAGENT - displayname" + element.getDisplayName(context.project.masterLanguage));
}
}
};
eventAgent = context.requireSpecialist(IDProviderEventAgent.TYPE);
context.logInfo("EVENTAGENT-eventAgent" + eventAgent);
eventAgent.addListener(eventFilter,eventListener);
Thread.sleep(10000*60*1);
eventAgent.removeListener(eventListener);
For test purposes this script was run as a script action within a schedule entry. But for your use case, you should create a module with an appropriate service.