Use RuntimeEnvironmentRequest2 where applicable 94/4194/2
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sun, 26 Apr 2020 20:21:09 +0000 (23:21 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sun, 26 Apr 2020 20:21:43 +0000 (23:21 +0300)
This allows e.g. procedural user component substructure expressions to
use SCL functionality included by the user component's local SCL modules
instead of only having to rely on functionality included by the SCLMain
at the containing index root.

gitlab #527

Change-Id: I7bcb22910737851771f2be54aafecd7480d1c81b

bundles/org.simantics.modeling/src/org/simantics/modeling/scl/CompileProceduralSCLMonitorRequest.java
bundles/org.simantics.modeling/src/org/simantics/modeling/scl/CompileSCLMonitorRequest.java
bundles/org.simantics.modeling/src/org/simantics/modeling/scl/CompileSCLQueryRequest.java
bundles/org.simantics.structural2/src/org/simantics/structural2/scl/AbstractCompileStructuralValueRequest.java
bundles/org.simantics.structural2/src/org/simantics/structural2/scl/procedural/ProceduralComponentTypeCompilationContextRequest.java

index 4c7964513f8f38b171c92b9607a1de6e4dd68bad..79eb3d6ba5da1f5ea8b751bf318aa1ae786b7929 100644 (file)
@@ -11,7 +11,7 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.request.VariableRead;
 import org.simantics.db.layer0.scl.AbstractExpressionCompilationContext;
 import org.simantics.db.layer0.scl.AbstractExpressionCompilationRequest;
-import org.simantics.db.layer0.util.RuntimeEnvironmentRequest;
+import org.simantics.db.layer0.util.RuntimeEnvironmentRequest2;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.ProceduralSubstructureMapRequest;
@@ -88,7 +88,7 @@ public class CompileProceduralSCLMonitorRequest extends AbstractExpressionCompil
             public CompilationContext perform(ReadGraph graph)
                     throws DatabaseException {
                 Resource indexRoot = graph.syncRequest(new IndexRoot(componentType));
-                RuntimeEnvironment runtimeEnvironment = graph.syncRequest(new RuntimeEnvironmentRequest(indexRoot));
+                RuntimeEnvironment runtimeEnvironment = graph.syncRequest(new RuntimeEnvironmentRequest2(componentType, indexRoot));
                 THashMap<String, Pair<String,Type>> propertyMap =
                         graph.sync(new ProceduralSubstructureMapRequest(componentVariable));
                 return new CompilationContext(runtimeEnvironment, propertyMap);
index dfea839318d2c33415dd454c30a60980e9e55c5f..b9ec1affcd9871fa5a134c9c2d736f6f5d9ad53f 100644 (file)
@@ -9,7 +9,7 @@ import org.simantics.db.common.request.ResourceRead;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.scl.AbstractExpressionCompilationContext;
 import org.simantics.db.layer0.scl.AbstractExpressionCompilationRequest;
-import org.simantics.db.layer0.util.RuntimeEnvironmentRequest;
+import org.simantics.db.layer0.util.RuntimeEnvironmentRequest2;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.layer0.Layer0;
 import org.simantics.modeling.ComponentTypeSubstructure;
@@ -114,7 +114,7 @@ public class CompileSCLMonitorRequest extends AbstractExpressionCompilationReque
             public CompilationContext perform(ReadGraph graph)
                     throws DatabaseException {
                 Resource indexRoot = graph.syncRequest(new IndexRoot(resource));
-                RuntimeEnvironment runtimeEnvironment = graph.syncRequest(new RuntimeEnvironmentRequest(indexRoot));
+                RuntimeEnvironment runtimeEnvironment = graph.syncRequest(new RuntimeEnvironmentRequest2(resource, indexRoot));
                 return new CompilationContext(runtimeEnvironment, ComponentTypeSubstructure.forType(graph, resource));
             }
         });
index 1cef75ddfec4662394c60850f930fc2ec77a0259..dab7aa0e78c57b798d2f14e74cd04371741a6588 100644 (file)
@@ -7,8 +7,8 @@ import org.simantics.db.Resource;
 import org.simantics.db.common.procedure.adapter.TransientCacheListener;
 import org.simantics.db.common.request.IndexRoot;
 import org.simantics.db.common.request.ResourceRead2;
+import org.simantics.db.common.request.RuntimeEnvironmentRequest;
 import org.simantics.db.exception.DatabaseException;
-import org.simantics.db.layer0.util.RuntimeEnvironmentRequest;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.layer0.Layer0;
 import org.simantics.scl.compiler.common.names.Name;
index fce1abaa2d8a62fa3fcadfd97c12c66b037e0655..5e8538a69a80aca2ca8560577d6df868175bf332 100644 (file)
@@ -9,10 +9,10 @@ import org.simantics.db.Resource;
 import org.simantics.db.common.procedure.adapter.TransientCacheListener;
 import org.simantics.db.common.request.PossibleIndexRoot;
 import org.simantics.db.common.request.ResourceRead2;
+import org.simantics.db.common.request.RuntimeEnvironmentRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.scl.AbstractExpressionCompilationContext;
 import org.simantics.db.layer0.scl.AbstractExpressionCompilationRequest;
-import org.simantics.db.layer0.util.RuntimeEnvironmentRequest;
 import org.simantics.db.layer0.util.RuntimeEnvironmentRequest2;
 import org.simantics.layer0.Layer0;
 import org.simantics.scl.compiler.elaboration.expressions.EApply;
index 50a905e8204d3b84e4f094b3de1dd030cf53761a..1e3647905b004f7855892249c500bc251fb8c749 100644 (file)
@@ -8,7 +8,7 @@ import org.simantics.db.common.procedure.adapter.TransientCacheListener;
 import org.simantics.db.common.request.IndexRoot;
 import org.simantics.db.common.request.UnaryRead;
 import org.simantics.db.exception.DatabaseException;
-import org.simantics.db.layer0.util.RuntimeEnvironmentRequest;
+import org.simantics.db.layer0.util.RuntimeEnvironmentRequest2;
 import org.simantics.scl.compiler.environment.specification.EnvironmentSpecification;
 import org.simantics.scl.compiler.runtime.RuntimeEnvironment;
 import org.simantics.structural2.scl.ComponentTypeProperty;
@@ -25,7 +25,7 @@ public class ProceduralComponentTypeCompilationContextRequest extends UnaryRead<
     public ProceduralComponentTypeCompilationContext perform(ReadGraph graph)
             throws DatabaseException {
         Resource indexRoot = graph.syncRequest(new IndexRoot(parameter));
-        RuntimeEnvironment runtimeEnvironment = graph.syncRequest(new RuntimeEnvironmentRequest(indexRoot) {
+        RuntimeEnvironment runtimeEnvironment = graph.syncRequest(new RuntimeEnvironmentRequest2(parameter, indexRoot) {
             @Override
             protected void fillEnvironmentSpecification(
                     EnvironmentSpecification environmentSpecification) {