PN.pattern.metamodel 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. {
  2. "types": {
  3. "__pPlace": [
  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": "tokens",
  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. "name": "pname",
  31. "type": "code",
  32. "default": "\"[PYTHON]\"\n\"Example:\t result = True\"\n\"Example:\t result = getAttr()\"\n\n\"[JAVASCRIPT]\"\n\"Example:\t true\"\n\"Example:\t getAttr()\""
  33. }
  34. ],
  35. "__pTransition": [
  36. {
  37. "name": "__pLabel",
  38. "type": "string",
  39. "default": ""
  40. },
  41. {
  42. "name": "__pPivotIn",
  43. "type": "string",
  44. "default": ""
  45. },
  46. {
  47. "name": "__pPivotOut",
  48. "type": "string",
  49. "default": ""
  50. },
  51. {
  52. "name": "__pMatchSubtypes",
  53. "type": "boolean",
  54. "default": false
  55. },
  56. {
  57. "name": "tname",
  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. "__pPlaceToTransition": [
  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. "__pTransitionToPlace": [
  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. },
  117. "constraints": [],
  118. "actions": [
  119. {
  120. "name": "distinctPLabels",
  121. "event": "post-create",
  122. "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}",
  123. "targetType": "*"
  124. }
  125. ],
  126. "cardinalities": {
  127. "__pPlace": [
  128. {
  129. "dir": "out",
  130. "type": "__pPlaceToTransition",
  131. "min": 0,
  132. "max": "Infinity"
  133. },
  134. {
  135. "dir": "in",
  136. "type": "__pTransitionToPlace",
  137. "min": 0,
  138. "max": "Infinity"
  139. }
  140. ],
  141. "__pTransition": [
  142. {
  143. "dir": "in",
  144. "type": "__pPlaceToTransition",
  145. "min": 0,
  146. "max": "Infinity"
  147. },
  148. {
  149. "dir": "out",
  150. "type": "__pTransitionToPlace",
  151. "min": 0,
  152. "max": "Infinity"
  153. }
  154. ],
  155. "__pPlaceToTransition": [
  156. {
  157. "dir": "in",
  158. "type": "__pPlace",
  159. "min": 0,
  160. "max": "1"
  161. },
  162. {
  163. "dir": "out",
  164. "type": "__pTransition",
  165. "min": 0,
  166. "max": "1"
  167. }
  168. ],
  169. "__pTransitionToPlace": [
  170. {
  171. "dir": "in",
  172. "type": "__pTransition",
  173. "min": 0,
  174. "max": "1"
  175. },
  176. {
  177. "dir": "out",
  178. "type": "__pPlace",
  179. "min": 0,
  180. "max": "1"
  181. }
  182. ]
  183. },
  184. "legalConnections": {
  185. "__pPlace": {
  186. "__pTransition": [
  187. "__pPlaceToTransition"
  188. ]
  189. },
  190. "__pTransition": {
  191. "__pPlace": [
  192. "__pTransitionToPlace"
  193. ]
  194. }
  195. },
  196. "connectorTypes": {
  197. "__pPlaceToTransition": "visual",
  198. "__pTransitionToPlace": "visual"
  199. },
  200. "types2parentTypes": {
  201. "__pPlace": [],
  202. "__pTransition": [],
  203. "__pPlaceToTransition": [],
  204. "__pTransitionToPlace": []
  205. }
  206. }