cpee 2.0.30 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (330) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/js/instance.js +3 -3
  3. data/cockpit/js/wfadaptor.js +2 -0
  4. data/cockpit/templates.legacy/Async.xml +12 -12
  5. data/cockpit/templates.legacy/BCO.xml +9 -11
  6. data/cockpit/templates.legacy/BCS.xml +9 -11
  7. data/cockpit/templates.legacy/Centurio.xml +7 -7
  8. data/cockpit/templates.legacy/Concurrent.xml +7 -7
  9. data/cockpit/templates.legacy/Coopis Testset.xml +7 -7
  10. data/cockpit/templates.legacy/Endpoints and Data Manipulation.xml +6 -7
  11. data/cockpit/templates.legacy/ICSOC Testset.xml +7 -7
  12. data/cockpit/templates.legacy/Infinity.xml +7 -7
  13. data/cockpit/templates.legacy/Lego Boxer.xml +13 -13
  14. data/cockpit/templates.legacy/Lego Conveyor.xml +13 -13
  15. data/cockpit/templates.legacy/Lego Crane.xml +16 -16
  16. data/cockpit/templates.legacy/Lego Ejector.xml +16 -16
  17. data/cockpit/templates.legacy/Lego Full.xml +12 -12
  18. data/cockpit/templates.legacy/Lego Liddy.xml +13 -13
  19. data/cockpit/templates.legacy/Lego Plate.xml +13 -13
  20. data/cockpit/templates.legacy/Lego Transporter.xml +14 -14
  21. data/cockpit/templates.legacy/Lego_Part_1.xml +12 -12
  22. data/cockpit/templates.legacy/LgLinear.xml +7 -10
  23. data/cockpit/templates.legacy/Linear.xml +11 -14
  24. data/cockpit/templates.legacy/Log.xml +11 -12
  25. data/cockpit/templates.legacy/Mangler 1.xml +7 -7
  26. data/cockpit/templates.legacy/Mangler 2.xml +7 -7
  27. data/cockpit/templates.legacy/Manuel Labels.xml +11 -11
  28. data/cockpit/templates.legacy/Promise.xml +30 -30
  29. data/cockpit/templates.legacy/SOPROMO Test Sonification.xml +7 -7
  30. data/cockpit/templates.legacy/Subprocess.xml +15 -15
  31. data/cockpit/templates.legacy/Syncing P34 1.xml +8 -11
  32. data/cockpit/templates.legacy/Syncing P34 2.xml +8 -11
  33. data/cockpit/templates.legacy/Syncing P34 3.xml +8 -11
  34. data/cockpit/templates.legacy/Syncing P34.xml +8 -11
  35. data/cockpit/templates.legacy/TEST - Bad Loop.xml +7 -7
  36. data/cockpit/templates.legacy/TEST - Wrong Positions.xml +7 -7
  37. data/cockpit/templates.legacy/Take_5.xml +14 -14
  38. data/cockpit/templates.legacy/Update.xml +11 -11
  39. data/cockpit/templates.legacy/Worklist Parallel.xml +17 -17
  40. data/cockpit/templates.legacy/Worklist Test CPEE.xml +14 -14
  41. data/cockpit/templates.legacy/Worklist Test.xml +14 -14
  42. data/cockpit/templates.legacy/Worklist Test2.xml +14 -14
  43. data/cockpit/templates/Coopis 2010.xml +8 -8
  44. data/cockpit/templates/IUPC arXiv:1104.3609 P34 1.xml +8 -11
  45. data/cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml +8 -11
  46. data/cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml +8 -11
  47. data/cockpit/templates/Track Test Local.xml +2 -2
  48. data/cockpit/templates/Track Test.xml +1 -1
  49. data/cockpit/templates/UR-VUE 2020 Manual Adjust.xml +1 -1
  50. data/cockpit/templates/UR-VUE 2020 Solution Baseline.xml +1 -1
  51. data/cockpit/templates/UR-VUE 2020 Solution NN.xml +1 -1
  52. data/cockpit/templates/UR-VUE 2020 Solution View.xml +1 -1
  53. data/cockpit/templates/UR-VUE 2020.xml +1 -1
  54. data/cockpit/templates/Worklist.xml +14 -14
  55. data/cockpit/templates/instantiate.local/Take_Sub.xml +2 -2
  56. data/cockpit/templates/instantiate/Take_Perf.xml +1 -1
  57. data/cockpit/templates/instantiate/Take_Sub.xml +2 -2
  58. data/cockpit/templates/instantiate/Take_X.xml +2 -2
  59. data/cockpit/themes/compact/rngs/start.rng +83 -0
  60. data/cockpit/themes/compact/symbols/start.svg +1 -1
  61. data/cockpit/themes/control/rngs/start.rng +83 -0
  62. data/cockpit/themes/control/symbols/start.svg +1 -1
  63. data/cockpit/themes/default/rngs/start.rng +83 -0
  64. data/cockpit/themes/default/symbols/start.svg +1 -1
  65. data/cockpit/themes/default/theme.js +1 -1
  66. data/cockpit/themes/extended/rngs/start.rng +83 -0
  67. data/cockpit/themes/extended/symbols/start.svg +1 -1
  68. data/cockpit/themes/model/symbols/start.svg +1 -1
  69. data/cockpit/themes/packed/rngs/start.rng +83 -0
  70. data/cockpit/themes/packed/symbols/start.svg +1 -1
  71. data/cockpit/themes/preset/rngs/start.rng +83 -0
  72. data/cockpit/themes/preset/symbols/start.svg +1 -1
  73. data/cockpit/themes/preset/theme.js +1 -1
  74. data/cpee.gemspec +2 -2
  75. data/lib/cpee/attributes_helper.rb +14 -0
  76. data/lib/cpee/implementation.rb +10 -8
  77. data/lib/cpee/implementation_callbacks.rb +14 -0
  78. data/lib/cpee/implementation_notifications.rb +14 -0
  79. data/lib/cpee/implementation_properties.rb +128 -24
  80. data/lib/cpee/persistence.rb +0 -27
  81. data/lib/cpee/statemachine.rb +14 -0
  82. data/lib/cpee/value_helper.rb +14 -0
  83. data/lib/properties.xml +4 -4
  84. data/lib/properties/{handlerwrapper.rng → executionhandler.rng} +2 -2
  85. data/lib/properties/properties.rng +2 -2
  86. data/lib/properties/set-properties.rng +2 -2
  87. data/lib/properties/set-some-properties.rng +2 -2
  88. data/server/{resources → executionhandlers/ruby}/backend/README.md +0 -0
  89. data/server/{resources → executionhandlers/ruby}/backend/instance.template +2 -4
  90. data/server/{resources → executionhandlers/ruby}/backend/opts.yaml +2 -2
  91. data/server/executionhandlers/ruby/backend/run +37 -0
  92. data/server/{handlerwrappers/default.rb → executionhandlers/ruby/connection.rb} +3 -3
  93. data/server/executionhandlers/ruby/controller.rb +195 -0
  94. data/server/{resources/transformation_dslx.xsl → executionhandlers/ruby/dsl_to_dslx.xsl} +53 -8
  95. data/server/executionhandlers/ruby/execution.rb +81 -0
  96. data/server/resources/properties.empty +1 -1
  97. data/server/resources/properties.init +1 -1
  98. data/server/resources/topics.xml +2 -2
  99. data/server/routing/persist.rb +3 -3
  100. data/tools/cpee +9 -3
  101. data/tools/server/cpee +1 -1
  102. data/tools/server/resources/properties.init +1 -1
  103. metadata +19 -237
  104. data/cockpit/templates.legacy/convert_cpee2.rb +0 -15
  105. data/lib/cpee/controller.rb +0 -199
  106. data/lib/cpee/transform.rb +0 -95
  107. data/server/resources/backend/instance.rb +0 -23
  108. data/server/resources/backend/run +0 -33
  109. data/server/routing/end.pid +0 -1
  110. data/server/routing/forward-events.pid +0 -1
  111. data/server/routing/forward-votes.pid +0 -1
  112. data/server/routing/persist.pid +0 -1
  113. data/server/server.pid +0 -1
  114. data/tools/test/README +0 -4
  115. data/tools/test/config.json +0 -3
  116. data/tools/test/contrib/graph_example.svg +0 -1166
  117. data/tools/test/contrib/legend.svg +0 -817
  118. data/tools/test/contrib/symbols.svg +0 -224
  119. data/tools/test/contrib/transformation1.xsl +0 -264
  120. data/tools/test/contrib/transformation2.xsl +0 -10
  121. data/tools/test/contrib/tree_example.svg +0 -788
  122. data/tools/test/css/model.css +0 -24
  123. data/tools/test/css/track.css +0 -60
  124. data/tools/test/css/ui.css +0 -214
  125. data/tools/test/css/wfadaptor.css +0 -422
  126. data/tools/test/edit.html +0 -258
  127. data/tools/test/graph.html +0 -69
  128. data/tools/test/index.html +0 -258
  129. data/tools/test/js/details.js +0 -109
  130. data/tools/test/js/instance.js +0 -1344
  131. data/tools/test/js/model.js +0 -41
  132. data/tools/test/js/parameters.js +0 -82
  133. data/tools/test/js/track.js +0 -18
  134. data/tools/test/js/ui.js +0 -104
  135. data/tools/test/js/wfadaptor.js +0 -763
  136. data/tools/test/js_libs.zip +0 -0
  137. data/tools/test/js_libs/Makefile +0 -2
  138. data/tools/test/js_libs/ansi_up.js +0 -333
  139. data/tools/test/js_libs/console.js +0 -80
  140. data/tools/test/js_libs/custommenu.css +0 -84
  141. data/tools/test/js_libs/custommenu.js +0 -104
  142. data/tools/test/js_libs/experiments1/relaxngui.css +0 -185
  143. data/tools/test/js_libs/experiments1/relaxngui.js +0 -488
  144. data/tools/test/js_libs/experiments1/rngtest9.html +0 -60
  145. data/tools/test/js_libs/experiments1/rngtest9.rng +0 -35
  146. data/tools/test/js_libs/experiments1/rngtest9.xml +0 -8
  147. data/tools/test/js_libs/jquery-2.2.4.min.js +0 -4
  148. data/tools/test/js_libs/jquery-3.2.1.min.js +0 -4
  149. data/tools/test/js_libs/jquery-3.3.1.min.js +0 -2
  150. data/tools/test/js_libs/jquery.browser.js +0 -40
  151. data/tools/test/js_libs/jquery.caret.min.js +0 -10
  152. data/tools/test/js_libs/jquery.cookie.js +0 -117
  153. data/tools/test/js_libs/jquery.min.js +0 -1
  154. data/tools/test/js_libs/jquery.svg.min.js +0 -6
  155. data/tools/test/js_libs/jquery.svgdom.min.js +0 -6
  156. data/tools/test/js_libs/markdown.min.js +0 -1
  157. data/tools/test/js_libs/parsequery.js +0 -21
  158. data/tools/test/js_libs/printf.js +0 -368
  159. data/tools/test/js_libs/relaxngui.css +0 -213
  160. data/tools/test/js_libs/relaxngui.js +0 -543
  161. data/tools/test/js_libs/strftime.min.js +0 -1
  162. data/tools/test/js_libs/tests/dataelements.html +0 -59
  163. data/tools/test/js_libs/tests/dataelements.rng +0 -8
  164. data/tools/test/js_libs/tests/dataelements.xml +0 -3
  165. data/tools/test/js_libs/tests/relaxngui.css +0 -203
  166. data/tools/test/js_libs/tests/relaxngui.js +0 -502
  167. data/tools/test/js_libs/tests/rngtest1.html +0 -66
  168. data/tools/test/js_libs/tests/rngtest1.rng +0 -147
  169. data/tools/test/js_libs/tests/rngtest1.xml +0 -13
  170. data/tools/test/js_libs/tests/rngtest2.html +0 -60
  171. data/tools/test/js_libs/tests/rngtest2.rng +0 -6
  172. data/tools/test/js_libs/tests/rngtest2.xml +0 -3
  173. data/tools/test/js_libs/tests/rngtest3.html +0 -60
  174. data/tools/test/js_libs/tests/rngtest3.rng +0 -23
  175. data/tools/test/js_libs/tests/rngtest3.xml +0 -9
  176. data/tools/test/js_libs/tests/rngtest4.html +0 -60
  177. data/tools/test/js_libs/tests/rngtest4.rng +0 -19
  178. data/tools/test/js_libs/tests/rngtest4.xml +0 -12
  179. data/tools/test/js_libs/tests/rngtest5.html +0 -60
  180. data/tools/test/js_libs/tests/rngtest5.rng +0 -75
  181. data/tools/test/js_libs/tests/rngtest5.xml +0 -40
  182. data/tools/test/js_libs/tests/rngtest6.html +0 -60
  183. data/tools/test/js_libs/tests/rngtest6.rng +0 -24
  184. data/tools/test/js_libs/tests/rngtest6.xml +0 -6
  185. data/tools/test/js_libs/tests/rngtest8.html +0 -60
  186. data/tools/test/js_libs/tests/rngtest8.rng +0 -13
  187. data/tools/test/js_libs/tests/rngtest8.xml +0 -2
  188. data/tools/test/js_libs/tests/rngtest9.html +0 -60
  189. data/tools/test/js_libs/tests/rngtest9.rng +0 -31
  190. data/tools/test/js_libs/tests/rngtest9.xml +0 -8
  191. data/tools/test/js_libs/ui.css +0 -333
  192. data/tools/test/js_libs/ui.html +0 -168
  193. data/tools/test/js_libs/ui.js +0 -177
  194. data/tools/test/js_libs/underscore.min.js +0 -27
  195. data/tools/test/js_libs/util.js +0 -81
  196. data/tools/test/js_libs/vkbeautify.0.99.00.beta.js +0 -358
  197. data/tools/test/js_libs/vkbeautify.js +0 -1
  198. data/tools/test/js_libs/webcomponents.min.js +0 -196
  199. data/tools/test/model.html +0 -192
  200. data/tools/test/rngs/attributes.rng +0 -8
  201. data/tools/test/rngs/dataelements.rng +0 -8
  202. data/tools/test/rngs/endpoints.rng +0 -8
  203. data/tools/test/templates.legacy/Async.xml +0 -46
  204. data/tools/test/templates.legacy/BCO.xml +0 -70
  205. data/tools/test/templates.legacy/BCS.xml +0 -70
  206. data/tools/test/templates.legacy/Centurio.xml +0 -75
  207. data/tools/test/templates.legacy/Concurrent.xml +0 -40
  208. data/tools/test/templates.legacy/Coopis Testset.xml +0 -76
  209. data/tools/test/templates.legacy/Endpoints and Data Manipulation.xml +0 -30
  210. data/tools/test/templates.legacy/ICSOC Testset.xml +0 -95
  211. data/tools/test/templates.legacy/Infinity.xml +0 -28
  212. data/tools/test/templates.legacy/Lego Boxer.xml +0 -31
  213. data/tools/test/templates.legacy/Lego Conveyor.xml +0 -31
  214. data/tools/test/templates.legacy/Lego Crane.xml +0 -87
  215. data/tools/test/templates.legacy/Lego Ejector.xml +0 -55
  216. data/tools/test/templates.legacy/Lego Full.xml +0 -142
  217. data/tools/test/templates.legacy/Lego Liddy.xml +0 -40
  218. data/tools/test/templates.legacy/Lego Plate.xml +0 -31
  219. data/tools/test/templates.legacy/Lego Transporter.xml +0 -43
  220. data/tools/test/templates.legacy/Lego_Part_1.xml +0 -85
  221. data/tools/test/templates.legacy/LgLinear.xml +0 -65
  222. data/tools/test/templates.legacy/Linear.xml +0 -77
  223. data/tools/test/templates.legacy/Log.xml +0 -117
  224. data/tools/test/templates.legacy/Mangler 1.xml +0 -87
  225. data/tools/test/templates.legacy/Mangler 2.xml +0 -103
  226. data/tools/test/templates.legacy/Manuel Labels.xml +0 -55
  227. data/tools/test/templates.legacy/Promise.xml +0 -275
  228. data/tools/test/templates.legacy/SOPROMO Test Sonification.xml +0 -83
  229. data/tools/test/templates.legacy/Subprocess.xml +0 -56
  230. data/tools/test/templates.legacy/Syncing P34 1.xml +0 -77
  231. data/tools/test/templates.legacy/Syncing P34 2.xml +0 -77
  232. data/tools/test/templates.legacy/Syncing P34 3.xml +0 -77
  233. data/tools/test/templates.legacy/Syncing P34.xml +0 -77
  234. data/tools/test/templates.legacy/TEST - Bad Loop.xml +0 -173
  235. data/tools/test/templates.legacy/TEST - Wrong Positions.xml +0 -174
  236. data/tools/test/templates.legacy/Take_5.xml +0 -48
  237. data/tools/test/templates.legacy/Update.xml +0 -32
  238. data/tools/test/templates.legacy/Worklist Parallel.xml +0 -104
  239. data/tools/test/templates.legacy/Worklist Test CPEE.xml +0 -40
  240. data/tools/test/templates.legacy/Worklist Test.xml +0 -42
  241. data/tools/test/templates.legacy/Worklist Test2.xml +0 -43
  242. data/tools/test/templates.legacy/convert_cpee2.rb +0 -15
  243. data/tools/test/templates.legacy/convert_preset.rb +0 -32
  244. data/tools/test/templates.legacy/testsets.xml +0 -37
  245. data/tools/test/templates.legacy/transformations.xml +0 -4
  246. data/tools/test/templates/Coopis 2010.xml +0 -76
  247. data/tools/test/templates/IUPC arXiv:1104.3609 P34 1.xml +0 -77
  248. data/tools/test/templates/IUPC arXiv:1104.3609 P34 2.xml +0 -77
  249. data/tools/test/templates/IUPC arXiv:1104.3609 P34 3.xml +0 -77
  250. data/tools/test/templates/Track Test Local.xml +0 -82
  251. data/tools/test/templates/Track Test.xml +0 -82
  252. data/tools/test/templates/UR-VUE 2020 Manual Adjust.xml +0 -182
  253. data/tools/test/templates/UR-VUE 2020 Solution Baseline.xml +0 -203
  254. data/tools/test/templates/UR-VUE 2020 Solution NN.xml +0 -197
  255. data/tools/test/templates/UR-VUE 2020 Solution View.xml +0 -151
  256. data/tools/test/templates/UR-VUE 2020.xml +0 -26
  257. data/tools/test/templates/Worklist.xml +0 -42
  258. data/tools/test/templates/instantiate.local/Take_Sub.xml +0 -59
  259. data/tools/test/templates/instantiate/Take_Perf.xml +0 -46
  260. data/tools/test/templates/instantiate/Take_Sub.xml +0 -58
  261. data/tools/test/templates/instantiate/Take_X.xml +0 -48
  262. data/tools/test/themes/compact/theme.js +0 -1285
  263. data/tools/test/themes/diana/theme.js +0 -1650
  264. data/tools/test/themes/extended/theme.js +0 -1325
  265. data/tools/test/themes/model/rngs/alternative.rng +0 -1
  266. data/tools/test/themes/model/rngs/call.rng +0 -67
  267. data/tools/test/themes/model/rngs/callmanipulate.rng +0 -72
  268. data/tools/test/themes/model/rngs/choose.rng +0 -1
  269. data/tools/test/themes/model/rngs/critical.rng +0 -1
  270. data/tools/test/themes/model/rngs/escape.rng +0 -1
  271. data/tools/test/themes/model/rngs/group.rng +0 -1
  272. data/tools/test/themes/model/rngs/loop.rng +0 -1
  273. data/tools/test/themes/model/rngs/manipulate.rng +0 -1
  274. data/tools/test/themes/model/rngs/otherwise.rng +0 -1
  275. data/tools/test/themes/model/rngs/parallel.rng +0 -1
  276. data/tools/test/themes/model/rngs/parallel_branch.rng +0 -1
  277. data/tools/test/themes/model/rngs/scripts.rng +0 -7
  278. data/tools/test/themes/model/rngs/stop.rng +0 -1
  279. data/tools/test/themes/model/rngs/terminate.rng +0 -1
  280. data/tools/test/themes/model/theme.js +0 -1268
  281. data/tools/test/themes/packed/theme.js +0 -1286
  282. data/tools/test/themes/preset/rngs/alternative.rng +0 -25
  283. data/tools/test/themes/preset/rngs/call.rng +0 -122
  284. data/tools/test/themes/preset/rngs/callmanipulate.rng +0 -145
  285. data/tools/test/themes/preset/rngs/choose.rng +0 -14
  286. data/tools/test/themes/preset/rngs/closed_loop.rng +0 -62
  287. data/tools/test/themes/preset/rngs/closed_loop_cancel.rng +0 -5
  288. data/tools/test/themes/preset/rngs/closed_loop_control.rng +0 -31
  289. data/tools/test/themes/preset/rngs/closed_loop_measuring.rng +0 -12
  290. data/tools/test/themes/preset/rngs/critical.rng +0 -5
  291. data/tools/test/themes/preset/rngs/escape.rng +0 -1
  292. data/tools/test/themes/preset/rngs/group.rng +0 -3
  293. data/tools/test/themes/preset/rngs/loop.rng +0 -22
  294. data/tools/test/themes/preset/rngs/manipulate.rng +0 -9
  295. data/tools/test/themes/preset/rngs/otherwise.rng +0 -22
  296. data/tools/test/themes/preset/rngs/parallel.rng +0 -21
  297. data/tools/test/themes/preset/rngs/parallel_branch.rng +0 -8
  298. data/tools/test/themes/preset/rngs/scripts.rng +0 -23
  299. data/tools/test/themes/preset/rngs/stop.rng +0 -5
  300. data/tools/test/themes/preset/rngs/terminate.rng +0 -1
  301. data/tools/test/themes/preset/symbols/alternative.svg +0 -5
  302. data/tools/test/themes/preset/symbols/arrow.svg +0 -3
  303. data/tools/test/themes/preset/symbols/call.svg +0 -6
  304. data/tools/test/themes/preset/symbols/callmanipulate.svg +0 -8
  305. data/tools/test/themes/preset/symbols/choose.svg +0 -5
  306. data/tools/test/themes/preset/symbols/choose_exclusive.svg +0 -5
  307. data/tools/test/themes/preset/symbols/choose_inclusive.svg +0 -4
  308. data/tools/test/themes/preset/symbols/closed_loop.svg +0 -5
  309. data/tools/test/themes/preset/symbols/closed_loop_cancel.svg +0 -5
  310. data/tools/test/themes/preset/symbols/closed_loop_control.svg +0 -5
  311. data/tools/test/themes/preset/symbols/closed_loop_measuring.svg +0 -6
  312. data/tools/test/themes/preset/symbols/complex.svg +0 -8
  313. data/tools/test/themes/preset/symbols/critical.svg +0 -4
  314. data/tools/test/themes/preset/symbols/end.svg +0 -3
  315. data/tools/test/themes/preset/symbols/escape.svg +0 -5
  316. data/tools/test/themes/preset/symbols/event_end.svg +0 -3
  317. data/tools/test/themes/preset/symbols/loop.svg +0 -5
  318. data/tools/test/themes/preset/symbols/manipulate.svg +0 -4
  319. data/tools/test/themes/preset/symbols/otherwise.svg +0 -5
  320. data/tools/test/themes/preset/symbols/parallel.svg +0 -5
  321. data/tools/test/themes/preset/symbols/parallel_branch.svg +0 -5
  322. data/tools/test/themes/preset/symbols/parallel_branch_compact.svg +0 -4
  323. data/tools/test/themes/preset/symbols/parallel_branch_event.svg +0 -14
  324. data/tools/test/themes/preset/symbols/parallel_branch_normal.svg +0 -5
  325. data/tools/test/themes/preset/symbols/scripts.svg +0 -4
  326. data/tools/test/themes/preset/symbols/start.svg +0 -3
  327. data/tools/test/themes/preset/symbols/stop.svg +0 -5
  328. data/tools/test/themes/preset/symbols/terminate.svg +0 -4
  329. data/tools/test/themes/preset/theme.js +0 -1287
  330. data/tools/test/track.html +0 -142
