]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.db/scl/Simantics/Variables.scl
VariableOrResource SCL type
[simantics/platform.git] / bundles / org.simantics.scl.db / scl / Simantics / Variables.scl
index 436e0a17357f32072ec80c2cea18f8f97d3bb734..47bf1a944cb92cdf824cce774e4fc6b385791f17 100644 (file)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Semantum Oy - initial API and implementation
+ *******************************************************************************/
 include "Simantics/Model"
 include "Simantics/DB"
 import "Simantics/DB" as DB
@@ -437,4 +448,15 @@ importJava "org.simantics.db.layer0.variable.RVI" where
 instantiateUnder :: Resource -> Resource -> <WriteGraph> Resource
 instantiateUnder container typeToInstantiate = do
     fn = (resourceVariable typeToInstantiate)#methods#instantiateUnder :: Resource -> Resource -> <WriteGraph> Resource  
-    fn container typeToInstantiate
\ No newline at end of file
+    fn container typeToInstantiate
+
+@JavaType "org.simantics.db.layer0.variable.VariableOrResource"
+data VariableOrResource =
+    @JavaType "org.simantics.db.layer0.variable.ResourceX"
+    @FieldNames [value]
+    ResourceX Resource
+  | @JavaType "org.simantics.db.layer0.variable.VariableX"
+    @FieldNames [value]
+    VariableX Variable
+    
+    
\ No newline at end of file