Fail-safe import can now be disabled with a system property 72/1672/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 2 Apr 2018 20:54:03 +0000 (23:54 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 2 Apr 2018 20:11:20 +0000 (22:11 +0200)
Use the system property -Dorg.simantics.tg.import.failOnMissingEntities@
to disable fail-safe import by settings its value to true.

refs #7850

Change-Id: I2c29d1795ba0c04b16be1798c237651556326bd9
(cherry picked from commit f7c2f46c7c411c5c9dd3323d3cec3a4b8b6a3bbe)

bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java

index c9b48b32591fce602c7a5aacec56c23f3b7fe9c9..6d3f7e48e7d421a0e5fe7e444e453f585ce2dfd5 100644 (file)
@@ -244,9 +244,16 @@ public class StreamingTransferableGraphImportProcess implements TransferableGrap
                                        handles[identity.resource] = builder.handle(graph.syncRequest(new UnescapedChildMapOfResource(parent)).get(def.name));                          
                        }
                }               
-               
-               //if(!missingExternals.isEmpty()) throw new MissingDependencyException(this);
-               
+
+               if (!missingExternals.isEmpty() && failOnMissingEntities())
+                       throw new MissingDependencyException(this);
+       }
+
+       private boolean failOnMissingEntities() {
+               return "true".equalsIgnoreCase(
+                               System.getProperty(
+                                               "org.simantics.tg.import.failOnMissingEntities",
+                                               "false") );
        }
 
        @Override