Best Python code snippet using slash
undo.py
Source:undo.py
...50 log = self.update(inverse[1])51 else:52 raise Exception("Unknown log: " + str(inverse))53 cl.add_log(log)54 if not log.is_success():55 self.fail(log)56 if cl.logs.len() == IntegerValue(1):57 return cl.logs[IntegerValue(0)]58 else:59 return cl60 def test_undo_package_create(self):61 cl = self.create(MappingValue({CreateConstants.LOCATION_KEY: LocationValue(""),62 CreateConstants.TYPE_KEY: StringValue("mvk.object.Package"),63 CreateConstants.ATTRS_KEY: MappingValue({StringValue("name"): StringValue("a")})}))64 self.assertTrue(self.mvk.read(LocationValue("a")).is_success())65 inverse = cl.get_inverse()66 self.assertTrue(self.mvk.read(LocationValue("a")).is_success())67 cl = self.processInverse(inverse)68 self.assertFalse(self.mvk.read(LocationValue("a")).is_success())69 def test_undo_package_create_composite(self):70 cl = self.create(MappingValue({CreateConstants.LOCATION_KEY: LocationValue("a.b.c.d.e.f"),71 CreateConstants.TYPE_KEY: StringValue("mvk.object.Package"),72 CreateConstants.ATTRS_KEY: MappingValue({StringValue("name"): StringValue("g")})}))73 self.assertTrue(self.mvk.read(LocationValue("a")).is_success())74 self.assertTrue(self.mvk.read(LocationValue("a.b")).is_success())75 self.assertTrue(self.mvk.read(LocationValue("a.b.c")).is_success())76 self.assertTrue(self.mvk.read(LocationValue("a.b.c.d")).is_success())77 self.assertTrue(self.mvk.read(LocationValue("a.b.c.d.e")).is_success())78 self.assertTrue(self.mvk.read(LocationValue("a.b.c.d.e.f")).is_success())79 self.assertTrue(self.mvk.read(LocationValue("a.b.c.d.e.f.g")).is_success())80 inverse = cl.get_inverse()81 self.assertTrue(self.mvk.read(LocationValue("a")).is_success())82 self.assertTrue(self.mvk.read(LocationValue("a.b")).is_success())83 self.assertTrue(self.mvk.read(LocationValue("a.b.c")).is_success())84 self.assertTrue(self.mvk.read(LocationValue("a.b.c.d")).is_success())85 self.assertTrue(self.mvk.read(LocationValue("a.b.c.d.e")).is_success())86 self.assertTrue(self.mvk.read(LocationValue("a.b.c.d.e.f")).is_success())87 self.assertTrue(self.mvk.read(LocationValue("a.b.c.d.e.f.g")).is_success())88 cl = self.processInverse(inverse)89 self.assertFalse(self.mvk.read(LocationValue("a")).is_success())90 self.assertFalse(self.mvk.read(LocationValue("a.b")).is_success())91 self.assertFalse(self.mvk.read(LocationValue("a.b.c")).is_success())92 self.assertFalse(self.mvk.read(LocationValue("a.b.c.d")).is_success())93 self.assertFalse(self.mvk.read(LocationValue("a.b.c.d.e")).is_success())94 self.assertFalse(self.mvk.read(LocationValue("a.b.c.d.e.f")).is_success())95 self.assertFalse(self.mvk.read(LocationValue("a.b.c.d.e.f.g")).is_success())96 def test_undo_package_update(self):97 cl = self.create(MappingValue({CreateConstants.LOCATION_KEY: LocationValue(""),98 CreateConstants.TYPE_KEY: StringValue("mvk.object.Package"),99 CreateConstants.ATTRS_KEY: MappingValue({StringValue("name"): StringValue("a")})}))100 self.assertTrue(self.mvk.read(LocationValue("a")).is_success())101 self.assertFalse(self.mvk.read(LocationValue("b")).is_success())102 ul = self.update(MappingValue({CreateConstants.LOCATION_KEY: LocationValue("a"),103 CreateConstants.TYPE_KEY: StringValue("mvk.object.Package"),104 CreateConstants.ATTRS_KEY: MappingValue({StringValue("name"): StringValue("b")})}))105 # Make sure that the rename went well106 self.assertFalse(self.mvk.read(LocationValue("a")).is_success())107 self.assertTrue(self.mvk.read(LocationValue("b")).is_success())108 inverse = ul.get_inverse()109 self.assertFalse(self.mvk.read(LocationValue("a")).is_success())110 self.assertTrue(self.mvk.read(LocationValue("b")).is_success())111 cl = self.processInverse(inverse)112 # Rename should be undone now113 self.assertTrue(self.mvk.read(LocationValue("a")).is_success())114 self.assertFalse(self.mvk.read(LocationValue("b")).is_success())115 def test_undo_and_redo_package_update(self):116 cl = self.create(MappingValue({CreateConstants.LOCATION_KEY: LocationValue(""),117 CreateConstants.TYPE_KEY: StringValue("mvk.object.Package"),118 CreateConstants.ATTRS_KEY: MappingValue({StringValue("name"): StringValue("a")})}))119 self.assertTrue(self.mvk.read(LocationValue("a")).is_success())120 self.assertFalse(self.mvk.read(LocationValue("b")).is_success())121 ul = self.update(MappingValue({CreateConstants.LOCATION_KEY: LocationValue("a"),122 CreateConstants.TYPE_KEY: StringValue("mvk.object.Package"),123 CreateConstants.ATTRS_KEY: MappingValue({StringValue("name"): StringValue("b")})}))124 # Make sure that the rename went well125 self.assertFalse(self.mvk.read(LocationValue("a")).is_success())126 self.assertTrue(self.mvk.read(LocationValue("b")).is_success())127 for i in range(10):128 # This code should be able to loop: alternate between an undo and redo 10 times129 self.assertFalse(self.mvk.read(LocationValue("a")).is_success())130 self.assertTrue(self.mvk.read(LocationValue("b")).is_success())131 ul = self.processInverse(ul.get_inverse())132 # Rename should be undone now133 self.assertTrue(self.mvk.read(LocationValue("a")).is_success())134 self.assertFalse(self.mvk.read(LocationValue("b")).is_success())135 # But now undo our undo (technically a redo)136 ul = self.processInverse(ul.get_inverse())137 def test_undo_twice_package(self):138 cl = self.create(MappingValue({CreateConstants.LOCATION_KEY: LocationValue(""),139 CreateConstants.TYPE_KEY: StringValue("mvk.object.Package"),140 CreateConstants.ATTRS_KEY: MappingValue({StringValue("name"): StringValue("a")})}))141 ul = self.update(MappingValue({UpdateConstants.LOCATION_KEY: LocationValue("a"),142 UpdateConstants.TYPE_KEY: StringValue("mvk.object.Package"),143 UpdateConstants.ATTRS_KEY: MappingValue({StringValue("name"): StringValue("b")})}))144 self.assertFalse(self.mvk.read(LocationValue("a")).is_success())145 self.assertTrue(self.mvk.read(LocationValue("b")).is_success())146 self.processInverse(ul.get_inverse())147 self.assertTrue(self.mvk.read(LocationValue("a")).is_success())148 self.assertFalse(self.mvk.read(LocationValue("b")).is_success())149 self.processInverse(cl.get_inverse())150 self.assertFalse(self.mvk.read(LocationValue("a")).is_success())151 self.assertFalse(self.mvk.read(LocationValue("b")).is_success())152 def test_undo_create_model(self):153 cl = self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams'),154 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms'),155 CreateConstants.ATTRS_KEY: MappingValue({StringValue('SimpleClassDiagrams.name'): StringValue('Petrinets')})156 })157 )158 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())159 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())160 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.SimpleClassDiagrams.name")).is_success())161 self.processInverse(cl.get_inverse())162 self.assertFalse(self.mvk.read(LocationValue("test_formalisms")).is_success())163 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())164 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.SimpleClassDiagrams.name")).is_success())165 def test_undo_update_model(self):166 cl = self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams'),167 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms'),168 CreateConstants.ATTRS_KEY: MappingValue({StringValue('SimpleClassDiagrams.name'): StringValue('Petrinets')})169 })170 )171 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())172 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())173 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.SimpleClassDiagrams.name")).is_success())174 ul = self.update(MappingValue({UpdateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams'),175 UpdateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),176 UpdateConstants.ATTRS_KEY: MappingValue({StringValue('SimpleClassDiagrams.name'): StringValue('extended_Petrinets')})177 })178 )179 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())180 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.extended_Petrinets")).is_success())181 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.extended_Petrinets.SimpleClassDiagrams.name")).is_success())182 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.SimpleClassDiagrams.name")).is_success())183 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())184 # Now undo185 self.processInverse(ul.get_inverse())186 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())187 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())188 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.SimpleClassDiagrams.name")).is_success())189 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.extended_Petrinets.SimpleClassDiagrams.name")).is_success())190 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.extended_Petrinets")).is_success())191 def test_undo_delete_model(self):192 cl = self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams'),193 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms'),194 CreateConstants.ATTRS_KEY: MappingValue({StringValue('SimpleClassDiagrams.name'): StringValue('Petrinets')})195 })196 )197 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())198 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())199 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.SimpleClassDiagrams.name")).is_success())200 dl = self.delete(LocationValue("test_formalisms.Petrinets"))201 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())202 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())203 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.SimpleClassDiagrams.name")).is_success())204 # Undo the deletion205 self.processInverse(dl.get_inverse())206 # Now everything should be just like before207 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())208 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())209 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.SimpleClassDiagrams.name")).is_success())210 def test_undo_create_clabject(self):211 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams'),212 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms'),213 CreateConstants.ATTRS_KEY: MappingValue({StringValue('SimpleClassDiagrams.name'): StringValue('Petrinets')})214 })215 )216 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),217 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),218 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('name'),219 StringValue('Attribute.type'): StringType(),220 StringValue('Attribute.default'): StringValue('')})221 })222 )223 cl = self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Class'),224 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),225 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Class.name'): StringValue('Place'),226 StringValue('Class.is_abstract'): BooleanValue(False),227 StringValue('Class.id_field'): StringValue('Place.name')})228 })229 )230 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())231 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())232 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())233 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())234 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())235 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())236 self.processInverse(cl.get_inverse())237 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())238 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())239 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())240 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())241 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())242 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())243 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Class'),244 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),245 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Class.name'): StringValue('Place'),246 StringValue('Class.is_abstract'): BooleanValue(False),247 StringValue('Class.id_field'): StringValue('Place.name')})248 })249 )250 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),251 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.Place'),252 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('tokens'),253 StringValue('Attribute.type'): IntegerType(),254 StringValue('Attribute.default'): IntegerValue(0)})255 })256 )257 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),258 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.Place'),259 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('name'),260 StringValue('Attribute.type'): StringType(),261 StringValue('Attribute.default'): StringValue('')})262 })263 )264 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())265 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())266 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())267 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())268 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())269 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())270 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())271 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())272 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets'),273 CreateConstants.LOCATION_KEY: LocationValue('models'),274 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Petrinets.name'): StringValue('myPetrinet')})275 })276 )277 cl = self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets.Place'),278 CreateConstants.LOCATION_KEY: LocationValue('models.myPetrinet'),279 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Place.name'): StringValue('p1'),280 StringValue("tokens"): IntegerValue(5)})281 })282 )283 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())284 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())285 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())286 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())287 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())288 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())289 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())290 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())291 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())292 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())293 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.name")).is_success())294 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).is_success())295 self.processInverse(cl.get_inverse())296 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())297 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())298 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())299 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())300 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())301 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())302 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())303 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())304 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())305 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())306 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.name")).is_success())307 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).is_success())308 def test_undo_update_clabject(self):309 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams'),310 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms'),311 CreateConstants.ATTRS_KEY: MappingValue({StringValue('SimpleClassDiagrams.name'): StringValue('Petrinets')})312 })313 )314 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),315 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),316 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('name'),317 StringValue('Attribute.type'): StringType(),318 StringValue('Attribute.default'): StringValue('')})319 })320 )321 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Class'),322 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),323 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Class.name'): StringValue('Place'),324 StringValue('Class.is_abstract'): BooleanValue(False),325 StringValue('Class.id_field'): StringValue('Place.name')})326 })327 )328 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())329 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())330 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())331 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())332 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())333 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())334 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2")).is_success())335 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2.Class.name")).is_success())336 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2.Class.is_abstract")).is_success())337 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2.Class.id_field")).is_success())338 ul = self.update(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Class'),339 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.Place'),340 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Class.name'): StringValue('Place2'),341 StringValue('Class.is_abstract'): BooleanValue(False),342 StringValue('Class.id_field'): StringValue('Place2.name')})343 })344 )345 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())346 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())347 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())348 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())349 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())350 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())351 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2")).is_success())352 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2.Class.name")).is_success())353 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2.Class.is_abstract")).is_success())354 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2.Class.id_field")).is_success())355 self.processInverse(ul.get_inverse())356 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())357 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())358 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())359 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())360 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())361 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())362 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2")).is_success())363 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2.Class.name")).is_success())364 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2.Class.is_abstract")).is_success())365 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place2.Class.id_field")).is_success())366 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Class'),367 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),368 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Class.name'): StringValue('Place'),369 StringValue('Class.is_abstract'): BooleanValue(False),370 StringValue('Class.id_field'): StringValue('Place.name')})371 })372 )373 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),374 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.Place'),375 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('tokens'),376 StringValue('Attribute.type'): IntegerType(),377 StringValue('Attribute.default'): IntegerValue(0)})378 })379 )380 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),381 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.Place'),382 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('name'),383 StringValue('Attribute.type'): StringType(),384 StringValue('Attribute.default'): StringValue('')})385 })386 )387 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())388 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())389 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())390 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())391 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())392 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())393 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())394 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())395 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets'),396 CreateConstants.LOCATION_KEY: LocationValue('models'),397 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Petrinets.name'): StringValue('myPetrinet')})398 })399 )400 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets.Place'),401 CreateConstants.LOCATION_KEY: LocationValue('models.myPetrinet'),402 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Place.name'): StringValue('p1'),403 StringValue("Place.tokens"): IntegerValue(1)})404 })405 )406 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())407 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())408 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())409 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())410 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())411 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())412 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())413 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())414 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())415 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())416 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.name")).is_success())417 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).is_success())418 self.assertEquals(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).get_item().value, IntegerValue(1))419 ul1 = self.update(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets.Place'),420 CreateConstants.LOCATION_KEY: LocationValue('models.myPetrinet.p1'),421 CreateConstants.ATTRS_KEY: MappingValue({StringValue("Place.tokens"): IntegerValue(5)})422 })423 )424 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())425 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())426 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())427 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())428 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())429 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())430 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())431 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())432 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())433 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())434 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.name")).is_success())435 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).is_success())436 self.assertEquals(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).get_item().value, IntegerValue(5))437 ul2 = self.update(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets.Place'),438 CreateConstants.LOCATION_KEY: LocationValue('models.myPetrinet.p1'),439 CreateConstants.ATTRS_KEY: MappingValue({StringValue("Place.name"): StringValue("p2")})440 })441 )442 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())443 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())444 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())445 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())446 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())447 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())448 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())449 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())450 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())451 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())452 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.name")).is_success())453 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).is_success())454 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p2.Place.name")).is_success())455 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p2.Place.tokens")).is_success())456 self.assertEquals(self.mvk.read(LocationValue("models.myPetrinet.p2.Place.tokens")).get_item().value, IntegerValue(5))457 # Roll back the name change first458 self.processInverse(ul2.get_inverse())459 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())460 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())461 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())462 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())463 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())464 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())465 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())466 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())467 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())468 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())469 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.name")).is_success())470 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).is_success())471 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p2.Place.name")).is_success())472 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p2.Place.tokens")).is_success())473 self.assertEquals(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).get_item().value, IntegerValue(5))474 # And now the change to the number of tokens475 self.processInverse(ul1.get_inverse())476 477 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())478 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())479 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())480 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())481 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())482 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())483 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())484 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())485 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())486 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())487 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.name")).is_success())488 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).is_success())489 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p2.Place.name")).is_success())490 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p2.Place.tokens")).is_success())491 self.assertEquals(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).get_item().value, IntegerValue(1))492 def test_undo_delete_clabject(self):493 self.setupPetrinets()494 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets'),495 CreateConstants.LOCATION_KEY: LocationValue('models'),496 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Petrinets.name'): StringValue('myPetrinet')})497 })498 )499 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets.Place'),500 CreateConstants.LOCATION_KEY: LocationValue('models.myPetrinet'),501 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Place.name'): StringValue('p1'),502 StringValue("Place.tokens"): IntegerValue(1)})503 })504 )505 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())506 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())507 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())508 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())509 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())510 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())511 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())512 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())513 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())514 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())515 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1")).is_success())516 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.name")).is_success())517 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).is_success())518 self.assertEquals(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).get_item().value, IntegerValue(1))519 # Delete the instantiation520 dl = self.delete(LocationValue("models.myPetrinet.p1"))521 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())522 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())523 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())524 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())525 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())526 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())527 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())528 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())529 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())530 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())531 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1")).is_success())532 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.name")).is_success())533 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).is_success())534 self.processInverse(dl.get_inverse())535 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())536 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())537 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())538 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())539 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())540 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())541 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())542 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())543 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())544 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())545 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1")).is_success())546 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.name")).is_success())547 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).is_success())548 self.assertEquals(self.mvk.read(LocationValue("models.myPetrinet.p1.Place.tokens")).get_item().value, IntegerValue(1))549 def setupPetrinets(self):550 logs = []551 logs.append(self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams'),552 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms'),553 CreateConstants.ATTRS_KEY: MappingValue({StringValue('SimpleClassDiagrams.name'): StringValue('Petrinets')})554 })555 ))556 logs.append(self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Class'),557 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),558 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Class.name'): StringValue('Place'),559 StringValue('Class.is_abstract'): BooleanValue(False),560 StringValue('Class.id_field'): StringValue('Place.name')})561 })562 ))563 logs.append(self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),564 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.Place'),565 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('tokens'),566 StringValue('Attribute.type'): IntegerType(),567 StringValue('Attribute.default'): IntegerValue(0)})568 })569 ))570 logs.append(self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),571 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.Place'),572 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('name'),573 StringValue('Attribute.type'): StringType(),574 StringValue('Attribute.default'): StringValue('')})575 })576 ))577 logs.append(self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Class'),578 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),579 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Class.name'): StringValue('Transition'),580 StringValue('Class.is_abstract'): BooleanValue(False),581 StringValue('Class.id_field'): StringValue('Transition.name')})582 })583 ))584 logs.append(self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),585 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.Transition'),586 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('name'),587 StringValue('Attribute.type'): StringType(),588 StringValue('Attribute.default'): StringValue('')})589 })590 ))591 logs.append(self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Association"),592 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),593 CreateConstants.ATTRS_KEY: MappingValue({StringValue('from_class'): LocationValue('test_formalisms.Petrinets.Place'),594 StringValue('to_class'): LocationValue('test_formalisms.Petrinets.Transition'),595 StringValue('Class.name'): StringValue('P2T'),596 StringValue('Class.is_abstract'): BooleanValue(False),597 StringValue('Class.id_field'): StringValue('P2T.name'),598 StringValue('Association.from_min'): IntegerValue(0),599 StringValue('Association.from_max'): InfiniteValue('+'),600 StringValue('Association.from_port'): StringValue('from_place'),601 StringValue('Association.to_min'): IntegerValue(0),602 StringValue('Association.to_max'): InfiniteValue('+'),603 StringValue('Association.to_port'): StringValue('to_transition')})604 })605 ))606 logs.append(self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),607 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.P2T'),608 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('name'),609 StringValue('Attribute.type'): StringType(),610 StringValue('Attribute.default'): StringValue('')})611 })612 ))613 logs.append(self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Association"),614 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets'),615 CreateConstants.ATTRS_KEY: MappingValue({StringValue('from_class'): LocationValue('test_formalisms.Petrinets.Transition'),616 StringValue('to_class'): LocationValue('test_formalisms.Petrinets.Place'),617 StringValue('Class.name'): StringValue('T2P'),618 StringValue('Class.is_abstract'): BooleanValue(False),619 StringValue('Class.id_field'): StringValue('T2P.name'),620 StringValue('Association.from_min'): IntegerValue(0),621 StringValue('Association.from_max'): InfiniteValue('+'),622 StringValue('Association.from_port'): StringValue('from_transition'),623 StringValue('Association.to_min'): IntegerValue(0),624 StringValue('Association.to_max'): InfiniteValue('+'),625 StringValue('Association.to_port'): StringValue('to_place')})626 })627 ))628 logs.append(self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Attribute'),629 CreateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.T2P'),630 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Attribute.name'): StringValue('name'),631 StringValue('Attribute.type'): StringType(),632 StringValue('Attribute.default'): StringValue('')})633 })634 ))635 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())636 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())637 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())638 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())639 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())640 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())641 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())642 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())643 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())644 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())645 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())646 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())647 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())648 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())649 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())650 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())651 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())652 return logs653 def test_undo_create_association(self):654 self.setupPetrinets()655 self.assertFalse(self.mvk.read(LocationValue("models")).is_success())656 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet")).is_success())657 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1")).is_success())658 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.t1")).is_success())659 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1_to_t1")).is_success())660 # Now do some instantiations661 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets'),662 CreateConstants.LOCATION_KEY: LocationValue('models'),663 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Petrinets.name'): StringValue('myPetrinet')})664 })665 )666 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets.Place'),667 CreateConstants.LOCATION_KEY: LocationValue('models.myPetrinet'),668 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Place.name'): StringValue('p1'),669 StringValue("Place.tokens"): IntegerValue(1)})670 })671 )672 self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets.Transition'),673 CreateConstants.LOCATION_KEY: LocationValue('models.myPetrinet'),674 CreateConstants.ATTRS_KEY: MappingValue({StringValue('Transition.name'): StringValue('t1')})675 })676 )677 cl = self.create(MappingValue({CreateConstants.TYPE_KEY: LocationValue('test_formalisms.Petrinets.P2T'),678 CreateConstants.LOCATION_KEY: LocationValue('models.myPetrinet'),679 CreateConstants.ATTRS_KEY: MappingValue({StringValue('P2T.name'): StringValue('p1_to_t1'),680 StringValue('from_place'): LocationValue('models.myPetrinet.p1'),681 StringValue('to_transition'): LocationValue('models.myPetrinet.t1')682 })683 })684 )685 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())686 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())687 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())688 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())689 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())690 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())691 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())692 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())693 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())694 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())695 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())696 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())697 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())698 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())699 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())700 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())701 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1")).is_success())702 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.t1")).is_success())703 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1_to_t1")).is_success())704 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1_to_t1.P2T.name")).is_success())705 self.processInverse(cl.get_inverse())706 707 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())708 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())709 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())710 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())711 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())712 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())713 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())714 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())715 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())716 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())717 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())718 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())719 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())720 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())721 self.assertTrue(self.mvk.read(LocationValue("models")).is_success())722 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet")).is_success())723 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.p1")).is_success())724 self.assertTrue(self.mvk.read(LocationValue("models.myPetrinet.t1")).is_success())725 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1_to_t1")).is_success())726 self.assertFalse(self.mvk.read(LocationValue("models.myPetrinet.p1_to_t1.P2T.name")).is_success())727 def test_undo_update_association(self):728 self.setupPetrinets()729 r = self.read(LocationValue("test_formalisms.Petrinets.Transition2Place"))730 self.assertFalse(r.is_success())731 r = self.read(LocationValue("test_formalisms.Petrinets.P2T"))732 self.assertTrue(r.is_success())733 t_to_p_from = r.get_item().from_multiplicity734 self.assertEqual(t_to_p_from.node, LocationValue('test_formalisms.Petrinets.Place'))735 self.assertEqual(t_to_p_from.port_name, StringValue('from_place'))736 self.assertEqual(t_to_p_from.lower, IntegerValue(0))737 self.assertEqual(t_to_p_from.upper, InfiniteValue('+'))738 t_to_p_to = r.get_item().to_multiplicity739 self.assertEqual(t_to_p_to.node, LocationValue('test_formalisms.Petrinets.Transition'))740 self.assertEqual(t_to_p_to.port_name, StringValue('to_transition'))741 self.assertEqual(t_to_p_to.lower, IntegerValue(0))742 self.assertEqual(t_to_p_to.upper, InfiniteValue('+'))743 ul = self.update(MappingValue({UpdateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams.Association'),744 UpdateConstants.LOCATION_KEY: LocationValue('test_formalisms.Petrinets.P2T'),745 UpdateConstants.ATTRS_KEY: MappingValue({StringValue('from_class'): LocationValue('test_formalisms.Petrinets.Transition'),746 StringValue('to_class'): LocationValue('test_formalisms.Petrinets.Place'),747 StringValue('Class.name'): StringValue('TransitionToPlace'),748 StringValue('Association.from_port'): StringValue('from_transition'),749 StringValue('Association.from_min'): IntegerValue(3),750 StringValue('Association.from_max'): IntegerValue(10),751 StringValue('Association.to_port'): StringValue('to_place'),752 StringValue('Association.to_min'): IntegerValue(5),753 StringValue('Association.to_max'): IntegerValue(15)})754 })755 )756 r = self.read(LocationValue("test_formalisms.Petrinets.P2T"))757 self.assertFalse(r.is_success())758 r = self.read(LocationValue("test_formalisms.Petrinets.TransitionToPlace"))759 self.assertTrue(r.is_success())760 t_to_p_from = r.get_item().from_multiplicity761 self.assertEqual(t_to_p_from.node, LocationValue('test_formalisms.Petrinets.Transition'))762 self.assertEqual(t_to_p_from.port_name, StringValue('from_transition'))763 self.assertEqual(t_to_p_from.lower, IntegerValue(3))764 self.assertEqual(t_to_p_from.upper, IntegerValue(10))765 t_to_p_to = r.get_item().to_multiplicity766 self.assertEqual(t_to_p_to.node, LocationValue('test_formalisms.Petrinets.Place'))767 self.assertEqual(t_to_p_to.port_name, StringValue('to_place'))768 self.assertEqual(t_to_p_to.lower, IntegerValue(5))769 self.assertEqual(t_to_p_to.upper, IntegerValue(15))770 self.processInverse(ul.get_inverse())771 r = self.read(LocationValue("test_formalisms.Petrinets.Transition2Place"))772 self.assertFalse(r.is_success())773 r = self.read(LocationValue("test_formalisms.Petrinets.P2T"))774 self.assertTrue(r.is_success())775 t_to_p_from = r.get_item().from_multiplicity776 self.assertEqual(t_to_p_from.node, LocationValue('test_formalisms.Petrinets.Place'))777 self.assertEqual(t_to_p_from.port_name, StringValue('from_place'))778 self.assertEqual(t_to_p_from.lower, IntegerValue(0))779 self.assertEqual(t_to_p_from.upper, InfiniteValue('+'))780 t_to_p_to = r.get_item().to_multiplicity781 self.assertEqual(t_to_p_to.node, LocationValue('test_formalisms.Petrinets.Transition'))782 self.assertEqual(t_to_p_to.port_name, StringValue('to_transition'))783 self.assertEqual(t_to_p_to.lower, IntegerValue(0))784 self.assertEqual(t_to_p_to.upper, InfiniteValue('+'))785 def test_undo_delete_association(self):786 self.setupPetrinets()787 r = self.read(LocationValue("test_formalisms.Petrinets.P2T"))788 self.assertTrue(r.is_success())789 t_to_p_from = r.get_item().from_multiplicity790 self.assertEqual(t_to_p_from.node, LocationValue('test_formalisms.Petrinets.Place'))791 self.assertEqual(t_to_p_from.port_name, StringValue('from_place'))792 self.assertEqual(t_to_p_from.lower, IntegerValue(0))793 self.assertEqual(t_to_p_from.upper, InfiniteValue('+'))794 t_to_p_to = r.get_item().to_multiplicity795 self.assertEqual(t_to_p_to.node, LocationValue('test_formalisms.Petrinets.Transition'))796 self.assertEqual(t_to_p_to.port_name, StringValue('to_transition'))797 self.assertEqual(t_to_p_to.lower, IntegerValue(0))798 self.assertEqual(t_to_p_to.upper, InfiniteValue('+'))799 dl = self.delete(LocationValue('test_formalisms.Petrinets.P2T'))800 self.assertFalse(self.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())801 self.processInverse(dl.get_inverse())802 r = self.read(LocationValue("test_formalisms.Petrinets.Transition2Place"))803 self.assertFalse(r.is_success())804 r = self.read(LocationValue("test_formalisms.Petrinets.P2T"))805 self.assertTrue(r.is_success())806 t_to_p_from = r.get_item().from_multiplicity807 self.assertEqual(t_to_p_from.node, LocationValue('test_formalisms.Petrinets.Place'))808 self.assertEqual(t_to_p_from.port_name, StringValue('from_place'))809 self.assertEqual(t_to_p_from.lower, IntegerValue(0))810 self.assertEqual(t_to_p_from.upper, InfiniteValue('+'))811 t_to_p_to = r.get_item().to_multiplicity812 self.assertEqual(t_to_p_to.node, LocationValue('test_formalisms.Petrinets.Transition'))813 self.assertEqual(t_to_p_to.port_name, StringValue('to_transition'))814 self.assertEqual(t_to_p_to.lower, IntegerValue(0))815 self.assertEqual(t_to_p_to.upper, InfiniteValue('+'))816 def test_undo_redo_all(self):817 logs = self.setupPetrinets()818 # Now we should have ourself a petrinet formalism819 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())820 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())821 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())822 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())823 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())824 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())825 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())826 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())827 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())828 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())829 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())830 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())831 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())832 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())833 # But undo everything834 undo_logs = []835 for log in reversed(logs):836 undo_logs.append(self.processInverse(log.get_inverse()))837 # We should have nothing anymore838 self.assertFalse(self.mvk.read(LocationValue("test_formalisms")).is_success())839 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())840 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())841 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())842 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())843 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())844 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())845 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())846 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())847 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())848 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())849 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())850 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())851 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())852 # But now we redo everything!853 redo_logs = []854 for i, log in enumerate(reversed(undo_logs)):855 redo_logs.append(self.processInverse(log.get_inverse()))856 if not redo_logs[-1].is_success():857 self.fail(redo_logs[-1])858 # And everything should be back859 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())860 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())861 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())862 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())863 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())864 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())865 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())866 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())867 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())868 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())869 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())870 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())871 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())872 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())873 def test_undo_remove_model_chain(self):874 self.setupPetrinets()875 # The Petrinets model should be present, including all its clabjects (Place and Transition) and associations (P2T and T2P)876 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())877 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())878 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())879 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())880 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())881 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())882 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())883 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())884 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())885 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())886 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())887 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())888 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())889 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())890 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())891 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())892 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())893 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())894 dl = self.delete(LocationValue("test_formalisms.Petrinets"))895 896 # Everything in the model, including the model itself, should be removed897 # Of course, the empty package remains898 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())899 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())900 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())901 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())902 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())903 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())904 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())905 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())906 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())907 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())908 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())909 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())910 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())911 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())912 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())913 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())914 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())915 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())916 # Now revert the delete917 self.processInverse(dl.get_inverse())918 # The Petrinets model should be present again, including all its clabjects (Place and Transition) and associations (P2T and T2P)919 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())920 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())921 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())922 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())923 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())924 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())925 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())926 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())927 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())928 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())929 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())930 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())931 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())932 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())933 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())934 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())935 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())936 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())937 def test_undo_remove_nonempty_package(self):938 self.setupPetrinets()939 # The Petrinets model should be present, including all its clabjects (Place and Transition) and associations (P2T and T2P)940 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())941 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())942 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())943 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())944 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())945 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())946 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())947 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())948 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())949 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())950 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())951 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())952 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())953 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())954 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())955 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())956 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())957 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())958 dl = self.delete(LocationValue("test_formalisms"))959 960 # Everything in the model, including the model itself, should be removed961 # Of course, the empty package remains962 self.assertFalse(self.mvk.read(LocationValue("test_formalisms")).is_success())963 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())964 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())965 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())966 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())967 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())968 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())969 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())970 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())971 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())972 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())973 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())974 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())975 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())976 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())977 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())978 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())979 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())980 # Now revert the delete981 self.processInverse(dl.get_inverse())982 # The Petrinets model should be present again, including all its clabjects (Place and Transition) and associations (P2T and T2P)983 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())984 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())985 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())986 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())987 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())988 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())989 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())990 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())991 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())992 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())993 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())994 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())995 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())996 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())997 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())998 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())999 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())1000 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())1001 def test_undo_redo_partial(self):1002 logs = self.setupPetrinets()1003 # Now we should have ourself a petrinet formalism1004 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())1005 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())1006 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())1007 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1008 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())1009 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())1010 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())1011 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())1012 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1013 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())1014 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())1015 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())1016 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())1017 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())1018 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())1019 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())1020 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())1021 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())1022 # But undo some logs and verify that the correct things are removed inbetween1023 # 0 --> create Model Petrinets1024 # 5 --> create Clabject Transition1025 # 7 --> create Association P2T1026 undo_logs = []1027 for reverse_num, log in enumerate(reversed(logs)):1028 undo_logs.append(self.processInverse(log.get_inverse()))1029 num = len(logs) - reverse_num1030 1031 if num == 7:1032 # Undo the creation of Association P2T and T2P1033 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())1034 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())1035 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())1036 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1037 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())1038 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())1039 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())1040 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())1041 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1042 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())1043 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())1044 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())1045 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())1046 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())1047 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())1048 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())1049 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())1050 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())1051 elif num == 5:1052 # Followed by the deletion of Clabject Transition1053 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())1054 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())1055 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())1056 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1057 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())1058 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())1059 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())1060 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())1061 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1062 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())1063 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())1064 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())1065 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())1066 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())1067 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())1068 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())1069 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())1070 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())1071 elif num == 1:1072 # And the deletion of everything1073 self.assertFalse(self.mvk.read(LocationValue("test_formalisms")).is_success())1074 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())1075 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())1076 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1077 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())1078 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())1079 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())1080 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())1081 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1082 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())1083 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())1084 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())1085 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())1086 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())1087 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())1088 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())1089 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())1090 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())1091 # But now we redo everything!1092 redo_logs = []1093 for i, log in enumerate(reversed(undo_logs)):1094 redo_logs.append(self.processInverse(log.get_inverse()))1095 if not redo_logs[-1].is_success():1096 self.fail(redo_logs[-1])1097 if i == 0:1098 # The recreation of the Model Petrinets1099 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())1100 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())1101 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())1102 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1103 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())1104 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())1105 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())1106 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())1107 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1108 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())1109 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())1110 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())1111 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())1112 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())1113 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())1114 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())1115 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())1116 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())1117 elif i == 5:1118 # Recreation of Clabject Transition (and Place)1119 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())1120 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())1121 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())1122 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1123 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())1124 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())1125 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())1126 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())1127 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1128 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())1129 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())1130 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())1131 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())1132 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())1133 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())1134 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())1135 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())1136 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())1137 elif i == 7:1138 # And recreation of P2T but not yet T2P1139 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())1140 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())1141 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())1142 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1143 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())1144 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())1145 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())1146 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())1147 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1148 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())1149 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())1150 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())1151 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())1152 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())1153 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T")).is_success())1154 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.P2T.name")).is_success())1155 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P")).is_success())1156 self.assertFalse(self.mvk.read(LocationValue("test_formalisms.Petrinets.T2P.name")).is_success())1157 # And everything should be back at the end1158 self.assertTrue(self.mvk.read(LocationValue("test_formalisms")).is_success())1159 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets")).is_success())1160 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place")).is_success())1161 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1162 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.name")).is_success())1163 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.is_abstract")).is_success())1164 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.Class.id_field")).is_success())1165 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.tokens")).is_success())1166 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Place.name")).is_success())1167 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition")).is_success())1168 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.name")).is_success())1169 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.name")).is_success())1170 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.is_abstract")).is_success())1171 self.assertTrue(self.mvk.read(LocationValue("test_formalisms.Petrinets.Transition.Class.id_field")).is_success())1172#if __name__ == "__main__":1173def runTests():...
test_action.py
Source:test_action.py
...20 CreateConstants.ATTRS_KEY: MappingValue({21 StringValue("SimpleClassDiagrams.name"): StringValue("PetriNet")22 })23 }))24 if(cl.is_success()):25 print('\t: cl.is_success() = True')26 else:27 print('\t: cl.is_success() = False')28 print(cl.get_status_message())29 print('addElement(MyFormalisms.PetriNet, Class, {u"name": {"type": "StringType", "value": u"Place"}, u"id_field": {"type": "StringType", "value": u"Place.name"}})')30 cl = self.mvk.create(MappingValue({31 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Class"),32 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet"),33 CreateConstants.ATTRS_KEY: MappingValue({34 StringValue("Class.name"): StringValue("Place"),35 StringValue("Class.id_field"): StringValue("Place.name")36 })37 }))38 if(cl.is_success()):39 print('\t: cl.is_success() = True')40 else:41 print('\t: cl.is_success() = False')42 print(cl.get_status_message())43 print('addElement(MyFormalisms.PetriNet.Place, Attribute, {u"type": {"type": "Type", "value": u"String"}, u"name": {"type": "StringType", "value": u"name"}})')44 cl = self.mvk.create(MappingValue({45 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Attribute"),46 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet.Place"),47 CreateConstants.ATTRS_KEY: MappingValue({48 StringValue("Attribute.type"): StringType(),49 StringValue("Attribute.name"): StringValue("name")50 })51 }))52 if(cl.is_success()):53 print('\t: cl.is_success() = True')54 else:55 print('\t: cl.is_success() = False')56 print(cl.get_status_message())57 print('addElement(MyFormalisms.PetriNet.Place, Attribute, {u"default": {"type": "IntegerType", "value": 0}, u"type": {"type": "Type", "value": u"Integer"}, u"name": {"type": "StringType", "value": u"token"}})')58 cl = self.mvk.create(MappingValue({59 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Attribute"),60 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet.Place"),61 CreateConstants.ATTRS_KEY: MappingValue({62 StringValue("Attribute.type"): IntegerType(),63 StringValue("Attribute.default"): IntegerValue(0),64 StringValue("Attribute.name"): StringValue("token")65 })66 }))67 if(cl.is_success()):68 print('\t: cl.is_success() = True')69 else:70 print('\t: cl.is_success() = False')71 print(cl.get_status_message())72 print('addElement(MyFormalisms.PetriNet, Class, {u"name": {"type": "StringType", "value": u"Transition"}, u"id_field": {"type": "StringType", "value": u"Transition.name"}})')73 cl = self.mvk.create(MappingValue({74 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Class"),75 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet"),76 CreateConstants.ATTRS_KEY: MappingValue({77 StringValue("Class.name"): StringValue("Transition"),78 StringValue("Class.id_field"): StringValue("Transition.name")79 })80 }))81 if(cl.is_success()):82 print('\t: cl.is_success() = True')83 else:84 print('\t: cl.is_success() = False')85 print(cl.get_status_message())86 print('addElement(MyFormalisms.PetriNet.Transition, Attribute, {u"type": {"type": "Type", "value": u"String"}, u"name": {"type": "StringType", "value": u"name"}})')87 cl = self.mvk.create(MappingValue({88 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Attribute"),89 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet.Transition"),90 CreateConstants.ATTRS_KEY: MappingValue({91 StringValue("Attribute.type"): StringType(),92 StringValue("Attribute.name"): StringValue("name")93 })94 }))95 if(cl.is_success()):96 print('\t: cl.is_success() = True')97 else:98 print('\t: cl.is_success() = False')99 print(cl.get_status_message())100 print('addElement(MyFormalisms.PetriNet, Association, {u"from_max": {"type": "CardType", "value": u"*"}, u"name": {"type": "StringType", "value": u"InArc"}, u"to_port": {"type": "StringType", "value": u"to_transition"}, u"to_max": {"type": "CardType", "value": u"*"}, u"from_min": {"type": "IntegerType", "value": 0}, u"id_field": {"type": "StringType", "value": u"InArc.name"}, u"from_port": {"type": "StringType", "value": u"from_place"}, u"to_min": {"type": "IntegerType", "value": 0}, u"to_class": {"type": "NamedType", "value": u"Transition"}, u"from_class": {"type": "NamedType", "value": u"Place"}, u"is_abstract": {"type": "BooleanType", "value": True}})')101 cl = self.mvk.create(MappingValue({102 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Association"),103 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet"),104 CreateConstants.ATTRS_KEY: MappingValue({105 StringValue("Association.to_min"): IntegerValue(0),106 StringValue("Association.to_port"): StringValue("to_transition"),107 StringValue("Association.from_port"): StringValue("from_place"),108 StringValue("to_class"): LocationValue("MyFormalisms.PetriNet.Transition"),109 StringValue("Association.from_min"): IntegerValue(0),110 StringValue("from_class"): LocationValue("MyFormalisms.PetriNet.Place"),111 StringValue("Class.name"): StringValue("InArc"),112 StringValue("Class.id_field"): StringValue("InArc.name"),113 StringValue("Association.to_max"): InfiniteValue("inf"),114 StringValue("Class.is_abstract"): BooleanValue(True),115 StringValue("Association.from_max"): InfiniteValue("inf")116 })117 }))118 if(cl.is_success()):119 print('\t: cl.is_success() = True')120 else:121 print('\t: cl.is_success() = False')122 print(cl.get_status_message())123 print('addElement(MyFormalisms.PetriNet.InArc, Attribute, {u"type": {"type": "Type", "value": u"String"}, u"name": {"type": "StringType", "value": u"name"}})')124 cl = self.mvk.create(MappingValue({125 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Attribute"),126 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet.InArc"),127 CreateConstants.ATTRS_KEY: MappingValue({128 StringValue("Attribute.type"): StringType(),129 StringValue("Attribute.name"): StringValue("name")130 })131 }))132 if(cl.is_success()):133 print('\t: cl.is_success() = True')134 else:135 print('\t: cl.is_success() = False')136 print(cl.get_status_message())137 print('addElement(MyFormalisms.PetriNet.InArc, Attribute, {u"default": {"type": "IntegerType", "value": 1}, u"type": {"type": "Type", "value": u"Integer"}, u"name": {"type": "StringType", "value": u"weight"}})')138 cl = self.mvk.create(MappingValue({139 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Attribute"),140 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet.InArc"),141 CreateConstants.ATTRS_KEY: MappingValue({142 StringValue("Attribute.type"): IntegerType(),143 StringValue("Attribute.default"): IntegerValue(1),144 StringValue("Attribute.name"): StringValue("weight")145 })146 }))147 if(cl.is_success()):148 print('\t: cl.is_success() = True')149 else:150 print('\t: cl.is_success() = False')151 print(cl.get_status_message())152 print('addElement(MyFormalisms.PetriNet, Association, {u"from_max": {"type": "CardType", "value": u"*"}, u"name": {"type": "StringType", "value": u"OutArc"}, u"to_port": {"type": "StringType", "value": u"to_place"}, u"to_max": {"type": "CardType", "value": u"*"}, u"from_min": {"type": "IntegerType", "value": 0}, u"id_field": {"type": "StringType", "value": u"OutArc.name"}, u"from_port": {"type": "StringType", "value": u"from_transition"}, u"to_min": {"type": "IntegerType", "value": 0}, u"to_class": {"type": "NamedType", "value": u"Place"}, u"from_class": {"type": "NamedType", "value": u"Transition"}, u"is_abstract": {"type": "BooleanType", "value": True}})')153 cl = self.mvk.create(MappingValue({154 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Association"),155 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet"),156 CreateConstants.ATTRS_KEY: MappingValue({157 StringValue("Association.to_min"): IntegerValue(0),158 StringValue("Association.to_port"): StringValue("to_place"),159 StringValue("Association.from_port"): StringValue("from_transition"),160 StringValue("to_class"): LocationValue("MyFormalisms.PetriNet.Place"),161 StringValue("Association.from_min"): IntegerValue(0),162 StringValue("from_class"): LocationValue("MyFormalisms.PetriNet.Transition"),163 StringValue("Class.name"): StringValue("OutArc"),164 StringValue("Class.id_field"): StringValue("OutArc.name"),165 StringValue("Association.to_max"): InfiniteValue("inf"),166 StringValue("Class.is_abstract"): BooleanValue(True),167 StringValue("Association.from_max"): InfiniteValue("inf")168 })169 }))170 if(cl.is_success()):171 print('\t: cl.is_success() = True')172 else:173 print('\t: cl.is_success() = False')174 print(cl.get_status_message())175 print('addElement(MyFormalisms.PetriNet.OutArc, Attribute, {u"type": {"type": "Type", "value": u"String"}, u"name": {"type": "StringType", "value": u"name"}})')176 cl = self.mvk.create(MappingValue({177 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Attribute"),178 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet.OutArc"),179 CreateConstants.ATTRS_KEY: MappingValue({180 StringValue("Attribute.type"): StringType(),181 StringValue("Attribute.name"): StringValue("name")182 })183 }))184 if(cl.is_success()):185 print('\t: cl.is_success() = True')186 else:187 print('\t: cl.is_success() = False')188 print(cl.get_status_message())189 print('addElement(MyFormalisms.PetriNet.OutArc, Attribute, {u"default": {"type": "IntegerType", "value": 1}, u"type": {"type": "Type", "value": u"Integer"}, u"name": {"type": "StringType", "value": u"weight"}})')190 cl = self.mvk.create(MappingValue({191 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.SimpleClassDiagrams.Attribute"),192 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.PetriNet.OutArc"),193 CreateConstants.ATTRS_KEY: MappingValue({194 StringValue("Attribute.type"): IntegerType(),195 StringValue("Attribute.default"): IntegerValue(1),196 StringValue("Attribute.name"): StringValue("weight")197 })198 }))199 if(cl.is_success()):200 print('\t: cl.is_success() = True')201 else:202 print('\t: cl.is_success() = False')203 print(cl.get_status_message())204 print('addElement(MyFormalisms, PetriNet, {u"name": {"type": "StringType", "value": u"pnInstance"}})')205 cl = self.mvk.create(MappingValue({206 CreateConstants.TYPE_KEY: LocationValue("MyFormalisms.PetriNet"),207 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms"),208 CreateConstants.ATTRS_KEY: MappingValue({209 StringValue("PetriNet.name"): StringValue("pnInstance")210 })211 }))212 if(cl.is_success()):213 print('\t: cl.is_success() = True')214 else:215 print('\t: cl.is_success() = False')216 print(cl.get_status_message())217 print('addElement(MyFormalisms.pnInstance, Place, {u"token": {"type": "IntegerType", "value": 1}, u"name": {"type": "StringType", "value": u"ab"}})')218 cl = self.mvk.create(MappingValue({219 CreateConstants.TYPE_KEY: LocationValue("MyFormalisms.PetriNet.Place"),220 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.pnInstance"),221 CreateConstants.ATTRS_KEY: MappingValue({222 StringValue("Place.name"): StringValue("ab"),223 StringValue("Place.token"): IntegerValue(1)224 })225 }))226 if(cl.is_success()):227 print('\t: cl.is_success() = True')228 else:229 print('\t: cl.is_success() = False')230 print(cl.get_status_message())231 print('addElement(MyFormalisms.pnInstance, Place, {u"token": {"type": "IntegerType", "value": 2}, u"name": {"type": "StringType", "value": u"ba"}})')232 cl = self.mvk.create(MappingValue({233 CreateConstants.TYPE_KEY: LocationValue("MyFormalisms.PetriNet.Place"),234 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.pnInstance"),235 CreateConstants.ATTRS_KEY: MappingValue({236 StringValue("Place.name"): StringValue("ba"),237 StringValue("Place.token"): IntegerValue(2)238 })239 }))240 if(cl.is_success()):241 print('\t: cl.is_success() = True')242 else:243 print('\t: cl.is_success() = False')244 print(cl.get_status_message())245 print('addElement(MyFormalisms.pnInstance, Transition, {u"name": {"type": "StringType", "value": u"t1"}})')246 cl = self.mvk.create(MappingValue({247 CreateConstants.TYPE_KEY: LocationValue("MyFormalisms.PetriNet.Transition"),248 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.pnInstance"),249 CreateConstants.ATTRS_KEY: MappingValue({250 StringValue("Transition.name"): StringValue("t1")251 })252 }))253 if(cl.is_success()):254 print('\t: cl.is_success() = True')255 else:256 print('\t: cl.is_success() = False')257 print(cl.get_status_message())258 print('addElement(MyFormalisms.pnInstance, InArc, {u"to_transition": {"type": "NamedType", "value": u"t1"}, u"name": {"type": "StringType", "value": u"p2t"}, u"from_place": {"type": "NamedType", "value": u"ab"}})')259 cl = self.mvk.create(MappingValue({260 CreateConstants.TYPE_KEY: LocationValue("MyFormalisms.PetriNet.InArc"),261 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.pnInstance"),262 CreateConstants.ATTRS_KEY: MappingValue({263 StringValue("InArc.name"): StringValue("p2t"),264 StringValue("to_transition"): LocationValue("MyFormalisms.pnInstance.t1"),265 StringValue("from_place"): LocationValue("MyFormalisms.pnInstance.ab")266 })267 }))268 if(cl.is_success()):269 print('\t: cl.is_success() = True')270 else:271 print('\t: cl.is_success() = False')272 print(cl.get_status_message())273 print('addElement(MyFormalisms.pnInstance, OutArc, {u"from_transition": {"type": "NamedType", "value": u"t1"}, u"name": {"type": "StringType", "value": u"t2p"}, u"to_place": {"type": "NamedType", "value": u"ab"}})')274 cl = self.mvk.create(MappingValue({275 CreateConstants.TYPE_KEY: LocationValue("MyFormalisms.PetriNet.OutArc"),276 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.pnInstance"),277 CreateConstants.ATTRS_KEY: MappingValue({278 StringValue("from_transition"): LocationValue("MyFormalisms.pnInstance.t1"),279 StringValue("OutArc.name"): StringValue("t2p"),280 StringValue("to_place"): LocationValue("MyFormalisms.pnInstance.ab")281 })282 }))283 if(cl.is_success()):284 print('\t: cl.is_success() = True')285 else:286 print('\t: cl.is_success() = False')287 print(cl.get_status_message())288 print('addElement(MyFormalisms, protected.formalisms.ActionLanguage, {u"name": {"type": "StringType", "value": u"Utilities"}})')289 cl = self.mvk.create(MappingValue({290 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage"),291 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms"),292 CreateConstants.ATTRS_KEY: MappingValue({293 StringValue("ActionLanguage.name"): StringValue("Utilities")294 })295 }))296 if(cl.is_success()):297 print('\t: cl.is_success() = True')298 else:299 print('\t: cl.is_success() = False')300 print(cl.get_status_message())301 print('addFunction(MyFormalisms.Utilities, z, PetriNet.Place)')302 cl = self.mvk.create(MappingValue({303 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Function"),304 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities"),305 CreateConstants.ATTRS_KEY: MappingValue({306 StringValue("Function.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.Place")),307 StringValue("Function.name"): StringValue("z")308 })309 }))310 if(cl.is_success()):311 print('\t: cl.is_success() = True')312 else:313 print('\t: cl.is_success() = False')314 print(cl.get_status_message())315 print('addFunctionParameter(MyFormalisms.Utilities, z, a, Integer, in)')316 cl = self.mvk.create(MappingValue({317 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Parameter"),318 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z"),319 CreateConstants.ATTRS_KEY: MappingValue({320 StringValue("Parameter.parameter_type"): StringValue("in"),321 StringValue("Parameter.name"): StringValue("a"),322 StringValue("Parameter.type"): IntegerType()323 })324 }))325 if(cl.is_success()):326 print('\t: cl.is_success() = True')327 else:328 print('\t: cl.is_success() = False')329 print(cl.get_status_message())330 print('addFunctionParameter(MyFormalisms.Utilities, z, b, Boolean, inout)')331 cl = self.mvk.create(MappingValue({332 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Parameter"),333 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z"),334 CreateConstants.ATTRS_KEY: MappingValue({335 StringValue("Parameter.parameter_type"): StringValue("inout"),336 StringValue("Parameter.name"): StringValue("b"),337 StringValue("Parameter.type"): BooleanType()338 })339 }))340 if(cl.is_success()):341 print('\t: cl.is_success() = True')342 else:343 print('\t: cl.is_success() = False')344 print(cl.get_status_message())345 print('addFunctionParameter(MyFormalisms.Utilities, z, c, String, out)')346 cl = self.mvk.create(MappingValue({347 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Parameter"),348 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z"),349 CreateConstants.ATTRS_KEY: MappingValue({350 StringValue("Parameter.parameter_type"): StringValue("out"),351 StringValue("Parameter.name"): StringValue("c"),352 StringValue("Parameter.type"): StringType()353 })354 }))355 if(cl.is_success()):356 print('\t: cl.is_success() = True')357 else:358 print('\t: cl.is_success() = False')359 print(cl.get_status_message())360 print('addDeclarationStm(MyFormalisms.Utilities.z.body, type_declaration1)')361 cl = self.mvk.create(MappingValue({362 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.DeclarationStatement"),363 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body"),364 CreateConstants.ATTRS_KEY: MappingValue({365 StringValue("Statement.name"): StringValue("type_declaration1")366 })367 }))368 if(cl.is_success()):369 print('\t: cl.is_success() = True')370 else:371 print('\t: cl.is_success() = False')372 print(cl.get_status_message())373 print('addIdentifier(MyFormalisms.Utilities.z.body.type_declaration1, PetriNet.Place, p1)')374 cl = self.mvk.create(MappingValue({375 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Identifier"),376 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration1"),377 CreateConstants.ATTRS_KEY: MappingValue({378 StringValue("Expression.name"): StringValue("p1"),379 StringValue("Identifier.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.Place"))380 })381 }))382 if(cl.is_success()):383 print('\t: cl.is_success() = True')384 else:385 print('\t: cl.is_success() = False')386 print(cl.get_status_message())387 print('addFunctionCall(MyFormalisms.Utilities.z.body.type_declaration1, funccall_expr2, PetriNet.Place)')388 cl = self.mvk.create(MappingValue({389 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),390 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration1"),391 CreateConstants.ATTRS_KEY: MappingValue({392 StringValue("Expression.name"): StringValue("funccall_expr2"),393 StringValue("FunctionCall.function_name"): StringValue("PetriNet.Place")394 })395 }))396 if(cl.is_success()):397 print('\t: cl.is_success() = True')398 else:399 print('\t: cl.is_success() = False')400 print(cl.get_status_message())401 print('addArgument(MyFormalisms.Utilities.z.body.type_declaration1.funccall_expr2, argument3, token)')402 cl = self.mvk.create(MappingValue({403 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),404 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration1.funccall_expr2"),405 CreateConstants.ATTRS_KEY: MappingValue({406 StringValue("Argument.key"): StringValue("token"),407 StringValue("Argument.name"): StringValue("argument3")408 })409 }))410 if(cl.is_success()):411 print('\t: cl.is_success() = True')412 else:413 print('\t: cl.is_success() = False')414 print(cl.get_status_message())415 print('addConstant(MyFormalisms.Utilities.z.body.type_declaration1.funccall_expr2.argument3, atomvalue4, 2, IntegerType)')416 cl = self.mvk.create(MappingValue({417 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Constant"),418 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration1.funccall_expr2.argument3"),419 CreateConstants.ATTRS_KEY: MappingValue({420 StringValue("Expression.name"): StringValue("atomvalue4"),421 StringValue("Constant.value"): IntegerValue(2),422 StringValue("Constant.type"): IntegerType()423 })424 }))425 if(cl.is_success()):426 print('\t: cl.is_success() = True')427 else:428 print('\t: cl.is_success() = False')429 print(cl.get_status_message())430 print('addExpressionStatement(MyFormalisms.Utilities.z.body, expression5)')431 cl = self.mvk.create(MappingValue({432 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.ExpressionStatement"),433 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body"),434 CreateConstants.ATTRS_KEY: MappingValue({435 StringValue("Statement.name"): StringValue("expression5")436 })437 }))438 if(cl.is_success()):439 print('\t: cl.is_success() = True')440 else:441 print('\t: cl.is_success() = False')442 print(cl.get_status_message())443 print('addAssignmentStm(MyFormalisms.Utilities.z.body.expression5, assignment6)')444 cl = self.mvk.create(MappingValue({445 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Assignment"),446 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression5"),447 CreateConstants.ATTRS_KEY: MappingValue({448 StringValue("Expression.name"): StringValue("assignment6")449 })450 }))451 if(cl.is_success()):452 print('\t: cl.is_success() = True')453 else:454 print('\t: cl.is_success() = False')455 print(cl.get_status_message())456 print('addNavigation(MyFormalisms.Utilities.z.body.expression5.assignment6, navigation7, p1.token)')457 cl = self.mvk.create(MappingValue({458 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),459 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression5.assignment6"),460 CreateConstants.ATTRS_KEY: MappingValue({461 StringValue("Expression.name"): StringValue("navigation7"),462 StringValue("Navigation.path"): LocationValue("p1.token")463 })464 }))465 if(cl.is_success()):466 print('\t: cl.is_success() = True')467 else:468 print('\t: cl.is_success() = False')469 print(cl.get_status_message())470 print('addSum(MyFormalisms.Utilities.z.body.expression5.assignment6, sumexpr8)')471 cl = self.mvk.create(MappingValue({472 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Plus"),473 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression5.assignment6"),474 CreateConstants.ATTRS_KEY: MappingValue({475 StringValue("Expression.name"): StringValue("sumexpr8")476 })477 }))478 if(cl.is_success()):479 print('\t: cl.is_success() = True')480 else:481 print('\t: cl.is_success() = False')482 print(cl.get_status_message())483 print('addNavigation(MyFormalisms.Utilities.z.body.expression5.assignment6.sumexpr8, navigation9, p1.token)')484 cl = self.mvk.create(MappingValue({485 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),486 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression5.assignment6.sumexpr8"),487 CreateConstants.ATTRS_KEY: MappingValue({488 StringValue("Expression.name"): StringValue("navigation9"),489 StringValue("Navigation.path"): LocationValue("p1.token")490 })491 }))492 if(cl.is_success()):493 print('\t: cl.is_success() = True')494 else:495 print('\t: cl.is_success() = False')496 print(cl.get_status_message())497 print('addNavigation(MyFormalisms.Utilities.z.body.expression5.assignment6.sumexpr8, navigation10, a)')498 cl = self.mvk.create(MappingValue({499 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),500 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression5.assignment6.sumexpr8"),501 CreateConstants.ATTRS_KEY: MappingValue({502 StringValue("Expression.name"): StringValue("navigation10"),503 StringValue("Navigation.path"): LocationValue("a")504 })505 }))506 if(cl.is_success()):507 print('\t: cl.is_success() = True')508 else:509 print('\t: cl.is_success() = False')510 print(cl.get_status_message())511 print('addExpressionStatement(MyFormalisms.Utilities.z.body, expression11)')512 cl = self.mvk.create(MappingValue({513 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.ExpressionStatement"),514 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body"),515 CreateConstants.ATTRS_KEY: MappingValue({516 StringValue("Statement.name"): StringValue("expression11")517 })518 }))519 if(cl.is_success()):520 print('\t: cl.is_success() = True')521 else:522 print('\t: cl.is_success() = False')523 print(cl.get_status_message())524 print('addFunctionCall(MyFormalisms.Utilities.z.body.expression11, funccall_expr12, mvk.create)')525 cl = self.mvk.create(MappingValue({526 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),527 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression11"),528 CreateConstants.ATTRS_KEY: MappingValue({529 StringValue("Expression.name"): StringValue("funccall_expr12"),530 StringValue("FunctionCall.function_name"): StringValue("mvk.create")531 })532 }))533 if(cl.is_success()):534 print('\t: cl.is_success() = True')535 else:536 print('\t: cl.is_success() = False')537 print(cl.get_status_message())538 print('addArgument(MyFormalisms.Utilities.z.body.expression11.funccall_expr12, argument13, )')539 cl = self.mvk.create(MappingValue({540 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),541 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression11.funccall_expr12"),542 CreateConstants.ATTRS_KEY: MappingValue({543 StringValue("Argument.key"): StringValue(""),544 StringValue("Argument.name"): StringValue("argument13")545 })546 }))547 if(cl.is_success()):548 print('\t: cl.is_success() = True')549 else:550 print('\t: cl.is_success() = False')551 print(cl.get_status_message())552 print('addNavigation(MyFormalisms.Utilities.z.body.expression11.funccall_expr12.argument13, navigation14, p1)')553 cl = self.mvk.create(MappingValue({554 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),555 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression11.funccall_expr12.argument13"),556 CreateConstants.ATTRS_KEY: MappingValue({557 StringValue("Expression.name"): StringValue("navigation14"),558 StringValue("Navigation.path"): LocationValue("p1")559 })560 }))561 if(cl.is_success()):562 print('\t: cl.is_success() = True')563 else:564 print('\t: cl.is_success() = False')565 print(cl.get_status_message())566 print('addArgument(MyFormalisms.Utilities.z.body.expression11.funccall_expr12, argument15, )')567 cl = self.mvk.create(MappingValue({568 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),569 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression11.funccall_expr12"),570 CreateConstants.ATTRS_KEY: MappingValue({571 StringValue("Argument.key"): StringValue(""),572 StringValue("Argument.name"): StringValue("argument15")573 })574 }))575 if(cl.is_success()):576 print('\t: cl.is_success() = True')577 else:578 print('\t: cl.is_success() = False')579 print(cl.get_status_message())580 print('addNavigation(MyFormalisms.Utilities.z.body.expression11.funccall_expr12.argument15, navigation16, pnInstance)')581 cl = self.mvk.create(MappingValue({582 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),583 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression11.funccall_expr12.argument15"),584 CreateConstants.ATTRS_KEY: MappingValue({585 StringValue("Expression.name"): StringValue("navigation16"),586 StringValue("Navigation.path"): LocationValue("pnInstance")587 })588 }))589 if(cl.is_success()):590 print('\t: cl.is_success() = True')591 else:592 print('\t: cl.is_success() = False')593 print(cl.get_status_message())594 print('addArgument(MyFormalisms.Utilities.z.body.expression11.funccall_expr12, argument17, )')595 cl = self.mvk.create(MappingValue({596 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),597 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression11.funccall_expr12"),598 CreateConstants.ATTRS_KEY: MappingValue({599 StringValue("Argument.key"): StringValue(""),600 StringValue("Argument.name"): StringValue("argument17")601 })602 }))603 if(cl.is_success()):604 print('\t: cl.is_success() = True')605 else:606 print('\t: cl.is_success() = False')607 print(cl.get_status_message())608 print('addConstant(MyFormalisms.Utilities.z.body.expression11.funccall_expr12.argument17, atomvalue18, newplace, StringType)')609 cl = self.mvk.create(MappingValue({610 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Constant"),611 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression11.funccall_expr12.argument17"),612 CreateConstants.ATTRS_KEY: MappingValue({613 StringValue("Expression.name"): StringValue("atomvalue18"),614 StringValue("Constant.value"): StringValue("newplace"),615 StringValue("Constant.type"): StringType()616 })617 }))618 if(cl.is_success()):619 print('\t: cl.is_success() = True')620 else:621 print('\t: cl.is_success() = False')622 print(cl.get_status_message())623 print('addDeclarationStm(MyFormalisms.Utilities.z.body, type_declaration19)')624 cl = self.mvk.create(MappingValue({625 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.DeclarationStatement"),626 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body"),627 CreateConstants.ATTRS_KEY: MappingValue({628 StringValue("Statement.name"): StringValue("type_declaration19")629 })630 }))631 if(cl.is_success()):632 print('\t: cl.is_success() = True')633 else:634 print('\t: cl.is_success() = False')635 print(cl.get_status_message())636 print('addIdentifier(MyFormalisms.Utilities.z.body.type_declaration19, PetriNet.Place, p3)')637 cl = self.mvk.create(MappingValue({638 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Identifier"),639 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration19"),640 CreateConstants.ATTRS_KEY: MappingValue({641 StringValue("Expression.name"): StringValue("p3"),642 StringValue("Identifier.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.Place"))643 })644 }))645 if(cl.is_success()):646 print('\t: cl.is_success() = True')647 else:648 print('\t: cl.is_success() = False')649 print(cl.get_status_message())650 print('addFunctionCall(MyFormalisms.Utilities.z.body.type_declaration19, funccall_expr20, mvk.read)')651 cl = self.mvk.create(MappingValue({652 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),653 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration19"),654 CreateConstants.ATTRS_KEY: MappingValue({655 StringValue("Expression.name"): StringValue("funccall_expr20"),656 StringValue("FunctionCall.function_name"): StringValue("mvk.read")657 })658 }))659 if(cl.is_success()):660 print('\t: cl.is_success() = True')661 else:662 print('\t: cl.is_success() = False')663 print(cl.get_status_message())664 print('addArgument(MyFormalisms.Utilities.z.body.type_declaration19.funccall_expr20, argument21, )')665 cl = self.mvk.create(MappingValue({666 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),667 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration19.funccall_expr20"),668 CreateConstants.ATTRS_KEY: MappingValue({669 StringValue("Argument.key"): StringValue(""),670 StringValue("Argument.name"): StringValue("argument21")671 })672 }))673 if(cl.is_success()):674 print('\t: cl.is_success() = True')675 else:676 print('\t: cl.is_success() = False')677 print(cl.get_status_message())678 print('addConstant(MyFormalisms.Utilities.z.body.type_declaration19.funccall_expr20.argument21, atomvalue22, MyFormalisms.pnInstance.newplace, StringType)')679 cl = self.mvk.create(MappingValue({680 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Constant"),681 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration19.funccall_expr20.argument21"),682 CreateConstants.ATTRS_KEY: MappingValue({683 StringValue("Expression.name"): StringValue("atomvalue22"),684 StringValue("Constant.value"): StringValue("MyFormalisms.pnInstance.newplace"),685 StringValue("Constant.type"): StringType()686 })687 }))688 if(cl.is_success()):689 print('\t: cl.is_success() = True')690 else:691 print('\t: cl.is_success() = False')692 print(cl.get_status_message())693 print('addDeclarationStm(MyFormalisms.Utilities.z.body, type_declaration23)')694 cl = self.mvk.create(MappingValue({695 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.DeclarationStatement"),696 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body"),697 CreateConstants.ATTRS_KEY: MappingValue({698 StringValue("Statement.name"): StringValue("type_declaration23")699 })700 }))701 if(cl.is_success()):702 print('\t: cl.is_success() = True')703 else:704 print('\t: cl.is_success() = False')705 print(cl.get_status_message())706 print('addIdentifier(MyFormalisms.Utilities.z.body.type_declaration23, PetriNet.Place, p2)')707 cl = self.mvk.create(MappingValue({708 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Identifier"),709 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration23"),710 CreateConstants.ATTRS_KEY: MappingValue({711 StringValue("Expression.name"): StringValue("p2"),712 StringValue("Identifier.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.Place"))713 })714 }))715 if(cl.is_success()):716 print('\t: cl.is_success() = True')717 else:718 print('\t: cl.is_success() = False')719 print(cl.get_status_message())720 print('addNavigation(MyFormalisms.Utilities.z.body.type_declaration23, navigation24, pnInstance.newplace)')721 cl = self.mvk.create(MappingValue({722 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),723 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration23"),724 CreateConstants.ATTRS_KEY: MappingValue({725 StringValue("Expression.name"): StringValue("navigation24"),726 StringValue("Navigation.path"): LocationValue("pnInstance.newplace")727 })728 }))729 if(cl.is_success()):730 print('\t: cl.is_success() = True')731 else:732 print('\t: cl.is_success() = False')733 print(cl.get_status_message())734 print('addDeclarationStm(MyFormalisms.Utilities.z.body, type_declaration25)')735 cl = self.mvk.create(MappingValue({736 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.DeclarationStatement"),737 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body"),738 CreateConstants.ATTRS_KEY: MappingValue({739 StringValue("Statement.name"): StringValue("type_declaration25")740 })741 }))742 if(cl.is_success()):743 print('\t: cl.is_success() = True')744 else:745 print('\t: cl.is_success() = False')746 print(cl.get_status_message())747 print('addIdentifier(MyFormalisms.Utilities.z.body.type_declaration25, PetriNet.Transition, t2)')748 cl = self.mvk.create(MappingValue({749 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Identifier"),750 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration25"),751 CreateConstants.ATTRS_KEY: MappingValue({752 StringValue("Expression.name"): StringValue("t2"),753 StringValue("Identifier.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.Transition"))754 })755 }))756 if(cl.is_success()):757 print('\t: cl.is_success() = True')758 else:759 print('\t: cl.is_success() = False')760 print(cl.get_status_message())761 print('addFunctionCall(MyFormalisms.Utilities.z.body.type_declaration25, funccall_expr26, PetriNet.Transition)')762 cl = self.mvk.create(MappingValue({763 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),764 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration25"),765 CreateConstants.ATTRS_KEY: MappingValue({766 StringValue("Expression.name"): StringValue("funccall_expr26"),767 StringValue("FunctionCall.function_name"): StringValue("PetriNet.Transition")768 })769 }))770 if(cl.is_success()):771 print('\t: cl.is_success() = True')772 else:773 print('\t: cl.is_success() = False')774 print(cl.get_status_message())775 print('addArgument(MyFormalisms.Utilities.z.body.type_declaration25.funccall_expr26, argument27, name)')776 cl = self.mvk.create(MappingValue({777 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),778 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration25.funccall_expr26"),779 CreateConstants.ATTRS_KEY: MappingValue({780 StringValue("Argument.key"): StringValue("name"),781 StringValue("Argument.name"): StringValue("argument27")782 })783 }))784 if(cl.is_success()):785 print('\t: cl.is_success() = True')786 else:787 print('\t: cl.is_success() = False')788 print(cl.get_status_message())789 print('addConstant(MyFormalisms.Utilities.z.body.type_declaration25.funccall_expr26.argument27, atomvalue28, t2, StringType)')790 cl = self.mvk.create(MappingValue({791 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Constant"),792 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration25.funccall_expr26.argument27"),793 CreateConstants.ATTRS_KEY: MappingValue({794 StringValue("Expression.name"): StringValue("atomvalue28"),795 StringValue("Constant.value"): StringValue("t2"),796 StringValue("Constant.type"): StringType()797 })798 }))799 if(cl.is_success()):800 print('\t: cl.is_success() = True')801 else:802 print('\t: cl.is_success() = False')803 print(cl.get_status_message())804 print('addExpressionStatement(MyFormalisms.Utilities.z.body, expression29)')805 cl = self.mvk.create(MappingValue({806 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.ExpressionStatement"),807 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body"),808 CreateConstants.ATTRS_KEY: MappingValue({809 StringValue("Statement.name"): StringValue("expression29")810 })811 }))812 if(cl.is_success()):813 print('\t: cl.is_success() = True')814 else:815 print('\t: cl.is_success() = False')816 print(cl.get_status_message())817 print('addFunctionCall(MyFormalisms.Utilities.z.body.expression29, funccall_expr30, mvk.create)')818 cl = self.mvk.create(MappingValue({819 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),820 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression29"),821 CreateConstants.ATTRS_KEY: MappingValue({822 StringValue("Expression.name"): StringValue("funccall_expr30"),823 StringValue("FunctionCall.function_name"): StringValue("mvk.create")824 })825 }))826 if(cl.is_success()):827 print('\t: cl.is_success() = True')828 else:829 print('\t: cl.is_success() = False')830 print(cl.get_status_message())831 print('addArgument(MyFormalisms.Utilities.z.body.expression29.funccall_expr30, argument31, )')832 cl = self.mvk.create(MappingValue({833 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),834 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression29.funccall_expr30"),835 CreateConstants.ATTRS_KEY: MappingValue({836 StringValue("Argument.key"): StringValue(""),837 StringValue("Argument.name"): StringValue("argument31")838 })839 }))840 if(cl.is_success()):841 print('\t: cl.is_success() = True')842 else:843 print('\t: cl.is_success() = False')844 print(cl.get_status_message())845 print('addNavigation(MyFormalisms.Utilities.z.body.expression29.funccall_expr30.argument31, navigation32, t2)')846 cl = self.mvk.create(MappingValue({847 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),848 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression29.funccall_expr30.argument31"),849 CreateConstants.ATTRS_KEY: MappingValue({850 StringValue("Expression.name"): StringValue("navigation32"),851 StringValue("Navigation.path"): LocationValue("t2")852 })853 }))854 if(cl.is_success()):855 print('\t: cl.is_success() = True')856 else:857 print('\t: cl.is_success() = False')858 print(cl.get_status_message())859 print('addArgument(MyFormalisms.Utilities.z.body.expression29.funccall_expr30, argument33, )')860 cl = self.mvk.create(MappingValue({861 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),862 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression29.funccall_expr30"),863 CreateConstants.ATTRS_KEY: MappingValue({864 StringValue("Argument.key"): StringValue(""),865 StringValue("Argument.name"): StringValue("argument33")866 })867 }))868 if(cl.is_success()):869 print('\t: cl.is_success() = True')870 else:871 print('\t: cl.is_success() = False')872 print(cl.get_status_message())873 print('addNavigation(MyFormalisms.Utilities.z.body.expression29.funccall_expr30.argument33, navigation34, pnInstance)')874 cl = self.mvk.create(MappingValue({875 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),876 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression29.funccall_expr30.argument33"),877 CreateConstants.ATTRS_KEY: MappingValue({878 StringValue("Expression.name"): StringValue("navigation34"),879 StringValue("Navigation.path"): LocationValue("pnInstance")880 })881 }))882 if(cl.is_success()):883 print('\t: cl.is_success() = True')884 else:885 print('\t: cl.is_success() = False')886 print(cl.get_status_message())887 print('addArgument(MyFormalisms.Utilities.z.body.expression29.funccall_expr30, argument35, )')888 cl = self.mvk.create(MappingValue({889 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),890 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression29.funccall_expr30"),891 CreateConstants.ATTRS_KEY: MappingValue({892 StringValue("Argument.key"): StringValue(""),893 StringValue("Argument.name"): StringValue("argument35")894 })895 }))896 if(cl.is_success()):897 print('\t: cl.is_success() = True')898 else:899 print('\t: cl.is_success() = False')900 print(cl.get_status_message())901 print('addConstant(MyFormalisms.Utilities.z.body.expression29.funccall_expr30.argument35, atomvalue36, t2, StringType)')902 cl = self.mvk.create(MappingValue({903 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Constant"),904 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression29.funccall_expr30.argument35"),905 CreateConstants.ATTRS_KEY: MappingValue({906 StringValue("Expression.name"): StringValue("atomvalue36"),907 StringValue("Constant.value"): StringValue("t2"),908 StringValue("Constant.type"): StringType()909 })910 }))911 if(cl.is_success()):912 print('\t: cl.is_success() = True')913 else:914 print('\t: cl.is_success() = False')915 print(cl.get_status_message())916 print('addDeclarationStm(MyFormalisms.Utilities.z.body, type_declaration37)')917 cl = self.mvk.create(MappingValue({918 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.DeclarationStatement"),919 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body"),920 CreateConstants.ATTRS_KEY: MappingValue({921 StringValue("Statement.name"): StringValue("type_declaration37")922 })923 }))924 if(cl.is_success()):925 print('\t: cl.is_success() = True')926 else:927 print('\t: cl.is_success() = False')928 print(cl.get_status_message())929 print('addIdentifier(MyFormalisms.Utilities.z.body.type_declaration37, PetriNet.InArc, out_t)')930 cl = self.mvk.create(MappingValue({931 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Identifier"),932 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration37"),933 CreateConstants.ATTRS_KEY: MappingValue({934 StringValue("Expression.name"): StringValue("out_t"),935 StringValue("Identifier.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.InArc"))936 })937 }))938 if(cl.is_success()):939 print('\t: cl.is_success() = True')940 else:941 print('\t: cl.is_success() = False')942 print(cl.get_status_message())943 print('addFunctionCall(MyFormalisms.Utilities.z.body.type_declaration37, funccall_expr38, PetriNet.InArc)')944 cl = self.mvk.create(MappingValue({945 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),946 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration37"),947 CreateConstants.ATTRS_KEY: MappingValue({948 StringValue("Expression.name"): StringValue("funccall_expr38"),949 StringValue("FunctionCall.function_name"): StringValue("PetriNet.InArc")950 })951 }))952 if(cl.is_success()):953 print('\t: cl.is_success() = True')954 else:955 print('\t: cl.is_success() = False')956 print(cl.get_status_message())957 print('addArgument(MyFormalisms.Utilities.z.body.type_declaration37.funccall_expr38, argument39, from_place)')958 cl = self.mvk.create(MappingValue({959 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),960 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration37.funccall_expr38"),961 CreateConstants.ATTRS_KEY: MappingValue({962 StringValue("Argument.key"): StringValue("from_place"),963 StringValue("Argument.name"): StringValue("argument39")964 })965 }))966 if(cl.is_success()):967 print('\t: cl.is_success() = True')968 else:969 print('\t: cl.is_success() = False')970 print(cl.get_status_message())971 print('addNavigation(MyFormalisms.Utilities.z.body.type_declaration37.funccall_expr38.argument39, navigation40, pnInstance.newplace)')972 cl = self.mvk.create(MappingValue({973 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),974 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration37.funccall_expr38.argument39"),975 CreateConstants.ATTRS_KEY: MappingValue({976 StringValue("Expression.name"): StringValue("navigation40"),977 StringValue("Navigation.path"): LocationValue("pnInstance.newplace")978 })979 }))980 if(cl.is_success()):981 print('\t: cl.is_success() = True')982 else:983 print('\t: cl.is_success() = False')984 print(cl.get_status_message())985 print('addArgument(MyFormalisms.Utilities.z.body.type_declaration37.funccall_expr38, argument41, to_transition)')986 cl = self.mvk.create(MappingValue({987 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),988 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration37.funccall_expr38"),989 CreateConstants.ATTRS_KEY: MappingValue({990 StringValue("Argument.key"): StringValue("to_transition"),991 StringValue("Argument.name"): StringValue("argument41")992 })993 }))994 if(cl.is_success()):995 print('\t: cl.is_success() = True')996 else:997 print('\t: cl.is_success() = False')998 print(cl.get_status_message())999 print('addNavigation(MyFormalisms.Utilities.z.body.type_declaration37.funccall_expr38.argument41, navigation42, pnInstance.t2)')1000 cl = self.mvk.create(MappingValue({1001 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1002 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.type_declaration37.funccall_expr38.argument41"),1003 CreateConstants.ATTRS_KEY: MappingValue({1004 StringValue("Expression.name"): StringValue("navigation42"),1005 StringValue("Navigation.path"): LocationValue("pnInstance.t2")1006 })1007 }))1008 if(cl.is_success()):1009 print('\t: cl.is_success() = True')1010 else:1011 print('\t: cl.is_success() = False')1012 print(cl.get_status_message())1013 print('addExpressionStatement(MyFormalisms.Utilities.z.body, expression43)')1014 cl = self.mvk.create(MappingValue({1015 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.ExpressionStatement"),1016 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body"),1017 CreateConstants.ATTRS_KEY: MappingValue({1018 StringValue("Statement.name"): StringValue("expression43")1019 })1020 }))1021 if(cl.is_success()):1022 print('\t: cl.is_success() = True')1023 else:1024 print('\t: cl.is_success() = False')1025 print(cl.get_status_message())1026 print('addFunctionCall(MyFormalisms.Utilities.z.body.expression43, funccall_expr44, mvk.create)')1027 cl = self.mvk.create(MappingValue({1028 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),1029 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression43"),1030 CreateConstants.ATTRS_KEY: MappingValue({1031 StringValue("Expression.name"): StringValue("funccall_expr44"),1032 StringValue("FunctionCall.function_name"): StringValue("mvk.create")1033 })1034 }))1035 if(cl.is_success()):1036 print('\t: cl.is_success() = True')1037 else:1038 print('\t: cl.is_success() = False')1039 print(cl.get_status_message())1040 print('addArgument(MyFormalisms.Utilities.z.body.expression43.funccall_expr44, argument45, )')1041 cl = self.mvk.create(MappingValue({1042 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1043 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression43.funccall_expr44"),1044 CreateConstants.ATTRS_KEY: MappingValue({1045 StringValue("Argument.key"): StringValue(""),1046 StringValue("Argument.name"): StringValue("argument45")1047 })1048 }))1049 if(cl.is_success()):1050 print('\t: cl.is_success() = True')1051 else:1052 print('\t: cl.is_success() = False')1053 print(cl.get_status_message())1054 print('addNavigation(MyFormalisms.Utilities.z.body.expression43.funccall_expr44.argument45, navigation46, out_t)')1055 cl = self.mvk.create(MappingValue({1056 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1057 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression43.funccall_expr44.argument45"),1058 CreateConstants.ATTRS_KEY: MappingValue({1059 StringValue("Expression.name"): StringValue("navigation46"),1060 StringValue("Navigation.path"): LocationValue("out_t")1061 })1062 }))1063 if(cl.is_success()):1064 print('\t: cl.is_success() = True')1065 else:1066 print('\t: cl.is_success() = False')1067 print(cl.get_status_message())1068 print('addArgument(MyFormalisms.Utilities.z.body.expression43.funccall_expr44, argument47, )')1069 cl = self.mvk.create(MappingValue({1070 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1071 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression43.funccall_expr44"),1072 CreateConstants.ATTRS_KEY: MappingValue({1073 StringValue("Argument.key"): StringValue(""),1074 StringValue("Argument.name"): StringValue("argument47")1075 })1076 }))1077 if(cl.is_success()):1078 print('\t: cl.is_success() = True')1079 else:1080 print('\t: cl.is_success() = False')1081 print(cl.get_status_message())1082 print('addNavigation(MyFormalisms.Utilities.z.body.expression43.funccall_expr44.argument47, navigation48, pnInstance)')1083 cl = self.mvk.create(MappingValue({1084 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1085 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression43.funccall_expr44.argument47"),1086 CreateConstants.ATTRS_KEY: MappingValue({1087 StringValue("Expression.name"): StringValue("navigation48"),1088 StringValue("Navigation.path"): LocationValue("pnInstance")1089 })1090 }))1091 if(cl.is_success()):1092 print('\t: cl.is_success() = True')1093 else:1094 print('\t: cl.is_success() = False')1095 print(cl.get_status_message())1096 print('addArgument(MyFormalisms.Utilities.z.body.expression43.funccall_expr44, argument49, )')1097 cl = self.mvk.create(MappingValue({1098 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1099 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression43.funccall_expr44"),1100 CreateConstants.ATTRS_KEY: MappingValue({1101 StringValue("Argument.key"): StringValue(""),1102 StringValue("Argument.name"): StringValue("argument49")1103 })1104 }))1105 if(cl.is_success()):1106 print('\t: cl.is_success() = True')1107 else:1108 print('\t: cl.is_success() = False')1109 print(cl.get_status_message())1110 print('addConstant(MyFormalisms.Utilities.z.body.expression43.funccall_expr44.argument49, atomvalue50, out_t, StringType)')1111 cl = self.mvk.create(MappingValue({1112 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Constant"),1113 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.expression43.funccall_expr44.argument49"),1114 CreateConstants.ATTRS_KEY: MappingValue({1115 StringValue("Expression.name"): StringValue("atomvalue50"),1116 StringValue("Constant.value"): StringValue("out_t"),1117 StringValue("Constant.type"): StringType()1118 })1119 }))1120 if(cl.is_success()):1121 print('\t: cl.is_success() = True')1122 else:1123 print('\t: cl.is_success() = False')1124 print(cl.get_status_message())1125 print('addReturnStm(MyFormalisms.Utilities.z.body, return_stm51)')1126 cl = self.mvk.create(MappingValue({1127 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.ReturnStatement"),1128 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body"),1129 CreateConstants.ATTRS_KEY: MappingValue({1130 StringValue("Statement.name"): StringValue("return_stm51")1131 })1132 }))1133 if(cl.is_success()):1134 print('\t: cl.is_success() = True')1135 else:1136 print('\t: cl.is_success() = False')1137 print(cl.get_status_message())1138 print('addFunctionCall(MyFormalisms.Utilities.z.body.return_stm51, funccall_expr52, joinTransitions)')1139 cl = self.mvk.create(MappingValue({1140 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),1141 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.return_stm51"),1142 CreateConstants.ATTRS_KEY: MappingValue({1143 StringValue("Expression.name"): StringValue("funccall_expr52"),1144 StringValue("FunctionCall.function_name"): StringValue("joinTransitions")1145 })1146 }))1147 if(cl.is_success()):1148 print('\t: cl.is_success() = True')1149 else:1150 print('\t: cl.is_success() = False')1151 print(cl.get_status_message())1152 print('addArgument(MyFormalisms.Utilities.z.body.return_stm51.funccall_expr52, argument53, )')1153 cl = self.mvk.create(MappingValue({1154 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1155 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.return_stm51.funccall_expr52"),1156 CreateConstants.ATTRS_KEY: MappingValue({1157 StringValue("Argument.key"): StringValue(""),1158 StringValue("Argument.name"): StringValue("argument53")1159 })1160 }))1161 if(cl.is_success()):1162 print('\t: cl.is_success() = True')1163 else:1164 print('\t: cl.is_success() = False')1165 print(cl.get_status_message())1166 print('addNavigation(MyFormalisms.Utilities.z.body.return_stm51.funccall_expr52.argument53, navigation54, pnInstance.t1)')1167 cl = self.mvk.create(MappingValue({1168 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1169 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.return_stm51.funccall_expr52.argument53"),1170 CreateConstants.ATTRS_KEY: MappingValue({1171 StringValue("Expression.name"): StringValue("navigation54"),1172 StringValue("Navigation.path"): LocationValue("pnInstance.t1")1173 })1174 }))1175 if(cl.is_success()):1176 print('\t: cl.is_success() = True')1177 else:1178 print('\t: cl.is_success() = False')1179 print(cl.get_status_message())1180 print('addArgument(MyFormalisms.Utilities.z.body.return_stm51.funccall_expr52, argument55, )')1181 cl = self.mvk.create(MappingValue({1182 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1183 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.return_stm51.funccall_expr52"),1184 CreateConstants.ATTRS_KEY: MappingValue({1185 StringValue("Argument.key"): StringValue(""),1186 StringValue("Argument.name"): StringValue("argument55")1187 })1188 }))1189 if(cl.is_success()):1190 print('\t: cl.is_success() = True')1191 else:1192 print('\t: cl.is_success() = False')1193 print(cl.get_status_message())1194 print('addNavigation(MyFormalisms.Utilities.z.body.return_stm51.funccall_expr52.argument55, navigation56, pnInstance.t2)')1195 cl = self.mvk.create(MappingValue({1196 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1197 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.z.body.return_stm51.funccall_expr52.argument55"),1198 CreateConstants.ATTRS_KEY: MappingValue({1199 StringValue("Expression.name"): StringValue("navigation56"),1200 StringValue("Navigation.path"): LocationValue("pnInstance.t2")1201 })1202 }))1203 if(cl.is_success()):1204 print('\t: cl.is_success() = True')1205 else:1206 print('\t: cl.is_success() = False')1207 print(cl.get_status_message())1208 print('addFunction(MyFormalisms.Utilities, joinTransitions, PetriNet.Place)')1209 cl = self.mvk.create(MappingValue({1210 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Function"),1211 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities"),1212 CreateConstants.ATTRS_KEY: MappingValue({1213 StringValue("Function.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.Place")),1214 StringValue("Function.name"): StringValue("joinTransitions")1215 })1216 }))1217 if(cl.is_success()):1218 print('\t: cl.is_success() = True')1219 else:1220 print('\t: cl.is_success() = False')1221 print(cl.get_status_message())1222 print('addFunctionParameter(MyFormalisms.Utilities, joinTransitions, f1, PetriNet.Transition, in)')1223 cl = self.mvk.create(MappingValue({1224 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Parameter"),1225 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions"),1226 CreateConstants.ATTRS_KEY: MappingValue({1227 StringValue("Parameter.parameter_type"): StringValue("in"),1228 StringValue("Parameter.name"): StringValue("f1"),1229 StringValue("Parameter.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.Transition"))1230 })1231 }))1232 if(cl.is_success()):1233 print('\t: cl.is_success() = True')1234 else:1235 print('\t: cl.is_success() = False')1236 print(cl.get_status_message())1237 print('addFunctionParameter(MyFormalisms.Utilities, joinTransitions, f2, PetriNet.Transition, in)')1238 cl = self.mvk.create(MappingValue({1239 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Parameter"),1240 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions"),1241 CreateConstants.ATTRS_KEY: MappingValue({1242 StringValue("Parameter.parameter_type"): StringValue("in"),1243 StringValue("Parameter.name"): StringValue("f2"),1244 StringValue("Parameter.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.Transition"))1245 })1246 }))1247 if(cl.is_success()):1248 print('\t: cl.is_success() = True')1249 else:1250 print('\t: cl.is_success() = False')1251 print(cl.get_status_message())1252 print('addDeclarationStm(MyFormalisms.Utilities.joinTransitions.body, type_declaration58)')1253 cl = self.mvk.create(MappingValue({1254 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.DeclarationStatement"),1255 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body"),1256 CreateConstants.ATTRS_KEY: MappingValue({1257 StringValue("Statement.name"): StringValue("type_declaration58")1258 })1259 }))1260 if(cl.is_success()):1261 print('\t: cl.is_success() = True')1262 else:1263 print('\t: cl.is_success() = False')1264 print(cl.get_status_message())1265 print('addIdentifier(MyFormalisms.Utilities.joinTransitions.body.type_declaration58, PetriNet.Place, p)')1266 cl = self.mvk.create(MappingValue({1267 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Identifier"),1268 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration58"),1269 CreateConstants.ATTRS_KEY: MappingValue({1270 StringValue("Expression.name"): StringValue("p"),1271 StringValue("Identifier.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.Place"))1272 })1273 }))1274 if(cl.is_success()):1275 print('\t: cl.is_success() = True')1276 else:1277 print('\t: cl.is_success() = False')1278 print(cl.get_status_message())1279 print('addExpressionStatement(MyFormalisms.Utilities.joinTransitions.body, expression59)')1280 cl = self.mvk.create(MappingValue({1281 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.ExpressionStatement"),1282 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body"),1283 CreateConstants.ATTRS_KEY: MappingValue({1284 StringValue("Statement.name"): StringValue("expression59")1285 })1286 }))1287 if(cl.is_success()):1288 print('\t: cl.is_success() = True')1289 else:1290 print('\t: cl.is_success() = False')1291 print(cl.get_status_message())1292 print('addFunctionCall(MyFormalisms.Utilities.joinTransitions.body.expression59, funccall_expr60, mvk.create)')1293 cl = self.mvk.create(MappingValue({1294 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),1295 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression59"),1296 CreateConstants.ATTRS_KEY: MappingValue({1297 StringValue("Expression.name"): StringValue("funccall_expr60"),1298 StringValue("FunctionCall.function_name"): StringValue("mvk.create")1299 })1300 }))1301 if(cl.is_success()):1302 print('\t: cl.is_success() = True')1303 else:1304 print('\t: cl.is_success() = False')1305 print(cl.get_status_message())1306 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60, argument61, )')1307 cl = self.mvk.create(MappingValue({1308 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1309 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60"),1310 CreateConstants.ATTRS_KEY: MappingValue({1311 StringValue("Argument.key"): StringValue(""),1312 StringValue("Argument.name"): StringValue("argument61")1313 })1314 }))1315 if(cl.is_success()):1316 print('\t: cl.is_success() = True')1317 else:1318 print('\t: cl.is_success() = False')1319 print(cl.get_status_message())1320 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60.argument61, navigation62, p)')1321 cl = self.mvk.create(MappingValue({1322 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1323 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60.argument61"),1324 CreateConstants.ATTRS_KEY: MappingValue({1325 StringValue("Expression.name"): StringValue("navigation62"),1326 StringValue("Navigation.path"): LocationValue("p")1327 })1328 }))1329 if(cl.is_success()):1330 print('\t: cl.is_success() = True')1331 else:1332 print('\t: cl.is_success() = False')1333 print(cl.get_status_message())1334 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60, argument63, )')1335 cl = self.mvk.create(MappingValue({1336 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1337 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60"),1338 CreateConstants.ATTRS_KEY: MappingValue({1339 StringValue("Argument.key"): StringValue(""),1340 StringValue("Argument.name"): StringValue("argument63")1341 })1342 }))1343 if(cl.is_success()):1344 print('\t: cl.is_success() = True')1345 else:1346 print('\t: cl.is_success() = False')1347 print(cl.get_status_message())1348 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60.argument63, navigation64, pnInstance)')1349 cl = self.mvk.create(MappingValue({1350 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1351 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60.argument63"),1352 CreateConstants.ATTRS_KEY: MappingValue({1353 StringValue("Expression.name"): StringValue("navigation64"),1354 StringValue("Navigation.path"): LocationValue("pnInstance")1355 })1356 }))1357 if(cl.is_success()):1358 print('\t: cl.is_success() = True')1359 else:1360 print('\t: cl.is_success() = False')1361 print(cl.get_status_message())1362 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60, argument65, )')1363 cl = self.mvk.create(MappingValue({1364 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1365 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60"),1366 CreateConstants.ATTRS_KEY: MappingValue({1367 StringValue("Argument.key"): StringValue(""),1368 StringValue("Argument.name"): StringValue("argument65")1369 })1370 }))1371 if(cl.is_success()):1372 print('\t: cl.is_success() = True')1373 else:1374 print('\t: cl.is_success() = False')1375 print(cl.get_status_message())1376 print('addConstant(MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60.argument65, atomvalue66, rep, StringType)')1377 cl = self.mvk.create(MappingValue({1378 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Constant"),1379 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression59.funccall_expr60.argument65"),1380 CreateConstants.ATTRS_KEY: MappingValue({1381 StringValue("Expression.name"): StringValue("atomvalue66"),1382 StringValue("Constant.value"): StringValue("rep"),1383 StringValue("Constant.type"): StringType()1384 })1385 }))1386 if(cl.is_success()):1387 print('\t: cl.is_success() = True')1388 else:1389 print('\t: cl.is_success() = False')1390 print(cl.get_status_message())1391 print('addDeclarationStm(MyFormalisms.Utilities.joinTransitions.body, type_declaration67)')1392 cl = self.mvk.create(MappingValue({1393 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.DeclarationStatement"),1394 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body"),1395 CreateConstants.ATTRS_KEY: MappingValue({1396 StringValue("Statement.name"): StringValue("type_declaration67")1397 })1398 }))1399 if(cl.is_success()):1400 print('\t: cl.is_success() = True')1401 else:1402 print('\t: cl.is_success() = False')1403 print(cl.get_status_message())1404 print('addIdentifier(MyFormalisms.Utilities.joinTransitions.body.type_declaration67, PetriNet.OutArc, a)')1405 cl = self.mvk.create(MappingValue({1406 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Identifier"),1407 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration67"),1408 CreateConstants.ATTRS_KEY: MappingValue({1409 StringValue("Expression.name"): StringValue("a"),1410 StringValue("Identifier.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.OutArc"))1411 })1412 }))1413 if(cl.is_success()):1414 print('\t: cl.is_success() = True')1415 else:1416 print('\t: cl.is_success() = False')1417 print(cl.get_status_message())1418 print('addFunctionCall(MyFormalisms.Utilities.joinTransitions.body.type_declaration67, funccall_expr68, PetriNet.OutArc)')1419 cl = self.mvk.create(MappingValue({1420 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),1421 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration67"),1422 CreateConstants.ATTRS_KEY: MappingValue({1423 StringValue("Expression.name"): StringValue("funccall_expr68"),1424 StringValue("FunctionCall.function_name"): StringValue("PetriNet.OutArc")1425 })1426 }))1427 if(cl.is_success()):1428 print('\t: cl.is_success() = True')1429 else:1430 print('\t: cl.is_success() = False')1431 print(cl.get_status_message())1432 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.type_declaration67.funccall_expr68, argument69, from_transition)')1433 cl = self.mvk.create(MappingValue({1434 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1435 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration67.funccall_expr68"),1436 CreateConstants.ATTRS_KEY: MappingValue({1437 StringValue("Argument.key"): StringValue("from_transition"),1438 StringValue("Argument.name"): StringValue("argument69")1439 })1440 }))1441 if(cl.is_success()):1442 print('\t: cl.is_success() = True')1443 else:1444 print('\t: cl.is_success() = False')1445 print(cl.get_status_message())1446 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.type_declaration67.funccall_expr68.argument69, navigation70, f1)')1447 cl = self.mvk.create(MappingValue({1448 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1449 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration67.funccall_expr68.argument69"),1450 CreateConstants.ATTRS_KEY: MappingValue({1451 StringValue("Expression.name"): StringValue("navigation70"),1452 StringValue("Navigation.path"): LocationValue("f1")1453 })1454 }))1455 if(cl.is_success()):1456 print('\t: cl.is_success() = True')1457 else:1458 print('\t: cl.is_success() = False')1459 print(cl.get_status_message())1460 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.type_declaration67.funccall_expr68, argument71, to_place)')1461 cl = self.mvk.create(MappingValue({1462 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1463 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration67.funccall_expr68"),1464 CreateConstants.ATTRS_KEY: MappingValue({1465 StringValue("Argument.key"): StringValue("to_place"),1466 StringValue("Argument.name"): StringValue("argument71")1467 })1468 }))1469 if(cl.is_success()):1470 print('\t: cl.is_success() = True')1471 else:1472 print('\t: cl.is_success() = False')1473 print(cl.get_status_message())1474 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.type_declaration67.funccall_expr68.argument71, navigation72, rep)')1475 cl = self.mvk.create(MappingValue({1476 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1477 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration67.funccall_expr68.argument71"),1478 CreateConstants.ATTRS_KEY: MappingValue({1479 StringValue("Expression.name"): StringValue("navigation72"),1480 StringValue("Navigation.path"): LocationValue("rep")1481 })1482 }))1483 if(cl.is_success()):1484 print('\t: cl.is_success() = True')1485 else:1486 print('\t: cl.is_success() = False')1487 print(cl.get_status_message())1488 print('addExpressionStatement(MyFormalisms.Utilities.joinTransitions.body, expression73)')1489 cl = self.mvk.create(MappingValue({1490 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.ExpressionStatement"),1491 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body"),1492 CreateConstants.ATTRS_KEY: MappingValue({1493 StringValue("Statement.name"): StringValue("expression73")1494 })1495 }))1496 if(cl.is_success()):1497 print('\t: cl.is_success() = True')1498 else:1499 print('\t: cl.is_success() = False')1500 print(cl.get_status_message())1501 print('addFunctionCall(MyFormalisms.Utilities.joinTransitions.body.expression73, funccall_expr74, mvk.create)')1502 cl = self.mvk.create(MappingValue({1503 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),1504 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression73"),1505 CreateConstants.ATTRS_KEY: MappingValue({1506 StringValue("Expression.name"): StringValue("funccall_expr74"),1507 StringValue("FunctionCall.function_name"): StringValue("mvk.create")1508 })1509 }))1510 if(cl.is_success()):1511 print('\t: cl.is_success() = True')1512 else:1513 print('\t: cl.is_success() = False')1514 print(cl.get_status_message())1515 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74, argument75, )')1516 cl = self.mvk.create(MappingValue({1517 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1518 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74"),1519 CreateConstants.ATTRS_KEY: MappingValue({1520 StringValue("Argument.key"): StringValue(""),1521 StringValue("Argument.name"): StringValue("argument75")1522 })1523 }))1524 if(cl.is_success()):1525 print('\t: cl.is_success() = True')1526 else:1527 print('\t: cl.is_success() = False')1528 print(cl.get_status_message())1529 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74.argument75, navigation76, a)')1530 cl = self.mvk.create(MappingValue({1531 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1532 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74.argument75"),1533 CreateConstants.ATTRS_KEY: MappingValue({1534 StringValue("Expression.name"): StringValue("navigation76"),1535 StringValue("Navigation.path"): LocationValue("a")1536 })1537 }))1538 if(cl.is_success()):1539 print('\t: cl.is_success() = True')1540 else:1541 print('\t: cl.is_success() = False')1542 print(cl.get_status_message())1543 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74, argument77, )')1544 cl = self.mvk.create(MappingValue({1545 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1546 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74"),1547 CreateConstants.ATTRS_KEY: MappingValue({1548 StringValue("Argument.key"): StringValue(""),1549 StringValue("Argument.name"): StringValue("argument77")1550 })1551 }))1552 if(cl.is_success()):1553 print('\t: cl.is_success() = True')1554 else:1555 print('\t: cl.is_success() = False')1556 print(cl.get_status_message())1557 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74.argument77, navigation78, pnInstance)')1558 cl = self.mvk.create(MappingValue({1559 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1560 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74.argument77"),1561 CreateConstants.ATTRS_KEY: MappingValue({1562 StringValue("Expression.name"): StringValue("navigation78"),1563 StringValue("Navigation.path"): LocationValue("pnInstance")1564 })1565 }))1566 if(cl.is_success()):1567 print('\t: cl.is_success() = True')1568 else:1569 print('\t: cl.is_success() = False')1570 print(cl.get_status_message())1571 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74, argument79, )')1572 cl = self.mvk.create(MappingValue({1573 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1574 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74"),1575 CreateConstants.ATTRS_KEY: MappingValue({1576 StringValue("Argument.key"): StringValue(""),1577 StringValue("Argument.name"): StringValue("argument79")1578 })1579 }))1580 if(cl.is_success()):1581 print('\t: cl.is_success() = True')1582 else:1583 print('\t: cl.is_success() = False')1584 print(cl.get_status_message())1585 print('addConstant(MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74.argument79, atomvalue80, in_rep1, StringType)')1586 cl = self.mvk.create(MappingValue({1587 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Constant"),1588 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression73.funccall_expr74.argument79"),1589 CreateConstants.ATTRS_KEY: MappingValue({1590 StringValue("Expression.name"): StringValue("atomvalue80"),1591 StringValue("Constant.value"): StringValue("in_rep1"),1592 StringValue("Constant.type"): StringType()1593 })1594 }))1595 if(cl.is_success()):1596 print('\t: cl.is_success() = True')1597 else:1598 print('\t: cl.is_success() = False')1599 print(cl.get_status_message())1600 print('addDeclarationStm(MyFormalisms.Utilities.joinTransitions.body, type_declaration81)')1601 cl = self.mvk.create(MappingValue({1602 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.DeclarationStatement"),1603 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body"),1604 CreateConstants.ATTRS_KEY: MappingValue({1605 StringValue("Statement.name"): StringValue("type_declaration81")1606 })1607 }))1608 if(cl.is_success()):1609 print('\t: cl.is_success() = True')1610 else:1611 print('\t: cl.is_success() = False')1612 print(cl.get_status_message())1613 print('addIdentifier(MyFormalisms.Utilities.joinTransitions.body.type_declaration81, PetriNet.OutArc, b)')1614 cl = self.mvk.create(MappingValue({1615 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Identifier"),1616 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration81"),1617 CreateConstants.ATTRS_KEY: MappingValue({1618 StringValue("Expression.name"): StringValue("b"),1619 StringValue("Identifier.type"): ClabjectReference(LocationValue("MyFormalisms.PetriNet.OutArc"))1620 })1621 }))1622 if(cl.is_success()):1623 print('\t: cl.is_success() = True')1624 else:1625 print('\t: cl.is_success() = False')1626 print(cl.get_status_message())1627 print('addFunctionCall(MyFormalisms.Utilities.joinTransitions.body.type_declaration81, funccall_expr82, PetriNet.OutArc)')1628 cl = self.mvk.create(MappingValue({1629 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),1630 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration81"),1631 CreateConstants.ATTRS_KEY: MappingValue({1632 StringValue("Expression.name"): StringValue("funccall_expr82"),1633 StringValue("FunctionCall.function_name"): StringValue("PetriNet.OutArc")1634 })1635 }))1636 if(cl.is_success()):1637 print('\t: cl.is_success() = True')1638 else:1639 print('\t: cl.is_success() = False')1640 print(cl.get_status_message())1641 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.type_declaration81.funccall_expr82, argument83, from_transition)')1642 cl = self.mvk.create(MappingValue({1643 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1644 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration81.funccall_expr82"),1645 CreateConstants.ATTRS_KEY: MappingValue({1646 StringValue("Argument.key"): StringValue("from_transition"),1647 StringValue("Argument.name"): StringValue("argument83")1648 })1649 }))1650 if(cl.is_success()):1651 print('\t: cl.is_success() = True')1652 else:1653 print('\t: cl.is_success() = False')1654 print(cl.get_status_message())1655 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.type_declaration81.funccall_expr82.argument83, navigation84, f2)')1656 cl = self.mvk.create(MappingValue({1657 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1658 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration81.funccall_expr82.argument83"),1659 CreateConstants.ATTRS_KEY: MappingValue({1660 StringValue("Expression.name"): StringValue("navigation84"),1661 StringValue("Navigation.path"): LocationValue("f2")1662 })1663 }))1664 if(cl.is_success()):1665 print('\t: cl.is_success() = True')1666 else:1667 print('\t: cl.is_success() = False')1668 print(cl.get_status_message())1669 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.type_declaration81.funccall_expr82, argument85, to_place)')1670 cl = self.mvk.create(MappingValue({1671 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1672 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration81.funccall_expr82"),1673 CreateConstants.ATTRS_KEY: MappingValue({1674 StringValue("Argument.key"): StringValue("to_place"),1675 StringValue("Argument.name"): StringValue("argument85")1676 })1677 }))1678 if(cl.is_success()):1679 print('\t: cl.is_success() = True')1680 else:1681 print('\t: cl.is_success() = False')1682 print(cl.get_status_message())1683 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.type_declaration81.funccall_expr82.argument85, navigation86, rep)')1684 cl = self.mvk.create(MappingValue({1685 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1686 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.type_declaration81.funccall_expr82.argument85"),1687 CreateConstants.ATTRS_KEY: MappingValue({1688 StringValue("Expression.name"): StringValue("navigation86"),1689 StringValue("Navigation.path"): LocationValue("rep")1690 })1691 }))1692 if(cl.is_success()):1693 print('\t: cl.is_success() = True')1694 else:1695 print('\t: cl.is_success() = False')1696 print(cl.get_status_message())1697 print('addExpressionStatement(MyFormalisms.Utilities.joinTransitions.body, expression87)')1698 cl = self.mvk.create(MappingValue({1699 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.ExpressionStatement"),1700 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body"),1701 CreateConstants.ATTRS_KEY: MappingValue({1702 StringValue("Statement.name"): StringValue("expression87")1703 })1704 }))1705 if(cl.is_success()):1706 print('\t: cl.is_success() = True')1707 else:1708 print('\t: cl.is_success() = False')1709 print(cl.get_status_message())1710 print('addFunctionCall(MyFormalisms.Utilities.joinTransitions.body.expression87, funccall_expr88, mvk.create)')1711 cl = self.mvk.create(MappingValue({1712 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.FunctionCall"),1713 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression87"),1714 CreateConstants.ATTRS_KEY: MappingValue({1715 StringValue("Expression.name"): StringValue("funccall_expr88"),1716 StringValue("FunctionCall.function_name"): StringValue("mvk.create")1717 })1718 }))1719 if(cl.is_success()):1720 print('\t: cl.is_success() = True')1721 else:1722 print('\t: cl.is_success() = False')1723 print(cl.get_status_message())1724 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88, argument89, )')1725 cl = self.mvk.create(MappingValue({1726 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1727 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88"),1728 CreateConstants.ATTRS_KEY: MappingValue({1729 StringValue("Argument.key"): StringValue(""),1730 StringValue("Argument.name"): StringValue("argument89")1731 })1732 }))1733 if(cl.is_success()):1734 print('\t: cl.is_success() = True')1735 else:1736 print('\t: cl.is_success() = False')1737 print(cl.get_status_message())1738 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88.argument89, navigation90, b)')1739 cl = self.mvk.create(MappingValue({1740 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1741 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88.argument89"),1742 CreateConstants.ATTRS_KEY: MappingValue({1743 StringValue("Expression.name"): StringValue("navigation90"),1744 StringValue("Navigation.path"): LocationValue("b")1745 })1746 }))1747 if(cl.is_success()):1748 print('\t: cl.is_success() = True')1749 else:1750 print('\t: cl.is_success() = False')1751 print(cl.get_status_message())1752 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88, argument91, )')1753 cl = self.mvk.create(MappingValue({1754 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1755 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88"),1756 CreateConstants.ATTRS_KEY: MappingValue({1757 StringValue("Argument.key"): StringValue(""),1758 StringValue("Argument.name"): StringValue("argument91")1759 })1760 }))1761 if(cl.is_success()):1762 print('\t: cl.is_success() = True')1763 else:1764 print('\t: cl.is_success() = False')1765 print(cl.get_status_message())1766 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88.argument91, navigation92, pnInstance)')1767 cl = self.mvk.create(MappingValue({1768 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1769 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88.argument91"),1770 CreateConstants.ATTRS_KEY: MappingValue({1771 StringValue("Expression.name"): StringValue("navigation92"),1772 StringValue("Navigation.path"): LocationValue("pnInstance")1773 })1774 }))1775 if(cl.is_success()):1776 print('\t: cl.is_success() = True')1777 else:1778 print('\t: cl.is_success() = False')1779 print(cl.get_status_message())1780 print('addArgument(MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88, argument93, )')1781 cl = self.mvk.create(MappingValue({1782 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Argument"),1783 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88"),1784 CreateConstants.ATTRS_KEY: MappingValue({1785 StringValue("Argument.key"): StringValue(""),1786 StringValue("Argument.name"): StringValue("argument93")1787 })1788 }))1789 if(cl.is_success()):1790 print('\t: cl.is_success() = True')1791 else:1792 print('\t: cl.is_success() = False')1793 print(cl.get_status_message())1794 print('addConstant(MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88.argument93, atomvalue94, in_rep2, StringType)')1795 cl = self.mvk.create(MappingValue({1796 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Constant"),1797 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.expression87.funccall_expr88.argument93"),1798 CreateConstants.ATTRS_KEY: MappingValue({1799 StringValue("Expression.name"): StringValue("atomvalue94"),1800 StringValue("Constant.value"): StringValue("in_rep2"),1801 StringValue("Constant.type"): StringType()1802 })1803 }))1804 if(cl.is_success()):1805 print('\t: cl.is_success() = True')1806 else:1807 print('\t: cl.is_success() = False')1808 print(cl.get_status_message())1809 print('addReturnStm(MyFormalisms.Utilities.joinTransitions.body, return_stm95)')1810 cl = self.mvk.create(MappingValue({1811 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.ReturnStatement"),1812 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body"),1813 CreateConstants.ATTRS_KEY: MappingValue({1814 StringValue("Statement.name"): StringValue("return_stm95")1815 })1816 }))1817 if(cl.is_success()):1818 print('\t: cl.is_success() = True')1819 else:1820 print('\t: cl.is_success() = False')1821 print(cl.get_status_message())1822 print('addNavigation(MyFormalisms.Utilities.joinTransitions.body.return_stm95, navigation96, p)')1823 cl = self.mvk.create(MappingValue({1824 CreateConstants.TYPE_KEY: LocationValue("protected.formalisms.ActionLanguage.Navigation"),1825 CreateConstants.LOCATION_KEY: LocationValue("MyFormalisms.Utilities.joinTransitions.body.return_stm95"),1826 CreateConstants.ATTRS_KEY: MappingValue({1827 StringValue("Expression.name"): StringValue("navigation96"),1828 StringValue("Navigation.path"): LocationValue("p")1829 })1830 }))1831 if(cl.is_success()):1832 print('\t: cl.is_success() = True')1833 else:1834 print('\t: cl.is_success() = False')1835 print(cl.get_status_message())1836if __name__ == "__main__":...
cache_test.py
Source:cache_test.py
...114 self.assertTrue(self.mvk.conforms_to(LocationValue('formalisms.Petrinets'), LocationValue('protected.formalisms.SimpleClassDiagrams')).get_result())115 def test_cache_read(self):116 self.create_petrinets()117 # First do an ordinary read of everything, hierarchically ordered118 self.assertTrue(self.mvk.read(LocationValue("")).is_success())119 self.assertTrue(self.mvk.read(LocationValue("formalisms")).is_success())120 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets")).is_success())121 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place")).is_success())122 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.name")).is_success())123 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.name")).is_success())124 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.is_abstract")).is_success())125 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.id_field")).is_success())126 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.tokens")).is_success())127 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition")).is_success())128 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.name")).is_success())129 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.name")).is_success())130 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.is_abstract")).is_success())131 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.id_field")).is_success())132 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.P2T")).is_success())133 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.P2T.name")).is_success())134 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.T2P")).is_success())135 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.T2P.name")).is_success())136 # Kill the cache ourself, note that this should normally not be done...137 self.mvk.read_cache.clear()138 # Now read again, but in a non-hierarchical order139 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.P2T.name")).is_success())140 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.name")).is_success())141 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.name")).is_success())142 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.is_abstract")).is_success())143 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets")).is_success())144 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.id_field")).is_success())145 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.name")).is_success())146 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.T2P.name")).is_success())147 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.tokens")).is_success())148 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.P2T")).is_success())149 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition")).is_success())150 self.assertTrue(self.mvk.read(LocationValue("formalisms")).is_success())151 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place")).is_success())152 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.is_abstract")).is_success())153 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.name")).is_success())154 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.id_field")).is_success())155 self.assertTrue(self.mvk.read(LocationValue("")).is_success())156 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.name")).is_success())157 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.T2P")).is_success())158 def test_cache_update(self):159 self.create_petrinets()160 # First do an ordinary read of everything, hierarchically ordered161 self.assertTrue(self.mvk.read(LocationValue("")).is_success())162 self.assertTrue(self.mvk.read(LocationValue("formalisms")).is_success())163 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets")).is_success())164 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place")).is_success())165 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.name")).is_success())166 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.name")).is_success())167 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.is_abstract")).is_success())168 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.id_field")).is_success())169 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.tokens")).is_success())170 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition")).is_success())171 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.name")).is_success())172 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.name")).is_success())173 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.is_abstract")).is_success())174 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.id_field")).is_success())175 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.P2T")).is_success())176 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.P2T.name")).is_success())177 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.T2P")).is_success())178 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.T2P.name")).is_success())179 # Now update the name of the Petrinets formalism180 ul = self.mvk.update(181 MappingValue({UpdateConstants.TYPE_KEY: LocationValue('protected.formalisms.SimpleClassDiagrams'),182 UpdateConstants.LOCATION_KEY: LocationValue('formalisms.Petrinets'),183 UpdateConstants.ATTRS_KEY: MappingValue({StringValue('SimpleClassDiagrams.name'): StringValue('My_Petrinets')})184 })185 )186 self.assertTrue(ul.is_success(), ul)187 # Read again in non-hierarchical method, but now on the new name, mixed with on the old name188 # Reads on the old name should fail (but might still be in cache!)189 # Reads on the new name should succeed (but might not yet be in cache!)190 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.P2T.name")).is_success())191 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.name")).is_success())192 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Transition")).is_success())193 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Place")).is_success())194 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.is_abstract")).is_success())195 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Place.Class.name")).is_success())196 self.assertTrue(self.mvk.read(LocationValue("formalisms")).is_success())197 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets")).is_success())198 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Transition.Class.id_field")).is_success())199 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.name")).is_success())200 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.P2T")).is_success())201 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.id_field")).is_success())202 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.name")).is_success())203 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Place.tokens")).is_success())204 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.T2P.name")).is_success())205 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.T2P")).is_success())206 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Transition.Class.is_abstract")).is_success())207 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Place.name")).is_success())208 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.tokens")).is_success())209 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Place.Class.id_field")).is_success())210 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.P2T")).is_success())211 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Transition.name")).is_success())212 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Transition.Class.name")).is_success())213 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Transition")).is_success())214 self.assertTrue(self.mvk.read(LocationValue("formalisms")).is_success())215 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place")).is_success())216 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.is_abstract")).is_success())217 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.T2P.name")).is_success())218 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.name")).is_success())219 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.Place.Class.is_abstract")).is_success())220 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.id_field")).is_success())221 self.assertTrue(self.mvk.read(LocationValue("")).is_success())222 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.name")).is_success())223 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets.P2T.name")).is_success())224 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.T2P")).is_success())225 self.assertTrue(self.mvk.read(LocationValue("")).is_success())226 self.assertTrue(self.mvk.read(LocationValue("formalisms.My_Petrinets")).is_success())227 def test_cache_update_root(self):228 self.create_petrinets()229 # First do an ordinary read of everything, hierarchically ordered230 self.assertTrue(self.mvk.read(LocationValue("")).is_success())231 self.assertTrue(self.mvk.read(LocationValue("formalisms")).is_success())232 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets")).is_success())233 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place")).is_success())234 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.name")).is_success())235 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.name")).is_success())236 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.is_abstract")).is_success())237 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.id_field")).is_success())238 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Place.tokens")).is_success())239 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition")).is_success())240 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.name")).is_success())241 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.name")).is_success())242 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.is_abstract")).is_success())243 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.id_field")).is_success())244 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.P2T")).is_success())245 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.P2T.name")).is_success())246 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.T2P")).is_success())247 self.assertTrue(self.mvk.read(LocationValue("formalisms.Petrinets.T2P.name")).is_success())248 # Now update the name of the Petrinets formalism249 ul = self.mvk.update(250 MappingValue({UpdateConstants.TYPE_KEY: LocationValue('mvk.object.Package'),251 UpdateConstants.LOCATION_KEY: LocationValue('formalisms'),252 UpdateConstants.ATTRS_KEY: MappingValue({StringValue('name'): StringValue('formalisms_v2')})253 })254 )255 self.assertTrue(ul.is_success(), ul)256 # Test again in different order257 # This is different from normal updates, as the topmost package doesn't have a link to destroy for invalidation258 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.name")).is_success())259 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2")).is_success())260 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets")).is_success())261 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Place")).is_success())262 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.name")).is_success())263 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Place.name")).is_success())264 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Transition")).is_success())265 self.assertTrue(self.mvk.read(LocationValue("")).is_success())266 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Place.Class.name")).is_success())267 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.P2T.name")).is_success())268 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Place.Class.is_abstract")).is_success())269 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.tokens")).is_success())270 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.T2P.name")).is_success())271 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Place.Class.id_field")).is_success())272 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.P2T")).is_success())273 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Place.tokens")).is_success())274 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.id_field")).is_success())275 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Transition")).is_success())276 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.name")).is_success())277 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Transition.name")).is_success())278 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets")).is_success())279 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.is_abstract")).is_success())280 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Transition.Class.name")).is_success())281 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Transition.Class.is_abstract")).is_success())282 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.id_field")).is_success())283 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.Transition.Class.id_field")).is_success())284 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.P2T")).is_success())285 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place.Class.is_abstract")).is_success())286 self.assertFalse(self.mvk.read(LocationValue("formalisms")).is_success())287 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.P2T.name")).is_success())288 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Transition.Class.name")).is_success())289 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.T2P")).is_success())290 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.T2P")).is_success())291 self.assertTrue(self.mvk.read(LocationValue("formalisms_v2.Petrinets.T2P.name")).is_success())292 self.assertFalse(self.mvk.read(LocationValue("formalisms.Petrinets.Place")).is_success())293#if __name__ == "__main__":294def runTests():...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!