changeset 8979:951a4af24a09

Fixed: 'error_no_export_found' after changing calculation mode in SINFO.
author gernotbelger
date Thu, 05 Apr 2018 17:12:23 +0200
parents b5600453bb8f
children b194fa64506a
files artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Thu Apr 05 11:57:54 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Thu Apr 05 17:12:23 2018 +0200
@@ -1014,6 +1014,19 @@
         log.debug("Bound to out: " + getBoundToOut());
         log.debug("OutName: " + outName);
 
+        // REMARK: look for facets of the current state
+        final List<Facet> currentFacets = facets.get(getCurrentStateId());
+        if( currentFacets != null ) {
+            for (Facet f: currentFacets) {
+                if (f.getIndex() == index && f.getName().equals(name)) 
+                    return f;
+            }
+        }
+        
+        // REMARK: this is old code, we should never get here actually.
+        // This posed leads to a problem when the user changes the calculation-mode after one calculation was executed.
+        // If both (new and old) calculations contained the same output-facet, it could happen that an old facet was executed
+        // with the calculation results of the new calculation.
         for (List<Facet> fs: facets.values()) {
             for (Facet f: fs) {
                 if (f.getIndex() == index && f.getName().equals(name)) {

http://dive4elements.wald.intevation.org