cpee 1.5.25 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (357) hide show
  1. checksums.yaml +4 -4
  2. data/{FEATURES → FEATURES.md} +7 -6
  3. data/INSTALL.md +1 -0
  4. data/{README → README.md} +3 -3
  5. data/Rakefile +1 -0
  6. data/cockpit/index.html +7 -7
  7. data/cockpit/js/details.js +13 -14
  8. data/cockpit/js/instance.js +191 -284
  9. data/cockpit/js/parameters.js +13 -3
  10. data/cockpit/js/ui.js +2 -2
  11. data/cockpit/model.html +1 -0
  12. data/cockpit/rngs/attributes.rng +1 -1
  13. data/cockpit/rngs/dataelements.rng +1 -1
  14. data/cockpit/rngs/endpoints.rng +1 -1
  15. data/cockpit/templates.legacy/Async.xml +7 -7
  16. data/cockpit/templates.legacy/BCO.xml +7 -10
  17. data/cockpit/templates.legacy/BCS.xml +7 -10
  18. data/cockpit/templates.legacy/Centurio.xml +6 -6
  19. data/cockpit/templates.legacy/Concurrent.xml +6 -6
  20. data/cockpit/templates.legacy/Coopis Testset.xml +6 -6
  21. data/cockpit/templates.legacy/Endpoints and Data Manipulation.xml +6 -6
  22. data/cockpit/templates.legacy/ICSOC Testset.xml +6 -6
  23. data/cockpit/templates.legacy/Infinity.xml +3 -3
  24. data/cockpit/templates.legacy/Lego Boxer.xml +7 -7
  25. data/cockpit/templates.legacy/Lego Conveyor.xml +7 -7
  26. data/cockpit/templates.legacy/Lego Crane.xml +7 -7
  27. data/cockpit/templates.legacy/Lego Ejector.xml +7 -7
  28. data/cockpit/templates.legacy/Lego Full.xml +7 -7
  29. data/cockpit/templates.legacy/Lego Liddy.xml +7 -7
  30. data/cockpit/templates.legacy/Lego Plate.xml +7 -7
  31. data/cockpit/templates.legacy/Lego Transporter.xml +7 -7
  32. data/cockpit/templates.legacy/Lego_Part_1.xml +7 -7
  33. data/cockpit/templates.legacy/LgLinear.xml +6 -10
  34. data/cockpit/templates.legacy/Linear.xml +7 -7
  35. data/cockpit/templates.legacy/Log.xml +7 -7
  36. data/cockpit/templates.legacy/Mangler 1.xml +6 -6
  37. data/cockpit/templates.legacy/Mangler 2.xml +6 -6
  38. data/cockpit/templates.legacy/Manuel Labels.xml +7 -7
  39. data/cockpit/templates.legacy/Promise.xml +7 -7
  40. data/cockpit/templates.legacy/SOPROMO Test Sonification.xml +6 -6
  41. data/cockpit/templates.legacy/Subprocess.xml +56 -0
  42. data/cockpit/templates.legacy/Syncing P34 1.xml +8 -11
  43. data/cockpit/templates.legacy/Syncing P34 2.xml +8 -11
  44. data/cockpit/templates.legacy/Syncing P34 3.xml +8 -11
  45. data/cockpit/templates.legacy/Syncing P34.xml +8 -11
  46. data/cockpit/templates.legacy/TEST - Bad Loop.xml +6 -6
  47. data/cockpit/templates.legacy/TEST - Wrong Positions.xml +6 -6
  48. data/cockpit/templates.legacy/Take_5.xml +48 -0
  49. data/cockpit/templates.legacy/Update.xml +7 -7
  50. data/cockpit/templates.legacy/Worklist Parallel.xml +7 -7
  51. data/cockpit/templates.legacy/Worklist Test CPEE.xml +7 -7
  52. data/cockpit/templates.legacy/Worklist Test.xml +7 -7
  53. data/cockpit/templates.legacy/Worklist Test2.xml +7 -7
  54. data/cockpit/templates.legacy/convert_cpee2.rb +15 -0
  55. data/cockpit/templates.legacy/testsets.xml +1 -1
  56. data/cockpit/templates/BPM 2020 Manual Adjust.xml +18 -71
  57. data/cockpit/templates/BPM 2020 Solution Baseline.xml +17 -71
  58. data/cockpit/templates/BPM 2020 Solution NN.xml +25 -71
  59. data/cockpit/templates/BPM 2020 Solution View.xml +15 -71
  60. data/cockpit/templates/BPM 2020.xml +17 -6
  61. data/cockpit/templates/Coopis 2010.xml +7 -7
  62. data/cockpit/templates/IUPC arXiv:1104.3609 P34 1.xml +7 -10
  63. data/cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml +7 -10
  64. data/cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml +7 -10
  65. data/cockpit/templates/Worklist.xml +7 -7
  66. data/cockpit/templates/convert_cpee2.rb +15 -0
  67. data/cockpit/themes/compact/rngs/alternative.rng +25 -0
  68. data/cockpit/themes/compact/rngs/call.rng +17 -17
  69. data/cockpit/themes/compact/rngs/callmanipulate.rng +26 -26
  70. data/cockpit/themes/compact/rngs/choose.rng +14 -0
  71. data/cockpit/themes/compact/rngs/critical.rng +5 -0
  72. data/cockpit/themes/compact/rngs/escape.rng +1 -0
  73. data/cockpit/themes/compact/rngs/group.rng +3 -0
  74. data/cockpit/themes/compact/rngs/loop.rng +22 -0
  75. data/cockpit/themes/compact/rngs/manipulate.rng +9 -0
  76. data/cockpit/themes/compact/rngs/otherwise.rng +22 -0
  77. data/cockpit/themes/compact/rngs/parallel.rng +21 -0
  78. data/cockpit/themes/compact/rngs/parallel_branch.rng +8 -0
  79. data/cockpit/themes/compact/rngs/scripts.rng +10 -11
  80. data/cockpit/themes/compact/rngs/stop.rng +5 -0
  81. data/cockpit/themes/compact/rngs/terminate.rng +1 -0
  82. data/cockpit/themes/convert_cpee2.rb +8 -0
  83. data/cockpit/themes/default/rngs/alternative.rng +8 -8
  84. data/cockpit/themes/default/rngs/call.rng +84 -48
  85. data/cockpit/themes/default/rngs/callmanipulate.rng +103 -64
  86. data/cockpit/themes/default/rngs/choose.rng +5 -3
  87. data/cockpit/themes/default/rngs/critical.rng +2 -2
  88. data/cockpit/themes/default/rngs/escape.rng +1 -1
  89. data/cockpit/themes/default/rngs/group.rng +3 -3
  90. data/cockpit/themes/default/rngs/loop.rng +8 -8
  91. data/cockpit/themes/default/rngs/manipulate.rng +3 -3
  92. data/cockpit/themes/default/rngs/otherwise.rng +8 -8
  93. data/cockpit/themes/default/rngs/parallel.rng +14 -6
  94. data/cockpit/themes/default/rngs/parallel_branch.rng +2 -2
  95. data/cockpit/themes/default/rngs/scripts.rng +23 -0
  96. data/cockpit/themes/default/rngs/stop.rng +2 -2
  97. data/cockpit/themes/default/rngs/terminate.rng +1 -1
  98. data/cockpit/themes/extended/rngs/alternative.rng +25 -0
  99. data/cockpit/themes/extended/rngs/call.rng +17 -17
  100. data/cockpit/themes/extended/rngs/callmanipulate.rng +26 -26
  101. data/cockpit/themes/extended/rngs/choose.rng +14 -0
  102. data/cockpit/themes/extended/rngs/critical.rng +5 -0
  103. data/cockpit/themes/extended/rngs/escape.rng +1 -0
  104. data/cockpit/themes/extended/rngs/group.rng +3 -0
  105. data/cockpit/themes/extended/rngs/loop.rng +22 -0
  106. data/cockpit/themes/extended/rngs/manipulate.rng +9 -0
  107. data/cockpit/themes/extended/rngs/otherwise.rng +22 -0
  108. data/cockpit/themes/extended/rngs/parallel.rng +21 -0
  109. data/cockpit/themes/extended/rngs/parallel_branch.rng +8 -0
  110. data/cockpit/themes/extended/rngs/scripts.rng +10 -11
  111. data/cockpit/themes/extended/rngs/stop.rng +5 -0
  112. data/cockpit/themes/extended/rngs/terminate.rng +1 -0
  113. data/cockpit/themes/extended/theme.js +7 -6
  114. data/cockpit/themes/model/rngs/alternative.rng +1 -1
  115. data/cockpit/themes/model/rngs/call.rng +16 -16
  116. data/cockpit/themes/model/rngs/callmanipulate.rng +17 -17
  117. data/cockpit/themes/model/rngs/choose.rng +1 -1
  118. data/cockpit/themes/model/rngs/critical.rng +1 -1
  119. data/cockpit/themes/model/rngs/escape.rng +1 -1
  120. data/cockpit/themes/model/rngs/group.rng +1 -1
  121. data/cockpit/themes/model/rngs/loop.rng +1 -1
  122. data/cockpit/themes/model/rngs/manipulate.rng +1 -1
  123. data/cockpit/themes/model/rngs/otherwise.rng +1 -1
  124. data/cockpit/themes/model/rngs/parallel.rng +1 -1
  125. data/cockpit/themes/model/rngs/parallel_branch.rng +1 -1
  126. data/cockpit/themes/model/rngs/scripts.rng +3 -4
  127. data/cockpit/themes/model/rngs/stop.rng +1 -1
  128. data/cockpit/themes/model/rngs/terminate.rng +1 -1
  129. data/cockpit/themes/model/theme.js +7 -6
  130. data/cockpit/themes/packed/rngs/alternative.rng +25 -0
  131. data/cockpit/themes/packed/rngs/call.rng +17 -17
  132. data/cockpit/themes/packed/rngs/callmanipulate.rng +26 -26
  133. data/cockpit/themes/packed/rngs/choose.rng +14 -0
  134. data/cockpit/themes/packed/rngs/critical.rng +5 -0
  135. data/cockpit/themes/packed/rngs/escape.rng +1 -0
  136. data/cockpit/themes/packed/rngs/group.rng +3 -0
  137. data/cockpit/themes/packed/rngs/loop.rng +22 -0
  138. data/cockpit/themes/packed/rngs/manipulate.rng +9 -0
  139. data/cockpit/themes/packed/rngs/otherwise.rng +22 -0
  140. data/cockpit/themes/packed/rngs/parallel.rng +21 -0
  141. data/cockpit/themes/packed/rngs/parallel_branch.rng +8 -0
  142. data/cockpit/themes/packed/rngs/scripts.rng +10 -11
  143. data/cockpit/themes/packed/rngs/stop.rng +5 -0
  144. data/cockpit/themes/packed/rngs/terminate.rng +1 -0
  145. data/cockpit/themes/packed/theme.js +7 -6
  146. data/cockpit/themes/preset/rngs/alternative.rng +25 -0
  147. data/cockpit/themes/preset/rngs/call.rng +17 -17
  148. data/cockpit/themes/preset/rngs/callmanipulate.rng +26 -26
  149. data/cockpit/themes/preset/rngs/choose.rng +14 -0
  150. data/cockpit/themes/preset/rngs/critical.rng +5 -0
  151. data/cockpit/themes/preset/rngs/escape.rng +1 -0
  152. data/cockpit/themes/preset/rngs/group.rng +3 -0
  153. data/cockpit/themes/preset/rngs/loop.rng +22 -0
  154. data/cockpit/themes/preset/rngs/manipulate.rng +9 -0
  155. data/cockpit/themes/preset/rngs/otherwise.rng +22 -0
  156. data/cockpit/themes/preset/rngs/parallel.rng +21 -0
  157. data/cockpit/themes/preset/rngs/parallel_branch.rng +8 -0
  158. data/cockpit/themes/preset/rngs/scripts.rng +10 -11
  159. data/cockpit/themes/preset/rngs/stop.rng +5 -0
  160. data/cockpit/themes/preset/rngs/terminate.rng +1 -0
  161. data/cockpit/themes/preset/theme.js +7 -6
  162. data/cpee.gemspec +10 -11
  163. data/{log/topics.xml → lib/callbacks.xml} +16 -6
  164. data/lib/{engine → callbacks}/callbacks.rng +2 -8
  165. data/lib/cpee.xml +10 -4
  166. data/lib/cpee/attributes_helper.rb +27 -0
  167. data/lib/cpee/controller.rb +113 -596
  168. data/lib/cpee/implementation.rb +167 -191
  169. data/lib/cpee/implementation_callbacks.rb +77 -0
  170. data/lib/cpee/implementation_notifications.rb +189 -0
  171. data/lib/cpee/implementation_properties.rb +714 -0
  172. data/lib/cpee/{callback.rb → message.rb} +20 -18
  173. data/lib/cpee/persistence.rb +135 -0
  174. data/lib/cpee/statemachine.rb +20 -0
  175. data/lib/cpee/transform.rb +95 -0
  176. data/lib/engine.xml +1 -59
  177. data/lib/properties.xml +236 -0
  178. data/lib/properties/arbitrary.rng +26 -0
  179. data/lib/properties/attributes.rng +10 -0
  180. data/lib/properties/dataelements.rng +10 -0
  181. data/lib/properties/description.rng +8 -0
  182. data/lib/properties/dsl.rng +7 -0
  183. data/lib/properties/dslx.rng +8 -0
  184. data/lib/properties/endpoints.rng +10 -0
  185. data/lib/properties/handlerwrapper.rng +9 -0
  186. data/lib/properties/position.rng +15 -0
  187. data/lib/properties/positions.rng +10 -0
  188. data/lib/properties/properties.rng +29 -0
  189. data/lib/properties/set-properties.rng +25 -0
  190. data/lib/properties/set-some-properties.rng +45 -0
  191. data/lib/properties/simple.rng +8 -0
  192. data/lib/properties/state.rng +33 -0
  193. data/lib/properties/status.rng +12 -0
  194. data/lib/properties/t_attributes.rng +7 -0
  195. data/lib/properties/t_dataelements.rng +7 -0
  196. data/lib/properties/t_endpoints.rng +7 -0
  197. data/lib/properties/t_position.rng +7 -0
  198. data/lib/properties/t_positions.rng +7 -0
  199. data/lib/properties/t_simple.rng +7 -0
  200. data/lib/properties/t_status.rng +7 -0
  201. data/lib/properties/t_transformation.rng +7 -0
  202. data/lib/properties/transformation.rng +40 -0
  203. data/server/dev.rb +1 -0
  204. data/server/handlerwrappers/default.rb +40 -38
  205. data/server/resources/backend/README.md +17 -0
  206. data/server/resources/backend/instance.rb +23 -0
  207. data/server/resources/backend/instance.template +19 -0
  208. data/server/resources/backend/opts.yaml +6 -0
  209. data/server/resources/backend/run +33 -0
  210. data/server/resources/notifications/logging/subscription.xml +19 -0
  211. data/server/resources/properties.empty +38 -0
  212. data/server/resources/properties.init +11 -11
  213. data/server/resources/states.dot +19 -0
  214. data/server/resources/states.xml +49 -0
  215. data/server/resources/transformation_dslx.xsl +12 -3
  216. data/server/routing/end.rb +44 -0
  217. data/server/routing/forward-events.rb +59 -0
  218. data/server/routing/forward-votes.rb +108 -0
  219. data/server/routing/persist.rb +155 -0
  220. data/server/server.rb +1 -0
  221. data/tools/cpee +46 -15
  222. data/tools/instantiation/instantiation +0 -1
  223. data/tools/server/server.rb +0 -1
  224. metadata +78 -132
  225. data/INSTALL +0 -23
  226. data/cockpit/templates/convert_preset.rb +0 -32
  227. data/cockpit/templates/testsets.xml +0 -11
  228. data/cockpit/templates/transformations.xml +0 -4
  229. data/cockpit/themes/compact/rngs/alternative.rng +0 -1
  230. data/cockpit/themes/compact/rngs/choose.rng +0 -1
  231. data/cockpit/themes/compact/rngs/critical.rng +0 -1
  232. data/cockpit/themes/compact/rngs/escape.rng +0 -1
  233. data/cockpit/themes/compact/rngs/group.rng +0 -1
  234. data/cockpit/themes/compact/rngs/loop.rng +0 -1
  235. data/cockpit/themes/compact/rngs/manipulate.rng +0 -1
  236. data/cockpit/themes/compact/rngs/otherwise.rng +0 -1
  237. data/cockpit/themes/compact/rngs/parallel.rng +0 -1
  238. data/cockpit/themes/compact/rngs/parallel_branch.rng +0 -1
  239. data/cockpit/themes/compact/rngs/stop.rng +0 -1
  240. data/cockpit/themes/compact/rngs/terminate.rng +0 -1
  241. data/cockpit/themes/default/rngs/finalize.rng +0 -6
  242. data/cockpit/themes/default/rngs/update.rng +0 -6
  243. data/cockpit/themes/default/theme.js +0 -1286
  244. data/cockpit/themes/extended/rngs/alternative.rng +0 -1
  245. data/cockpit/themes/extended/rngs/choose.rng +0 -1
  246. data/cockpit/themes/extended/rngs/critical.rng +0 -1
  247. data/cockpit/themes/extended/rngs/escape.rng +0 -1
  248. data/cockpit/themes/extended/rngs/group.rng +0 -1
  249. data/cockpit/themes/extended/rngs/loop.rng +0 -1
  250. data/cockpit/themes/extended/rngs/manipulate.rng +0 -1
  251. data/cockpit/themes/extended/rngs/otherwise.rng +0 -1
  252. data/cockpit/themes/extended/rngs/parallel.rng +0 -1
  253. data/cockpit/themes/extended/rngs/parallel_branch.rng +0 -1
  254. data/cockpit/themes/extended/rngs/stop.rng +0 -1
  255. data/cockpit/themes/extended/rngs/terminate.rng +0 -1
  256. data/cockpit/themes/labels/rngs/alternative.rng +0 -25
  257. data/cockpit/themes/labels/rngs/call.rng +0 -81
  258. data/cockpit/themes/labels/rngs/callmanipulate.rng +0 -101
  259. data/cockpit/themes/labels/rngs/choose.rng +0 -12
  260. data/cockpit/themes/labels/rngs/critical.rng +0 -5
  261. data/cockpit/themes/labels/rngs/escape.rng +0 -1
  262. data/cockpit/themes/labels/rngs/finalize.rng +0 -6
  263. data/cockpit/themes/labels/rngs/group.rng +0 -3
  264. data/cockpit/themes/labels/rngs/loop.rng +0 -22
  265. data/cockpit/themes/labels/rngs/manipulate.rng +0 -9
  266. data/cockpit/themes/labels/rngs/otherwise.rng +0 -22
  267. data/cockpit/themes/labels/rngs/parallel.rng +0 -13
  268. data/cockpit/themes/labels/rngs/parallel_branch.rng +0 -8
  269. data/cockpit/themes/labels/rngs/stop.rng +0 -5
  270. data/cockpit/themes/labels/rngs/terminate.rng +0 -1
  271. data/cockpit/themes/labels/rngs/update.rng +0 -6
  272. data/cockpit/themes/labels/symbols/alternative.svg +0 -5
  273. data/cockpit/themes/labels/symbols/arrow.svg +0 -3
  274. data/cockpit/themes/labels/symbols/call.svg +0 -6
  275. data/cockpit/themes/labels/symbols/callmanipulate.svg +0 -8
  276. data/cockpit/themes/labels/symbols/choose.svg +0 -5
  277. data/cockpit/themes/labels/symbols/choose_exclusive.svg +0 -5
  278. data/cockpit/themes/labels/symbols/choose_inclusive.svg +0 -4
  279. data/cockpit/themes/labels/symbols/complex.svg +0 -8
  280. data/cockpit/themes/labels/symbols/critical.svg +0 -4
  281. data/cockpit/themes/labels/symbols/end.svg +0 -3
  282. data/cockpit/themes/labels/symbols/escape.svg +0 -5
  283. data/cockpit/themes/labels/symbols/event_end.svg +0 -3
  284. data/cockpit/themes/labels/symbols/loop.svg +0 -5
  285. data/cockpit/themes/labels/symbols/manipulate.svg +0 -4
  286. data/cockpit/themes/labels/symbols/otherwise.svg +0 -5
  287. data/cockpit/themes/labels/symbols/parallel.svg +0 -5
  288. data/cockpit/themes/labels/symbols/parallel_branch.svg +0 -5
  289. data/cockpit/themes/labels/symbols/parallel_branch_compact.svg +0 -4
  290. data/cockpit/themes/labels/symbols/parallel_branch_event.svg +0 -14
  291. data/cockpit/themes/labels/symbols/parallel_branch_normal.svg +0 -5
  292. data/cockpit/themes/labels/symbols/scripts.svg +0 -4
  293. data/cockpit/themes/labels/symbols/start.svg +0 -3
  294. data/cockpit/themes/labels/symbols/stop.svg +0 -5
  295. data/cockpit/themes/labels/symbols/terminate.svg +0 -4
  296. data/cockpit/themes/packed/rngs/alternative.rng +0 -1
  297. data/cockpit/themes/packed/rngs/choose.rng +0 -1
  298. data/cockpit/themes/packed/rngs/critical.rng +0 -1
  299. data/cockpit/themes/packed/rngs/escape.rng +0 -1
  300. data/cockpit/themes/packed/rngs/group.rng +0 -1
  301. data/cockpit/themes/packed/rngs/loop.rng +0 -1
  302. data/cockpit/themes/packed/rngs/manipulate.rng +0 -1
  303. data/cockpit/themes/packed/rngs/otherwise.rng +0 -1
  304. data/cockpit/themes/packed/rngs/parallel.rng +0 -1
  305. data/cockpit/themes/packed/rngs/parallel_branch.rng +0 -1
  306. data/cockpit/themes/packed/rngs/stop.rng +0 -1
  307. data/cockpit/themes/packed/rngs/terminate.rng +0 -1
  308. data/cockpit/themes/preset/rngs/alternative.rng +0 -1
  309. data/cockpit/themes/preset/rngs/choose.rng +0 -1
  310. data/cockpit/themes/preset/rngs/critical.rng +0 -1
  311. data/cockpit/themes/preset/rngs/escape.rng +0 -1
  312. data/cockpit/themes/preset/rngs/group.rng +0 -1
  313. data/cockpit/themes/preset/rngs/loop.rng +0 -1
  314. data/cockpit/themes/preset/rngs/manipulate.rng +0 -1
  315. data/cockpit/themes/preset/rngs/otherwise.rng +0 -1
  316. data/cockpit/themes/preset/rngs/parallel.rng +0 -1
  317. data/cockpit/themes/preset/rngs/parallel_branch.rng +0 -1
  318. data/cockpit/themes/preset/rngs/stop.rng +0 -1
  319. data/cockpit/themes/preset/rngs/terminate.rng +0 -1
  320. data/lib/cpee/empty_workflow.rb +0 -28
  321. data/lib/cpee/handler_notifications.rb +0 -47
  322. data/lib/cpee/handler_properties.rb +0 -50
  323. data/lib/cpee/instantiation.rb +0 -369
  324. data/lib/cpee/processtransformation/bpel/Repository/booking.bpel +0 -125
  325. data/lib/cpee/processtransformation/bpel/Repository/booking.wsdl +0 -72
  326. data/lib/cpee/processtransformation/bpel/Repository/booking/airline.wsdl +0 -71
  327. data/lib/cpee/processtransformation/bpel/Repository/booking/hotel.wsdl +0 -64
  328. data/lib/cpee/processtransformation/bpel/Repository/booking/report.wsdl +0 -71
  329. data/lib/cpee/processtransformation/bpel/bpel2wee.rb +0 -34
  330. data/lib/cpee/processtransformation/bpel/bpelserver.ru +0 -64
  331. data/lib/cpee/processtransformation/bpel/bpelserver.xml +0 -70
  332. data/lib/cpee/processtransformation/bpel/lib/BPEL_Transform.rb +0 -367
  333. data/lib/cpee/processtransformation/bpmn2.rb +0 -297
  334. data/lib/cpee/processtransformation/cpee.rb +0 -119
  335. data/lib/cpee/processtransformation/structures.rb +0 -465
  336. data/lib/cpee/processtransformation/target.rb +0 -50
  337. data/log/azure.rb +0 -10
  338. data/log/azure_logger.rb +0 -136
  339. data/log/chain.xml +0 -27
  340. data/log/elasticsearch.rb +0 -15
  341. data/log/elasticsearch_logging.rb +0 -377
  342. data/log/legacy/test_es.rb +0 -26
  343. data/log/legacy/test_split.rb +0 -211
  344. data/log/log.xml +0 -13
  345. data/log/non_tamp.rb +0 -156
  346. data/log/sic.rb +0 -64
  347. data/log/template.xes_xml +0 -23
  348. data/log/template.xes_yaml +0 -28
  349. data/log/trace.yaml +0 -17717
  350. data/log/trace_sic.yaml +0 -18343
  351. data/log/xes_xml.rb +0 -121
  352. data/log/xes_yaml.rb +0 -96
  353. data/server/handlerwrappers/soap.rb +0 -146
  354. data/server/resources/properties.schema.active +0 -139
  355. data/server/resources/properties.schema.finished +0 -139
  356. data/server/resources/properties.schema.inactive +0 -136
  357. data/test/callback.rb +0 -9
