|
@@ -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:35:42 2018
|
|
|
+Date: Wed May 23 11:39:36 2018
|
|
|
|
|
|
Model author: Yentl Van Tendeloo
|
|
|
Model name: MvK Server
|
|
@@ -45,7 +45,7 @@ class Modelverse(RuntimeClassBase):
|
|
|
def user_defined_constructor(self, taskname = None):
|
|
|
if taskname == None: taskname = None
|
|
|
self.controller.taskname = taskname
|
|
|
- self.actions = {None: []}
|
|
|
+ self.actions = []
|
|
|
self.responses = []
|
|
|
self.http_clients = []
|
|
|
self.registered_metamodel = {}
|
|
@@ -58,7 +58,7 @@ class Modelverse(RuntimeClassBase):
|
|
|
|
|
|
# user defined method
|
|
|
def load_action(self, context):
|
|
|
- action = self.actions[None].pop(0)
|
|
|
+ action = self.actions.pop(0)
|
|
|
self.parameters = action["parameters"]
|
|
|
self.current_ID = action["ID"]
|
|
|
self.action_name = action["name"]
|
|
@@ -108,9 +108,9 @@ class Modelverse(RuntimeClassBase):
|
|
|
# user defined method
|
|
|
def expect_action(self, context, expected):
|
|
|
if isinstance(expected, list):
|
|
|
- return self.actions[None] and self.actions[None][0]["name"] in expected
|
|
|
+ return self.actions and self.actions[0]["name"] in expected
|
|
|
else:
|
|
|
- return self.actions[None] and self.actions[None][0]["name"] == expected
|
|
|
+ return self.actions and self.actions[0]["name"] == expected
|
|
|
|
|
|
|
|
|
# user defined method
|
|
@@ -1806,15 +1806,10 @@ class Modelverse(RuntimeClassBase):
|
|
|
self.states["/initialized/behaviour/wait_for_action"].addTransition(_initialized_behaviour_wait_for_action_0)
|
|
|
|
|
|
# transition /initialized/behaviour/wait_for_action/modelling
|
|
|
- _initialized_behaviour_wait_for_action_modelling_0 = Transition(self, self.states["/initialized/behaviour/wait_for_action/modelling"], [self.states["/initialized/behaviour/wait_for_action/history"]])
|
|
|
- _initialized_behaviour_wait_for_action_modelling_0.setAction(self._initialized_behaviour_wait_for_action_modelling_0_exec)
|
|
|
+ _initialized_behaviour_wait_for_action_modelling_0 = Transition(self, self.states["/initialized/behaviour/wait_for_action/modelling"], [self.states["/initialized/behaviour/leaving_manual"]])
|
|
|
_initialized_behaviour_wait_for_action_modelling_0.setTrigger(None)
|
|
|
_initialized_behaviour_wait_for_action_modelling_0.setGuard(self._initialized_behaviour_wait_for_action_modelling_0_guard)
|
|
|
self.states["/initialized/behaviour/wait_for_action/modelling"].addTransition(_initialized_behaviour_wait_for_action_modelling_0)
|
|
|
- _initialized_behaviour_wait_for_action_modelling_1 = Transition(self, self.states["/initialized/behaviour/wait_for_action/modelling"], [self.states["/initialized/behaviour/leaving_manual"]])
|
|
|
- _initialized_behaviour_wait_for_action_modelling_1.setTrigger(None)
|
|
|
- _initialized_behaviour_wait_for_action_modelling_1.setGuard(self._initialized_behaviour_wait_for_action_modelling_1_guard)
|
|
|
- self.states["/initialized/behaviour/wait_for_action/modelling"].addTransition(_initialized_behaviour_wait_for_action_modelling_1)
|
|
|
|
|
|
# transition /initialized/behaviour/wait_for_action/modelling/recognized
|
|
|
_initialized_behaviour_wait_for_action_modelling_recognized_0 = Transition(self, self.states["/initialized/behaviour/wait_for_action/modelling/recognized"], [self.states["/initialized/behaviour/operations/element_list"]])
|
|
@@ -2153,7 +2148,7 @@ class Modelverse(RuntimeClassBase):
|
|
|
self.raiseInternalEvent(Event("request", None, [['service_stop']]))
|
|
|
|
|
|
def _initialized_behaviour_going_manual_init_enter(self):
|
|
|
- self.current_model = self.actions[None][0]["parameters"][0]
|
|
|
+ self.current_model = self.actions[0]["parameters"][0]
|
|
|
|
|
|
def _initialized_behaviour_going_manual_search_enter(self):
|
|
|
self.raiseInternalEvent(Event("request", None, [['model_types', self.current_model]]))
|
|
@@ -2276,21 +2271,14 @@ class Modelverse(RuntimeClassBase):
|
|
|
return self.expect_response_partial('', pop=False)
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_0_exec(self, parameters):
|
|
|
- print("Got unknown operation: " + str(self.actions[None].pop(0)))
|
|
|
+ print("Got unknown operation: " + str(self.actions.pop(0)))
|
|
|
self.raiseInternalEvent(Event("exception", None, ['UnknownOperation', 'Operation is unknown']))
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_0_guard(self, parameters):
|
|
|
- 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[None].pop(0)))
|
|
|
- self.raiseInternalEvent(Event("exception", None, ['IllegalContextOperation', 'Operation not allowed in a context!']))
|
|
|
+ return self.actions
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_0_guard(self, parameters):
|
|
|
- return None is not None and self.actions[None]
|
|
|
-
|
|
|
- def _initialized_behaviour_wait_for_action_modelling_1_guard(self, parameters):
|
|
|
- return None is None and self.actions[None]
|
|
|
+ return self.actions
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_0_exec(self, parameters):
|
|
|
self.load_action(None)
|
|
@@ -3351,7 +3339,7 @@ class Modelverse(RuntimeClassBase):
|
|
|
return self.expect_action(None, 'drop')
|
|
|
|
|
|
def _initialized_behaviour_wait_for_action_modelling_recognized_manual_2_guard(self, parameters):
|
|
|
- return self.actions[None] and self.actions[None][0]['parameters'][0] != self.current_model
|
|
|
+ return self.actions and self.actions[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']))
|
|
@@ -3383,7 +3371,7 @@ class Modelverse(RuntimeClassBase):
|
|
|
def _initialized_behaviour_going_manual_OK_1_exec(self, parameters):
|
|
|
self.raiseInternalEvent(Event("exception", None, ['UnknownMetamodellingHierarchy', 'Conformance relation not found']))
|
|
|
self.responses.pop(0)
|
|
|
- self.actions[None].pop(0)
|
|
|
+ self.actions.pop(0)
|
|
|
|
|
|
def _initialized_behaviour_going_manual_OK_1_guard(self, parameters):
|
|
|
return self.expect_response_partial('No conformance relation can be found ', pop=False)
|
|
@@ -3399,7 +3387,7 @@ class Modelverse(RuntimeClassBase):
|
|
|
ID = parameters[1]
|
|
|
context_ID = parameters[2]
|
|
|
parameters = parameters[3]
|
|
|
- self.actions[None].append({"name": action_name, "ID": ID, "parameters": parameters})
|
|
|
+ self.actions.append({"name": action_name, "ID": ID, "parameters": parameters})
|
|
|
|
|
|
def _initialized_queue_queue_1_exec(self, parameters):
|
|
|
parameters = parameters[0]
|