PM_to_SCCD.mvc 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413
  1. include "primitives.alh"
  2. include "modelling.alh"
  3. include "object_operations.alh"
  4. Composite schedule {
  5. {Contains} Failure failure {}
  6. {Contains} Success success {}
  7. {Contains} Atomic create_orchestrator {
  8. LHS {
  9. Pre_SCCD/Diagram pre_diagram_0 {
  10. label = "0"
  11. }
  12. }
  13. RHS {
  14. Post_SCCD/Diagram post_diagram_0 {
  15. label = "0"
  16. }
  17. Post_SCCD/Class post_class_1 {
  18. label = "1"
  19. value_name = $
  20. String function value(model : Element, name : String, mapping : Element):
  21. return "Orchestrator"!
  22. $
  23. value_constructor_body = $
  24. String function value(model : Element, name : String, mapping : Element):
  25. return "self.queue=[], self.finish={}, self.token={}, self.data={}, self.decision_consumes={}, self.assn_names={}"!
  26. $
  27. value_default = $
  28. Boolean function value(model : Element, name : String, mapping : Element):
  29. return True!
  30. $
  31. }
  32. Post_SCCD/diagram_classes (post_diagram_0, post_class_1) {
  33. label = "2"
  34. }
  35. Post_SCCD/CompositeState post_cs_3 {
  36. label = "3"
  37. value_name = $
  38. String function value(model : Element, name : String, mapping : Element):
  39. return "Root"!
  40. $
  41. }
  42. Post_SCCD/behaviour (post_class_1, post_cs_3) {
  43. label = "4"
  44. }
  45. Post_SCCD/BasicState post_bs_5 {
  46. label = "5"
  47. value_name = $
  48. String function value(model : Element, name : String, mapping : Element):
  49. return "Init"!
  50. $
  51. value_isInitial = $
  52. Boolean function value(model : Element, name : String, mapping : Element):
  53. return True!
  54. $
  55. }
  56. Post_SCCD/composite_children (post_cs_3, post_bs_5) {
  57. label = "6"
  58. }
  59. Post_SCCD/ParallelState post_ps_7 {
  60. label = "7"
  61. value_name = $
  62. String function value(model : Element, name : String, mapping : Element):
  63. return "Running"!
  64. $
  65. }
  66. Post_SCCD/transition (post_bs_5, post_ps_7) {
  67. label = "8"
  68. }
  69. Post_SCCD/CompositeState post_cs_9 {
  70. label = "9"
  71. value_name = $
  72. String function value(model : Element, name : String, mapping : Element):
  73. return "Queue_spawn"!
  74. $
  75. }
  76. Post_SCCD/CompositeState post_cs_10 {
  77. label = "10"
  78. value_name = $
  79. String function value(model : Element, name : String, mapping : Element):
  80. return "Spawning"!
  81. $
  82. }
  83. Post_SCCD/parallel_children (post_ps_7, post_cs_9) {
  84. label = "11"
  85. }
  86. Post_SCCD/parallel_children (post_ps_7, post_cs_10) {
  87. label = "12"
  88. }
  89. Post_SCCD/composite_children (post_cs_3, post_ps_7) {
  90. label = "13"
  91. }
  92. Post_SCCD/BasicState post_bs_14 {
  93. label = "14"
  94. value_name = $
  95. String function value(model : Element, name : String, mapping : Element):
  96. return "Waiting"!
  97. $
  98. value_isInitial = $
  99. Boolean function value(model : Element, name : String, mapping : Element):
  100. return True!
  101. $
  102. }
  103. Post_SCCD/transition post_trans_15(post_bs_14, post_bs_14) {
  104. label = "15"
  105. value_event = $
  106. String function value(model : Element, name : String, mapping : Element):
  107. return "spawn_exec"!
  108. $
  109. value_script = $
  110. String function value(model : Element, name : String, mapping : Element):
  111. return "self.queue.append(exec_name)"!
  112. $
  113. }
  114. Post_SCCD/FormalParameter post_fp_16 {
  115. label = "16"
  116. value_name = $
  117. String function value(model : Element, name : String, mapping : Element):
  118. return "exec_name"!
  119. $
  120. }
  121. Post_SCCD/transition_parameters (post_trans_15, post_fp_16) {
  122. label = "17"
  123. value_order = $
  124. Integer function value(model : Element, name : String, mapping : Element):
  125. return 0!
  126. $
  127. }
  128. Post_SCCD/composite_children (post_cs_9, post_bs_14) {
  129. label = "18"
  130. }
  131. Post_SCCD/BasicState post_bs_19 {
  132. label = "19"
  133. value_name = $
  134. String function value(model : Element, name : String, mapping : Element):
  135. return "Waiting"!
  136. $
  137. value_isInitial = $
  138. Boolean function value(model : Element, name : String, mapping : Element):
  139. return True!
  140. $
  141. }
  142. Post_SCCD/BasicState post_bs_20 {
  143. label = "20"
  144. value_name = $
  145. String function value(model : Element, name : String, mapping : Element):
  146. return "Creating"!
  147. $
  148. }
  149. Post_SCCD/composite_children (post_cs_10, post_bs_19) {
  150. label = "21"
  151. }
  152. Post_SCCD/composite_children (post_cs_10, post_bs_20) {
  153. label = "22"
  154. }
  155. Post_SCCD/transition post_trans_23 (post_bs_19, post_bs_20) {
  156. label = "23"
  157. value_cond = $
  158. String function value(model : Element, name : String, mapping : Element):
  159. return "not self.queue"!
  160. $
  161. }
  162. Post_SCCD/Raise post_re_24 {
  163. label = "24"
  164. value_event = $
  165. String function value(model : Element, name : String, mapping : Element):
  166. return "create_instance"!
  167. $
  168. value_scope = $
  169. String function value(model : Element, name : String, mapping : Element):
  170. return "CD"!
  171. $
  172. }
  173. Post_SCCD/ActualParameter post_ap_25 {
  174. label = "25"
  175. value_exp = $
  176. String function value(model : Element, name : String, mapping : Element):
  177. return "'children'"!
  178. $
  179. }
  180. Post_SCCD/ActualParameter post_ap_26 {
  181. label = "26"
  182. value_exp = $
  183. String function value(model : Element, name : String, mapping : Element):
  184. return "'Activity'"!
  185. $
  186. }
  187. Post_SCCD/raise_parameters (post_re_24, post_ap_25) {
  188. label = "27"
  189. value_order = $
  190. Integer function value(model : Element, name : String, mapping : Element):
  191. return 0!
  192. $
  193. }
  194. Post_SCCD/raise_parameters (post_re_24, post_ap_26) {
  195. label = "28"
  196. value_order = $
  197. Integer function value(model : Element, name : String, mapping : Element):
  198. return 1!
  199. $
  200. }
  201. Post_SCCD/transition_raises (post_trans_23, post_re_24) {
  202. label = "29"
  203. }
  204. Post_SCCD/transition post_trans_30 (post_bs_20, post_bs_19) {
  205. label = "30"
  206. value_event = $
  207. String function value(model : Element, name : String, mapping : Element):
  208. return "instance_created"!
  209. $
  210. value_script = $
  211. String function value(model : Element, name : String, mapping : Element):
  212. return "self.assn_names[self.queue.pop(0)] = association_name"!
  213. $
  214. }
  215. Post_SCCD/FormalParameter post_fp_31 {
  216. label = "31"
  217. value_name = $
  218. String function value(model : Element, name : String, mapping : Element):
  219. return "association_name"!
  220. $
  221. }
  222. Post_SCCD/transition_parameters (post_trans_30, post_fp_31) {
  223. label = "32"
  224. value_order = $
  225. Integer function value(model : Element, name : String, mapping : Element):
  226. return 0!
  227. $
  228. }
  229. Post_SCCD/BasicState post_bs_33 {
  230. label = "33"
  231. value_name = $
  232. String function value(model : Element, name : String, mapping : Element):
  233. return "End"!
  234. $
  235. }
  236. Post_SCCD/composite_children (post_cs_3, post_bs_33) {
  237. label = "34"
  238. }
  239. Post_SCCD/transition post_trans_35 (post_ps_7, post_bs_33) {
  240. label = "35"
  241. value_event = $
  242. String function value(model : Element, name : String, mapping : Element):
  243. return "process_done"!
  244. $
  245. }
  246. }
  247. }
  248. {Contains} ForAll create_class_association {
  249. LHS {
  250. Pre_SCCD/Class {
  251. label = "0"
  252. constraint_name = $
  253. Boolean function constraint(value : String):
  254. return (value != "Orchestrator")!
  255. $
  256. }
  257. Pre_SCCD/Class {
  258. label = "1"
  259. constraint_name = $
  260. Boolean function constraint(value : String):
  261. return (value == "Orchestrator")!
  262. $
  263. }
  264. }
  265. RHS {
  266. Post_SCCD/Class post_exec_class_0{
  267. label = "0"
  268. }
  269. Post_SCCD/Class post_orchestrator_class_1{
  270. label = "1"
  271. }
  272. Post_SCCD/association (post_orchestrator_class_1, post_exec_class_0){
  273. label = "3"
  274. value_name = $
  275. String function value(model : Element, name : String, mapping : Element):
  276. return "children"!
  277. $
  278. }
  279. }
  280. }
  281. {Contains} ForAll initialize {
  282. LHS {
  283. Pre_PM/Activity {
  284. label = "0"
  285. }
  286. Pre_SCCD/BasicState {
  287. label = "1"
  288. constraint_name = $
  289. Boolean function constraint(value : String):
  290. return (value == "Init")!
  291. $
  292. }
  293. constraint = $
  294. Boolean function constraint (model : Element, mapping : Element):
  295. Element comp_children
  296. String parent
  297. Element class_beh
  298. String class
  299. comp_children = allIncomingAssociationInstances(model, mapping["1"], "composite_children")
  300. parent = readAssociationSource(model, set_pop(comp_children))
  301. class_beh = allIncomingAssociationInstances(model, parent, "behaviour")
  302. class = readAssociationSource(model, set_pop(class_beh))
  303. if (value_eq(read_attribute(model, class, "name"), "Orchestrator")):
  304. return True!
  305. else:
  306. return False!
  307. $
  308. }
  309. RHS {
  310. Post_PM/Activity post_activity_0{
  311. label = "0"
  312. }
  313. Post_SCCD/BasicState post_init_bs_1{
  314. label = "1"
  315. value_onEntryScript = $
  316. String function value(model : Element, name : String, mapping : Element):
  317. String type
  318. String joined_str
  319. Element outgoing_assns
  320. String edge
  321. String activity
  322. type = read_type(model, mapping["0"])
  323. if (type == "Start"):
  324. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  325. return string_join(joined_str, "]= True")!
  326. elif (type == "Decision"):
  327. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  328. joined_str = string_join(joined_str, "]= False , self.decision_consumes[")
  329. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  330. return string_join(joined_str, "]= None")!
  331. elif bool_or(type == "Join", type == "Finish"):
  332. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  333. return string_join(joined_str, "]= False")!
  334. elif (type == "Exec"):
  335. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  336. joined_str = string_join(joined_str, "]= False , self.finish[")
  337. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  338. return string_join(joined_str, "]= False")!
  339. elif (type == "Fork"):
  340. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  341. joined_str = string_join(joined_str, "]= False ,self.finish[")
  342. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  343. joined_str = string_join(joined_str, "]= {")
  344. outgoing_assns = allOutgoingAssociationInstances(model, mapping["0"], "Next")
  345. while (read_nr_out(outgoing_assns) > 0):
  346. edge = set_pop(outgoing_assns)
  347. activity = readAssociationDestination(model, edge)
  348. joined_str = string_join(joined_str,read_attribute(model, activity, "id"))
  349. joined_str = string_join(joined_str, ": False ")
  350. if (read_nr_out(outgoing_assns) == 0):
  351. joined_str = string_join(joined_str, "}")
  352. else:
  353. joined_str = string_join(joined_str, ",")
  354. return joined_str!
  355. $
  356. }
  357. }
  358. }
  359. {Contains} ForAll map_exec {
  360. LHS {
  361. Pre_PM/Activity pre_exec_0 {
  362. label = "0"
  363. }
  364. Pre_PM/Exec pre_exec_1 {
  365. label = "1"
  366. }
  367. Pre_PM/Next pre_next_2 (pre_exec_0, pre_exec_1) {
  368. label = "2"
  369. }
  370. Pre_SCCD/ParallelState pre_ps_3 {
  371. label = "3"
  372. constraint_name = $
  373. Boolean function constraint(value : String):
  374. return (value == "Running")!
  375. $
  376. }
  377. constraint = $
  378. Boolean function constraint (model : Element, mapping : Element):
  379. Element children
  380. String parent
  381. Element class_beh
  382. String class
  383. children = allIncomingAssociationInstances(model, mapping["3"], "composite_children")
  384. parent = readAssociationSource(model, set_pop(children))
  385. class_beh = allIncomingAssociationInstances(model, parent, "behaviour")
  386. class = readAssociationSource(model, set_pop(class_beh))
  387. if (value_eq(read_attribute(model, class, "name"), "Orchestrator")):
  388. return True!
  389. else:
  390. return False!
  391. $
  392. }
  393. RHS {
  394. Post_PM/Activity post_exec_0 {
  395. label = "0"
  396. }
  397. Post_PM/Exec post_exec_1 {
  398. label = "1"
  399. }
  400. Post_PM/Next post_flow_2 (post_exec_0, post_exec_1) {
  401. label = "2"
  402. }
  403. Post_SCCD/ParallelState post_ps_3 {
  404. label = "3"
  405. }
  406. Post_SCCD/CompositeState post_cs_4 {
  407. label = "4"
  408. value_name = $
  409. String function value(model : Element, name : String, mapping : Element):
  410. return name!
  411. $
  412. }
  413. Post_SCCD/parallel_children post_ps_5 (post_ps_3, post_cs_4) {
  414. label = "5"
  415. }
  416. Post_SCCD/BasicState post_bs_6 {
  417. label = "6"
  418. value_name = $
  419. String function value(model : Element, name : String, mapping : Element):
  420. return "Waiting"!
  421. $
  422. value_isInitial = $
  423. Boolean function value(model : Element, name : String, mapping : Element):
  424. return True!
  425. $
  426. }
  427. Post_SCCD/BasicState post_bs_7 {
  428. label = "7"
  429. value_name = $
  430. String function value(model : Element, name : String, mapping : Element):
  431. return "Running"!
  432. $
  433. }
  434. Post_SCCD/composite_children post_cc_8 (post_cs_4, post_bs_6) {
  435. label = "8"
  436. }
  437. Post_SCCD/composite_children post_cc_9 (post_cs_4, post_bs_7) {
  438. label = "9"
  439. }
  440. Post_SCCD/transition post_trans_10 (post_bs_6, post_bs_7) {
  441. label = "10"
  442. value_cond = $
  443. String function value(model : Element, name : String, mapping : Element):
  444. String type
  445. String joined_str
  446. type = read_type(model, mapping["0"])
  447. if bool_or(type == "Join", type == "Start"):
  448. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  449. return string_join(joined_str, "]")!
  450. elif (type == "Decision"):
  451. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  452. joined_str = string_join(joined_str, "] and self.decision_consumes[")
  453. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  454. joined_str = string_join(joined_str, "]==")
  455. return string_join(joined_str, read_attribute(model, mapping["2"], "value"))!
  456. elif (type == "Exec"):
  457. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  458. joined_str = string_join(joined_str, "] and self.finish[")
  459. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  460. return string_join(joined_str, "]")!
  461. elif (type == "Fork"):
  462. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  463. joined_str = string_join(joined_str, "] and self.finish[")
  464. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  465. joined_str = string_join(joined_str, "][")
  466. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  467. return string_join(joined_str, "]==False")!
  468. $
  469. value_script = $
  470. String function value(model : Element, name : String, mapping : Element):
  471. String type
  472. String joined_str
  473. type = read_type(model, mapping["0"])
  474. if bool_or(bool_or(type == "Join", type == "Start"), type == "Decision"):
  475. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  476. joined_str = string_join(joined_str, "]= False, self.token[")
  477. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  478. return string_join(joined_str, "]= True")!
  479. elif (type == "Fork"):
  480. joined_str = string_join("self.token[", read_attribute(model, mapping["1"], "id"))
  481. return string_join(joined_str, "] = True")!
  482. elif (type == "Exec"):
  483. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  484. joined_str = string_join(joined_str, "] = False, self.finish[")
  485. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  486. joined_str = string_join(joined_str, "] = False, self.token[")
  487. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  488. return string_join(joined_str, "]=True")!
  489. $
  490. }
  491. Post_SCCD/Raise post_re_11 {
  492. label = "11"
  493. value_event = $
  494. String function value(model : Element, name : String, mapping : Element):
  495. return "spawn_exec"!
  496. $
  497. value_scope = $
  498. String function value(model : Element, name : String, mapping : Element):
  499. return "local"!
  500. $
  501. }
  502. Post_SCCD/ActualParameter post_rap_25 {
  503. label = "12"
  504. value_exp = $
  505. String function value(model : Element, name : String, mapping : Element):
  506. return read_attribute(model, mapping["1"], "name")!
  507. $
  508. }
  509. Post_SCCD/raise_parameters (post_re_11, post_rap_25) {
  510. label = "13"
  511. value_order = $
  512. Integer function value(model : Element, name : String, mapping : Element):
  513. return 0!
  514. $
  515. }
  516. Post_SCCD/transition_raises (post_trans_10, post_re_11) {
  517. label = "14"
  518. }
  519. Post_SCCD/transition post_etrans_15 (post_bs_7, post_bs_6) {
  520. label = "15"
  521. value_event = $
  522. String function value(model : Element, name : String, mapping : Element):
  523. return "terminated"!
  524. $
  525. value_cond = $
  526. String function value(model : Element, name : String, mapping : Element):
  527. String joined_str
  528. joined_str = string_join(read_attribute(model, mapping["1"], "name"), "==")
  529. return string_join(joined_str, "exec_name")!
  530. $
  531. value_script = $
  532. String function value(model : Element, name : String, mapping : Element):
  533. String type
  534. String joined_str
  535. type = read_type(model, mapping["0"])
  536. if (type == "Fork"):
  537. joined_str = string_join("self.finish[", read_attribute(model, mapping["1"], "id"))
  538. joined_str = string_join(joined_str, "] =True, self.finish[")
  539. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  540. joined_str = string_join(joined_str, "][")
  541. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  542. return string_join(joined_str, "]=True")!
  543. else:
  544. joined_str = string_join("self.finish[", read_attribute(model, mapping["1"], "id"))
  545. return string_join(joined_str, "]=True")!
  546. $
  547. }
  548. Post_SCCD/FormalParameter post_efp_16 {
  549. label = "16"
  550. value_name = $
  551. String function value(model : Element, name : String, mapping : Element):
  552. return "exec_name"!
  553. $
  554. }
  555. Post_SCCD/transition_parameters (post_etrans_15, post_efp_16) {
  556. label = "17"
  557. value_order = $
  558. Integer function value(model : Element, name : String, mapping : Element):
  559. return 0!
  560. $
  561. }
  562. Post_Activity2State_link (post_exec_0, post_cs_4){
  563. label = "18"
  564. }
  565. }
  566. }
  567. {Contains} ForAll data_produces {
  568. LHS {
  569. Pre_PM/Exec pre_exec_data_0 {
  570. label = "0"
  571. }
  572. Pre_PM/Data pre_data_1 {
  573. label = "1"
  574. }
  575. Pre_PM/Produces pre_pro_2 (pre_exec_data_0, pre_data_1) {
  576. label = "2"
  577. }
  578. Pre_SCCD/CompositeState pre_co_3 {
  579. label = "3"
  580. }
  581. Pre_Activity2State_link (pre_exec_data_0, pre_co_3){
  582. label = "4"
  583. }
  584. Pre_SCCD/BasicState pre_bs_5 {
  585. label = "5"
  586. }
  587. Pre_SCCD/composite_children (pre_co_3, pre_bs_5) {
  588. label = "6"
  589. }
  590. }
  591. RHS {
  592. Post_PM/Exec post_exec_data_0 {
  593. label = "0"
  594. }
  595. Post_PM/Data post_data_1 {
  596. label = "1"
  597. }
  598. Post_PM/Produces post_pro_2 (post_exec_data_0, post_data_1) {
  599. label = "2"
  600. }
  601. Post_SCCD/CompositeState post_co_3 {
  602. label = "3"
  603. }
  604. Post_Activity2State_link (post_exec_data_0, post_co_3){
  605. label = "4"
  606. }
  607. Post_SCCD/BasicState post_pbs_5 {
  608. label = "5"
  609. }
  610. Post_SCCD/composite_children (post_co_3, post_pbs_5) {
  611. label = "6"
  612. }
  613. Post_SCCD/transition post_trans_7 (post_pbs_5, post_pbs_5) {
  614. label = "7"
  615. value_event = $
  616. String function value(model : Element, name : String, mapping : Element):
  617. return "save"!
  618. $
  619. value_cond = $
  620. String function value(model : Element, name : String, mapping : Element):
  621. return string_join(read_attribute(model, mapping["0"], "name"), "== exec_name")!
  622. $
  623. value_script = $
  624. String function value(model : Element, name : String, mapping : Element):
  625. return "'self.data['+ data_name +']= get_full_model('+ data_name +')'"!
  626. $
  627. }
  628. Post_SCCD/FormalParameter post_fp_8 {
  629. label = "8"
  630. value_name = $
  631. String function value(model : Element, name : String, mapping : Element):
  632. return "data_name"!
  633. $
  634. }
  635. Post_SCCD/FormalParameter post_fp_9 {
  636. label = "9"
  637. value_name = $
  638. String function value(model : Element, name : String, mapping : Element):
  639. return "exec_name"!
  640. $
  641. }
  642. Post_SCCD/transition_parameters (post_trans_7, post_fp_8) {
  643. label = "10"
  644. value_order = $
  645. Integer function value(model : Element, name : String, mapping : Element):
  646. return 0!
  647. $
  648. }
  649. Post_SCCD/transition_parameters (post_trans_7, post_fp_9) {
  650. label = "11"
  651. value_order = $
  652. Integer function value(model : Element, name : String, mapping : Element):
  653. return 1!
  654. $
  655. }
  656. }
  657. }
  658. {Contains} ForAll data_consumes {
  659. LHS {
  660. Pre_PM/Exec pre_exec_consumes_0 {
  661. label = "0"
  662. }
  663. Pre_PM/Data pre_data_consumes_1 {
  664. label = "1"
  665. }
  666. Pre_PM/Consumes pre_con_2 (pre_exec_consumes_0, pre_data_consumes_1) {
  667. label = "2"
  668. }
  669. Pre_SCCD/CompositeState pre_cs_3 {
  670. label = "3"
  671. }
  672. Pre_Activity2State_link (pre_exec_consumes_0, pre_cs_3){
  673. label = "4"
  674. }
  675. Pre_SCCD/BasicState pre_consumes_bs_5 {
  676. label = "5"
  677. }
  678. Pre_SCCD/composite_children (pre_cs_3, pre_consumes_bs_5) {
  679. label = "6"
  680. }
  681. }
  682. RHS {
  683. Post_PM/Exec post_exec_consumes_0 {
  684. label = "0"
  685. }
  686. Post_PM/Data post_data_consumes_1 {
  687. label = "1"
  688. }
  689. Post_PM/Consumes post_con_2 (post_exec_consumes_0, post_data_consumes_1) {
  690. label = "2"
  691. }
  692. Post_SCCD/CompositeState post_ccs_3 {
  693. label = "3"
  694. }
  695. Post_Activity2State_link (post_exec_consumes_0, post_ccs_3){
  696. label = "4"
  697. }
  698. Post_SCCD/BasicState post_bs_consumes_5 {
  699. label = "5"
  700. }
  701. Post_SCCD/composite_children (post_ccs_3, post_bs_consumes_5) {
  702. label = "6"
  703. }
  704. Post_SCCD/transition post_trans_consumes_7 (post_bs_consumes_5, post_bs_consumes_5) {
  705. label = "7"
  706. value_event = $
  707. String function value(model : Element, name : String, mapping : Element):
  708. return "load"!
  709. $
  710. value_cond = $
  711. String function value(model : Element, name : String, mapping : Element):
  712. return string_join(read_attribute(model, mapping["0"], "name"), "== exec_name")!
  713. $
  714. }
  715. Post_SCCD/FormalParameter post_trans_fp_8 {
  716. label = "8"
  717. value_name = $
  718. String function value(model : Element, name : String, mapping : Element):
  719. return "data_name"!
  720. $
  721. }
  722. Post_SCCD/FormalParameter post_trans_fp_9 {
  723. label = "9"
  724. value_name = $
  725. String function value(model : Element, name : String, mapping : Element):
  726. return "exec_name"!
  727. $
  728. }
  729. Post_SCCD/transition_parameters (post_trans_consumes_7, post_trans_fp_8) {
  730. label = "10"
  731. value_order = $
  732. Integer function value(model : Element, name : String, mapping : Element):
  733. return 0!
  734. $
  735. }
  736. Post_SCCD/transition_parameters (post_trans_consumes_7, post_trans_fp_9) {
  737. label = "11"
  738. value_order = $
  739. Integer function value(model : Element, name : String, mapping : Element):
  740. return 1!
  741. $
  742. }
  743. Post_SCCD/Raise post_re_12 {
  744. label = "12"
  745. value_event = $
  746. String function value(model : Element, name : String, mapping : Element):
  747. return "load"!
  748. $
  749. value_scope = $
  750. String function value(model : Element, name : String, mapping : Element):
  751. return "narrow"!
  752. $
  753. value_target = $
  754. String function value(model : Element, name : String, mapping : Element):
  755. String joined_str
  756. joined_str = string_join("self.assn_names[", read_attribute(model, mapping["0"], "name"))
  757. return string_join(joined_str, "]")!
  758. $
  759. }
  760. Post_SCCD/ActualParameter post_ap_13 {
  761. label = "13"
  762. value_exp = $
  763. String function value(model : Element, name : String, mapping : Element):
  764. return "self.data[data_name]"!
  765. $
  766. }
  767. Post_SCCD/raise_parameters (post_re_12, post_ap_13) {
  768. label = "14"
  769. value_order = $
  770. Integer function value(model : Element, name : String, mapping : Element):
  771. return 0!
  772. $
  773. }
  774. Post_SCCD/transition_raises (post_trans_consumes_7, post_re_12){
  775. label = "15"
  776. }
  777. }
  778. }
  779. {Contains} ForAll map_decision {
  780. LHS {
  781. Pre_PM/Activity pre_0 {
  782. label = "0"
  783. }
  784. Pre_PM/Decision pre_1 {
  785. label = "1"
  786. }
  787. Pre_PM/Next (pre_0, pre_1) {
  788. label = "2"
  789. }
  790. Pre_PM/Data pre_3 {
  791. label = "3"
  792. }
  793. Pre_PM/Consumes (pre_1, pre_3) {
  794. label = "4"
  795. }
  796. Pre_SCCD/ParallelState pre_5 {
  797. label = "5"
  798. constraint_name = $
  799. Boolean function constraint(value : String):
  800. return (value == "Running")!
  801. $
  802. }
  803. constraint = $
  804. Boolean function constraint (model : Element, mapping : Element):
  805. Element children
  806. String parent
  807. Element class_beh
  808. String class
  809. children = allIncomingAssociationInstances(model, mapping["5"], "composite_children")
  810. parent = readAssociationSource(model, set_pop(children))
  811. class_beh = allIncomingAssociationInstances(model, parent, "behaviour")
  812. class = readAssociationSource(model, set_pop(class_beh))
  813. if (value_eq(read_attribute(model, class, "name"), "Orchestrator")):
  814. return True!
  815. else:
  816. return False!
  817. $
  818. }
  819. RHS {
  820. Post_PM/Activity post_0 {
  821. label = "0"
  822. }
  823. Post_PM/Decision post_1 {
  824. label = "1"
  825. }
  826. Post_PM/Next (post_0, post_1) {
  827. label = "2"
  828. }
  829. Post_PM/Data post_3 {
  830. label = "3"
  831. }
  832. Post_PM/Consumes (post_1, post_3) {
  833. label = "4"
  834. }
  835. Post_SCCD/ParallelState post_5 {
  836. label = "5"
  837. }
  838. Post_SCCD/CompositeState post_6 {
  839. label = "6"
  840. value_name = $
  841. String function value(model : Element, name : String, mapping : Element):
  842. return name!
  843. $
  844. }
  845. Post_SCCD/parallel_children (post_5, post_6) {
  846. label = "7"
  847. }
  848. Post_SCCD/BasicState post_8 {
  849. label = "8"
  850. value_name = $
  851. String function value(model : Element, name : String, mapping : Element):
  852. return "Waiting"!
  853. $
  854. value_isInitial = $
  855. Boolean function value(model : Element, name : String, mapping : Element):
  856. return True!
  857. $
  858. }
  859. Post_SCCD/composite_children (post_6, post_8) {
  860. label = "9"
  861. }
  862. Post_SCCD/transition post_10(post_8, post_8) {
  863. label = "10"
  864. value_cond = $
  865. String function value(model : Element, name : String, mapping : Element):
  866. String type
  867. String joined_str
  868. type = read_type(model, mapping["0"])
  869. if bool_or(type == "Join", type == "Start"):
  870. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  871. return string_join(joined_str, "]")!
  872. elif (type == "Decision"):
  873. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  874. joined_str = string_join(joined_str, "] and self.decision_consumes[")
  875. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  876. joined_str = string_join(joined_str, "]==")
  877. return string_join(joined_str, read_attribute(model, mapping["2"], "value"))!
  878. elif (type == "Exec"):
  879. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  880. joined_str = string_join(joined_str, "] and self.finish[")
  881. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  882. return string_join(joined_str, "]")!
  883. elif (type == "Fork"):
  884. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  885. joined_str = string_join(joined_str, "] and self.finish[")
  886. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  887. joined_str = string_join(joined_str, "][")
  888. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  889. return string_join(joined_str, "]==False")!
  890. $
  891. value_script = $
  892. String function value(model : Element, name : String, mapping : Element):
  893. String type
  894. String joined_str
  895. type = read_type(model, mapping["0"])
  896. if bool_or(bool_or(type == "Join", type == "Start"), type == "Decision"):
  897. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  898. joined_str = string_join(joined_str, "]= False, self.token[")
  899. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  900. joined_str = string_join(joined_str, "]= True, self.data_consumes[")
  901. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  902. joined_str = string_join(joined_str, "]= self.data[")
  903. joined_str = string_join(joined_str, read_attribute(model, mapping["3"], "name"))
  904. return string_join(joined_str, "]")!
  905. elif (type == "Fork"):
  906. joined_str = string_join("self.token[", read_attribute(model, mapping["1"], "id"))
  907. joined_str = string_join(joined_str, "] = True , self.finish[")
  908. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  909. joined_str = string_join("][", read_attribute(model, mapping["1"], "id"))
  910. joined_str = string_join(joined_str, "]=True, self.data_consumes[")
  911. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  912. joined_str = string_join(joined_str, "]= self.data[")
  913. joined_str = string_join(joined_str, read_attribute(model, mapping["3"], "name"))
  914. return string_join(joined_str, "]")!
  915. elif (type == "Exec"):
  916. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  917. joined_str = string_join(joined_str, "] = False, self.finish[")
  918. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  919. joined_str = string_join(joined_str, "] = False, self.token[")
  920. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  921. joined_str = string_join(joined_str, "]=True, self.data_consumes[")
  922. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  923. joined_str = string_join(joined_str, "]= self.data[")
  924. joined_str = string_join(joined_str, read_attribute(model, mapping["3"], "name"))
  925. return string_join(joined_str, "]")!
  926. $
  927. }
  928. Post_Activity2State_link (post_1, post_6){
  929. label = "11"
  930. }
  931. }
  932. }
  933. {Contains} ForAll map_fork {
  934. LHS {
  935. Pre_PM/Activity pre_f_0 {
  936. label = "0"
  937. }
  938. Pre_PM/Fork pre_f_1 {
  939. label = "1"
  940. }
  941. Pre_PM/Next (pre_f_0, pre_f_1) {
  942. label = "2"
  943. }
  944. Pre_SCCD/ParallelState pre_f_3 {
  945. label = "3"
  946. constraint_name = $
  947. Boolean function constraint(value : String):
  948. return (value == "Running")!
  949. $
  950. }
  951. constraint = $
  952. Boolean function constraint (model : Element, mapping : Element):
  953. Element children
  954. String parent
  955. Element class_beh
  956. String class
  957. children = allIncomingAssociationInstances(model, mapping["3"], "composite_children")
  958. parent = readAssociationSource(model, set_pop(children))
  959. class_beh = allIncomingAssociationInstances(model, parent, "behaviour")
  960. class = readAssociationSource(model, set_pop(class_beh))
  961. if (value_eq(read_attribute(model, class, "name"), "Orchestrator")):
  962. return True!
  963. else:
  964. return False!
  965. $
  966. }
  967. RHS {
  968. Post_PM/Activity post_f_0 {
  969. label = "0"
  970. }
  971. Post_PM/Fork post_f_1 {
  972. label = "1"
  973. }
  974. Post_PM/Next (post_f_0, post_f_1) {
  975. label = "2"
  976. }
  977. Post_SCCD/ParallelState post_f_3 {
  978. label = "3"
  979. }
  980. Post_SCCD/CompositeState post_f_6 {
  981. label = "6"
  982. value_name = $
  983. String function value(model : Element, name : String, mapping : Element):
  984. return name!
  985. $
  986. }
  987. Post_SCCD/parallel_children (post_f_3, post_f_6) {
  988. label = "7"
  989. }
  990. Post_SCCD/BasicState post_f_8 {
  991. label = "8"
  992. value_name = $
  993. String function value(model : Element, name : String, mapping : Element):
  994. return "Waiting"!
  995. $
  996. value_isInitial = $
  997. Boolean function value(model : Element, name : String, mapping : Element):
  998. return True!
  999. $
  1000. }
  1001. Post_SCCD/BasicState post_f_9 {
  1002. label = "9"
  1003. value_name = $
  1004. String function value(model : Element, name : String, mapping : Element):
  1005. return "Running"!
  1006. $
  1007. }
  1008. Post_SCCD/composite_children (post_f_6, post_f_8) {
  1009. label = "10"
  1010. }
  1011. Post_SCCD/composite_children (post_f_6, post_f_9) {
  1012. label = "11"
  1013. }
  1014. Post_SCCD/transition post_f_12(post_f_8, post_f_9) {
  1015. label = "12"
  1016. value_cond = $
  1017. String function value(model : Element, name : String, mapping : Element):
  1018. String type
  1019. String joined_str
  1020. type = read_type(model, mapping["0"])
  1021. if bool_or(type == "Join", type == "Start"):
  1022. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  1023. joined_str = string_join(joined_str, "] and self.token[")
  1024. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  1025. return string_join(joined_str, "]==False")!
  1026. elif (type == "Decision"):
  1027. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  1028. joined_str = string_join(joined_str, "] and self.decision_consumes[")
  1029. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  1030. joined_str = string_join(joined_str, "]==")
  1031. joined_str = string_join(joined_str, read_attribute(model, mapping["2"], "value"))
  1032. joined_str = string_join(joined_str, " and self.token[")
  1033. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  1034. return string_join(joined_str, "]==False")!
  1035. elif (type == "Exec"):
  1036. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  1037. joined_str = string_join(joined_str, "] and self.finish[")
  1038. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  1039. joined_str = string_join(joined_str, " and self.token[")
  1040. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  1041. return string_join(joined_str, "]==False")!
  1042. $
  1043. value_script = $
  1044. String function value(model : Element, name : String, mapping : Element):
  1045. String type
  1046. String joined_str
  1047. type = read_type(model, mapping["0"])
  1048. if bool_or(bool_or(type == "Join", type == "Start"), type == "Decision"):
  1049. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  1050. joined_str = string_join(joined_str, "]= False, self.token[")
  1051. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  1052. return string_join(joined_str, "]= True")!
  1053. elif (type == "Exec"):
  1054. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  1055. joined_str = string_join(joined_str, "] = False, self.finish[")
  1056. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  1057. joined_str = string_join(joined_str, "] = False, self.token[")
  1058. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  1059. return string_join(joined_str, "]=True")!
  1060. $
  1061. }
  1062. Post_SCCD/transition post_f_13(post_f_9, post_f_8) {
  1063. label = "13"
  1064. value_cond = $
  1065. String function value(model : Element, name : String, mapping : Element):
  1066. String joined_str
  1067. Element outgoing_assns
  1068. String edge
  1069. String activity
  1070. outgoing_assns = allOutgoingAssociationInstances(model, mapping["0"], "Next")
  1071. while (read_nr_out(outgoing_assns) > 0):
  1072. edge = set_pop(outgoing_assns)
  1073. activity = readAssociationDestination(model, edge)
  1074. joined_str = string_join("self.finish[", read_attribute(model, mapping["1"], "id"))
  1075. joined_str = string_join(joined_str, "][")
  1076. joined_str = string_join(joined_str,read_attribute(model, activity, "id"))
  1077. joined_str = string_join(joined_str, "] ")
  1078. if (read_nr_out(outgoing_assns) != 0):
  1079. joined_str = string_join(joined_str, " and ")
  1080. return joined_str!
  1081. $
  1082. value_script = $
  1083. String function value(model : Element, name : String, mapping : Element):
  1084. String joined_str
  1085. Element outgoing_assns
  1086. String edge
  1087. String activity
  1088. joined_str = string_join("self.token[", read_attribute(model, mapping["1"], "id"))
  1089. joined_str = string_join(joined_str, "]= False ,")
  1090. outgoing_assns = allOutgoingAssociationInstances(model, mapping["0"], "Next")
  1091. while (read_nr_out(outgoing_assns) > 0):
  1092. edge = set_pop(outgoing_assns)
  1093. activity = readAssociationDestination(model, edge)
  1094. joined_str = string_join("self.finish[", read_attribute(model, mapping["1"], "id"))
  1095. joined_str = string_join(joined_str, "][")
  1096. joined_str = string_join(joined_str,read_attribute(model, activity, "id"))
  1097. joined_str = string_join(joined_str, "]= False ")
  1098. if (read_nr_out(outgoing_assns) != 0):
  1099. joined_str = string_join(joined_str, ", ")
  1100. return joined_str!
  1101. $
  1102. }
  1103. Post_Activity2State_link (post_f_1, post_f_6){
  1104. label = "14"
  1105. }
  1106. }
  1107. }
  1108. {Contains} ForAll map_join {
  1109. LHS {
  1110. Pre_PM/Join pre_j_0 {
  1111. label = "0"
  1112. }
  1113. Pre_SCCD/ParallelState pre_j_1 {
  1114. label = "1"
  1115. constraint_name = $
  1116. Boolean function constraint(value : String):
  1117. return (value == "Running")!
  1118. $
  1119. }
  1120. constraint = $
  1121. Boolean function constraint (model : Element, mapping : Element):
  1122. Element children
  1123. String parent
  1124. Element class_beh
  1125. String class
  1126. children = allIncomingAssociationInstances(model, mapping["1"], "composite_children")
  1127. parent = readAssociationSource(model, set_pop(children))
  1128. class_beh = allIncomingAssociationInstances(model, parent, "behaviour")
  1129. class = readAssociationSource(model, set_pop(class_beh))
  1130. if (value_eq(read_attribute(model, class, "name"), "Orchestrator")):
  1131. return True!
  1132. else:
  1133. return False!
  1134. $
  1135. }
  1136. RHS {
  1137. Post_PM/Join post_j_0 {
  1138. label = "0"
  1139. }
  1140. Post_SCCD/ParallelState post_j_1 {
  1141. label = "1"
  1142. }
  1143. Post_SCCD/CompositeState post_j_6 {
  1144. label = "6"
  1145. value_name = $
  1146. String function value(model : Element, name : String, mapping : Element):
  1147. return name!
  1148. $
  1149. }
  1150. Post_SCCD/parallel_children (post_j_1, post_j_6) {
  1151. label = "7"
  1152. }
  1153. Post_SCCD/BasicState post_j_8 {
  1154. label = "8"
  1155. value_name = $
  1156. String function value(model : Element, name : String, mapping : Element):
  1157. return "Waiting"!
  1158. $
  1159. value_isInitial = $
  1160. Boolean function value(model : Element, name : String, mapping : Element):
  1161. return True!
  1162. $
  1163. }
  1164. Post_SCCD/composite_children (post_j_6, post_j_8) {
  1165. label = "9"
  1166. }
  1167. Post_SCCD/transition post_j_10(post_j_8, post_j_8) {
  1168. label = "10"
  1169. value_cond = $
  1170. String function value(model : Element, name : String, mapping : Element):
  1171. String joined_str
  1172. Element outgoing_assns
  1173. String edge
  1174. String type
  1175. String activity
  1176. outgoing_assns = allIncomingAssociationInstances(model, mapping["0"], "Next")
  1177. while (read_nr_out(outgoing_assns) > 0):
  1178. edge = set_pop(outgoing_assns)
  1179. activity = readAssociationSource(model, edge)
  1180. type = read_type(model, activity)
  1181. if (type == "Exec"):
  1182. joined_str = string_join("self.finish[", read_attribute(model, activity, "id"))
  1183. joined_str = string_join(joined_str, "] and self.token[")
  1184. joined_str = string_join(joined_str,read_attribute(model, activity, "id"))
  1185. joined_str = string_join(joined_str, "]")
  1186. if (read_nr_out(outgoing_assns) != 0):
  1187. joined_str = string_join(joined_str, " and ")
  1188. elif (type == "Decision"):
  1189. joined_str = string_join("self.token[", read_attribute(model, activity, "id"))
  1190. joined_str = string_join(joined_str, "] and self.decision_consumes[")
  1191. joined_str = string_join(joined_str,read_attribute(model, activity, "id"))
  1192. joined_str = string_join(joined_str, "]==")
  1193. joined_str = string_join(joined_str,read_attribute(model, edge, "value"))
  1194. if (read_nr_out(outgoing_assns) != 0):
  1195. joined_str = string_join(joined_str, " and ")
  1196. return joined_str!
  1197. $
  1198. value_script = $
  1199. String function value(model : Element, name : String, mapping : Element):
  1200. String joined_str
  1201. Element outgoing_assns
  1202. String edge
  1203. String type
  1204. String activity
  1205. outgoing_assns = allIncomingAssociationInstances(model, mapping["0"], "Next")
  1206. while (read_nr_out(outgoing_assns) > 0):
  1207. edge = set_pop(outgoing_assns)
  1208. activity = readAssociationSource(model, edge)
  1209. type = read_type(model, activity)
  1210. if (type == "Exec"):
  1211. joined_str = string_join("self.token[", read_attribute(model, activity, "id"))
  1212. joined_str = string_join(joined_str, "]= False, self.token[")
  1213. joined_str = string_join(joined_str,read_attribute(model, mapping["0"], "id"))
  1214. joined_str = string_join(joined_str, "]=True, self.finish[")
  1215. joined_str = string_join(joined_str,read_attribute(model, activity, "id"))
  1216. joined_str = string_join(joined_str, "]=False")
  1217. elif (type == "Decision"):
  1218. joined_str = string_join("self.token[", read_attribute(model, activity, "id"))
  1219. joined_str = string_join(joined_str, "]= False, self.token[")
  1220. joined_str = string_join(joined_str,read_attribute(model, mapping["0"], "id"))
  1221. joined_str = string_join(joined_str, "]=True")
  1222. if (read_nr_out(outgoing_assns) != 0):
  1223. joined_str = string_join(joined_str, " , ")
  1224. return joined_str!
  1225. $
  1226. }
  1227. Post_Activity2State_link (post_j_0, post_j_6){
  1228. label = "14"
  1229. }
  1230. }
  1231. }
  1232. {Contains} ForAll map_finish {
  1233. LHS {
  1234. Pre_PM/Activity pre_e_0 {
  1235. label = "0"
  1236. }
  1237. Pre_PM/Finish pre_e_1 {
  1238. label = "1"
  1239. }
  1240. Pre_SCCD/ParallelState pre_e_2 {
  1241. label = "2"
  1242. constraint_name = $
  1243. Boolean function constraint(value : String):
  1244. return (value == "Running")!
  1245. $
  1246. }
  1247. Pre_PM/Next (pre_e_0, pre_e_1){
  1248. label = "11"
  1249. }
  1250. constraint = $
  1251. Boolean function constraint (model : Element, mapping : Element):
  1252. Element children
  1253. String parent
  1254. Element class_beh
  1255. String class
  1256. children = allIncomingAssociationInstances(model, mapping["2"], "composite_children")
  1257. parent = readAssociationSource(model, set_pop(children))
  1258. class_beh = allIncomingAssociationInstances(model, parent, "behaviour")
  1259. class = readAssociationSource(model, set_pop(class_beh))
  1260. if (value_eq(read_attribute(model, class, "name"), "Orchestrator")):
  1261. return True!
  1262. else:
  1263. return False!
  1264. $
  1265. }
  1266. RHS {
  1267. Post_PM/Activity post_e_0 {
  1268. label = "0"
  1269. }
  1270. Post_PM/Finish post_e_1 {
  1271. label = "1"
  1272. }
  1273. Post_PM/Next (post_e_0, post_e_1){
  1274. label = "11"
  1275. }
  1276. Post_SCCD/ParallelState post_e_2 {
  1277. label = "2"
  1278. }
  1279. Post_SCCD/CompositeState post_e_3 {
  1280. label = "3"
  1281. value_name = $
  1282. String function value(model : Element, name : String, mapping : Element):
  1283. return name!
  1284. $
  1285. }
  1286. Post_SCCD/parallel_children (post_e_2, post_e_3) {
  1287. label = "4"
  1288. }
  1289. Post_SCCD/BasicState post_e_5 {
  1290. label = "5"
  1291. value_name = $
  1292. String function value(model : Element, name : String, mapping : Element):
  1293. return "Waiting"!
  1294. $
  1295. value_isInitial = $
  1296. Boolean function value(model : Element, name : String, mapping : Element):
  1297. return True!
  1298. $
  1299. }
  1300. Post_SCCD/composite_children (post_e_3, post_e_5) {
  1301. label = "6"
  1302. }
  1303. Post_SCCD/transition post_e_7(post_e_5, post_e_5) {
  1304. label = "7"
  1305. value_cond = $
  1306. String function value(model : Element, name : String, mapping : Element):
  1307. String joined_str
  1308. String type
  1309. type = read_type(model, mapping["0"])
  1310. if (type == "Join"):
  1311. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  1312. return string_join(joined_str, "]")!
  1313. elif (type == "Decision"):
  1314. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  1315. joined_str = string_join(joined_str, "] and self.decision_consumes[")
  1316. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  1317. joined_str = string_join(joined_str, "]==")
  1318. return string_join(joined_str, read_attribute(model, mapping["11"], "value"))!
  1319. elif (type == "Exec"):
  1320. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  1321. joined_str = string_join(joined_str, "] and self.finish[")
  1322. joined_str = string_join(joined_str, read_attribute(model, mapping["0"], "id"))
  1323. return string_join(joined_str, "]")!
  1324. $
  1325. value_script = $
  1326. String function value(model : Element, name : String, mapping : Element):
  1327. String joined_str
  1328. joined_str = string_join("self.token[", read_attribute(model, mapping["0"], "id"))
  1329. joined_str = string_join(joined_str, "] = False , self.token[")
  1330. joined_str = string_join(joined_str, read_attribute(model, mapping["1"], "id"))
  1331. return string_join(joined_str, "] = True")!
  1332. $
  1333. }
  1334. Post_SCCD/Raise post_e_8 {
  1335. label = "8"
  1336. value_event = $
  1337. String function value(model : Element, name : String, mapping : Element):
  1338. return "process_done"!
  1339. $
  1340. value_scope = $
  1341. String function value(model : Element, name : String, mapping : Element):
  1342. return "local"!
  1343. $
  1344. }
  1345. Post_SCCD/transition_raises (post_e_7, post_e_8) {
  1346. label = "9"
  1347. }
  1348. Post_Activity2State_link (post_e_1, post_e_3){
  1349. label = "10"
  1350. }
  1351. }
  1352. }
  1353. }
  1354. Initial (schedule, create_orchestrator) {}
  1355. OnSuccess (create_orchestrator, create_class_association) {}
  1356. OnSuccess (create_class_association, initialize) {}
  1357. OnSuccess (initialize, map_exec) {}
  1358. OnSuccess (map_exec, data_produces) {}
  1359. OnSuccess (data_produces, data_consumes) {}
  1360. OnSuccess (data_consumes, map_decision) {}
  1361. OnSuccess (map_decision, map_fork) {}
  1362. OnSuccess (map_fork, map_join) {}
  1363. OnSuccess (map_join, map_finish) {}
  1364. OnFailure (create_orchestrator, create_class_association) {}
  1365. OnFailure (create_class_association, initialize) {}
  1366. OnFailure (initialize, map_exec) {}
  1367. OnFailure (map_exec, data_produces) {}
  1368. OnFailure (data_produces, data_consumes) {}
  1369. OnFailure (data_consumes, map_decision) {}
  1370. OnFailure (map_decision, map_fork) {}
  1371. OnFailure (map_fork, map_join) {}
  1372. OnFailure (map_join, map_finish) {}