Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3499 MCP reports are not shown if the initial MCP job failed #3506

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com)
### Fixed

- #3471 - EmailService not working due to unsatisfied reference to MailTemplateManager in AEM on prem
- #3499 - MCP reports are not shown if the initial MCP job failed

## 6.9.10 - 2024-12-13

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ public Collection<ProcessInstance> getInactiveProcesses() {
TreeFilteringResourceVisitor visitor = new TreeFilteringResourceVisitor();
visitor.setLeafVisitor((r, l) -> {
if (!activeProcesses.containsKey(r.getName())) {
processes.add(r.adaptTo(ArchivedProcessInstance.class));
ArchivedProcessInstance inst = r.adaptTo(ArchivedProcessInstance.class);
if (inst != null) {
processes.add(inst);
}
}
});
visitor.accept(tree);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -243,8 +244,14 @@ public void recordErrors(int step, List<Failure> failures, ResourceResolver rr)
List<ArchivedProcessFailure> archivedFailures = failures.stream().map(ArchivedProcessFailure::adapt).collect(Collectors.toList());
infoBean.setReportedErrors(archivedFailures);
try {
ResourceUtil.getOrCreateResource(rr, BASE_PATH,
Collections.singletonMap(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_FOLDER), null, false);
ResourceUtil.getOrCreateResource(rr, getPath(),
Collections.singletonMap(JcrConstants.JCR_PRIMARYTYPE, "cq:Page"), null, false);

String errFolder = getPath() + "/jcr:content/failures/step" + (step + 1);
JcrUtil.createPath(errFolder, "nt:unstructured", rr.adaptTo(Session.class));
ResourceUtil.getOrCreateResource(rr, errFolder,
Collections.singletonMap(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED), "nt:unstructured", false);
if (rr.hasChanges()) {
rr.commit();
}
Expand All @@ -261,7 +268,7 @@ public void recordErrors(int step, List<Failure> failures, ResourceResolver rr)
});
}
batch.commitBatch();
} catch (RepositoryException | PersistenceException | LoginException | NullPointerException ex) {
} catch (PersistenceException | LoginException | NullPointerException ex) {
LOG.error("Unable to record errors", ex);
}
}
Expand Down
Loading