|
@@ -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: Wed May 23 11:24:03 2018
|
|
|
+Date: Wed May 23 11:35:42 2018
|
|
|
|
|
|
Model author: Yentl Van Tendeloo
|
|
|
Model name: MvK Server
|
|
@@ -48,7 +48,6 @@ class Modelverse(RuntimeClassBase):
|
|
|
self.actions = {None: []}
|
|
|
self.responses = []
|
|
|
self.http_clients = []
|
|
|
- self.context = None
|
|
|
self.registered_metamodel = {}
|
|
|
self.inputs = {}
|
|
|
self.finish_output_thread = False
|
|
@@ -59,7 +58,7 @@ class Modelverse(RuntimeClassBase):
|
|
|
|
|
|
# user defined method
|
|
|
def load_action(self, context):
|
|
|
- action = self.actions[context].pop(0)
|
|
|
+ action = self.actions[None].pop(0)
|
|
|
self.parameters = action["parameters"]
|
|
|
self.current_ID = action["ID"]
|
|
|
self.action_name = action["name"]
|
|
@@ -109,19 +108,19 @@ class Modelverse(RuntimeClassBase):
|
|
|
# user defined method
|
|
|
def expect_action(self, context, expected):
|
|
|
if isinstance(expected, list):
|
|
|
- return self.actions[context] and self.actions[context][0]["name"] in expected
|
|
|
+ return self.actions[None] and self.actions[None][0]["name"] in expected
|
|
|
else:
|
|
|
- return self.actions[context] and self.actions[context][0]["name"] == expected
|
|
|
+ return self.actions[None] and self.actions[None][0]["name"] == expected
|
|
|
|
|
|
|
|
|
# user defined method
|
|
|
def expect_input(self, context, expected):
|
|
|
- if context not in self.inputs:
|
|
|
+ if None not in self.inputs:
|
|
|
return False
|
|
|
if isinstance(expected, list):
|
|
|
- return self.inputs[context] and self.inputs[context][0]["name"] in expected
|
|
|
+ return self.inputs[None] and self.inputs[None][0]["name"] in expected
|
|
|
else:
|
|
|
- return self.inputs[context] and self.inputs[context][0]["name"] == expected
|
|
|
+ return self.inputs[None] and self.inputs[None][0]["name"] == expected
|
|
|
|
|
|
|
|
|
# builds Statechart structure
|
|
@@ -2154,7 +2153,6 @@ class Modelverse(RuntimeClassBase):
|
|
|
self.raiseInternalEvent(Event("request", None, [['service_stop']]))
|
|
|
|
|
|
def _initialized_behaviour_going_manual_init_enter(self):
|
|
|
- self.context = None
|
|
|
self.current_model = self.actions[None][0]["parameters"][0]
|
|
|
|
|
|
def _initialized_behaviour_going_manual_search_enter(self):
|
|
@@ -2282,161 +2280,161 @@ class Modelverse(RuntimeClassBase):
|
|
|
self.raiseInternalEvent(Event("exception", None, ['UnknownOperation', 'Operation is unknown']))
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_0_guard(self, parameters):
|
|
|
- return self.context is None and self.actions[None]
|
|
|
+ return None is None and self.actions[None]
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_0_exec(self, parameters):
|
|
|
- print("Got unexpected operation: " + str(self.actions[self.context].pop(0)))
|
|
|
+ print("Got unexpected operation: " + str(self.actions[None].pop(0)))
|
|
|
self.raiseInternalEvent(Event("exception", None, ['IllegalContextOperation', 'Operation not allowed in a context!']))
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_0_guard(self, parameters):
|
|
|
- return self.context is not None and self.actions[self.context]
|
|
|
+ return None is not None and self.actions[None]
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_1_guard(self, parameters):
|
|
|
- return self.context is None and self.actions[None]
|
|
|
+ return None is None and self.actions[None]
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_0_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_0_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'element_list')
|
|
|
+ return self.expect_action(None, 'element_list')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_1_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_1_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'element_list_nice')
|
|
|
+ return self.expect_action(None, 'element_list_nice')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_2_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_2_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'types')
|
|
|
+ return self.expect_action(None, 'types')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_3_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_3_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'types_full')
|
|
|
+ return self.expect_action(None, 'types_full')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_4_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_4_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'read_info')
|
|
|
+ return self.expect_action(None, 'read_info')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_5_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_5_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'read_attrs')
|
|
|
+ return self.expect_action(None, 'read_attrs')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_6_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_6_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'read_defined_attrs')
|
|
|
+ return self.expect_action(None, 'read_defined_attrs')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_7_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_7_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'instantiate')
|
|
|
+ return self.expect_action(None, 'instantiate')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_8_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_8_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'delete_element')
|
|
|
+ return self.expect_action(None, 'delete_element')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_9_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_9_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'attr_assign')
|
|
|
+ return self.expect_action(None, 'attr_assign')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_10_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_10_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'attr_assign_code')
|
|
|
+ return self.expect_action(None, 'attr_assign_code')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_11_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_11_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'attr_delete')
|
|
|
+ return self.expect_action(None, 'attr_delete')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_12_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_12_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'attr_name')
|
|
|
+ return self.expect_action(None, 'attr_name')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_13_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_13_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'attr_type')
|
|
|
+ return self.expect_action(None, 'attr_type')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_14_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_14_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'attr_optional')
|
|
|
+ return self.expect_action(None, 'attr_optional')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_15_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_15_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'read_outgoing')
|
|
|
+ return self.expect_action(None, 'read_outgoing')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_16_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_16_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'read_incoming')
|
|
|
+ return self.expect_action(None, 'read_incoming')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_17_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_17_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'read_association_source')
|
|
|
+ return self.expect_action(None, 'read_association_source')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_18_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_18_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'read_association_destination')
|
|
|
+ return self.expect_action(None, 'read_association_destination')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_19_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_19_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'connections_between')
|
|
|
+ return self.expect_action(None, 'connections_between')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_20_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_20_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'define_attribute')
|
|
|
+ return self.expect_action(None, 'define_attribute')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_21_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_21_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'undefine_attribute')
|
|
|
+ return self.expect_action(None, 'undefine_attribute')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_22_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_22_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'all_instances')
|
|
|
+ return self.expect_action(None, 'all_instances')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_23_exec(self, parameters):
|
|
|
- self.load_action(self.context)
|
|
|
+ self.load_action(None)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_23_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'exit_save')
|
|
|
+ return self.expect_action(None, 'exit_save')
|
|
|
|
|
|
def _init_0_exec(self, parameters):
|
|
|
instance = parameters[0]
|
|
@@ -3347,25 +3345,25 @@ class Modelverse(RuntimeClassBase):
|
|
|
return self.expect_action(None, 'service_stop')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_manual_0_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'exit')
|
|
|
+ return self.expect_action(None, 'exit')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_manual_1_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'drop')
|
|
|
+ return self.expect_action(None, 'drop')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_manual_2_guard(self, parameters):
|
|
|
- return self.actions[self.context] and self.actions[self.context][0]['parameters'][0] != self.current_model
|
|
|
+ return self.actions[None] and self.actions[None][0]['parameters'][0] != self.current_model
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_scripted_0_exec(self, parameters):
|
|
|
self.raiseInternalEvent(Event("request", None, ['exit']))
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_scripted_0_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'exit')
|
|
|
+ return self.expect_action(None, 'exit')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_scripted_1_exec(self, parameters):
|
|
|
self.raiseInternalEvent(Event("request", None, ['drop']))
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_scripted_1_guard(self, parameters):
|
|
|
- return self.expect_action(self.context, 'drop')
|
|
|
+ return self.expect_action(None, 'drop')
|
|
|
|
|
|
def _initialized_behaviour_going_manual_init_0_guard(self, parameters):
|
|
|
return self.current_model in self.registered_metamodel
|
|
@@ -3401,7 +3399,7 @@ class Modelverse(RuntimeClassBase):
|
|
|
ID = parameters[1]
|
|
|
context_ID = parameters[2]
|
|
|
parameters = parameters[3]
|
|
|
- self.actions[context_ID].append({"name": action_name, "ID": ID, "parameters": parameters})
|
|
|
+ self.actions[None].append({"name": action_name, "ID": ID, "parameters": parameters})
|
|
|
|
|
|
def _initialized_queue_queue_1_exec(self, parameters):
|
|
|
parameters = parameters[0]
|