Browse Source

Add traceability links

Yentl Van Tendeloo 7 years ago
parent
commit
c7098d4a8e
2 changed files with 24 additions and 1 deletions
  1. 5 1
      examples/FTG_generate.py
  2. 19 0
      models/FTGPM/transformations/PM_to_FTG.mvc

+ 5 - 1
examples/FTG_generate.py

@@ -20,6 +20,10 @@ model_add("formalisms/Architecture", "formalisms/SimpleClassDiagrams", open("mod
 model_add("models/pm_powerwindow", "formalisms/ProcessModel", open("models/PowerWindow/PM_analyze.mvc", 'r').read())
 model_add("formalisms/FormalismTransformationGraph", "formalisms/SimpleClassDiagrams", open("models/FTGPM/metamodels/FTG_MM.mvc", 'r').read())
 
-transformation_add_MT({"PM": "formalisms/ProcessModel"}, {"FTG": "formalisms/FormalismTransformationGraph"}, "models/generate_FTG", open("models/FTGPM/transformations/PM_to_FTG.mvc", 'r').read())
+def add_traceability(model):
+    instantiate(model, "Association", edge=("PM/Exec", "FTG/Activity"), ID="activity_link")
+    instantiate(model, "Association", edge=("PM/Data", "FTG/Formalism"), ID="formalism_link")
+
+transformation_add_MT({"PM": "formalisms/ProcessModel"}, {"FTG": "formalisms/FormalismTransformationGraph"}, "models/generate_FTG", open("models/FTGPM/transformations/PM_to_FTG.mvc", 'r').read(), add_traceability)
 
 transformation_execute_MT("models/generate_FTG", {"PM": "models/pm_powerwindow"}, {"FTG": "models/ftg_powerwindow"})

+ 19 - 0
models/FTGPM/transformations/PM_to_FTG.mvc

@@ -2,3 +2,22 @@
 // TODO for each formalism, we make the type
 // TODO for each link, we make the consume/produce link
 // TODO ignore the control links and control elements
+
+include "primitives.alh"
+include "modelling.alh"
+include "object_operations.alh"
+
+Composite schedule {
+    {Contains} Failure failure {}
+    {Contains} Success success {}
+}
+
+// Initial (schedule, translate_activity) {}
+
+// OnSuccess (translate_activity, translate_formalism) {}
+// OnFailure (translate_activity, translate_formalism) {}
+
+translate_activity
+translate_formalism
+translate_consume
+translate_produce