Просмотр исходного кода

Fix adding AL activity without input/output

Yentl Van Tendeloo 8 лет назад
Родитель
Сommit
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):
 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])
     INPUT("transformation_add_AL", None, [source_metamodels, target_metamodels, operation_name, code])
     context = OUTPUT()
     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:
     if callback is not None:
         callback(context)
         callback(context)
     INPUT("exit", 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)
 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 author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server