瀏覽代碼

Fix adding AL activity without input/output

Yentl Van Tendeloo 7 年之前
父節點
當前提交
4ba9b9dc6f
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 5 0
      wrappers/modelverse.py
  2. 1 1
      wrappers/modelverse_SCCD.py

+ 5 - 0
wrappers/modelverse.py

@@ -145,6 +145,11 @@ def transformation_add_MT(source_metamodels, target_metamodels, operation_name,
 def transformation_add_AL(source_metamodels, target_metamodels, operation_name, code, callback=None):
     INPUT("transformation_add_AL", None, [source_metamodels, target_metamodels, operation_name, code])
     context = OUTPUT()
+
+    if context is None:
+        # In case the source and target metamodels are empty, the context will be None, indicating that we are finished already (no callbacks allowed)
+        return
+
     if callback is not None:
         callback(context)
     INPUT("exit", context, [])

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-Date:   Tue Oct 31 08:43:26 2017
+Date:   Tue Oct 31 08:57:11 2017
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server