PN.pattern.metamodel 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. {
  2. "types": {
  3. "__pTransition": [
  4. {
  5. "name": "__pLabel",
  6. "type": "string",
  7. "default": ""
  8. },
  9. {
  10. "name": "__pPivotIn",
  11. "type": "string",
  12. "default": ""
  13. },
  14. {
  15. "name": "__pPivotOut",
  16. "type": "string",
  17. "default": ""
  18. },
  19. {
  20. "name": "__pMatchSubtypes",
  21. "type": "boolean",
  22. "default": false
  23. },
  24. {
  25. "name": "tname",
  26. "type": "code",
  27. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  28. }
  29. ],
  30. "__pPlace": [
  31. {
  32. "name": "__pLabel",
  33. "type": "string",
  34. "default": ""
  35. },
  36. {
  37. "name": "__pPivotIn",
  38. "type": "string",
  39. "default": ""
  40. },
  41. {
  42. "name": "__pPivotOut",
  43. "type": "string",
  44. "default": ""
  45. },
  46. {
  47. "name": "__pMatchSubtypes",
  48. "type": "boolean",
  49. "default": false
  50. },
  51. {
  52. "name": "pname",
  53. "type": "code",
  54. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  55. },
  56. {
  57. "name": "tokens",
  58. "type": "code",
  59. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  60. }
  61. ],
  62. "__pT2P": [
  63. {
  64. "name": "__pLabel",
  65. "type": "string",
  66. "default": ""
  67. },
  68. {
  69. "name": "__pPivotIn",
  70. "type": "string",
  71. "default": ""
  72. },
  73. {
  74. "name": "__pPivotOut",
  75. "type": "string",
  76. "default": ""
  77. },
  78. {
  79. "name": "__pMatchSubtypes",
  80. "type": "boolean",
  81. "default": false
  82. },
  83. {
  84. "name": "weight",
  85. "type": "code",
  86. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  87. }
  88. ],
  89. "__pP2T": [
  90. {
  91. "name": "__pLabel",
  92. "type": "string",
  93. "default": ""
  94. },
  95. {
  96. "name": "__pPivotIn",
  97. "type": "string",
  98. "default": ""
  99. },
  100. {
  101. "name": "__pPivotOut",
  102. "type": "string",
  103. "default": ""
  104. },
  105. {
  106. "name": "__pMatchSubtypes",
  107. "type": "boolean",
  108. "default": false
  109. },
  110. {
  111. "name": "weight",
  112. "type": "code",
  113. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  114. }
  115. ],
  116. "__pinhibitor": [
  117. {
  118. "name": "__pLabel",
  119. "type": "string",
  120. "default": ""
  121. },
  122. {
  123. "name": "__pPivotIn",
  124. "type": "string",
  125. "default": ""
  126. },
  127. {
  128. "name": "__pPivotOut",
  129. "type": "string",
  130. "default": ""
  131. },
  132. {
  133. "name": "__pMatchSubtypes",
  134. "type": "boolean",
  135. "default": false
  136. }
  137. ]
  138. },
  139. "constraints": [],
  140. "actions": [
  141. {
  142. "name": "distinctPLabels",
  143. "event": "post-create",
  144. "code": "if( getAttr(\"__pLabel\") == \"\" )\n{\n\tvar pLabels = getAllNodes().\n\t\t\t\t\t\t\tfilter( function(n) {return hasAttr(\"__pLabel\",n);} ).\n\t\t\t\t\t\t\t\tmap( function(n) {return getAttr(\"__pLabel\",n);} ),\n\t\t i\t\t\t= \"0\";\n\n\twhile( _utils.contains(pLabels,i) )\n\t\ti = String(parseInt(i)+1);\n\tsetAttr(\"__pLabel\",i);\n}",
  145. "targetType": "*"
  146. }
  147. ],
  148. "cardinalities": {
  149. "__pTransition": [
  150. {
  151. "dir": "out",
  152. "type": "__pT2P",
  153. "min": 0,
  154. "max": "Infinity"
  155. },
  156. {
  157. "dir": "in",
  158. "type": "__pP2T",
  159. "min": 0,
  160. "max": "Infinity"
  161. },
  162. {
  163. "dir": "in",
  164. "type": "__pinhibitor",
  165. "min": 0,
  166. "max": "Infinity"
  167. }
  168. ],
  169. "__pPlace": [
  170. {
  171. "dir": "in",
  172. "type": "__pT2P",
  173. "min": 0,
  174. "max": "Infinity"
  175. },
  176. {
  177. "dir": "out",
  178. "type": "__pP2T",
  179. "min": 0,
  180. "max": "Infinity"
  181. },
  182. {
  183. "dir": "out",
  184. "type": "__pinhibitor",
  185. "min": 0,
  186. "max": "Infinity"
  187. }
  188. ],
  189. "__pT2P": [
  190. {
  191. "dir": "in",
  192. "type": "__pTransition",
  193. "min": 0,
  194. "max": "1"
  195. },
  196. {
  197. "dir": "out",
  198. "type": "__pPlace",
  199. "min": 0,
  200. "max": "1"
  201. }
  202. ],
  203. "__pP2T": [
  204. {
  205. "dir": "in",
  206. "type": "__pPlace",
  207. "min": 0,
  208. "max": "1"
  209. },
  210. {
  211. "dir": "out",
  212. "type": "__pTransition",
  213. "min": 0,
  214. "max": "1"
  215. }
  216. ],
  217. "__pinhibitor": [
  218. {
  219. "dir": "in",
  220. "type": "__pPlace",
  221. "min": 0,
  222. "max": "1"
  223. },
  224. {
  225. "dir": "out",
  226. "type": "__pTransition",
  227. "min": 0,
  228. "max": "1"
  229. }
  230. ]
  231. },
  232. "legalConnections": {
  233. "__pTransition": {
  234. "__pPlace": [
  235. "__pT2P"
  236. ]
  237. },
  238. "__pPlace": {
  239. "__pTransition": [
  240. "__pP2T",
  241. "__pinhibitor"
  242. ]
  243. }
  244. },
  245. "connectorTypes": {
  246. "__pT2P": "visual",
  247. "__pP2T": "visual",
  248. "__pinhibitor": "visual"
  249. },
  250. "types2parentTypes": {
  251. "__pTransition": [],
  252. "__pPlace": [],
  253. "__pT2P": [],
  254. "__pP2T": [],
  255. "__pinhibitor": []
  256. }
  257. }