@@ -1,70 +0,0 @@
1
- <description datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
2
-
3
- <message name="list-of-workflow-instances">
4
- <parameter name="wis" mimetype="text/xml" handler="http://riddl.org/ns/handlers/relaxng">
5
- <xi:include href="rngs/instances.rng"/>
6
- </parameter>
7
- </message>
8
-
9
- <message name="instance-id">
10
- <parameter name="id" type="integer"/>
11
- </message>
12
-
13
- <message name="instance-name">
14
- <parameter name="name" type="string"/>
15
- </message>
16
-
17
- <message name="instance-info">
18
- <parameter name="info" mimetype="text/xml" handler="http://riddl.org/ns/handlers/relaxng">
19
- <xi:include href="rngs/instance-info.rng"/>
20
- </parameter>
21
- </message>
22
- <message name="callbacks">
23
- <parameter name="info" mimetype="text/xml" handler="http://riddl.org/ns/handlers/relaxng">
24
- <xi:include href="rngs/callbacks.rng"/>
25
- </parameter>
26
- </message>
27
- <message name="xsl">
28
- <parameter name="xsl" mimetype="application/xml"/>
29
- </message>
30
-
31
- <message name="message">
32
- <parameter name="type" type="integer"/>
33
- <parameter name="message" type="string"/>
34
- <optional>
35
- <parameter name="details" mimetype="text/xml"/>
36
- <parameter name="details" mimetype="text/yaml"/>
37
- </optional>
38
- </message>
39
-
40
- <resource>
41
- <get in="*" out="list-of-bpel-schemas"/>
42
- <resource relative='xsls'>
43
- <resource>
44
- <get in="*" out="xsl"/>
45
- </resource>
46
- </resource>
47
- <resource relative="cpee">
48
- <get in="*" out="cpee-base"/>
49
- </resource>
50
- <resource>
51
- <get in="*" out="schema-info"/>
52
- <resource relative="instances">
53
- <get in="*" out="instances"/>
54
- </resource>
55
- <resource relative="dsl">
56
- <get in="*" out="dsl"/>
57
- </resource>
58
- <resource relative="dataelements">
59
- <get in="*" out="dataelements"/>
60
- </resource>
61
- <resource relative="endpoints">
62
- <get in="*" out="endpoints"/>
63
- </resource>
64
- <resource relative="invocation">
65
- <get in="*" out="invocation"/>
66
- </resource>
67
- <post in="*"/>
68
- <put in="*"/>
69
- </resource>
70
- </description>
@@ -1,367 +0,0 @@
1
- #!/usr/bin/ruby
2
- require 'rubygems'
3
- require 'xml/smart'
4
-
5
- class BPEL_Transform
6
-
7
- def initialize(fname)
8
- @base = ::File.dirname(fname)
9
- @doc = XML::Smart.open(fname)
10
- @doc.namespaces = {
11
- 'bpel' => 'http://docs.oasis-open.org/wsbpel/2.0/process/executable',
12
- 'bpws' => 'http://schemas.xmlsoap.org/ws/2003/03/business-process/',
13
- 'ext' => 'http://www.activebpel.org/2006/09/bpel/extension/query_handling',
14
- 'xsd' => 'http://www.w3.org/2001/XMLSchema'
15
- }
16
- @acounter = 0
17
- @MULTI = 2
18
- @vars = {}
19
- end
20
-
21
- def transform_dsl # {{{
22
- @acounter = 0
23
- @vars = {}
24
- extract_vars
25
- spaces = 0
26
- result = ''
27
- @doc.find("/bpel:process/bpel:sequence").each do |e|
28
- result << print_elements(e,spaces)
29
- end
30
- result
31
- end # }}}
32
- def extract_vars # {{{
33
- @doc.find("//bpel:variables/bpel:variable").each do |v|
34
- @vars[v.attributes['name']] = extract_ns_plus v.attributes['messageType']
35
- end
36
- end # }}}
37
- def transform_data # {{{
38
- result = "<dataelements>\n"
39
- @doc.find("//bpel:variables/bpel:variable").each do |v|
40
- result << print_spaces(@MULTI)
41
- result << "<" + v.attributes['name'] + "/>\n"
42
- end
43
- result << '</dataelements>'
44
- result
45
- end # }}}
46
- def transform_endpoints # {{{
47
- result = XML::Smart.string('<endpoints/>')
48
- result.namespaces = {
49
- 'xsd' => 'http://www.w3.org/2001/XMLSchema',
50
- }
51
- @doc.find("//bpel:invoke").each do |e|
52
- op = e.attributes['operation']
53
- plnk_name = e.attributes['partnerLink']
54
- @doc.find("/bpel:process/bpel:partnerLinks/bpel:partnerLink[@name=\"#{plnk_name}\"]").each do |f|
55
- plnk_role = f.attributes['partnerRole']
56
- plnk_type = remove_ns f.attributes['partnerLinkType']
57
- @doc.find("/bpel:process/bpel:import[@importType=\"http://www.w3.org/ns/wsdl\"]").each do |g|
58
- XML::Smart.open(@base + "/" + g.attributes['location']) do |w|
59
- w.namespaces = {
60
- 'wsdl' => 'http://www.w3.org/ns/wsdl',
61
- 'plnk' => 'http://schemas.xmlsoap.org/ws/2003/05/partner-link/',
62
- 'std' => g.attributes['namespace'],
63
- 'xsd' => 'http://www.w3.org/2001/XMLSchema',
64
- 'whttp' => 'http://www.w3.org/ns/wsdl/http'
65
- }
66
- w.find("/wsdl:description/plnk:partnerLinkType[@name='#{plnk_type}']/plnk:role[@name='#{plnk_role}']").each do |h|
67
- interface = remove_ns h.attributes['portType']
68
- method = w.find("string(/wsdl:description/wsdl:binding[@interface='#{interface}']/wsdl:operation[@ref='#{op}']/@whttp:method)")
69
- method = method == '' ? 'SOAP' : method
70
- n1 = result.root.add("#{plnk_name}.#{op}")
71
- w.find("/wsdl:description/wsdl:interface[@name='#{interface}']/wsdl:operation[@name='#{op}']/wsdl:*").each do |i|
72
- schema_nsn = extract_ns i.attributes['element']
73
- schema_root = remove_ns i.attributes['element']
74
- schema_ns = w.root.namespaces[schema_nsn]
75
- w.find("/wsdl:description/wsdl:types/xsd:schema[@targetNamespace='#{schema_ns}']").each do |s|
76
- n2 = n1.add(i.name.to_s, 'method' => method, 'targetNamespace' => w.root.attributes['targetNamespace'])
77
- n2.add(s)
78
- n2.find("xsd:schema/xsd:element[@name!='#{schema_root}']").delete_all!
79
- end
80
- end
81
- end
82
- end
83
- end
84
- end
85
- end
86
- result.to_s
87
- end # }}}
88
- def transform_invocation # {{{
89
- result = XML::Smart.string('<invocations/>')
90
- @doc.find("/bpel:process/bpel:sequence/bpel:receive[@createInstance='yes']").each do |e|
91
- op = e.attributes['operation']
92
- plnk_name = e.attributes['partnerLink']
93
- @doc.find("/bpel:process/bpel:partnerLinks/bpel:partnerLink[@name=\"#{plnk_name}\"]").each do |f|
94
- plnk_role = f.attributes['myRole']
95
- plnk_type = remove_ns f.attributes['partnerLinkType']
96
- @doc.find("/bpel:process/bpel:import[@importType=\"http://www.w3.org/ns/wsdl\"]").each do |g|
97
- XML::Smart.open(@base + "/" + g.attributes['location']) do |w|
98
- w.namespaces = {
99
- 'wsdl' => 'http://www.w3.org/ns/wsdl',
100
- 'plnk' => 'http://schemas.xmlsoap.org/ws/2003/05/partner-link/',
101
- 'std' => g.attributes['namespace'],
102
- 'xsd' => 'http://www.w3.org/2001/XMLSchema',
103
- 'whttp' => 'http://www.w3.org/ns/wsdl/http'
104
- }
105
- w.find("/wsdl:description/plnk:partnerLinkType[@name='#{plnk_type}']/plnk:role[@name='#{plnk_role}']").each do |h|
106
- interface = remove_ns h.attributes['portType']
107
- method = w.find("string(/wsdl:description/wsdl:binding[@interface='#{interface}']/wsdl:operation[@ref='#{op}']/@whttp:method)")
108
- method = method == '' ? 'SOAP' : method
109
- w.find("/wsdl:description/wsdl:interface[@name='#{interface}']/wsdl:operation[@name='#{op}']/wsdl:input").each do |i|
110
- schema_nsn = extract_ns i.attributes['element']
111
- schema_root = remove_ns i.attributes['element']
112
- schema_ns = w.root.namespaces[schema_nsn]
113
- w.find("/wsdl:description/wsdl:types/xsd:schema[@targetNamespace='#{schema_ns}']/xsd:element[@name!='#{schema_root}']").delete_all!
114
- w.find("/wsdl:description/wsdl:types/xsd:schema[@targetNamespace='#{schema_ns}']").each do |s|
115
- node = result.root.add('invocation', 'plnk_name' => plnk_name, 'plnk_role' => plnk_role, 'plnk_type' => plnk_type, 'interface' => interface, 'method' => method, 'targetNamespace' => w.root.attributes['targetNamespace'])
116
- node.add(s)
117
- end
118
- end
119
- end
120
- end
121
- end
122
- end
123
- end
124
- result.to_s
125
- end # }}}
126
-
127
- def print_elements(e,spaces) # {{{
128
- result = ''
129
- e.find("*[not(@createInstance) or @createInstance='no']").each do |e|
130
- result << print_element(e,spaces)
131
- end
132
- result
133
- end # }}}
134
- def print_element(e,spaces) # {{{
135
- result = ''
136
- case e.name.name
137
- when 'invoke'
138
- result << print_activity_plain(spaces)
139
- result << print_activity_call(e,spaces)
140
- when 'receive'
141
- result << print_activity_plain(spaces)
142
- result << print_activity_call(e)
143
- result << print_activity_end(spaces)
144
- when 'reply'
145
- result << print_reply(e,spaces)
146
- when 'forEach'
147
- result << print_foreach(e,spaces)
148
- when 'pick'
149
- when 'sequence'
150
- result << print_elements(e,spaces)
151
- when 'pick'
152
- when 'scope'
153
- when 'wait'
154
- when 'assign'
155
- result << print_activity_plain(spaces)
156
- result << print_activity_manipulate(e)
157
- result << print_activity_assign(e,spaces+@MULTI)
158
- result << print_activity_end(spaces)
159
- when 'if'
160
- result << print_choose(e,spaces)
161
- when 'while'
162
- result << print_while(e,spaces)
163
- when 'flow'
164
- result << print_parallel(e,spaces)
165
- end
166
- result
167
- end # }}}
168
-
169
- def print_activity_plain(spaces) # {{{
170
- @acounter += 1
171
- result = print_spaces(spaces)
172
- result << 'activity :a'
173
- result << @acounter.to_s
174
- end # }}}
175
- def print_activity_manipulate(e) # {{{
176
- result = ", :manipulate do\n"
177
- end # }}}
178
- def print_activity_assign(e,spaces) # {{{
179
- result = ''
180
- e.find('bpel:copy').each do |c|
181
- result << print_spaces(spaces)
182
- result << bpel_copy_x(c,'bpel:to','set')
183
- result << ' = '
184
- result << bpel_copy_x(c,'bpel:from','evaluate')
185
- result << "\n"
186
- end
187
- result
188
- end # }}}
189
- def print_activity_end(spaces) # {{{
190
- result = print_spaces(spaces)
191
- result << "end\n"
192
- end # }}}
193
- def bpel_copy_x(c,what,op) # {{{
194
- result = ''
195
- c.find(what).each do |to|
196
- text = if to.attributes['variable']
197
- if to.attributes['part']
198
- temp = "$#{to.attributes['variable']}"
199
- temp << '/' + @vars[to.attributes['variable']].to_s + to.attributes['part']
200
- result << transform_bpel_xpath(temp,op)
201
- else
202
- result << "data.#{to.attributes['variable']}"
203
- end
204
- temp
205
- else
206
- result << transform_bpel_xpath(to.text,op)
207
- end
208
- end
209
- result
210
- end # }}}
211
-
212
- def print_choose(e,spaces) # {{{
213
- result = ''
214
- result << print_spaces(spaces) << "choose do\n"
215
- result << print_alternative(e,'alternative',spaces+@MULTI)
216
- e.find('bpel:elseif').each do |ei|
217
- result << print_alternative(ei,'alternative',spaces+@MULTI)
218
- end
219
- e.find('bpel:else').each do |ei|
220
- result << print_alternative(ei,'otherwise',spaces+@MULTI)
221
- end
222
- result << print_spaces(spaces) << "end\n"
223
- result
224
- end # }}}
225
- def print_alternative(e,word,spaces) # {{{
226
- result = ''
227
- result << print_spaces(spaces)
228
- case word
229
- when 'alternative'
230
- result << word + " "
231
- result << transform_bpel_xpath(e.find('string(bpel:condition)'),'evaluate')
232
- when 'otherwise'
233
- result << word
234
- end
235
- result << " do\n"
236
- result << print_elements(e,spaces+@MULTI)
237
- result << print_spaces(spaces) << "end\n"
238
- result
239
- end # }}}
240
-
241
- def print_while(e,spaces) # {{{
242
- result = ''
243
- result << print_spaces(spaces)
244
- result << "loop pre_test{"
245
- result << transform_bpel_xpath(e.find('string(bpel:condition)'),'evaluate')
246
- result << "} do\n"
247
- result << print_elements(e,spaces+@MULTI)
248
- result << print_spaces(spaces) << "end\n"
249
- result
250
- end # }}}
251
-
252
- def print_foreach(e,spaces) # {{{
253
- result = ''
254
- cname = e.find('string(@counterName)')
255
- parallel = e.find('boolean(@parallel[.="yes"])')
256
- sps = spaces
257
-
258
- if parallel
259
- result << print_spaces(sps) << "parallel(:wait) do\n"
260
- sps += @MULTI
261
- end
262
-
263
- result << print_spaces(sps) << "#{cname} = " << e.find('string(bpel:startCounterValue)') << "\n"
264
- result << print_spaces(sps) << "loop pre_test{"
265
- result << "#{cname} <= " << transform_bpel_xpath(e.find('string(bpel:finalCounterValue)'),'evaluate')
266
- result << "} do\n"
267
- if parallel
268
- sps += @MULTI
269
- result << print_spaces(sps) << "parallel_branch(#{cname}) do |#{cname}|\n"
270
- end
271
- e.find("*[name()='bpel:scope']").each do |f|
272
- result << print_elements(f,sps+@MULTI)
273
- end
274
- if parallel
275
- result << print_spaces(sps) << "end\n"
276
- sps -= @MULTI
277
- end
278
- result << print_spaces(sps+@MULTI) << "#{cname} += 1\n"
279
- result << print_spaces(sps) << "end\n"
280
-
281
- if parallel
282
- result << print_spaces(spaces) << "end\n"
283
- end
284
- result
285
- end # }}}
286
-
287
- def print_reply(e,spaces) # {{{
288
- result = ''
289
- result << print_spaces(spaces)
290
- result << "status.update(1,\"#{e.attributes['partnerLink']}.#{e.attributes['operation']};#{e.attributes['variable']}\")"
291
- result
292
- end # }}}
293
-
294
- def print_parallel(e,spaces) # {{{
295
- result = ''
296
- result << print_spaces(spaces)
297
- result << "parallel do\n"
298
-
299
- result << print_spaces(spaces+@MULTI)
300
- result << "links = {}\n"
301
-
302
- e.find("*[name()!='bpel:links']").each do |e|
303
- result << print_spaces(spaces+@MULTI)
304
- result << "parallel_branch do\n"
305
-
306
- e.find('bpel:targets/bpel:target').each do |l|
307
- result << print_spaces(spaces+@MULTI+@MULTI)
308
- result << "links[\"" + l.attributes['linkName'] + "\"] = Thread.current\n"
309
- result << print_spaces(spaces+@MULTI+@MULTI)
310
- result << "Thread.current.stop\n"
311
- end
312
-
313
- result << print_element(e,spaces+@MULTI+@MULTI)
314
-
315
- e.find('bpel:sources/bpel:source').each do |s|
316
- result << print_spaces(spaces+@MULTI+@MULTI)
317
- result << "until links.include?(\"" + s.attributes["linkName"] + "\") && links[\"" + s.attributes["linkName"] + "\"].stop?\n"
318
- result << print_spaces(spaces+@MULTI+@MULTI+@MULTI)
319
- result << "Thread.current.pass\n"
320
- result << print_spaces(spaces+@MULTI+@MULTI) << "end\n"
321
- result << print_spaces(spaces+@MULTI+@MULTI)
322
- result << "links[\"" + s.attributes["linkName"] + "\"].run\n"
323
- end
324
-
325
- result << print_spaces(spaces+@MULTI) << "end\n"
326
- end
327
-
328
- result << print_spaces(spaces) << "end\n"
329
- result
330
- end # }}}
331
-
332
- def print_activity_call(e,spaces) # {{{
333
- result = ", :call, :\"#{e.attributes['partnerLink']}.#{e.attributes['operation']}\", data.#{e.attributes['inputVariable']}"
334
- if e.attributes['outputVariable']
335
- result << " do |result|\n"
336
- result << print_spaces(spaces+@MULTI)
337
- result << "data.#{e.attributes['outputVariable']} = result\n"
338
- result << print_activity_end(spaces)
339
- else
340
- result << "\n"
341
- end
342
- end # }}}
343
-
344
- def print_spaces(spaces) # {{{
345
- ' ' * spaces
346
- end # }}}
347
- def transform_bpel_xpath(text,op) # {{{
348
- text.gsub!(/\$([a-z][a-zA-Z0-9]+)\.Document/,'/helper/\1')
349
- text.gsub!(/\$([a-z][a-zA-Z0-9]+)\.([a-z][a-zA-Z0-9]+)/) do
350
- t1,t2 = $1,$2
351
- "/helper/#{t1}/" + @vars[t1] + t2
352
- end
353
- text.gsub!(/\$([a-z][a-zA-Z0-9]+)/,'/helper/\1')
354
- "XPATHHelper.#{op}(\"" + text.strip + "\")"
355
- end # }}}
356
-
357
- private
358
- def remove_ns(str) # {{{
359
- str.gsub(/[a-zA_Z][a-zA_Z0-9]*:/,'')
360
- end # }}}
361
- def extract_ns(str) # {{{
362
- str.nil? ? '' : str.match(/^([a-zA_Z][a-zA_Z0-9]*):/)[1].to_s
363
- end # }}}
364
- def extract_ns_plus(str) # {{{
365
- str.nil? ? '' : str.match(/^[a-zA_Z][a-zA_Z0-9]*:/).to_s
366
- end # }}}
367
- end
@@ -1,297 +0,0 @@
1
- # encoding: UTF-8
2
- #
3
- # This file is part of CPEE.
4
- #
5
- # Apache License, Version 2.0
6
- #
7
- # Copyright (c) 2013 Juergen Mangler
8
- #
9
- # Licensed under the Apache License, Version 2.0 (the "License");
10
- # you may not use this file except in compliance with the License.
11
- # You may obtain a copy of the License at
12
- #
13
- # http://www.apache.org/licenses/LICENSE-2.0
14
- #
15
- # Unless required by applicable law or agreed to in writing, software
16
- # distributed under the License is distributed on an "AS IS" BASIS,
17
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- # See the License for the specific language governing permissions and
19
- # limitations under the License.
20
-
21
- require File.expand_path(File.dirname(__FILE__) + '/structures')
22
- require 'rubygems'
23
- require 'xml/smart'
24
- require 'highline'
25
-
26
- module CPEE
27
-
28
- module ProcessTransformation
29
-
30
- module Source
31
-
32
- class BPMN2
33
- attr_reader :dataelements, :endpoints, :start, :graph
34
-
35
- def initialize(xml) #{{{
36
- @tree = Tree.new
37
- @hl = HighLine.new
38
- @start = nil
39
-
40
- doc = XML::Smart.string(xml)
41
- doc.register_namespace 'bm', "http://www.omg.org/spec/BPMN/20100524/MODEL"
42
-
43
- @dataelements = {}
44
- @endpoints = {}
45
- @graph = Graph.new
46
-
47
- extract_dataelements(doc)
48
- extract_endpoints(doc)
49
- extract_nodelink(doc)
50
-
51
- @traces = Traces.new [[@start]]
52
- end #}}}
53
-
54
- def extract_dataelements(doc) #{{{
55
- doc.find("/bm:definitions/bm:process/bm:property[bm:dataState/@name='cpee:dataelement']").each do |ref|
56
- if ref.attributes['itemSubjectRef']
57
- doc.find("/bm:definitions/bm:itemDefinition[@id=\"" + ref.attributes['itemSubjectRef'] + "\"]").each do |sref|
58
- @dataelements[ref.attributes['name']] = sref.attributes['structureRef'].to_s
59
- end
60
- else
61
- @dataelements[ref.attributes['name']] = ''
62
- end
63
- end
64
- end #}}}
65
-
66
- def extract_endpoints(doc) #{{{
67
- doc.find("/bm:definitions/bm:process/bm:property[bm:dataState/@name='cpee:endpoint']/@itemSubjectRef").each do |ref|
68
- doc.find("/bm:definitions/bm:itemDefinition[@id=\"" + ref.value + "\"]/@structureRef").each do |sref|
69
- @endpoints[ref.value] = sref.value
70
- end
71
- end
72
- end #}}}
73
-
74
- def extract_nodelink(doc) #{{{
75
- doc.find("/bm:definitions/bm:process/bm:*[@id and @name and not(@itemSubjectRef) and not(name()='sequenceFlow')]").each do |e|
76
- n = Node.new(self.object_id,e.attributes['id'],e.qname.name.to_sym,e.attributes['name'].strip,e.find('count(bm:incoming)'),e.find('count(bm:outgoing)'))
77
-
78
- if e.attributes['scriptFormat'] != ''
79
- n.script_type = e.attributes['scriptFormat']
80
- end
81
-
82
- e.find("bm:property[@name='cpee:endpoint']/@itemSubjectRef").each do |ep|
83
- n.endpoints << ep.value
84
- end
85
- e.find("bm:property[@name='cpee:method']/@itemSubjectRef").each do |m|
86
- n.methods << m.value
87
- end
88
- e.find("bm:script").each do |s|
89
- n.script ||= ''
90
- n.script << s.text.strip
91
- end
92
- e.find("bm:ioSpecification/bm:dataInput").each do |a|
93
- name = a.attributes['name']
94
- value = a.attributes['itemSubjectRef']
95
- if @dataelements.keys.include?(value)
96
- n.parameters[name] = 'data.' + value
97
- else
98
- n.parameters[name] = value
99
- end
100
- end
101
- e.find("bm:ioSpecification/bm:dataOutput").each do |a|
102
- ref = a.attributes['id']
103
- e.find("bm:dataOutputAssociation[bm:sourceRef=\"#{ref}\"]").each do |d|
104
- n.script_var = ref
105
- n.script_id = d.find("string(bm:targetRef)")
106
- end
107
- end
108
-
109
- @graph.add_node n
110
- @start = n if n.type == :startEvent && @start == nil
111
- end
112
-
113
- # extract all sequences to a links
114
- doc.find("/bm:definitions/bm:process/bm:sequenceFlow").each do |e|
115
- source = e.attributes['sourceRef']
116
- target = e.attributes['targetRef']
117
- cond = e.find('bm:conditionExpression')
118
- @graph.add_link Link.new(source, target, cond.empty? ? nil : cond.first.text.strip)
119
- end
120
-
121
- @graph.clean_up do |node|
122
- if node.type == :scriptTask && (x = @graph.find_script_id(node.id)).any?
123
- x.each do |k,n|
124
- n.script = node.script
125
- n.script_type = node.script_type
126
- end
127
- true
128
- else
129
- false
130
- end
131
- end
132
- end #}}}
133
-
134
- def build_traces #{{{
135
- build_extraces @traces, @start
136
- @traces
137
- end #}}}
138
- def build_tree(debug=false) #{{{
139
- build_ttree @tree, @traces.dup, nil, debug
140
- debug_print debug, 'Tree finished'
141
- @tree
142
- end #}}}
143
-
144
- def build_extraces(traces, node) #{{{
145
- dupt = traces.last.dup
146
- @graph.next_nodes(node).each_with_index do |n,i|
147
- traces << dupt.dup if i > 0
148
- if traces.last.include?(n)
149
- traces.last << n
150
- else
151
- traces.last << n
152
- build_extraces(traces,n)
153
- end
154
- end
155
- end #}}}
156
- private :build_extraces
157
-
158
- def map_node(node,flat) #{{{
159
- case node.type
160
- when :parallelGateway
161
- flat ? nil : Parallel.new(node.id,node.type)
162
- when :exclusiveGateway
163
- flat ? nil : Conditional.new(node.id,:exclusive,node.type)
164
- when :eventBasedGateway
165
- flat ? nil : Parallel.new(node.id,node.type,1)
166
- when :inclusiveGateway
167
- flat ? nil : Conditional.new(node.id,:inclusive,node.type)
168
- when :endEvent, :startEvent, nil
169
- nil
170
- else
171
- node
172
- end
173
- end #}}}
174
- private :map_node
175
-
176
- def print_node(niceid)
177
- @graph.find_node(niceid)
178
- end
179
-
180
- def build_ttree(branch,traces,enode=nil,debug=false,down=0)
181
- while not traces.finished?
182
- ### if traces exist more than once, make it so they exist only once
183
- ### if somebody creates a modell with an inclusive/exclusive that
184
- ### has identical branches with different conditions, we are fucked
185
- ### but how are the odds? right? right?
186
- traces.uniq!
187
- puts '--> now on ' + down.to_s if debug
188
- debug_print debug, traces
189
- if node = traces.same_first
190
- if branch.empty? && branch.respond_to?(:id)
191
- li = if (branch.id == traces.first_node.id)
192
- ### for tail controlled loops, use the link from this to next
193
- ### if a tasks loops to itself, then second_nodes returns the first
194
- @graph.link(branch.id,traces.second_nodes.first.id)
195
- else
196
- @graph.link(branch.id,traces.first_node.id)
197
- end
198
- unless li.nil?
199
- if branch.condition?
200
- branch.condition << li.condition unless li.condition.nil?
201
- branch.condition_type = "text/javascript"
202
- end
203
- if branch.respond_to?(:attributes)
204
- branch.attributes.merge!(li.attributes)
205
- li.attributes.delete_if{true}
206
- end
207
- end
208
- end
209
- if node == enode
210
- traces.shift_all
211
- elsif traces.incoming(node) == 1
212
- traces.shift_all
213
- n = map_node(node,traces.same_first)
214
- if !n.nil? && !(n.container? && traces.finished?)
215
- (branch << n).compact!
216
- end
217
- else
218
- loops = traces.loops
219
- if node.type == :exclusiveGateway || traces.all_loops? # or (infinite loop[s])
220
- traces.remove(loops)
221
-
222
- ### an infinite loop that can only be left by break is created
223
- ### at the output time it is decided wether this can be optimized
224
- branch << Loop.new(node.id)
225
- ### duplicate because we need it later to remove all the shit from traces
226
- loops.add_breaks(self.object_id,node.type == :exclusiveGateway)
227
- ### remove the exclusive gateway because we no longer need it
228
- ### if there is non (tail controlled, remove the loop target (last)
229
- if node.type == :exclusiveGateway
230
- loops.shift_all
231
- traces.shift_all
232
- else
233
- loops.pop_all
234
- end
235
- ### add the blank conditional to get a break
236
- puts '--> down head_loop to ' + (down + 1).to_s if debug
237
- if loops.same_first
238
- build_ttree branch.last.new_branch, loops, nil, debug, down + 1
239
- else
240
- build_ttree branch, loops, nil, debug, down + 1
241
- end
242
- puts '--> up head_loop from ' + (down + 1).to_s if debug
243
- else
244
- ### throw away the loop traces, remove loop traces from front of all other traces
245
- traces.remove(loops)
246
- traces.eliminate(loops)
247
- loops.extend
248
- puts '--> down tail_loop to ' + (down + 1).to_s if debug
249
- build_ttree branch, loops.dup, nil, debug, down + 1
250
- puts '--> up tail_loop from ' + (down + 1).to_s if debug
251
- end
252
- traces.remove_empty
253
- end
254
- else
255
- endnode = traces.find_endnode || enode
256
- puts "--> endnode #{endnode.nil? ? 'nil' : endnode.niceid}" if debug
257
- tracesgroup, endnode = traces.segment_by endnode
258
- tracesgroup.each do |trcs|
259
- next unless branch.last.respond_to?(:new_branch)
260
- nb = branch.last.new_branch
261
- unless trcs.finished?
262
- puts '--> branch down to ' + (down + 1).to_s if debug
263
- build_ttree nb, trcs, endnode, debug, down + 1
264
- puts '--> branch up from ' + (down + 1).to_s if debug
265
- end
266
- end
267
- # remove all traces that don't start with endnode to account for loops
268
- if endnode.nil?
269
- traces.empty!
270
- else
271
- traces.remove_by_endnode(endnode)
272
- end
273
- end
274
- end
275
- end
276
- private :build_ttree
277
-
278
- def debug_print(debug,traces) #{{{
279
- if debug
280
- puts '-' * @hl.output_cols, @tree.to_s
281
- puts traces.to_s
282
- @hl.ask('Continue ... '){ |q| q.echo = false }
283
- end
284
- end #}}}
285
- private :debug_print
286
-
287
- def generate_model(formater) #{{{
288
- formater.new(@tree).generate
289
- end #}}}
290
-
291
- end
292
-
293
- end
294
-
295
- end
296
-
297
- end