consider following code being a part of ResourceChangeListener:
private void executeScripts(List<String> scripts) {
try {
var history = aecu.createHistoryEntry();
try {
for (var groovyScriptPath : scripts) {
try {
var result = aecu.execute(groovyScriptPath);
//var result = aecu.executeWithInstallHookHistory(groovyScriptPath);
history = aecu.storeExecutionInHistory(history, result);
} catch (AecuException e) {
LOG.error("AECU script '%s' execution error '{}'", groovyScriptPath, e);
}
}
} finally {
aecu.finishHistoryEntry(history);
}
} catch (AecuException e) {
LOG.error("AECU scripts runner error", e);
}
}
since execute does not check hasBeenExecutedBefore and there is only executeWithInstallHookHistory which does that check, it's impossible (?) to group multiple scripts together to have single HistoryEntry and still idempotently execute scripts (on change, once, etc)
could we update AECU API to address this issue? I am asking because AECU history does not look nice when using executeWithInstallHookHistory in loop (all entries contain 0/1 scripts which looks quite messy)
Hi :)
This request is kinda continuation of https://github.com/valtech/aem-easy-content-upgrade/issues/172
consider following code being a part of ResourceChangeListener:
since
execute
does not checkhasBeenExecutedBefore
and there is onlyexecuteWithInstallHookHistory
which does that check, it's impossible (?) to group multiple scripts together to have single HistoryEntry and still idempotently execute scripts (on change, once, etc)could we update AECU API to address this issue? I am asking because AECU history does not look nice when using executeWithInstallHookHistory in loop (all entries contain 0/1 scripts which looks quite messy)