]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/userComponent/ComponentTypeCommands.java
Special handling to retain the range of derived properties on type edit
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / userComponent / ComponentTypeCommands.java
index 9cf93fac5ce83d9067b99d7ebbb7e0da6a272f63..de8591d5f5e037e96d97055ed01a66808bfd3b9f 100644 (file)
@@ -209,6 +209,7 @@ public class ComponentTypeCommands {
     public static void setRequiredType(WriteGraph g, Resource componentType, Resource property,
             String requiredType, Resource possibleType) throws DatabaseException {
         Layer0 L0 = Layer0.getInstance(g);
+        ModelingResources MOD = ModelingResources.getInstance(g);
         g.claimLiteral(property, L0.RequiresValueType, requiredType);
 
         if (componentType != null) {
@@ -229,6 +230,9 @@ public class ComponentTypeCommands {
             if(g.hasStatement(possibleType, L0.Enumeration)) {
                 // This value type is an enumeration - let's constrain the range of this predicate to match the enumeration type only
                 g.claim(property, L0.HasRange, possibleType);
+            } else if (g.isInheritedFrom(possibleType, MOD.MonitorValue)) {
+                // Support derived properties
+                g.claim(property, L0.HasRange, possibleType);
             }
         }