+
+ graph.forEachObject(resource, ISSUE.Issue_ContextList_Element_Inverse, new AsyncMultiProcedure<Resource>() {
+ @Override
+ public void execute(AsyncReadGraph graph, final Resource element) {
+
+ graph.asyncRequest(new ResourceRead<Resource>(element) {
+ @Override
+ public Resource perform(ReadGraph graph) throws DatabaseException {
+ Resource list = ListUtils.getListElementList(graph, resource);
+ return graph.getSingleObject(list, ISSUE.Issue_HasContexts_Inverse);
+ }
+ }, new AsyncProcedure<Resource>() {
+
+ @Override
+ public void execute(AsyncReadGraph graph, Resource issue) {
+ /*
+ * Compare severity of each related issue and find the maximum severity.
+ * The issues that are not resolved and have active issue source manager
+ * are taken into account.
+ */
+ acceptIfNotResolved(graph, procedure, ISSUE, issue, maxSeverity);
+ }
+
+ @Override
+ public void exception(AsyncReadGraph graph, Throwable throwable) {
+ procedure.exception(graph, throwable);
+ }
+ });
+
+
+ }
+ @Override
+ public void finished(AsyncReadGraph graph) {
+ }
+ @Override
+ public void exception(AsyncReadGraph graph, Throwable throwable) {
+ procedure.exception(graph, throwable);
+ }
+ });
+
+ procedure.execute(graph, maxSeverity.get());
+