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;
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");
}
return result;
} catch (Throwable t) {
+ LOGGER.error("Calculating label failed.", t);
throw new DatabaseException(t);
} finally {
sclContext.put("graph", oldGraph);