]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Merge "Removed extra modules OntologyModule imported to namespace"
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 18 Oct 2018 10:34:23 +0000 (10:34 +0000)
committerGerrit Code Review <gerrit2@simantics>
Thu, 18 Oct 2018 10:34:23 +0000 (10:34 +0000)
bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/SCLLabelRule.java
bundles/org.simantics.viewpoint.ontology/graph/Viewpoint.pgraph

index e0bff0fe126331208d1331f58de18381e66bba3f..243ef4d3693c74545b9aec74f521d551555aaeda 100644 (file)
@@ -14,8 +14,11 @@ import org.simantics.db.layer0.variable.Variables;
 import org.simantics.modeling.ModelingResources;
 import org.simantics.scl.runtime.SCLContext;
 import org.simantics.scl.runtime.function.Function1;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class SCLLabelRule implements LabelRule {
+    private static final Logger LOGGER = LoggerFactory.getLogger(SCLLabelRule.class);
 
     private Resource rule;
     
@@ -35,7 +38,10 @@ public class SCLLabelRule implements LabelRule {
         Variable ruleVariable = Variables.getVariable(graph, rule);
 
         Function1<Object,List<String>> getLabels = ruleVariable.getPossiblePropertyValue(graph, MOD.SCLLabelRule_getLabels);
-        if(getLabels == null) return Collections.emptyMap();
+        if(getLabels == null) {
+            LOGGER.warn("Didn't find value for subject={}, predicate={}.", rule, ModelingResources.URIs.SCLLabelRule_getLabels);
+            return Collections.emptyMap();
+        }
 
         SCLContext sclContext = SCLContext.getCurrent();
         Object oldGraph = sclContext.get("graph");
@@ -48,6 +54,7 @@ public class SCLLabelRule implements LabelRule {
             }
             return result;
         } catch (Throwable t) {
+            LOGGER.error("Calculating label failed.", t);
                throw new DatabaseException(t);
         } finally {
             sclContext.put("graph", oldGraph);
index e7cfd1e93428b98e892a71de01a735e512744b83..e345d6798b83c20da9dc0beb2e8961f8d48815b0 100644 (file)
@@ -130,7 +130,7 @@ VP.VariableLabelModifierRule : VP.ModifierRule
 
 VP.ImageRule <T VP.VisualsRule
     L0.HasDescription """Label rule gives an image to a node."""
-VP.ConstantImageRule <T VP.LabelRule     
+VP.ConstantImageRule <T VP.ImageRule
     L0.HasDescription """Constant label rule gives a fixed image to a node."""
 VP.ConstantImageRule.HasImage <R L0.HasProperty : L0.TotalFunction            
     L0.HasDomain VP.ConstantLabelRule