@@ -1,1325 +0,0 @@
1
- function WFAdaptorManifestation(adaptor) {
2
- var self = this;
3
-
4
- this.adaptor = adaptor;
5
- this.resources = {};
6
- this.elements = {};
7
- this.events = {};
8
- this.compact = false;
9
- this.striped = true;
10
- this.endpoints = {};
11
-
12
- //{{{ transform the details data to description parts based on rng
13
- this.source = function(base,opts) {
14
- if (base[0].namespaceURI == "http://relaxng.org/ns/structure/1.0") {
15
- $('#relaxngworker').empty();
16
- var rngw = new RelaxNGui(base,$('#relaxngworker'),self.adaptor.description.context_eval);
17
- var nnew = $(rngw.save().documentElement);
18
- return(nnew);
19
- } else {
20
- if (opts && opts == 'clone') {
21
- base = base.clone();
22
- if (base.attr('id')) {
23
- base.attr('id',self.adaptor.description.get_free_id());
24
- }
25
- base.find('*[id]').each(function(k,v){
26
- $(v).attr('id',self.adaptor.description.get_free_id(base));
27
- });
28
- }
29
- return base;
30
- }
31
- }; //}}}
32
- //{{{ Return the svgid for the selected task
33
- this.selected = function(){
34
- var svgid = 'unknown';
35
- _.each(self.adaptor.illustrator.get_elements(),function(value,key) {
36
- if ($(value).hasClass('selected')) {
37
- svgid = $(value).attr('element-id');
38
- }
39
- });
40
- return svgid;
41
- }; //}}}
42
- //{{{ Return the svgids for all marked tasks
43
- this.marked = function(){
44
- var svgid = [];
45
- _.each(self.adaptor.illustrator.get_elements(),function(value,key) {
46
- if ($(value).hasClass('marked')) {
47
- svgid.push($(value).attr('element-id'));
48
- }
49
- });
50
- return svgid;
51
- }; //}}}
52
- //{{{ Render the details from rng (right hand side of graph tab)
53
- this.update_details = function(svgid){
54
- var tab = $('#dat_details');
55
- var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
56
- tab.empty();
57
- if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
58
- save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
59
- var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
60
- if (save['endpoints_cache'][$(node).attr('endpoint')] && save['endpoints_cache'][$(node).attr('endpoint')].schema) {
61
- var schema = save['endpoints_cache'][$(node).attr('endpoint')].schema.documentElement;
62
- $(rng).find(' > element[name="parameters"] > element[name="arguments"]').replaceWith($(schema).clone());
63
- }
64
- if (save['endpoints_list'][$(node).attr('endpoint')] && (!save['endpoints_list'][$(node).attr('endpoint')].startsWith('http') || save['endpoints_list'][$(node).attr('endpoint')].match(/^https?-/))) {
65
- $(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
66
- }
67
- save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
68
- var nn = $X($(node).serializeXML());
69
- nn.removeAttr('svg-id');
70
- nn.removeAttr('svg-type');
71
- nn.removeAttr('svg-subtype');
72
- nn.removeAttr('svg-label');
73
- save['details'].content(nn);
74
- format_visual_forms();
75
- }
76
- }; //}}}
77
-
78
- function copyOrMove(menu,group,xml_node,mode) { //{{{
79
- var markymark = _.uniq(self.marked());
80
- var check1 = [];
81
- var check2 = [];
82
- $(markymark).each(function(key,svgid){
83
- var node = self.adaptor.description.get_node_by_svg_id(svgid);
84
- check1.push($(node).attr('svg-type'));
85
- });
86
- $(group).each(function(key,value){
87
- check2.push(value.type);
88
- });
89
-
90
- if (markymark.length > 0 && _.uniq(check1).length == _.intersection(check1,check2).length) {
91
- var nodes = [];
92
- $(markymark).each(function(key,svgid){
93
- var node = self.adaptor.description.get_node_by_svg_id(svgid);
94
- nodes.unshift(node);
95
- });
96
-
97
- var iconm = self.resources['arrow'].clone();
98
- var iconc = self.resources['arrow'].clone();
99
- iconm.children('.rfill').addClass('menu');
100
- menu.push(
101
- {
102
- 'label': '<em>Move Marked Elements</em>',
103
- 'function_call': mode,
104
- 'menu_icon': iconm,
105
- 'type': undefined,
106
- 'params': [nodes, xml_node]
107
- },
108
- {
109
- 'label': '<em>Copy Marked Elements</em>',
110
- 'function_call': mode,
111
- 'menu_icon': iconc,
112
- 'type': undefined,
113
- 'params': [nodes, xml_node, 'clone']
114
- }
115
- );
116
- }
117
- } //}}}
118
-
119
- // Events
120
- this.events.mousedown = function(svgid, e, child, sibling) { // {{{
121
- if(e.button == 0) { // left-click
122
- } else if(e.button == 1) { // middle-click
123
- } else if(e.button == 2) { // right-click
124
- if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
125
-
126
- var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
127
- var group = null;
128
- var menu = {};
129
-
130
- if (child) {
131
- group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node,'into');
132
- if(group.length > 0) {
133
- menu['Insert into'] = group;
134
- copyOrMove(menu['Insert into'],group,xml_node,self.adaptor.description.insert_first_into);
135
- }
136
- if (self.elements[xml_node.get(0).tagName].permissible_children_expert) {
137
- group = self.elements[xml_node.get(0).tagName].permissible_children_expert(xml_node,'into');
138
- if(group.length > 0) {
139
- menu['Insert into (Experts Only!)'] = group;
140
- copyOrMove(menu['Insert into (Experts Only!)'],group,xml_node,self.adaptor.description.insert_first_into);
141
- }
142
- }
143
- }
144
- if (sibling) {
145
- group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node,'after');
146
- if(group.length > 0) {
147
- menu['Insert after'] = group;
148
- copyOrMove(menu['Insert after'],group,xml_node,self.adaptor.description.insert_after);
149
- }
150
- if (self.elements[xml_node.parent().get(0).tagName].permissible_children_expert) {
151
- group = self.elements[xml_node.parent().get(0).tagName].permissible_children_expert(xml_node,'after');
152
- if(group.length > 0) {
153
- menu['Insert after (Experts Only!)'] = group;
154
- copyOrMove(menu['Insert after (Experts Only!)'],group,xml_node,self.adaptor.description.insert_after);
155
- }
156
- }
157
- }
158
-
159
- if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
160
- var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
161
- icon.children('.rfill').addClass('menu');
162
- menu['Delete'] = [{
163
- 'label': 'Remove Element',
164
- 'function_call': function(selector,target,selected){ self.adaptor.description.remove(selector,target); self.adaptor.illustrator.get_label_by_svg_id(selected).addClass('selected'); },
165
- 'menu_icon': icon,
166
- 'type': undefined,
167
- 'params': [null, xml_node, self.selected()]
168
- }];
169
- }
170
- if($('> code', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
171
- var icon = self.elements.callmanipulate.illustrator.svg.clone();
172
- icon.children('.rfill:last').addClass('menu');
173
- menu['Delete'].push({
174
- 'label': 'Remove Scripts',
175
- 'function_call': self.adaptor.description.remove,
176
- 'menu_icon': icon,
177
- 'type': undefined,
178
- 'params': ['> code', xml_node]
179
- });
180
- }
181
- if (xml_node.get(0).tagName == "call" || xml_node.get(0).tagName == "manipulate" || xml_node.get(0).tagName == "stop") {
182
- var icon = self.elements.call.illustrator.svg.clone();
183
- icon.children('g.replace').addClass('active');
184
- var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
185
- if (vtarget.length > 0) {
186
- if (vtarget.parents('g.activities.passive, g.activities.active').length > 0) {
187
- menu['Position'] = [{
188
- 'label': 'No Execution from here',
189
- 'function_call': del_ui_pos,
190
- 'menu_icon': icon,
191
- 'type': undefined,
192
- 'params': xml_node
193
- }];
194
- } else {
195
- menu['Position'] = [{
196
- 'label': 'Execute from here',
197
- 'function_call': add_ui_pos,
198
- 'menu_icon': icon,
199
- 'type': undefined,
200
- 'params': xml_node
201
- }];
202
- }
203
- }
204
- }
205
- new CustomMenu(e).contextmenu(menu);
206
- }
207
- return false;
208
- } // }}}
209
- this.events.suppress = function(svgid, e, child, sibling) { // {{{
210
- return false;
211
- } // }}}
212
- this.events.click = function(svgid, e) { // {{{
213
- if (self.adaptor.description.get_node_by_svg_id(svgid).length == 0) {
214
- return;
215
- }
216
-
217
- self.adaptor.illustrator.get_elements().removeClass('selected');
218
- self.adaptor.illustrator.get_labels().removeClass('selected');
219
-
220
- if (e && e.ctrlKey) {
221
- if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
222
- var tab = $('#dat_details');
223
- tab.empty();
224
- var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
225
- if (vtarget.length > 0) {
226
- vtarget.parents('g.element[element-id]').toggleClass('marked');
227
- }
228
- } else {
229
- self.adaptor.illustrator.get_elements().removeClass('marked');
230
-
231
- var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
232
- if (vtarget.length > 0) {
233
- vtarget.parents('g.element[element-id]').addClass('selected');
234
- }
235
- self.adaptor.illustrator.get_label_by_svg_id(svgid).addClass('selected');
236
-
237
- self.update_details(svgid);
238
- }
239
- } // }}}
240
- this.events.dblclick = function(svgid, e) { // {{{
241
- } // }}}
242
- this.events.mouseover = function(svgid, e) { // {{{
243
- self.adaptor.illustrator.svg.container.find('.tile[element-id = "' + svgid + '"]').css('display','block');
244
- self.adaptor.illustrator.svg.container.find('[element-id = "' + svgid + '"]').addClass('hover');
245
- self.adaptor.illustrator.svg.label_container.find('[element-id = "' + svgid + '"]').addClass('hover');
246
- return false;
247
- } // }}}
248
- this.events.mouseout = function(svgid, e) { // {{{
249
- self.adaptor.illustrator.svg.container.find('.tile[element-id = "' + svgid + '"]').css('display','none');
250
- self.adaptor.illustrator.svg.container.find('[element-id = "' + svgid + '"]').removeClass('hover');
251
- self.adaptor.illustrator.svg.label_container.find('[element-id = "' + svgid + '"]').removeClass('hover');
252
- return false;
253
- } // }}}
254
- this.events.dragstart = function (svgid, e) { //{{{
255
- } //}}}
256
-
257
- // other resources
258
- this.resources.arrow = self.adaptor.theme_dir + 'symbols/arrow.svg';
259
-
260
- // Primitive Elements
261
- this.elements.call = { /*{{{*/
262
- 'type': 'primitive',
263
- 'illustrator': {//{{{
264
- 'endnodes': 'this',
265
- 'label': function(node){
266
- var rep = $('body').attr('current-resources');
267
- var ep = self.endpoints[$(node).attr('endpoint')];
268
- var wait = $('_timing_wait',$(node).children('annotations')).text();
269
- var threshold = $('_timing_threshold',$(node).children('annotations')).text();
270
- var adur = $('_timing_avg',$(node).children('annotations')).text();
271
- var lab = $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'');
272
- var ret = [ { column: 'ID', value: $(node).attr('id') } ];
273
- if (lab != '') {
274
- ret.unshift( { column: 'Label', value: lab } );
275
- }
276
- if (wait != '') {
277
- ret.push({ column: 'Wait', value: 'ω = ' + wait });
278
- }
279
- if (threshold != '') {
280
- ret.push({ column: 'Threshold', value: 'κ = ' + threshold });
281
- }
282
- if (adur != '') {
283
- ret.push({ column: 'Duration', value: '~T = ' + adur + 'm' });
284
- }
285
- return ret;
286
- },
287
- 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
288
- 'resolve_symbol': function(node) {
289
- if($('code', node).length > 0) {
290
- return 'callmanipulate';
291
- } else {
292
- return 'call';
293
- }
294
- },
295
- 'svg': self.adaptor.theme_dir + 'symbols/call.svg'
296
- },//}}}
297
- 'description': self.adaptor.theme_dir + 'rngs/call.rng',
298
- 'permissible_children': function(node,mode) { //{{{
299
- if(node.children('code').length < 1)
300
- return [
301
- {'label': 'Scripts',
302
- 'function_call': self.adaptor.description.insert_last_into,
303
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
304
- 'type': undefined,
305
- 'params': [self.adaptor.description.elements.scripts, node]}
306
- ];
307
- return [];
308
- }, //}}}
309
- 'adaptor': {//{{{
310
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
311
- 'click': self.events.click,
312
- 'dragstart': self.events.dragstart,
313
- 'mouseover': self.events.mouseover,
314
- 'mouseout': self.events.mouseout
315
- }//}}}
316
- }; /*}}}*/
317
- this.elements.manipulate = { /*{{{*/
318
- 'type': 'primitive',
319
- 'illustrator': {//{{{
320
- 'endnodes': 'this',
321
- 'label': function(node){
322
- var lab = $(node).attr('label');
323
- if (lab) {
324
- return [ { column: 'Label', value: lab.replace(/^['"]/,'').replace(/['"]$/,'') }, { column: 'ID', value: $(node).attr('id') } ];
325
- } else {
326
- return [ { column: 'ID', value: $(node).attr('id') } ];
327
- }
328
- },
329
- 'svg': self.adaptor.theme_dir + 'symbols/manipulate.svg'
330
- },//}}}
331
- 'description': self.adaptor.theme_dir + 'rngs/manipulate.rng',
332
- 'permissible_children': function(node,mode) { //{{{
333
- return [];
334
- }, //}}}
335
- 'adaptor': {//{{{
336
- 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
337
- 'click': self.events.click,
338
- 'mouseover': self.events.mouseover,
339
- 'mouseout': self.events.mouseout
340
- }//}}}
341
- }; /*}}}*/
342
- this.elements.escape = { /*{{{*/
343
- 'type': 'primitive',
344
- 'illustrator': {//{{{
345
- 'endnodes': 'this',
346
- 'svg': self.adaptor.theme_dir + 'symbols/escape.svg'
347
- },//}}}
348
- 'description': self.adaptor.theme_dir + 'rngs/escape.rng',
349
- 'permissible_children': function(node,mode) { //{{{
350
- return [];
351
- }, //}}}
352
- 'adaptor': {//{{{
353
- 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
354
- 'click': self.events.click,
355
- 'mouseover': self.events.mouseover,
356
- 'mouseout': self.events.mouseout
357
- }//}}}
358
- }; /*}}}*/
359
- this.elements.stop = { /*{{{*/
360
- 'type': 'primitive',
361
- 'illustrator': {//{{{
362
- 'endnodes': 'this',
363
- 'label': function(node){
364
- return [ { column: 'ID', value: $(node).attr('id') } ];
365
- },
366
- 'svg': self.adaptor.theme_dir + 'symbols/stop.svg'
367
- },//}}}
368
- 'description': self.adaptor.theme_dir + 'rngs/stop.rng',
369
- 'permissible_children': function(node,mode) { //{{{
370
- return [];
371
- }, //}}}
372
- 'adaptor': {//{{{
373
- 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
374
- 'click': self.events.click,
375
- 'mouseover': self.events.mouseover,
376
- 'mouseout': self.events.mouseout
377
- }//}}}
378
- }; /*}}}*/
379
- this.elements.terminate = { /*{{{*/
380
- 'type': 'primitive',
381
- 'illustrator': {//{{{
382
- 'endnodes': 'this',
383
- 'final': true,
384
- 'svg': self.adaptor.theme_dir + 'symbols/terminate.svg'
385
- },//}}}
386
- 'description': self.adaptor.theme_dir + 'rngs/terminate.rng',
387
- 'permissible_children': function(node,mode) { //{{{
388
- return [];
389
- }, //}}}
390
- 'adaptor': {//{{{
391
- 'mousedown': function (node,e) { self.events.mousedown(node,e,false,false); },
392
- 'mouseover': self.events.mouseover,
393
- 'mouseout': self.events.mouseout
394
- }//}}}
395
- }; /*}}}*/
396
- this.elements.end = { /*{{{*/
397
- 'type': 'primitive',
398
- 'illustrator': {//{{{
399
- 'endnodes': 'this',
400
- 'svg': self.adaptor.theme_dir + 'symbols/end.svg'
401
- }, //}}}
402
- 'adaptor': {//{{{
403
- 'mousedown': function (node,e) {
404
- self.events.suppress();
405
- }
406
- }//}}}
407
- }; /*}}}*/
408
- this.elements.event_end = { /*{{{*/
409
- 'type': 'primitive',
410
- 'illustrator': {//{{{
411
- 'endnodes': 'this',
412
- 'svg': self.adaptor.theme_dir + 'symbols/event_end.svg'
413
- }, //}}}
414
- 'adaptor': {//{{{
415
- 'mousedown': function (node,e) {
416
- self.events.suppress();
417
- },
418
- 'click': self.events.click,
419
- 'dblclick': self.events.dblclick,
420
- 'mouseover': self.events.mouseover,
421
- 'mouseout': self.events.mouseout
422
- }//}}}
423
- }; /*}}}*/
424
- this.elements.choose_finish = { /*{{{*/
425
- 'type': 'primitive',
426
- 'illustrator': {//{{{
427
- 'endnodes': 'this',
428
- 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg',
429
- 'resolve_symbol': function(node) {
430
- if($(node).attr('mode') == 'exclusive') {
431
- return 'choose_exclusive_finish';
432
- } else {
433
- return 'choose_inclusive_finish';
434
- }
435
- },
436
- }, //}}}
437
- 'adaptor': {//{{{
438
- 'mousedown': function (node,e) {
439
- self.events.mousedown(node,e,true,true);
440
- },
441
- 'click': self.events.click,
442
- 'dblclick': self.events.dblclick,
443
- 'mouseover': self.events.mouseover,
444
- 'mouseout': self.events.mouseout
445
- }//}}}
446
- }; /*}}}*/
447
- this.elements.loop_finish = { /*{{{*/
448
- 'type': 'primitive',
449
- 'illustrator': {//{{{
450
- 'endnodes': 'this',
451
- 'closeblock': true,
452
- 'label': function(node){
453
- var avg = $('> _probability_avg',$(node).children('_probability')).text();
454
- var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
455
- if (avg != '') {
456
- ret.push({ column: 'Average', value: avg + 'x' });
457
- }
458
- return ret;
459
- },
460
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg',
461
- }, //}}}
462
- 'adaptor': {//{{{
463
- 'mousedown': function (node,e) {
464
- self.events.mousedown(node,e,true,true);
465
- },
466
- 'click': self.events.click,
467
- 'dblclick': self.events.dblclick,
468
- 'mouseover': self.events.mouseover,
469
- 'mouseout': self.events.mouseout
470
- }//}}}
471
- }; /*}}}*/
472
- this.elements.parallel_finish = { /*{{{*/
473
- 'type': 'primitive',
474
- 'illustrator': {//{{{
475
- 'endnodes': 'this',
476
- 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg',
477
- 'resolve_symbol': function(node) {
478
- if($(node).attr('wait') == '-1') {
479
- return 'parallel_simple';
480
- } else {
481
- return 'parallel_complex';
482
- }
483
- },
484
- }, //}}}
485
- 'adaptor': {//{{{
486
- 'mousedown': function (node,e) {
487
- self.events.mousedown(node,e,true,true);
488
- },
489
- 'click': self.events.click,
490
- 'dblclick': self.events.dblclick,
491
- 'mouseover': self.events.mouseover,
492
- 'mouseout': self.events.mouseout
493
- }//}}}
494
- }; /*}}}*/
495
-
496
- // Complex Elements
497
- this.elements.choose = { /*{{{*/
498
- 'type': 'complex',
499
- 'illustrator': {//{{{
500
- 'label': function(node){ return [ { column: 'Label', value: $(node).attr('mode') == 'exclusive' ? 'exclusive' : 'inclusive' } ]; },
501
- 'endnodes': 'aggregate',
502
- 'closeblock': false,
503
- 'closing_symbol': 'choose_finish',
504
- 'expansion': function(node) {
505
- return 'horizontal';
506
- },
507
- 'resolve_symbol': function(node) {
508
- if($(node).attr('mode') == 'exclusive') {
509
- return 'choose_exclusive';
510
- } else {
511
- return 'choose_inclusive';
512
- }
513
- },
514
- 'col_shift': function(node) {
515
- return false;
516
- },
517
- 'svg': self.adaptor.theme_dir + 'symbols/choose.svg'
518
- },//}}}
519
- 'description': self.adaptor.theme_dir + 'rngs/choose.rng',
520
- 'permissible_children': function(node,mode) { //{{{
521
- var func = null;
522
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
523
- else { func = self.adaptor.description.insert_after }
524
- if(node.children('parallel_branch').length > 0) {
525
- return [{'label': 'Parallel Branch',
526
- 'function_call': func,
527
- 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
528
- 'type': 'parallel_branch',
529
- 'params': [self.adaptor.description.elements.parallel_branch, node]}];
530
- }
531
- var childs = [{'label': 'Alternative',
532
- 'function_call': func,
533
- 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
534
- 'type': 'alternative',
535
- 'params': [self.adaptor.description.elements.alternative, node]}];
536
- if((node.children('otherwise').length == 0) && node.parents('parallel').length == node.parents('parallel_branch').length && node.parent('choose').length == 0)
537
- childs.push({'label': 'Otherwise',
538
- 'function_call': self.adaptor.description.insert_last_into,
539
- 'menu_icon': self.elements.otherwise.illustrator.svg.clone(),
540
- 'type': 'otherwise',
541
- 'params': [self.adaptor.description.elements.otherwise, node]});
542
- if(node.parents('parallel').length > node.parents('parallel_branch').length)
543
- childs.push({'label': 'Parallel Branch',
544
- 'function_call': func,
545
- 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
546
- 'type': 'parallel_branch',
547
- 'params': [self.adaptor.description.elements.parallel_branch, node]});
548
- return childs;
549
- }, //}}}
550
- 'adaptor': {//{{{
551
- 'mousedown': function (node,e) {
552
- self.events.mousedown(node,e,true,true);
553
- },
554
- 'click': self.events.click,
555
- 'dblclick': self.events.dblclick,
556
- 'mouseover': self.events.mouseover,
557
- 'mouseout': self.events.mouseout
558
- }//}}}
559
- }; /*}}}*/
560
- this.elements.otherwise = { /*{{{*/
561
- 'type': 'complex',
562
- 'illustrator': {//{{{
563
- 'label': function(node){
564
- var avg = $('> _probability_avg',$(node).children('_probability')).text();
565
- return (avg == '' ? [] : [ { column: 'Average', value: avg + '%' } ]);
566
- },
567
- 'endnodes': 'passthrough',
568
- 'closeblock': false,
569
- 'noarrow': true,
570
- 'expansion': function(node) {
571
- return 'vertical';
572
- },
573
- 'col_shift': function(node) {
574
- return false;
575
- },
576
- 'svg': self.adaptor.theme_dir + 'symbols/otherwise.svg'
577
- },//}}}
578
- 'description': self.adaptor.theme_dir + 'rngs/otherwise.rng',
579
- 'neverdelete': true,
580
- 'permissible_children': function(node,mode) { //{{{
581
- var func = null;
582
- var childs = null;
583
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
584
- else { func = self.adaptor.description.insert_after }
585
- var childs = [
586
- {'label': 'Service Call with Scripts',
587
- 'function_call': func,
588
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
589
- 'type': 'callmanipulate',
590
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
591
- {'label': 'Service Call',
592
- 'function_call': func,
593
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
594
- 'type': 'call',
595
- 'params': [self.adaptor.description.elements.call, node]},
596
- {'label': 'Script',
597
- 'function_call': func,
598
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
599
- 'type': 'manipulate',
600
- 'params': [self.adaptor.description.elements.manipulate, node]},
601
- {'label': 'Parallel',
602
- 'function_call': func,
603
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
604
- 'type': 'parallel',
605
- 'params': [self.adaptor.description.elements.parallel, node]},
606
- {'label': 'Decision',
607
- 'function_call': func,
608
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
609
- 'type': 'choose',
610
- 'params': [self.adaptor.description.elements.choose, node]},
611
- {'label': 'Loop',
612
- 'function_call': func,
613
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
614
- 'type': 'loop',
615
- 'params': [self.adaptor.description.elements.loop, node]},
616
- {'label': 'Terminate',
617
- 'function_call': func,
618
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
619
- 'type': 'terminate',
620
- 'params': [self.adaptor.description.elements.terminate, node]},
621
- {'label': 'Stop',
622
- 'function_call': func,
623
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
624
- 'type': 'stop',
625
- 'params': [self.adaptor.description.elements.stop, node]}
626
- ];
627
- if(node.parent('parallel_branch').length > 0) {
628
- childs.push({
629
- 'label': 'Critical',
630
- 'function_call': func,
631
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
632
- 'type': 'critical',
633
- 'params': [self.adaptor.description.elements.critical, node]
634
- });
635
- }
636
- return childs;
637
- }, //}}}
638
- 'adaptor': {//{{{
639
- 'mousedown': function (node,e) {
640
- self.events.mousedown(node,e,true,false);
641
- },
642
- 'click': self.events.click,
643
- 'dblclick': self.events.dblclick,
644
- 'mouseover': self.events.mouseover,
645
- 'mouseout': self.events.mouseout,
646
- }//}}}
647
- }; /*}}}*/
648
- this.elements.alternative = { /*{{{*/
649
- 'type': 'complex',
650
- 'illustrator': {//{{{
651
- 'label': function(node){
652
- var avg = $('> _probability_avg',$(node).children('_probability')).text();
653
- var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
654
- if (avg != '') {
655
- ret.push({ column: 'Average', value: avg + '%' });
656
- }
657
- return ret;
658
- },
659
- 'endnodes': 'passthrough',
660
- 'noarrow': true,
661
- 'closeblock':false,
662
- 'expansion': function(node) {
663
- return 'vertical';
664
- },
665
- 'col_shift': function(node) {
666
- return false;
667
- },
668
- 'svg': self.adaptor.theme_dir + 'symbols/alternative.svg'
669
- },//}}}
670
- 'description': self.adaptor.theme_dir + 'rngs/alternative.rng',
671
- 'permissible_children': function(node,mode) { //{{{
672
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
673
- else { func = self.adaptor.description.insert_after }
674
- if(node.parents('parallel').length > node.parents('parallel_branch').length && node.get(0).tagName == 'alternative') {
675
- return [{'label': 'Parallel Branch',
676
- 'function_call': func,
677
- 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
678
- 'type': 'parallel_branch',
679
- 'params': [self.adaptor.description.elements.parallel_branch, node]}];
680
- }
681
- var childs = [
682
- {'label': 'Service Call with Scripts',
683
- 'function_call': func,
684
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
685
- 'type': 'callmanipulate',
686
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
687
- {'label': 'Service Call',
688
- 'function_call': func,
689
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
690
- 'type': 'call',
691
- 'params': [self.adaptor.description.elements.call, node]},
692
- {'label': 'Script',
693
- 'function_call': func,
694
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
695
- 'type': 'manipulate',
696
- 'params': [self.adaptor.description.elements.manipulate, node]},
697
- {'label': 'Parallel',
698
- 'function_call': func,
699
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
700
- 'type': 'parallel',
701
- 'params': [self.adaptor.description.elements.parallel, node]},
702
- {'label': 'Decision',
703
- 'function_call': func,
704
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
705
- 'type': 'choose',
706
- 'params': [self.adaptor.description.elements.choose, node]},
707
- {'label': 'Loop',
708
- 'function_call': func,
709
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
710
- 'type': 'loop',
711
- 'params': [self.adaptor.description.elements.loop, node]},
712
- {'label': 'Terminate',
713
- 'function_call': func,
714
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
715
- 'type': 'terminate',
716
- 'params': [self.adaptor.description.elements.terminate, node]},
717
- {'label': 'Stop',
718
- 'function_call': func,
719
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
720
- 'type': 'stop',
721
- 'params': [self.adaptor.description.elements.stop, node]}
722
- ];
723
- if(node.parent('parallel_branch').length > 0) {
724
- childs.push({
725
- 'label': 'Critical',
726
- 'function_call': func,
727
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
728
- 'type': 'critical',
729
- 'params': [self.adaptor.description.elements.critical, node]
730
- });
731
- }
732
- return childs;
733
- }, //}}}
734
- 'adaptor': {//{{{
735
- 'mousedown': function (node,e) {
736
- self.events.mousedown(node,e,true,true);
737
- },
738
- 'click': self.events.click,
739
- 'dblclick': self.events.dblclick,
740
- 'mouseover': self.events.mouseover,
741
- 'mouseout': self.events.mouseout,
742
- }//}}}
743
- }; /*}}}*/
744
- this.elements.loop = { /*{{{*/
745
- 'type': 'complex',
746
- 'illustrator': {//{{{
747
- 'resolve_symbol': function(node) {
748
- if($(node).attr('mode') == 'pre_test') {
749
- return 'loop_head';
750
- } else {
751
- return 'loop_tail';
752
- }
753
- },
754
- 'expansion': function(node) {
755
- return 'vertical';
756
- },
757
- 'col_shift': function(node) {
758
- return true;
759
- },
760
- 'svg': self.adaptor.theme_dir + 'symbols/loop.svg'
761
- },// }}}
762
- 'description': self.adaptor.theme_dir + 'rngs/loop.rng',
763
- 'permissible_children': function(node,mode) { //{{{
764
- var func = null;
765
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
766
- else { func = self.adaptor.description.insert_after }
767
- var childs = [
768
- {'label': 'Service Call with Scripts',
769
- 'function_call': func,
770
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
771
- 'type': 'callmanipulate',
772
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
773
- {'label': 'Service Call',
774
- 'function_call': func,
775
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
776
- 'type': 'call',
777
- 'params': [self.adaptor.description.elements.call, node]},
778
- {'label': 'Script',
779
- 'function_call': func,
780
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
781
- 'type': 'manipulate',
782
- 'params': [self.adaptor.description.elements.manipulate, node]},
783
- {'label': 'Decision',
784
- 'function_call': func,
785
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
786
- 'type': 'choose',
787
- 'params': [self.adaptor.description.elements.choose, node]},
788
- {'label': 'Loop',
789
- 'function_call': func,
790
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
791
- 'type': 'loop',
792
- 'params': [self.adaptor.description.elements.loop, node]},
793
- {'label': 'Terminate',
794
- 'function_call': func,
795
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
796
- 'type': 'terminate',
797
- 'params': [self.adaptor.description.elements.terminate, node]},
798
- {'label': 'Stop',
799
- 'function_call': func,
800
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
801
- 'type': 'stop',
802
- 'params': [self.adaptor.description.elements.stop, node]}
803
- ];
804
- if(node.parent('parallel_branch').length > 0) {
805
- childs.push({
806
- 'label': 'Critical',
807
- 'function_call': func,
808
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
809
- 'type': 'critical',
810
- 'params': [self.adaptor.description.elements.critical, node]
811
- });
812
- }
813
- if(node.parent('parallel').length > node.parent('parallel_branch').length) {
814
- childs.push({'label': 'Parallel Branch',
815
- 'function_call': func,
816
- 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
817
- 'type': 'parallel_branch',
818
- 'params': [self.adaptor.description.elements.parallel_branch, node]}
819
- );
820
- } else {
821
- childs.push({'label': 'Parallel',
822
- 'function_call': func,
823
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
824
- 'type': 'parallel',
825
- 'params': [self.adaptor.description.elements.parallel, node]}
826
- );
827
- }
828
- return childs;
829
- }, //}}}
830
- 'adaptor': {//{{{
831
- 'mousedown': function (node,e) {
832
- self.events.mousedown(node,e,true,true);
833
- },
834
- 'click': self.events.click,
835
- 'dblclick': self.events.dblclick,
836
- 'mouseover': self.events.mouseover,
837
- 'mouseout': self.events.mouseout,
838
- }//}}}
839
- }; /*}}}*/
840
- this.elements.parallel = { /*{{{*/
841
- 'type': 'complex',
842
- 'illustrator': {//{{{
843
- 'endnodes': 'aggregate',
844
- 'closeblock': false,
845
- 'closing_symbol': 'parallel_finish',
846
- 'expansion': function(node) {
847
- // check if any sibling other than 'parallel_branch' is present
848
- if($(node).children(':not(parallel_branch)').length > 0) return 'vertical';
849
- return 'horizontal';
850
- },
851
- 'col_shift': function(node) {
852
- return true;
853
- },
854
- 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
855
- },//}}}
856
- 'description': self.adaptor.theme_dir + 'rngs/parallel.rng',
857
- 'permissible_children': function(node,mode) { //{{{
858
- var func = null;
859
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
860
- else { func = self.adaptor.description.insert_after }
861
- var childs = [
862
- {'label': 'Parallel Branch',
863
- 'function_call': func,
864
- 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
865
- 'type': 'parallel_branch',
866
- 'params': [self.adaptor.description.elements.parallel_branch, node]},
867
- ];
868
- return childs;
869
- }, //}}}
870
- 'permissible_children_expert': function(node,mode) { //{{{
871
- var func = null;
872
- if (mode.match(/into/)) { func = self.adaptor.description.insert_first_into }
873
- else { func = self.adaptor.description.insert_after }
874
- var childs = [
875
- {'label': 'Service Call with Scripts',
876
- 'function_call': func,
877
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
878
- 'type': 'callmanipulate',
879
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
880
- {'label': 'Service Call',
881
- 'function_call': func,
882
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
883
- 'type': 'call',
884
- 'params': [self.adaptor.description.elements.call, node]},
885
- {'label': 'Script',
886
- 'function_call': func,
887
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
888
- 'type': 'manipulate',
889
- 'params': [self.adaptor.description.elements.manipulate, node]},
890
- {'label': 'Decision',
891
- 'function_call': func,
892
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
893
- 'type': 'choose',
894
- 'params': [self.adaptor.description.elements.choose, node]},
895
- {'label': 'Loop',
896
- 'function_call': func,
897
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
898
- 'type': 'loop',
899
- 'params': [self.adaptor.description.elements.loop, node]},
900
- {'label': 'Stop',
901
- 'function_call': func,
902
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
903
- 'type': 'stop',
904
- 'params': [self.adaptor.description.elements.stop, node]}
905
- ];
906
- if(node.get(0).tagName != 'parallel')
907
- childs.push({'label': 'Parallel',
908
- 'function_call': self.adaptor.description.insert_last_into,
909
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
910
- 'type': 'parallel',
911
- 'params': [self.adaptor.description.elements.parallel, node]});
912
- return childs;
913
- }, //}}}
914
- 'adaptor': {//{{{
915
- 'mousedown': function (node,e) {
916
- self.events.mousedown(node,e,true,true);
917
- },
918
- 'click': self.events.click,
919
- 'dblclick': self.events.dblclick,
920
- 'mouseover': self.events.mouseover,
921
- 'mouseout': self.events.mouseout,
922
- }//}}}
923
- }; /*}}}*/
924
- this.elements.parallel_branch = { /*{{{*/
925
- 'type': 'complex',
926
- 'illustrator': {//{{{
927
- 'endnodes': 'passthrough',
928
- 'closeblock': false,
929
- 'noarrow': true,
930
- 'expansion': function(node) {
931
- return 'vertical';
932
- },
933
- 'resolve_symbol': function(node,shift) {
934
- if(shift == true) {
935
- return 'parallel_branch_event';
936
- } else {
937
- return 'parallel_branch_normal';
938
- }
939
- },
940
- 'col_shift': function(node) {
941
- if(node.parentNode.tagName == 'choose') return false;
942
- if($(node).parents('parallel').first().children(':not(parallel_branch)').length > 0) return true;
943
- return false;
944
- },
945
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch.svg'
946
- },//}}}
947
- 'description': self.adaptor.theme_dir + 'rngs/parallel_branch.rng',
948
- 'permissible_children': function(node,mode) { //{{{
949
- var func = null;
950
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
951
- else { func = self.adaptor.description.insert_after }
952
- var childs = [
953
- {'label': 'Service Call with Scripts',
954
- 'function_call': func,
955
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
956
- 'type': 'callmanipulate',
957
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
958
- {'label': 'Service Call',
959
- 'function_call': func,
960
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
961
- 'type': 'call',
962
- 'params': [self.adaptor.description.elements.call, node]},
963
- {'label': 'Script',
964
- 'function_call': func,
965
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
966
- 'type': 'manipulate',
967
- 'params': [self.adaptor.description.elements.manipulate, node]},
968
- {'label': 'Parallel',
969
- 'function_call': func,
970
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
971
- 'type': 'parallel',
972
- 'params': [self.adaptor.description.elements.parallel, node]},
973
- {'label': 'Decision',
974
- 'function_call': func,
975
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
976
- 'type': 'choose',
977
- 'params': [self.adaptor.description.elements.choose, node]},
978
- {'label': 'Loop',
979
- 'function_call': func,
980
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
981
- 'type': 'loop',
982
- 'params': [self.adaptor.description.elements.loop, node]},
983
- {'label': 'Terminate',
984
- 'function_call': func,
985
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
986
- 'type': 'terminate',
987
- 'params': [self.adaptor.description.elements.terminate, node]},
988
- {'label': 'Stop',
989
- 'function_call': func,
990
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
991
- 'type': 'stop',
992
- 'params': [self.adaptor.description.elements.stop, node]},
993
- {'label': 'Critical',
994
- 'function_call': func,
995
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
996
- 'type': 'critical',
997
- 'params': [self.adaptor.description.elements.critical, node]}
998
- ];
999
- if(node.parents('choose').length > node.parents('alternative, otherwise').length && node.get(0).tagName == 'parallel_branch') {
1000
- return [{'label': 'Alternative',
1001
- 'function_call': func,
1002
- 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
1003
- 'type': 'alternative',
1004
- 'params': [self.adaptor.description.elements.alternative, node]}];
1005
- }
1006
- return childs;
1007
- }, //}}}
1008
- 'adaptor': {//{{{
1009
- 'mousedown': function (node,e) {
1010
- self.events.mousedown(node,e,true,true);
1011
- },
1012
- 'click': self.events.click,
1013
- 'dblclick': self.events.dblclick,
1014
- 'mouseover': self.events.mouseover,
1015
- 'mouseout': self.events.mouseout,
1016
- }//}}}
1017
- }; /*}}}*/
1018
- this.elements.critical = { /*{{{*/
1019
- 'type': 'complex',
1020
- 'illustrator': {//{{{
1021
- 'endnodes': 'aggregate',
1022
- 'closeblock': false,
1023
- 'border': true,
1024
- 'expansion': function(node) {
1025
- return 'vertical';
1026
- },
1027
- 'col_shift': function(node) {
1028
- return true;
1029
- },
1030
- 'svg': self.adaptor.theme_dir + 'symbols/critical.svg'
1031
- },//}}}
1032
- 'description': self.adaptor.theme_dir + 'rngs/critical.rng',
1033
- 'permissible_children': function(node,mode) { //{{{
1034
- var func = null;
1035
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1036
- else { func = self.adaptor.description.insert_after }
1037
- var childs = [
1038
- {'label': 'Service Call with Scripts',
1039
- 'function_call': func,
1040
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1041
- 'type': 'callmanipulate',
1042
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
1043
- {'label': 'Service Call',
1044
- 'function_call': func,
1045
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
1046
- 'type': 'call',
1047
- 'params': [self.adaptor.description.elements.call, node]},
1048
- {'label': 'Script',
1049
- 'function_call': func,
1050
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1051
- 'type': 'manipulate',
1052
- 'params': [self.adaptor.description.elements.manipulate, node]},
1053
- {'label': 'Parallel',
1054
- 'function_call': func,
1055
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1056
- 'type': 'parallel',
1057
- 'params': [self.adaptor.description.elements.parallel, node]},
1058
- {'label': 'Decision',
1059
- 'function_call': func,
1060
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1061
- 'type': 'choose',
1062
- 'params': [self.adaptor.description.elements.choose, node]},
1063
- {'label': 'Loop',
1064
- 'function_call': func,
1065
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1066
- 'type': 'loop',
1067
- 'params': [self.adaptor.description.elements.loop, node]},
1068
- {'label': 'Terminate',
1069
- 'function_call': func,
1070
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
1071
- 'type': 'terminate',
1072
- 'params': [self.adaptor.description.elements.terminate, node]},
1073
- {'label': 'Stop',
1074
- 'function_call': func,
1075
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1076
- 'type': 'stop',
1077
- 'params': [self.adaptor.description.elements.stop, node]}
1078
- ];
1079
- if(node.parent('parallel_branch').length > 0) {
1080
- childs.push({
1081
- 'label': 'Critical',
1082
- 'function_call': func,
1083
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1084
- 'type': 'critical',
1085
- 'params': [self.adaptor.description.elements.critical, node]
1086
- });
1087
- }
1088
- return childs;
1089
- }, //}}}
1090
- 'adaptor': {//{{{
1091
- 'mousedown': function (node,e) {
1092
- self.events.mousedown(node,e,true,true);
1093
- },
1094
- 'click': self.events.click,
1095
- 'dblclick': self.events.dblclick,
1096
- 'mouseover': self.events.mouseover,
1097
- 'mouseout': self.events.mouseout,
1098
- }//}}}
1099
- }; /*}}}*/
1100
- this.elements.group = { /*{{{*/
1101
- 'type': 'complex',
1102
- 'illustrator': {//{{{
1103
- 'endnodes': 'aggregate',
1104
- 'closeblock': false,
1105
- 'border': 'injectiongroup', // other value than true,false inidcates the used class for the svg-object
1106
- 'expansion': function(node) {
1107
- return 'vertical';
1108
- },
1109
- 'col_shift': function(node) {
1110
- return true;
1111
- },
1112
- 'svg': null
1113
- },//}}}
1114
- 'description': self.adaptor.theme_dir + 'rngs/group.rng',
1115
- 'permissible_children': function(node,mode) { //{{{
1116
- var func = null;
1117
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1118
- else { func = self.adaptor.description.insert_after }
1119
- return [
1120
- ];
1121
- }, //}}}
1122
- 'adaptor': {//{{{
1123
- 'mousedown': function (node,e) {
1124
- self.events.mousedown(node,e,true,true);
1125
- },
1126
- 'click': self.events.click,
1127
- 'dblclick': self.events.dblclick,
1128
- 'mouseover': self.events.mouseover,
1129
- 'mouseout': self.events.mouseout,
1130
- }//}}}
1131
- }; /*}}}*/
1132
- this.elements.start = this.elements.description = { /*{{{*/
1133
- 'type': 'description',
1134
- 'illustrator': {//{{{
1135
- 'endnodes': 'passthrough',
1136
- 'label': function(node){ return [ { column: 'Label'}, { column: 'ID' }, { column: 'Resource' }, { column: 'RP' }, { column: 'R#' } ]; },
1137
- 'closeblock': false,
1138
- 'balance': true,
1139
- 'expansion': function(node) {
1140
- return 'vertical';
1141
- },
1142
- 'closing_symbol': 'end',
1143
- 'col_shift': function(node) {
1144
- return true;
1145
- },
1146
- 'svg': self.adaptor.theme_dir + 'symbols/start.svg'
1147
- },//}}}
1148
- 'description': null,
1149
- 'permissible_children': function(node,mode) { //{{{
1150
- var func = null;
1151
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1152
- else { func = self.adaptor.description.insert_after }
1153
- var childs = [
1154
- {'label': 'Service Call with Scripts',
1155
- 'function_call': func,
1156
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1157
- 'type': 'callmanipulate',
1158
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
1159
- {'label': 'Service Call',
1160
- 'function_call': func,
1161
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
1162
- 'type': 'call',
1163
- 'params': [self.adaptor.description.elements.call, node]},
1164
- {'label': 'Script',
1165
- 'function_call': func,
1166
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1167
- 'type': 'manipulate',
1168
- 'params': [self.adaptor.description.elements.manipulate, node]},
1169
- {'label': 'Parallel',
1170
- 'function_call': func,
1171
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1172
- 'type': 'parallel',
1173
- 'params': [self.adaptor.description.elements.parallel, node]},
1174
- {'label': 'Decision',
1175
- 'function_call': func,
1176
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1177
- 'type': 'choose',
1178
- 'params': [self.adaptor.description.elements.choose, node]},
1179
- {'label': 'Loop',
1180
- 'function_call': func,
1181
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1182
- 'type': 'loop',
1183
- 'params': [self.adaptor.description.elements.loop, node]},
1184
- {'label': 'Stop',
1185
- 'function_call': func,
1186
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1187
- 'type': 'stop',
1188
- 'params': [self.adaptor.description.elements.stop, node]}
1189
- ];
1190
- if(node.parent('parallel_branch').length > 0) {
1191
- childs.push({
1192
- 'label': 'Critical',
1193
- 'function_call': func,
1194
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1195
- 'type': 'critical',
1196
- 'params': [self.adaptor.description.elements.critical, node]
1197
- });
1198
- }
1199
- return childs;
1200
- }, //}}}
1201
- 'adaptor': {//{{{
1202
- 'mousedown': function (node,e) {
1203
- self.events.mousedown(node,e,true,false);
1204
- },
1205
- 'click': self.events.click,
1206
- 'dblclick': self.events.dblclick,
1207
- 'mouseover': self.events.mouseover,
1208
- 'mouseout': self.events.mouseout,
1209
- }//}}}
1210
- }; /*}}}*/
1211
-
1212
- // Abstract Elements
1213
- // * they may only have an illustrator (or other parts)
1214
- // * they HAVE TO have a parent
1215
- this.elements.callmanipulate = { /*{{{*/
1216
- 'parent': 'call',
1217
- 'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
1218
- 'illustrator': {//{{{
1219
- 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
1220
- 'svg': self.adaptor.theme_dir + 'symbols/callmanipulate.svg'
1221
- },//}}}
1222
- }; /*}}}*/
1223
- this.elements.loop_head = { /*{{{*/
1224
- 'parent': 'loop',
1225
- 'illustrator': {//{{{
1226
- 'endnodes': 'this',
1227
- 'closeblock': true,
1228
- 'label': function(node){
1229
- var avg = $('> _probability_avg',$(node).children('_probability')).text();
1230
- var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
1231
- if (avg != '') {
1232
- ret.push({ column: 'Average', value: avg + 'x' });
1233
- }
1234
- return ret;
1235
- },
1236
- }//}}}
1237
- }; /*}}}*/
1238
- this.elements.loop_tail = { /*{{{*/
1239
- 'parent': 'loop',
1240
- 'illustrator': {//{{{
1241
- 'endnodes': 'aggregate',
1242
- 'closeblock': false,
1243
- 'closing_symbol': 'loop_finish'
1244
- },//}}}
1245
- }; /*}}}*/
1246
- this.elements.choose_inclusive = { /*{{{*/
1247
- 'parent': 'choose',
1248
- 'illustrator': {//{{{
1249
- 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1250
- }//}}}
1251
- }; /*}}}*/
1252
- this.elements.choose_exclusive = { /*{{{*/
1253
- 'parent': 'choose',
1254
- 'illustrator': {//{{{
1255
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1256
- },//}}}
1257
- }; /*}}}*/
1258
- this.elements.choose_inclusive_finish = { /*{{{*/
1259
- 'parent': 'choose_finish',
1260
- 'illustrator': {//{{{
1261
- 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1262
- }//}}}
1263
- }; /*}}}*/
1264
- this.elements.choose_exclusive_finish = { /*{{{*/
1265
- 'parent': 'choose_finish',
1266
- 'illustrator': {//{{{
1267
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1268
- },//}}}
1269
- }; /*}}}*/
1270
- this.elements.loop_head_finish = { /*{{{*/
1271
- 'parent': 'loop_finish',
1272
- 'illustrator': {//{{{
1273
- 'endnodes': 'this',
1274
- 'closeblock': true,
1275
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1276
- }//}}}
1277
- }; /*}}}*/
1278
- this.elements.loop_tail_finish = { /*{{{*/
1279
- 'parent': 'loop_finish',
1280
- 'illustrator': {//{{{
1281
- 'endnodes': 'this',
1282
- 'closeblock': false,
1283
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1284
- },//}}}
1285
- }; /*}}}*/
1286
- this.elements.parallel_simple = { /*{{{*/
1287
- 'parent': 'parallel_finish',
1288
- 'illustrator': {//{{{
1289
- 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
1290
- }//}}}
1291
- }; /*}}}*/
1292
- this.elements.parallel_complex = { /*{{{*/
1293
- 'parent': 'parallel_finish',
1294
- 'illustrator': {//{{{
1295
- 'svg': self.adaptor.theme_dir + 'symbols/complex.svg'
1296
- },//}}}
1297
- }; /*}}}*/
1298
- this.elements.parallel_branch_normal = { /*{{{*/
1299
- 'parent': 'parallel_branch',
1300
- 'illustrator': {//{{{
1301
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_normal.svg'
1302
- }//}}}
1303
- }; /*}}}*/
1304
- this.elements.parallel_branch_event = { /*{{{*/
1305
- 'parent': 'parallel_branch',
1306
- 'illustrator': {//{{{
1307
- 'endnodes': 'this',
1308
- 'noarrow': false,
1309
- 'border': true,
1310
- 'wide': true,
1311
- 'closing_symbol': 'event_end',
1312
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_event.svg'
1313
- }//}}}
1314
- }; /*}}}*/
1315
- this.elements.parallel_branch_compact = { /*{{{*/
1316
- 'parent': 'parallel_branch',
1317
- 'illustrator': {//{{{
1318
- 'endnodes': 'this',
1319
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_compact.svg'
1320
- }//}}}
1321
- }; /*}}}*/
1322
- this.elements.scripts = { /*{{{*/
1323
- 'description': [self.adaptor.theme_dir + 'rngs/scripts.rng']
1324
- }; /*}}}*/
1325
- }