浏览代码

Add check if we modify defined attributes in a SCD model or not

Yentl Van Tendeloo 7 年之前
父节点
当前提交
dedc520685
共有 5 个文件被更改,包括 235 次插入81 次删除
  1. 87 63
      bootstrap/mini_modify.alc
  2. 110 1
      unit/test_all.py
  3. 7 0
      wrappers/classes/modelverse.xml
  4. 3 0
      wrappers/modelverse.py
  5. 28 17
      wrappers/modelverse_SCCD.py

+ 87 - 63
bootstrap/mini_modify.alc

@@ -96,13 +96,17 @@ String function cmd_define_attribute(write : Boolean, model : Element, element_n
 	if (write):
 		if (dict_in(model["model"], element_name)):
 			if (dict_in(model["model"], type)):
-				Element attrs
-				attrs = getInstantiatableAttributes(model, element_name, "AttributeLink")
-				if (bool_not(set_in(dict_keys(attrs), attr_name))):
-					model_define_attribute(model, element_name, attr_name, False, type)
-					return "Success"!
+				//TODO automatically find name AttributeLink, as this might change with merging...
+				if (dict_in(model["metamodel"]["model"], "AttributeLink")):
+					Element attrs
+					attrs = getInstantiatableAttributes(model, element_name, "AttributeLink")
+					if (bool_not(set_in(dict_keys(attrs), attr_name))):
+						model_define_attribute(model, element_name, attr_name, False, type)
+						return "Success"!
+					else:
+						return "Attribute exists: " + attr_name!
 				else:
-					return "Attribute exists: " + attr_name!
+					return "Not a SimpleClassDiagrams model!"!
 			else:
 				return "Element not found: " + type!
 		else:
@@ -165,26 +169,30 @@ String function cmd_attr_name(write : Boolean, model : Element, element_name : S
 	if (write):
 		if (dict_in(model["model"], element_name)):
 			Element attrs
-			attrs = getInstantiatableAttributes(model, element_name, "AttributeLink")
-			if (set_in(dict_keys(attrs), attr_name)):
+			// TODO automatically find AttributeLink name
+			if (dict_in(model["metamodel"]["model"], "AttributeLink")):
+				attrs = getInstantiatableAttributes(model, element_name, "AttributeLink")
 				if (set_in(dict_keys(attrs), attr_name)):
-					if (bool_not(set_in(dict_keys(attrs), new_attr_name))):
-						if (dict_in(model["model"][element_name], attr_name)):
-							Boolean optional
-							String attr_edge
-							attr_edge = reverseKeyLookup(model["model"], dict_read_edge(model["model"][element_name], attr_name))
-							optional = read_attribute(model, attr_edge, "optional")
-							model_undefine_attribute(model, element_name, attr_name)
-							model_define_attribute_ID(model, element_name, new_attr_name, optional, attrs[attr_name], attr_edge)
-							return "Success"!
+					if (set_in(dict_keys(attrs), attr_name)):
+						if (bool_not(set_in(dict_keys(attrs), new_attr_name))):
+							if (dict_in(model["model"][element_name], attr_name)):
+								Boolean optional
+								String attr_edge
+								attr_edge = reverseKeyLookup(model["model"], dict_read_edge(model["model"][element_name], attr_name))
+								optional = read_attribute(model, attr_edge, "optional")
+								model_undefine_attribute(model, element_name, attr_name)
+								model_define_attribute_ID(model, element_name, new_attr_name, optional, attrs[attr_name], attr_edge)
+								return "Success"!
+							else:
+								return "Attribute not defined here: " + new_attr_name!
 						else:
-							return "Attribute not defined here: " + new_attr_name!
+							return "Attribute exists: " + new_attr_name!
 					else:
-						return "Attribute exists: " + new_attr_name!
+						return "Attribute not found: " + attr_name!
 				else:
 					return "Attribute not found: " + attr_name!
 			else:
-				return "Attribute not found: " + attr_name!
+				return "Not a SimpleClassDiagrams model!"!
 		else:
 			return "Element not found: " + element_name!
 	else:
@@ -194,23 +202,27 @@ String function cmd_attr_type(write : Boolean, model : Element, element_name : S
 	if (write):
 		if (dict_in(model["model"], element_name)):
 			Element attrs
-			attrs = getInstantiatableAttributes(model, element_name, "AttributeLink")
-			if (set_in(dict_keys(attrs), attr_name)):
+			// TODO automatically find AttributeLink name
+			if (dict_in(model["metamodel"]["model"], "AttributeLink")):
+				attrs = getInstantiatableAttributes(model, element_name, "AttributeLink")
 				if (set_in(dict_keys(attrs), attr_name)):
-					if (dict_in(model["model"][element_name], attr_name)):
-						Boolean optional
-						String attr_edge
-						attr_edge = reverseKeyLookup(model["model"], dict_read_edge(model["model"][element_name], attr_name))
-						optional = read_attribute(model, attr_edge, "optional")
-						model_undefine_attribute(model, element_name, attr_name)
-						model_define_attribute_ID(model, element_name, attr_name, optional, new_attr_type, attr_edge)
-						return "Success"!
+					if (set_in(dict_keys(attrs), attr_name)):
+						if (dict_in(model["model"][element_name], attr_name)):
+							Boolean optional
+							String attr_edge
+							attr_edge = reverseKeyLookup(model["model"], dict_read_edge(model["model"][element_name], attr_name))
+							optional = read_attribute(model, attr_edge, "optional")
+							model_undefine_attribute(model, element_name, attr_name)
+							model_define_attribute_ID(model, element_name, attr_name, optional, new_attr_type, attr_edge)
+							return "Success"!
+						else:
+							return "Attribute not defined here: " + attr_name!
 					else:
-						return "Attribute not defined here: " + attr_name!
+						return "Attribute not defined: " + attr_name!
 				else:
-					return "Attribute not defined: " + attr_name!
+					return "Attribute not found: " + attr_name!
 			else:
-				return "Attribute not found: " + attr_name!
+				return "Not a SimpleClassDiagrams model!"!
 		else:
 			return "Element not found: " + element_name!
 	else:
@@ -220,21 +232,25 @@ String function cmd_attr_optional(write : Boolean, model : Element, element_name
 	if (write):
 		if (dict_in(model["model"], element_name)):
 			Element attrs
-			attrs = getInstantiatableAttributes(model, element_name, "AttributeLink")
-			if (set_in(dict_keys(attrs), attr_name)):
+			// TODO automatically find AttributeLink name
+			if (dict_in(model["metamodel"]["model"], "AttributeLink")):
+				attrs = getInstantiatableAttributes(model, element_name, "AttributeLink")
 				if (set_in(dict_keys(attrs), attr_name)):
-					if (dict_in(model["model"][element_name], attr_name)):
-						String attr_edge
-						attr_edge = reverseKeyLookup(model["model"], dict_read_edge(model["model"][element_name], attr_name))
-						model_undefine_attribute(model, element_name, attr_name)
-						model_define_attribute_ID(model, element_name, attr_name, optional, attrs[attr_name], attr_edge)
-						return "Success"!
+					if (set_in(dict_keys(attrs), attr_name)):
+						if (dict_in(model["model"][element_name], attr_name)):
+							String attr_edge
+							attr_edge = reverseKeyLookup(model["model"], dict_read_edge(model["model"][element_name], attr_name))
+							model_undefine_attribute(model, element_name, attr_name)
+							model_define_attribute_ID(model, element_name, attr_name, optional, attrs[attr_name], attr_edge)
+							return "Success"!
+						else:
+							return "Attribute not defined here: " + attr_name!
 					else:
-						return "Attribute not defined here: " + attr_name!
+						return "Attribute not defined: " + attr_name!
 				else:
-					return "Attribute not defined: " + attr_name!
+					return "Attribute not found: " + attr_name!
 			else:
-				return "Attribute not found: " + attr_name!
+				return "Not a SimpleClassDiagrams model!"!
 		else:
 			return "Element not found: " + element_name!
 	else:
@@ -243,19 +259,23 @@ String function cmd_attr_optional(write : Boolean, model : Element, element_name
 String function cmd_undefine_attribute(write : Boolean, model : Element, element_name : String, attr_name : String):
 	if (write):
 		if (dict_in(model["model"], element_name)):
-			Element attrs
-			attrs = getInstantiatableAttributes(model, element_name, "AttributeLink")
-			if (set_in(dict_keys(attrs), attr_name)):
+			//TODO automatically find name AttributeLink, as this might change with merging...
+			if (dict_in(model["metamodel"]["model"], "AttributeLink")):
+				Element attrs
+				attrs = getInstantiatableAttributes(model, element_name, "AttributeLink")
 				if (set_in(dict_keys(attrs), attr_name)):
-					if (dict_in(model["model"][element_name], attr_name)):
-						model_undefine_attribute(model, element_name, attr_name)
-						return "Success"!
+					if (set_in(dict_keys(attrs), attr_name)):
+						if (dict_in(model["model"][element_name], attr_name)):
+							model_undefine_attribute(model, element_name, attr_name)
+							return "Success"!
+						else:
+							return "Attribute not defined here: " + attr_name!
 					else:
-						return "Attribute not defined here: " + attr_name!
+						return "Attribute not defined: " + attr_name!
 				else:
-					return "Attribute not defined: " + attr_name!
+					return "Attribute not found: " + attr_name!
 			else:
-				return "Attribute not found: " + attr_name!
+				return "Not a SimpleClassDiagrams model!"!
 		else:
 			return "Element not found: " + element_name!
 	else:
@@ -387,16 +407,20 @@ String function cmd_read_defined_attrs(model : Element, element_name : String):
 
 	result = "Success: "
 	if (dict_in(model["model"], element_name)):
-		attr_list = getInstantiatableAttributes(model, element_name, "AttributeLink")
-		optionality = getAttributeOptionality(model, element_name, "AttributeLink")
-		attr_keys = dict_keys(attr_list)
-		while (0 < set_len(attr_keys)):
-			attr_key = set_pop(attr_keys)
-			if (optionality[attr_key]):
-				result = string_join(result, attr_key) + " ?: " + cast_string(attr_list[attr_key]) + "\n"
-			else:
-				result = string_join(result, attr_key) + " : " + cast_string(attr_list[attr_key]) + "\n"
-		return result!
+		//TODO automatically find name AttributeLink, as this might change with merging...
+		if (dict_in(model["metamodel"]["model"], "AttributeLink")):
+			attr_list = getInstantiatableAttributes(model, element_name, "AttributeLink")
+			optionality = getAttributeOptionality(model, element_name, "AttributeLink")
+			attr_keys = dict_keys(attr_list)
+			while (0 < set_len(attr_keys)):
+				attr_key = set_pop(attr_keys)
+				if (optionality[attr_key]):
+					result = string_join(result, attr_key) + " ?: " + cast_string(attr_list[attr_key]) + "\n"
+				else:
+					result = string_join(result, attr_key) + " : " + cast_string(attr_list[attr_key]) + "\n"
+			return result!
+		else:
+			return "Not a SimpleClassDiagrams model!"!
 	else:
 		return "Element not found: " + element_name!
 

+ 110 - 1
unit/test_all.py

@@ -1952,6 +1952,14 @@ class TestModelverse(unittest.TestCase):
         except WritePermissionDenied:
             assert element_list("users/user/test/a") == before
 
+        # None defined in non-SCD model
+        model_add("users/user/test/b", "users/user/test/a", "A a {}")
+        try:
+            define_attribute("users/user/test/b", "a", "abc", "a")
+            self.fail()
+        except NoSimpleClassDiagramsModel:
+            pass
+
     def test_op_read_defined_attrs(self):
         model_add("users/user/test/a", "formalisms/SimpleClassDiagrams", """
             SimpleAttribute String {}
@@ -2012,6 +2020,14 @@ class TestModelverse(unittest.TestCase):
         # No write permissions, but can still query
         assert read_defined_attrs("formalisms/SimpleClassDiagrams", "Association") == ({"name": "String"}, {"abstract": "Boolean", "constraint": "ActionCode", "lower_cardinality": "Natural", "upper_cardinality": "Natural", "source_lower_cardinality": "Natural", "source_upper_cardinality": "Natural", "target_lower_cardinality": "Natural", "target_upper_cardinality": "Natural"})
 
+        # None defined in non-SCD model
+        model_add("users/user/test/b", "users/user/test/a", "A a {}")
+        try:
+            read_defined_attrs("users/user/test/b", "a")
+            self.fail()
+        except NoSimpleClassDiagramsModel:
+            pass
+
     def test_op_undefine_attribute(self):
         model_add("users/user/test/a", "formalisms/SimpleClassDiagrams", """
             SimpleAttribute String {}
@@ -2096,6 +2112,100 @@ class TestModelverse(unittest.TestCase):
         except WritePermissionDenied:
             assert read_defined_attrs("formalisms/SimpleClassDiagrams", "Class") == before
 
+    def test_op_attribute_optional(self):
+        model_add("users/user/test/a", "formalisms/SimpleClassDiagrams", """
+            SimpleAttribute String {}
+            SimpleAttribute Natural {}
+            Class A {
+                name = "ABC"
+                value : Natural
+                new_name ?: String
+                name : String
+            }
+            Association B (A, A) {
+                name = "DEF"
+                edge_value : Natural
+                name : String
+                other_value ?: String
+            }
+            Class C {}
+            Class D : A {
+                additional_attr : Natural
+            }
+            Association E : B (D, A) {
+                next_attr : String
+            }
+            """)
+
+        # Check initial situation
+        assert read_defined_attrs("users/user/test/a", "A") == ({"value": "Natural", "name": "String"}, {"new_name": "String"})
+        assert read_defined_attrs("users/user/test/a", "B") == ({"edge_value": "Natural", "name": "String"}, {"other_value": "String"})
+        assert read_defined_attrs("users/user/test/a", "C") == ({}, {})
+        assert read_defined_attrs("users/user/test/a", "D") == ({"value": "Natural", "name": "String", "additional_attr": "Natural"}, {"new_name": "String"})
+        assert read_defined_attrs("users/user/test/a", "E") == ({"edge_value": "Natural", "name": "String", "next_attr": "String"}, {"other_value": "String"})
+
+        # mandatory -> optional
+        attribute_optional("users/user/test/a", "A", "value", True)
+        assert read_defined_attrs("users/user/test/a", "A") == ({"name": "String"}, {"new_name": "String", "value": "Natural"})
+        # Check inheritance as well
+        assert read_defined_attrs("users/user/test/a", "D") == ({"name": "String", "additional_attr": "Natural"}, {"new_name": "String", "value": "Natural"})
+
+        # optional -> mandatory
+        attribute_optional("users/user/test/a", "A", "new_name", False)
+        assert read_defined_attrs("users/user/test/a", "A") == ({"name": "String", "new_name": "String"}, {"value": "Natural"})
+        # Check inheritance as well
+        assert read_defined_attrs("users/user/test/a", "D") == ({"name": "String", "additional_attr": "Natural", "new_name": "String"}, {"value": "Natural"})
+
+        # mandatory -> mandatory
+        attribute_optional("users/user/test/a", "A", "new_name", False)
+        assert read_defined_attrs("users/user/test/a", "A") == ({"name": "String", "new_name": "String"}, {"value": "Natural"})
+        # Check inheritance as well
+        assert read_defined_attrs("users/user/test/a", "D") == ({"name": "String", "additional_attr": "Natural", "new_name": "String"}, {"value": "Natural"})
+
+        # optional -> optional
+        attribute_optional("users/user/test/a", "A", "value", True) 
+        assert read_defined_attrs("users/user/test/a", "A") == ({"name": "String", "new_name": "String"}, {"value": "Natural"})
+        # Check inheritance as well
+        assert read_defined_attrs("users/user/test/a", "D") == ({"name": "String", "additional_attr": "Natural", "new_name": "String"}, {"value": "Natural"})
+
+        # Non-existing model
+        try:
+            attribute_optional("users/afa", "A", "value", False)
+            self.fail()
+        except UnknownModel:
+            pass
+
+        # Non-existing element
+        before = element_list("users/user/test/a")
+        try:
+            attribute_optional("users/user/test/a", "AA", "value", False)
+            self.fail()
+        except UnknownElement:
+            assert element_list("users/user/test/a") == before
+
+        # No read permissions
+        try:
+            attribute_optional("administration/core", "formalisms", "name", True)
+            self.fail()
+        except ReadPermissionDenied:
+            pass
+
+        # No write permissions, but can still query
+        before = element_list("formalisms/SimpleClassDiagrams")
+        try:
+            attribute_optional("formalisms/SimpleClassDiagrams", "Class", "name", True)
+            self.fail()
+        except WritePermissionDenied:
+            assert element_list("formalisms/SimpleClassDiagrams") == before
+
+        # None defined in non-SCD model
+        model_add("users/user/test/b", "users/user/test/a", "A a {}")
+        try:
+            attribute_optional("users/user/test/b", "a", "b", False)
+            self.fail()
+        except NoSimpleClassDiagramsModel:
+            pass
+
     """
     def test_op_model_render(self):
     def test_op_transformation_between(self):
@@ -2118,7 +2228,6 @@ class TestModelverse(unittest.TestCase):
     def test_op_group_list(self):
     def test_op_conformance_delete(self):
     def test_op_conformance_add(self):
-    def test_op_attribute_optional(self):
     def test_op_attribute_type(self):
     def test_op_attribute_name(self):
     """

+ 7 - 0
wrappers/classes/modelverse.xml

@@ -1419,6 +1419,13 @@
                         </raise>
                     </transition>
 
+                    <transition cond="self.expect_response_partial('Not a SimpleClassDiagrams model!', pop=True)" target="../wait_for_action/history">
+                        <raise event="exception">
+                            <parameter expr="'NoSimpleClassDiagramsModel'"/>
+                            <parameter expr="'Model is not a Simple Class Diagrams model and has no notion of defined attributes'"/>
+                        </raise>
+                    </transition>
+
                     <transition cond="self.expect_response_partial('Execute permission denied to: ', pop=False)" target="../wait_for_action/history">
                         <raise event="exception">
                             <parameter expr="'ExecutePermissionDenied'"/>

+ 3 - 0
wrappers/modelverse.py

@@ -33,6 +33,9 @@ class UnknownIdentifier(ModelverseException):
 class CompilationError(ModelverseException):
     pass
 
+class NoSimpleClassDiagramsModel(ModelverseException):
+    pass
+
 class UnknownAttribute(UnknownIdentifier):
     pass
 

+ 28 - 17
wrappers/modelverse_SCCD.py

@@ -1784,6 +1784,11 @@ class Modelverse(RuntimeClassBase):
         _initialized_behaviour_operations_21.setTrigger(None)
         _initialized_behaviour_operations_21.setGuard(self._initialized_behaviour_operations_21_guard)
         self.states["/initialized/behaviour/operations"].addTransition(_initialized_behaviour_operations_21)
+        _initialized_behaviour_operations_22 = Transition(self, self.states["/initialized/behaviour/operations"], [self.states["/initialized/behaviour/wait_for_action/history"]])
+        _initialized_behaviour_operations_22.setAction(self._initialized_behaviour_operations_22_exec)
+        _initialized_behaviour_operations_22.setTrigger(None)
+        _initialized_behaviour_operations_22.setGuard(self._initialized_behaviour_operations_22_guard)
+        self.states["/initialized/behaviour/operations"].addTransition(_initialized_behaviour_operations_22)
         
         # transition /initialized/behaviour/wait_for_action
         _initialized_behaviour_wait_for_action_0 = Transition(self, self.states["/initialized/behaviour/wait_for_action"], [self.states["/initialized/behaviour/wait_for_action/history"]])
@@ -2234,59 +2239,65 @@ class Modelverse(RuntimeClassBase):
         return self.expect_response('Write permission denied', pop=True)
     
     def _initialized_behaviour_operations_13_exec(self, parameters):
-        self.raiseInternalEvent(Event("exception", None, ['ExecutePermissionDenied', self.split_response(self.responses.pop(0))[0]]))
+        self.raiseInternalEvent(Event("exception", None, ['NoSimpleClassDiagramsModel', 'Model is not a Simple Class Diagrams model and has no notion of defined attributes']))
     
     def _initialized_behaviour_operations_13_guard(self, parameters):
-        return self.expect_response_partial('Execute permission denied to: ', pop=False)
+        return self.expect_response_partial('Not a SimpleClassDiagrams model!', pop=True)
     
     def _initialized_behaviour_operations_14_exec(self, parameters):
-        self.raiseInternalEvent(Event("exception", None, ['GroupPermissionDenied', self.split_response(self.responses.pop(0))[0]]))
+        self.raiseInternalEvent(Event("exception", None, ['ExecutePermissionDenied', self.split_response(self.responses.pop(0))[0]]))
     
     def _initialized_behaviour_operations_14_guard(self, parameters):
-        return self.expect_response_partial('Group permission denied to: ', pop=False)
+        return self.expect_response_partial('Execute permission denied to: ', pop=False)
     
     def _initialized_behaviour_operations_15_exec(self, parameters):
-        self.raiseInternalEvent(Event("exception", None, ['UserPermissionDenied', self.split_response(self.responses.pop(0))[0]]))
+        self.raiseInternalEvent(Event("exception", None, ['GroupPermissionDenied', self.split_response(self.responses.pop(0))[0]]))
     
     def _initialized_behaviour_operations_15_guard(self, parameters):
-        return self.expect_response_partial('User permission denied to: ', pop=False)
+        return self.expect_response_partial('Group permission denied to: ', pop=False)
     
     def _initialized_behaviour_operations_16_exec(self, parameters):
-        self.raiseInternalEvent(Event("exception", None, ['AdminPermissionDenied', 'Admin permissions are required for this operation!']))
+        self.raiseInternalEvent(Event("exception", None, ['UserPermissionDenied', self.split_response(self.responses.pop(0))[0]]))
     
     def _initialized_behaviour_operations_16_guard(self, parameters):
-        return self.expect_response_partial('Admin permission denied', pop=True)
+        return self.expect_response_partial('User permission denied to: ', pop=False)
     
     def _initialized_behaviour_operations_17_exec(self, parameters):
-        self.raiseInternalEvent(Event("exception", None, ['InterfaceMismatch', self.split_response(self.responses.pop(0))[0]]))
+        self.raiseInternalEvent(Event("exception", None, ['AdminPermissionDenied', 'Admin permissions are required for this operation!']))
     
     def _initialized_behaviour_operations_17_guard(self, parameters):
-        return self.expect_response_partial('Incorrect format: ', pop=False)
+        return self.expect_response_partial('Admin permission denied', pop=True)
     
     def _initialized_behaviour_operations_18_exec(self, parameters):
-        self.raiseInternalEvent(Event("exception", None, ['UnknownElement', self.split_response(self.responses.pop(0))[0]]))
+        self.raiseInternalEvent(Event("exception", None, ['InterfaceMismatch', self.split_response(self.responses.pop(0))[0]]))
     
     def _initialized_behaviour_operations_18_guard(self, parameters):
-        return self.expect_response_partial('Element not found: ', pop=False)
+        return self.expect_response_partial('Incorrect format: ', pop=False)
     
     def _initialized_behaviour_operations_19_exec(self, parameters):
-        self.raiseInternalEvent(Event("exception", None, ['UnknownModel', self.split_response(self.responses.pop(0))[0]]))
+        self.raiseInternalEvent(Event("exception", None, ['UnknownElement', self.split_response(self.responses.pop(0))[0]]))
     
     def _initialized_behaviour_operations_19_guard(self, parameters):
-        return self.expect_response_partial('Model not found: ', pop=False)
+        return self.expect_response_partial('Element not found: ', pop=False)
     
     def _initialized_behaviour_operations_20_exec(self, parameters):
-        self.raiseInternalEvent(Event("exception", None, ['UnknownMetamodellingHierarchy', 'Metamodelling hierarchy could not be resolved or automatically inferred: there is no typing relation between your specified model and metamodel (%s)' % self.responses.pop(0)]))
+        self.raiseInternalEvent(Event("exception", None, ['UnknownModel', self.split_response(self.responses.pop(0))[0]]))
     
     def _initialized_behaviour_operations_20_guard(self, parameters):
-        return self.expect_response_partial('Conformance hierarchy unknown for: ', pop=False)
+        return self.expect_response_partial('Model not found: ', pop=False)
     
     def _initialized_behaviour_operations_21_exec(self, parameters):
+        self.raiseInternalEvent(Event("exception", None, ['UnknownMetamodellingHierarchy', 'Metamodelling hierarchy could not be resolved or automatically inferred: there is no typing relation between your specified model and metamodel (%s)' % self.responses.pop(0)]))
+    
+    def _initialized_behaviour_operations_21_guard(self, parameters):
+        return self.expect_response_partial('Conformance hierarchy unknown for: ', pop=False)
+    
+    def _initialized_behaviour_operations_22_exec(self, parameters):
         print("Unknown Error: " + self.responses[0])
         pass
         self.raiseInternalEvent(Event("exception", None, ['UnknownError', 'Error: %s' % self.responses.pop(0)]))
     
-    def _initialized_behaviour_operations_21_guard(self, parameters):
+    def _initialized_behaviour_operations_22_guard(self, parameters):
         return self.expect_response_partial('', pop=False)
     
     def _initialized_behaviour_wait_for_action_0_exec(self, parameters):