cpee 1.4.20 → 1.4.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. checksums.yaml +4 -4
  2. data/cpee.gemspec +1 -1
  3. data/lib/cpee/instantiation.rb +27 -13
  4. data/lib/instantiation.xml +1 -1
  5. data/log/logs/0a499c6f-397b-4ead-9528-8ce4190d5e8c.xes.yaml +138 -0
  6. data/log/logs/0eec6f24-d5f5-4f07-9125-b1985854e96c.xes.yaml +191 -0
  7. data/log/logs/17532e92-8e6e-4c91-bfa9-28817e42faee.xes.yaml +138 -0
  8. data/log/logs/30811b7d-3df6-40db-a284-31518fadce0d.xes.yaml +171 -0
  9. data/log/logs/453d4ae8-cf7c-4377-8ef3-5f47f7d6801e.xes.yaml +138 -0
  10. data/log/logs/49197119-b437-4bc0-8c57-b7e065945dd1.xes.yaml +171 -0
  11. data/log/logs/4ae75f71-e8ef-4a31-8fa6-3692267d8def.xes.yaml +130 -0
  12. data/log/logs/53d4ff20-041f-4255-a424-085848ebcad6.xes.yaml +211 -0
  13. data/log/logs/5d775fd6-fef7-46a9-94e4-139a2ea133ad.xes.yaml +171 -0
  14. data/log/logs/726f0d7b-7aa6-4281-89c6-6f233c28e09f.xes.yaml +195 -0
  15. data/log/logs/802f619e-d8de-4ff8-8ae5-bffe585179e9.xes.yaml +130 -0
  16. data/log/logs/83f11c93-40b1-4cbd-846e-57dc20b91e2d.xes.yaml +130 -0
  17. data/log/logs/93b6290b-4915-42a2-9857-0a791ad3b5e3.xes.yaml +179 -0
  18. data/log/logs/9945e0ce-f02b-4e38-8fe7-25c573f29fb7.xes.yaml +138 -0
  19. data/log/logs/9e32e3e9-fbef-45d4-90e2-61138d4eb88b.xes.yaml +171 -0
  20. data/log/logs/9f32c451-e05d-43a0-bb6d-515f1168d3ee.xes.yaml +179 -0
  21. data/log/logs/a6bbd56f-96d6-4ed4-928d-f4980b80e107.xes.yaml +130 -0
  22. data/log/logs/a7b9a45d-ae4b-4b2b-b9a0-5212d5d360d0.xes.yaml +138 -0
  23. data/log/logs/ad9f1f9c-b727-44cc-afce-e6c98815b639.xes.yaml +171 -0
  24. data/log/logs/b27668d3-e39b-490f-9137-76c59eb6e00b.xes.yaml +171 -0
  25. data/log/logs/bf9cab2c-9e55-49b5-8f70-5f0611d71ec0.xes.yaml +171 -0
  26. data/log/logs/d1d2e9ce-7806-47cc-a9f3-569f3d9cad90.xes.yaml +130 -0
  27. data/log/logs/d8624a1e-11de-4b1c-806a-9cdd5f808043.xes.yaml +130 -0
  28. data/log/logs/ed8d4536-6b41-4252-bad5-bf4a7d9df4f1.xes.yaml +130 -0
  29. data/log/logs/f2d4ab8e-edc4-4fd7-980a-95562fb90466.xes.yaml +130 -0
  30. data/log/logs/feb3c50b-a8db-4641-bbfd-8a081f59f16a.xes.yaml +179 -0
  31. data/log/sic.rb +45 -35
  32. data/log/template.xes_yaml +1 -1
  33. data/log/xes_yaml.pid +1 -1
  34. data/log/xes_yaml.rb +18 -18
  35. data/server/handlerwrappers/default.rb +4 -4
  36. data/server/instances/15/notifications/logging/consumer-secret +1 -0
  37. data/server/instances/15/notifications/logging/producer-secret +1 -0
  38. data/server/instances/15/notifications/logging/subscription.xml +16 -0
  39. data/server/instances/15/properties.xml +97 -0
  40. data/server/instances/16/notifications/51f2da0a2b51743cd8f434eada2428c6/consumer-secret +1 -0
  41. data/server/instances/16/notifications/51f2da0a2b51743cd8f434eada2428c6/producer-secret +1 -0
  42. data/server/instances/16/notifications/51f2da0a2b51743cd8f434eada2428c6/subscription.xml +5 -0
  43. data/server/instances/16/notifications/logging/consumer-secret +1 -0
  44. data/server/instances/16/notifications/logging/producer-secret +1 -0
  45. data/server/instances/16/notifications/logging/subscription.xml +16 -0
  46. data/server/instances/16/properties.xml +80 -0
  47. data/server/instances/17/notifications/logging/consumer-secret +1 -0
  48. data/server/instances/17/notifications/logging/producer-secret +1 -0
  49. data/server/instances/17/notifications/logging/subscription.xml +16 -0
  50. data/server/instances/17/properties.xml +97 -0
  51. data/server/instances/18/notifications/75330e9851bd351c8ae656a9b83c6465/consumer-secret +1 -0
  52. data/server/instances/18/notifications/75330e9851bd351c8ae656a9b83c6465/producer-secret +1 -0
  53. data/server/instances/18/notifications/75330e9851bd351c8ae656a9b83c6465/subscription.xml +5 -0
  54. data/server/instances/18/notifications/logging/consumer-secret +1 -0
  55. data/server/instances/18/notifications/logging/producer-secret +1 -0
  56. data/server/instances/18/notifications/logging/subscription.xml +16 -0
  57. data/server/instances/18/properties.xml +78 -0
  58. data/server/instances/19/notifications/aaef45f88e70f4036f1753a69229665b/consumer-secret +1 -0
  59. data/server/instances/19/notifications/aaef45f88e70f4036f1753a69229665b/producer-secret +1 -0
  60. data/server/instances/19/notifications/aaef45f88e70f4036f1753a69229665b/subscription.xml +5 -0
  61. data/server/instances/19/notifications/logging/consumer-secret +1 -0
  62. data/server/instances/19/notifications/logging/producer-secret +1 -0
  63. data/server/instances/19/notifications/logging/subscription.xml +16 -0
  64. data/server/instances/19/properties.xml +78 -0
  65. data/server/instances/20/notifications/5773d11316827873826f7e749a037709/consumer-secret +1 -0
  66. data/server/instances/20/notifications/5773d11316827873826f7e749a037709/producer-secret +1 -0
  67. data/server/instances/20/notifications/5773d11316827873826f7e749a037709/subscription.xml +5 -0
  68. data/server/instances/20/notifications/logging/consumer-secret +1 -0
  69. data/server/instances/20/notifications/logging/producer-secret +1 -0
  70. data/server/instances/20/notifications/logging/subscription.xml +16 -0
  71. data/server/instances/20/properties.xml +80 -0
  72. data/server/instances/21/notifications/logging/consumer-secret +1 -0
  73. data/server/instances/21/notifications/logging/producer-secret +1 -0
  74. data/server/instances/21/notifications/logging/subscription.xml +16 -0
  75. data/server/instances/21/properties.xml +97 -0
  76. data/server/instances/22/notifications/30d677fd9e2842193d276833377b9fba/consumer-secret +1 -0
  77. data/server/instances/22/notifications/30d677fd9e2842193d276833377b9fba/producer-secret +1 -0
  78. data/server/instances/22/notifications/30d677fd9e2842193d276833377b9fba/subscription.xml +5 -0
  79. data/server/instances/22/notifications/logging/consumer-secret +1 -0
  80. data/server/instances/22/notifications/logging/producer-secret +1 -0
  81. data/server/instances/22/notifications/logging/subscription.xml +16 -0
  82. data/server/instances/22/properties.xml +80 -0
  83. data/server/instances/23/notifications/logging/consumer-secret +1 -0
  84. data/server/instances/23/notifications/logging/producer-secret +1 -0
  85. data/server/instances/23/notifications/logging/subscription.xml +16 -0
  86. data/server/instances/23/properties.xml +97 -0
  87. data/server/instances/24/notifications/28f2189ca56cd2427efdfc57eb905e5f/consumer-secret +1 -0
  88. data/server/instances/24/notifications/28f2189ca56cd2427efdfc57eb905e5f/producer-secret +1 -0
  89. data/server/instances/24/notifications/28f2189ca56cd2427efdfc57eb905e5f/subscription.xml +5 -0
  90. data/server/instances/24/notifications/logging/consumer-secret +1 -0
  91. data/server/instances/24/notifications/logging/producer-secret +1 -0
  92. data/server/instances/24/notifications/logging/subscription.xml +16 -0
  93. data/server/instances/24/properties.xml +80 -0
  94. data/server/instances/25/notifications/logging/consumer-secret +1 -0
  95. data/server/instances/25/notifications/logging/producer-secret +1 -0
  96. data/server/instances/25/notifications/logging/subscription.xml +19 -0
  97. data/server/instances/25/properties.xml +97 -0
  98. data/server/instances/26/notifications/9a21be44b099502673e1cd8af3dba479/consumer-secret +1 -0
  99. data/server/instances/26/notifications/9a21be44b099502673e1cd8af3dba479/producer-secret +1 -0
  100. data/server/instances/26/notifications/9a21be44b099502673e1cd8af3dba479/subscription.xml +5 -0
  101. data/server/instances/26/notifications/logging/consumer-secret +1 -0
  102. data/server/instances/26/notifications/logging/producer-secret +1 -0
  103. data/server/instances/26/notifications/logging/subscription.xml +19 -0
  104. data/server/instances/26/properties.xml +80 -0
  105. data/server/instances/27/notifications/logging/consumer-secret +1 -0
  106. data/server/instances/27/notifications/logging/producer-secret +1 -0
  107. data/server/instances/27/notifications/logging/subscription.xml +19 -0
  108. data/server/instances/27/properties.xml +97 -0
  109. data/server/instances/28/notifications/bd82af4386830cdad3e253de3ee5e516/consumer-secret +1 -0
  110. data/server/instances/28/notifications/bd82af4386830cdad3e253de3ee5e516/producer-secret +1 -0
  111. data/server/instances/28/notifications/bd82af4386830cdad3e253de3ee5e516/subscription.xml +5 -0
  112. data/server/instances/28/notifications/logging/consumer-secret +1 -0
  113. data/server/instances/28/notifications/logging/producer-secret +1 -0
  114. data/server/instances/28/notifications/logging/subscription.xml +19 -0
  115. data/server/instances/28/properties.xml +80 -0
  116. data/server/instances/29/notifications/logging/consumer-secret +1 -0
  117. data/server/instances/29/notifications/logging/producer-secret +1 -0
  118. data/server/instances/29/notifications/logging/subscription.xml +19 -0
  119. data/server/instances/29/properties.xml +97 -0
  120. data/server/instances/30/notifications/74684c7d5ea89b47200503597c6a8d3c/consumer-secret +1 -0
  121. data/server/instances/30/notifications/74684c7d5ea89b47200503597c6a8d3c/producer-secret +1 -0
  122. data/server/instances/30/notifications/74684c7d5ea89b47200503597c6a8d3c/subscription.xml +5 -0
  123. data/server/instances/30/notifications/logging/consumer-secret +1 -0
  124. data/server/instances/30/notifications/logging/producer-secret +1 -0
  125. data/server/instances/30/notifications/logging/subscription.xml +19 -0
  126. data/server/instances/30/properties.xml +80 -0
  127. data/server/instances/31/notifications/logging/consumer-secret +1 -0
  128. data/server/instances/31/notifications/logging/producer-secret +1 -0
  129. data/server/instances/31/notifications/logging/subscription.xml +19 -0
  130. data/server/instances/31/properties.xml +97 -0
  131. data/server/instances/32/notifications/4e9c27a373f77e02b36be6cc2164a1f8/consumer-secret +1 -0
  132. data/server/instances/32/notifications/4e9c27a373f77e02b36be6cc2164a1f8/producer-secret +1 -0
  133. data/server/instances/32/notifications/4e9c27a373f77e02b36be6cc2164a1f8/subscription.xml +5 -0
  134. data/server/instances/32/notifications/logging/consumer-secret +1 -0
  135. data/server/instances/32/notifications/logging/producer-secret +1 -0
  136. data/server/instances/32/notifications/logging/subscription.xml +19 -0
  137. data/server/instances/32/properties.xml +80 -0
  138. data/server/instances/33/notifications/logging/consumer-secret +1 -0
  139. data/server/instances/33/notifications/logging/producer-secret +1 -0
  140. data/server/instances/33/notifications/logging/subscription.xml +19 -0
  141. data/server/instances/33/properties.xml +97 -0
  142. data/server/instances/34/notifications/76ac875c4d221cd3492e481a81182e94/consumer-secret +1 -0
  143. data/server/instances/34/notifications/76ac875c4d221cd3492e481a81182e94/producer-secret +1 -0
  144. data/server/instances/34/notifications/76ac875c4d221cd3492e481a81182e94/subscription.xml +5 -0
  145. data/server/instances/34/notifications/logging/consumer-secret +1 -0
  146. data/server/instances/34/notifications/logging/producer-secret +1 -0
  147. data/server/instances/34/notifications/logging/subscription.xml +19 -0
  148. data/server/instances/34/properties.xml +80 -0
  149. data/server/instances/35/notifications/logging/consumer-secret +1 -0
  150. data/server/instances/35/notifications/logging/producer-secret +1 -0
  151. data/server/instances/35/notifications/logging/subscription.xml +19 -0
  152. data/server/instances/35/properties.xml +94 -0
  153. data/server/instances/36/notifications/7c50d7013f5632adb8b32689620c3213/consumer-secret +1 -0
  154. data/server/instances/36/notifications/7c50d7013f5632adb8b32689620c3213/producer-secret +1 -0
  155. data/server/instances/36/notifications/7c50d7013f5632adb8b32689620c3213/subscription.xml +5 -0
  156. data/server/instances/36/notifications/logging/consumer-secret +1 -0
  157. data/server/instances/36/notifications/logging/producer-secret +1 -0
  158. data/server/instances/36/notifications/logging/subscription.xml +19 -0
  159. data/server/instances/36/properties.xml +80 -0
  160. data/server/instances/37/notifications/logging/consumer-secret +1 -0
  161. data/server/instances/37/notifications/logging/producer-secret +1 -0
  162. data/server/instances/37/notifications/logging/subscription.xml +19 -0
  163. data/server/instances/37/properties.xml +97 -0
  164. data/server/instances/38/notifications/a9d9ef3e82d5f1864534198e12f8ca05/consumer-secret +1 -0
  165. data/server/instances/38/notifications/a9d9ef3e82d5f1864534198e12f8ca05/producer-secret +1 -0
  166. data/server/instances/38/notifications/a9d9ef3e82d5f1864534198e12f8ca05/subscription.xml +5 -0
  167. data/server/instances/38/notifications/logging/consumer-secret +1 -0
  168. data/server/instances/38/notifications/logging/producer-secret +1 -0
  169. data/server/instances/38/notifications/logging/subscription.xml +19 -0
  170. data/server/instances/38/properties.xml +80 -0
  171. data/server/instances/39/notifications/logging/consumer-secret +1 -0
  172. data/server/instances/39/notifications/logging/producer-secret +1 -0
  173. data/server/instances/39/notifications/logging/subscription.xml +19 -0
  174. data/server/instances/39/properties.xml +97 -0
  175. data/server/instances/40/notifications/08a43a729b46ae851f586a0db118a4b3/consumer-secret +1 -0
  176. data/server/instances/40/notifications/08a43a729b46ae851f586a0db118a4b3/producer-secret +1 -0
  177. data/server/instances/40/notifications/08a43a729b46ae851f586a0db118a4b3/subscription.xml +5 -0
  178. data/server/instances/40/notifications/logging/consumer-secret +1 -0
  179. data/server/instances/40/notifications/logging/producer-secret +1 -0
  180. data/server/instances/40/notifications/logging/subscription.xml +19 -0
  181. data/server/instances/40/properties.xml +80 -0
  182. data/server/instances/41/notifications/logging/consumer-secret +1 -0
  183. data/server/instances/41/notifications/logging/producer-secret +1 -0
  184. data/server/instances/41/notifications/logging/subscription.xml +19 -0
  185. data/server/instances/41/properties.xml +97 -0
  186. data/server/instances/42/notifications/c5602688252fb056a3b7a6dd803d74b4/consumer-secret +1 -0
  187. data/server/instances/42/notifications/c5602688252fb056a3b7a6dd803d74b4/producer-secret +1 -0
  188. data/server/instances/42/notifications/c5602688252fb056a3b7a6dd803d74b4/subscription.xml +5 -0
  189. data/server/instances/42/notifications/logging/consumer-secret +1 -0
  190. data/server/instances/42/notifications/logging/producer-secret +1 -0
  191. data/server/instances/42/notifications/logging/subscription.xml +19 -0
  192. data/server/instances/42/properties.xml +80 -0
  193. data/server/instances/43/notifications/d8166e6e1c8500ac36978bbb7fa8f48f/consumer-secret +1 -0
  194. data/server/instances/43/notifications/d8166e6e1c8500ac36978bbb7fa8f48f/producer-secret +1 -0
  195. data/server/instances/{13/notifications/90d34985542a88c3071d176f6400efe7 → 43/notifications/d8166e6e1c8500ac36978bbb7fa8f48f}/subscription.xml +0 -0
  196. data/server/instances/43/notifications/logging/consumer-secret +1 -0
  197. data/server/instances/43/notifications/logging/producer-secret +1 -0
  198. data/server/instances/43/notifications/logging/subscription.xml +19 -0
  199. data/server/instances/43/properties.xml +97 -0
  200. data/server/instances/44/notifications/d03545ffb17a6eddf84fd4cd88423295/consumer-secret +1 -0
  201. data/server/instances/44/notifications/d03545ffb17a6eddf84fd4cd88423295/producer-secret +1 -0
  202. data/server/instances/44/notifications/d03545ffb17a6eddf84fd4cd88423295/subscription.xml +5 -0
  203. data/server/instances/44/notifications/logging/consumer-secret +1 -0
  204. data/server/instances/44/notifications/logging/producer-secret +1 -0
  205. data/server/instances/44/notifications/logging/subscription.xml +19 -0
  206. data/server/instances/44/properties.xml +80 -0
  207. data/server/resources/notifications/logging/subscription.xml +3 -0
  208. metadata +199 -10
  209. data/log/display.rb +0 -46
  210. data/server/instances/13/notifications/90d34985542a88c3071d176f6400efe7/consumer-secret +0 -1
  211. data/server/instances/13/notifications/90d34985542a88c3071d176f6400efe7/producer-secret +0 -1
  212. data/server/instances/9/notifications/e242ccf30f3878511aaf390e20e42d5d/consumer-secret +0 -1
  213. data/server/instances/9/notifications/e242ccf30f3878511aaf390e20e42d5d/producer-secret +0 -1
  214. data/server/instances/9/notifications/e242ccf30f3878511aaf390e20e42d5d/subscription.xml +0 -38
  215. data/server/server.pid +0 -1
data/log/sic.rb CHANGED
@@ -1,51 +1,61 @@
1
1
  #!/usr/bin/ruby
2
2
  require 'yaml'
3
3
  require 'typhoeus'
4
+ require 'stringio'
4
5
  require 'xml/smart'
5
6
 
6
- # concept:endpoint: https://centurio.work/flow/start/url/
7
- # id:id: a17
8
- # cpee:uuid: bf93adcd-9421-495b-bafa-d34de608fc6c
9
- # lifecycle:transition: unknown
10
- # cpee:lifecycle:transition: activity/receiving
11
- # list:
12
- # data_receiver:
13
- # - name: dataelements
14
- # mimetype: application/json
15
- # data:
16
- # CPEE-INSTANCE: https://centurio.work/flow/engine/547
17
- # qr: "*269MFA466*TZHZE 000"
18
- # queue: ''
19
- # machine: MaxxTurn45
20
- # program: _N_LOWERHOUSING2_MPF
21
- # label: Lowerhousing Turn 2
22
- # finished: no good
23
- # time:timestamp: '2019-01-16T11:24:41.162+01:00'
24
-
25
- def follow(fname,deep=0)
26
- io = File.open(fname)
7
+ def follow(fname,io,deep=0)
8
+ if ARGV[1] == 'copy'
9
+ File.write(File.basename(fname,'.xes.yaml') + '.xes.yaml',io.read)
10
+ io.rewind
11
+ end
27
12
  YAML.load_stream(io) do |e|
28
13
  if name = e.dig('log','trace','cpee:name')
29
- FileUtils.cp(File.join(__dir__,'logs',File.basename(fname,'.xes.yaml') + '.xes.yaml'),'.') if ARGV[1] == 'copy'
30
- puts " " * deep + name + " (#{File.basename(fname,'.xes.yaml')})"
14
+ puts " " * deep + name + " (#{File.basename(fname,'.xes.yaml')}) - #{e.dig('log','trace','concept:name')}"
31
15
  end
32
16
  if e.dig('event','concept:endpoint') == 'https://centurio.work/flow/start/url/' && e.dig('event','cpee:lifecycle:transition') == 'activity/receiving'
33
- val = e.dig('event','list','data_receiver',0,'data','CPEE-INSTANCE')
34
- res = Typhoeus.get(File.join(val,'/properties/values/attributes/uuid/'))
35
- if res.success?
36
- uuid = XML::Smart.string(res.body).find('string(/*)')
37
- follow File.dirname(fname) + "/#{uuid}.xes.yaml",deep + 2
17
+ base = e.dig('event','list','data_receiver',0,'data')
18
+ val = base.dig('CPEE-INSTANCE') rescue nil
19
+ if val.nil?
20
+ val = File.basename(base)
21
+ end
22
+ uuid = base.dig('CPEE-INSTANCE-UUID') rescue nil
23
+ unless uuid
24
+ res = Typhoeus.get(File.join('https://centurio.work/flow/engine/',val,'/properties/values/attributes/uuid/'))
25
+ if res.success?
26
+ uuid = XML::Smart.string(res.body).find('string(/*)')
27
+ end
38
28
  end
29
+ next unless ((base.dig('CPEE-STATE') == 'running' || (base.dig('CPEE-FORKED') == 'true')) rescue true)
30
+
31
+ react File.dirname(fname) + "/#{uuid}.xes.yaml",deep + 2
39
32
  end
40
33
  end
41
34
  end
42
35
 
43
- fname = File.join(__dir__,'logs',(ARGV[0].strip rescue '') + '.xes.yaml')
44
- if File.exists? fname
45
- follow fname
46
- else
47
- puts 'Copies log files tree to current directory.'
36
+ def react(name,deep=0)
37
+ if name =~ /^https?:\/\//
38
+ res = Typhoeus.get(name)
39
+ if res.success?
40
+ file = Tempfile.new('sic')
41
+ file.write(res.body)
42
+ file.rewind
43
+ follow name, file, deep
44
+ file.close
45
+ file.unlink
46
+ end
47
+ elsif File.exists? name
48
+ follow name, File.open(name), deep
49
+ end
50
+ end
51
+
52
+ def help
53
+ puts 'Views or copies log file trees to current directory.'
48
54
  puts
49
- puts ' Example: sic.rb UUID'
50
- puts ' Example: sic.rb UUID copy'
55
+ puts ' View: sic.rb https://centurio.work/log/865916c6-2b18-4e9d-81d4-0fab0df248f4.xes.yaml'
56
+ puts ' Copy: sic.rb https://centurio.work/log/865916c6-2b18-4e9d-81d4-0fab0df248f4.xes.yaml copy'
57
+ puts ' Copy: sic.rb ~/Projects/cpee/log/logs/865916c6-2b18-4e9d-81d4-0fab0df248f4.xes.yaml copy'
58
+ puts ' View: sic.rb 865916c6-2b18-4e9d-81d4-0fab0df248f4.xes.yaml'
51
59
  end
60
+
61
+ react(ARGV[0]) || help
@@ -11,7 +11,7 @@ log:
11
11
  concept:name: __INVALID__
12
12
  cpee:name: __INVALID__
13
13
  event:
14
- trace:id: -1
14
+ concept:instance: -1
15
15
  concept:name: __INVALID__
16
16
  concept:endpoint: ''
17
17
  id:id: ''
@@ -1 +1 @@
1
- 27395
1
+ 7611
@@ -22,7 +22,7 @@ class Logging < Riddl::Implementation #{{{
22
22
  log["log"]["trace"]["cpee:uuid"] ||= notification['instance_uuid'] if notification["instance_uuid"]
23
23
  File.open(File.join(log_dir,uuid+'.xes.yaml'),'w'){|f| f.puts log.to_yaml} unless File.exists? File.join(log_dir,uuid+'.xes.yaml')
24
24
  event = {}
25
- event["trace:id"] = instancenr
25
+ event["concept:instance"] = instancenr
26
26
  event["concept:name"] = notification["label"] if notification["label"]
27
27
  if notification["endpoint"]
28
28
  event["concept:endpoint"] = notification["endpoint"]
@@ -39,26 +39,26 @@ class Logging < Riddl::Implementation #{{{
39
39
  end
40
40
  event["cpee:lifecycle:transition"] = "#{topic}/#{event_name}"
41
41
  data_send = ((parameters["arguments"].nil? ? [] : parameters["arguments"]) rescue [])
42
- event["list"] = {"data_send" => data_send} unless data_send.empty?
42
+ event["data"] = {"data_send" => data_send} unless data_send.empty?
43
43
  if notification['changed']&.any?
44
- if event.has_key? "list"
45
- event["list"]["data_changed"] ||= notification['changed']
44
+ if event.has_key? "data"
45
+ event["data"]["data_changed"] ||= notification['changed']
46
46
  else
47
- event["list"] = {"data_changer" => notification['changed']}
47
+ event["data"] = {"data_changer" => notification['changed']}
48
48
  end
49
49
  end
50
50
  if notification['values']&.any?
51
- if event.has_key? "list"
52
- event["list"]["data_values"] ||= notification['values']
51
+ if event.has_key? "data"
52
+ event["data"]["data_values"] ||= notification['values']
53
53
  else
54
- event["list"] = {"data_values" => notification['values']}
54
+ event["data"] = {"data_values" => notification['values']}
55
55
  end
56
56
  end
57
- if receiving&.any?
58
- if event.has_key? "list"
59
- event["list"]["data_received"] ||= receiving
57
+ unless receiving&.empty?
58
+ if event.has_key? "data"
59
+ event["data"]["data_received"] ||= receiving
60
60
  else
61
- event["list"] = {"data_receiver" => receiving}
61
+ event["data"] = {"data_receiver" => receiving}
62
62
  end
63
63
  end
64
64
  event["time:timestamp"]= event['cpee:timestamp'] || Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z")
@@ -69,12 +69,12 @@ class Logging < Riddl::Implementation #{{{
69
69
  end
70
70
 
71
71
  def response
72
- topic = @p[1].value
73
- event_name = @p[2].value
74
- log_dir = @a[0]
75
- template = @a[1]
76
- instancenr = @h['CPEE_INSTANCE_URL'].split('/').last
77
- notification = JSON.parse(@p[3].value)
72
+ topic = @p[1].value
73
+ event_name = @p[2].value
74
+ log_dir = @a[0]
75
+ template = @a[1]
76
+ instancenr = @h['CPEE_INSTANCE_URL'].split('/').last
77
+ notification = JSON.parse(@p[3].value)
78
78
  doc topic, event_name, log_dir, template, instancenr, notification
79
79
  end
80
80
  end #}}}
@@ -87,7 +87,10 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
87
87
 
88
88
  raise "Could not #{parameters[:method] || 'post'} #{@handler_endpoint} - status: #{status}: #{result&.dig(0)&.value&.read}" if status < 200 || status >= 300
89
89
 
90
- unless headers["CPEE_CALLBACK"] && headers["CPEE_CALLBACK"] == 'true'
90
+ if headers['CPEE_INSTANTIATION']
91
+ @controller.notify("task/instantiation", :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :received => CPEE::ValueHelper.parse(headers['CPEE_INSTANTIATION']), :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
92
+ end
93
+ unless headers['CPEE_CALLBACK'] && headers['CPEE_CALLBACK'] == 'true'
91
94
  callback result
92
95
  end
93
96
  else
@@ -208,9 +211,6 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
208
211
  def callback(result=nil,options={})
209
212
  @controller.notify("activity/receiving", :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :received => structurize_result(result), :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated, :sensors => @sensors)
210
213
  result = simplify_result(result)
211
- if options['CPEE_INSTANTIATION']
212
- @controller.notify("task/instantiation", :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :received => structurize_result(result), :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
213
- end
214
214
  if options['CPEE_UPDATE']
215
215
  @handler_returnValue = result
216
216
  if options['CPEE_UPDATE_STATUS']
@@ -0,0 +1 @@
1
+ f7c77861ac613eeac8fb9829c9a545a2
@@ -0,0 +1 @@
1
+ 2a24d172b1aeb05fe94fdc5e095dec32
@@ -0,0 +1,16 @@
1
+ <subscription xmlns="http://riddl.org/ns/common-patterns/notifications-producer/1.0" url="http://localhost:9299/">
2
+ <topic id="activity">
3
+ <event>calling</event>
4
+ <event>receiving</event>
5
+ <event>done</event>
6
+ </topic>
7
+ <topic id="dataelements">
8
+ <event>change</event>
9
+ </topic>
10
+ <topic id="endpoints">
11
+ <event>change</event>
12
+ </topic>
13
+ <topic id="attributes">
14
+ <event>change</event>
15
+ </topic>
16
+ </subscription>
@@ -0,0 +1,97 @@
1
+ <properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
2
+ <attributes>
3
+ <uuid>ad9f1f9c-b727-44cc-afce-e6c98815b639</uuid>
4
+ <info>Subprocess</info>
5
+ <modeltype>CPEE</modeltype>
6
+ <theme>default</theme>
7
+ <customer>pilotfabrik</customer>
8
+ <status>development</status>
9
+ </attributes>
10
+ <state changed="2019-02-13T16:33:09+01:00">finished</state>
11
+ <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
12
+ <positions/>
13
+ <dataelements>
14
+ <instance>16</instance>
15
+ <res>{"CPEE-INSTANCE":"16","CPEE-INSTANCE-URL":"http://localhost:8298/16","CPEE-INSTANCE-UUID":"83f11c93-40b1-4cbd-846e-57dc20b91e2d","CPEE-STATE":"finished","a":17}</res>
16
+ </dataelements>
17
+ <endpoints>
18
+ <timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
19
+ <instantiate>http://localhost:9296/url/</instantiate>
20
+ </endpoints>
21
+ <dsl>call :a1, :instantiate, parameters: { :label =&gt; "Take 5", :method =&gt; :post, :arguments =&gt; [⭐(:name =&gt; :info, :value =&gt; "Take Time"), ⭐(:name =&gt; :behavior, :value =&gt; "wait_running"), ⭐(:name =&gt; :url, :value =&gt; "http://localhost/testsets/Take_5.xml"), ⭐(:name =&gt; :init, :value =&gt; "{ \"a\": 3 }")] }, finalize: &lt;&lt;-END
22
+ data.instance = result['CPEE-INSTANCE']
23
+ data.res = result
24
+ END
25
+ </dsl>
26
+ <dslx>
27
+ <description xmlns="http://cpee.org/ns/description/1.0">
28
+ <call id="a1" endpoint="instantiate">
29
+ <parameters>
30
+ <label>Take 5</label>
31
+ <method>:post</method>
32
+ <arguments>
33
+ <info>Take Time</info>
34
+ <behavior>wait_running</behavior>
35
+ <url>http://localhost/testsets/Take_5.xml</url>
36
+ <init>
37
+ <a>3</a>
38
+ </init>
39
+ </arguments>
40
+ </parameters>
41
+ <finalize output="result">data.instance = result['CPEE-INSTANCE']
42
+ data.res = result</finalize>
43
+ <update output="result"/>
44
+ <_timing>
45
+ <_timing_min/>
46
+ <_timing_max/>
47
+ <_timing_avg/>
48
+ </_timing>
49
+ <_notes>
50
+ <_notes_general/>
51
+ <_notes_output/>
52
+ <_attachments/>
53
+ </_notes>
54
+ </call>
55
+ </description>
56
+ </dslx>
57
+ <status>
58
+ <id>0</id>
59
+ <message>undefined</message>
60
+ </status>
61
+ <description>
62
+ <description xmlns="http://cpee.org/ns/description/1.0">
63
+ <call id="a1" endpoint="instantiate">
64
+ <parameters>
65
+ <label>Take 5</label>
66
+ <method>:post</method>
67
+ <arguments>
68
+ <info>Take Time</info>
69
+ <behavior>wait_running</behavior>
70
+ <url>http://localhost/testsets/Take_5.xml</url>
71
+ <init>
72
+ <a>3</a>
73
+ </init>
74
+ </arguments>
75
+ </parameters>
76
+ <finalize output="result">data.instance = result['CPEE-INSTANCE']
77
+ data.res = result</finalize>
78
+ <update output="result"/>
79
+ <_timing>
80
+ <_timing_min/>
81
+ <_timing_max/>
82
+ <_timing_avg/>
83
+ </_timing>
84
+ <_notes>
85
+ <_notes_general/>
86
+ <_notes_output/>
87
+ <_attachments/>
88
+ </_notes>
89
+ </call>
90
+ </description>
91
+ </description>
92
+ <transformation>
93
+ <description type="copy"/>
94
+ <dataelements type="none"/>
95
+ <endpoints type="none"/>
96
+ </transformation>
97
+ </properties>
@@ -0,0 +1,5 @@
1
+ <subscription xmlns="http://riddl.org/ns/common-patterns/notifications-producer/1.0" url="http://localhost:9296/callback/c87a2f56-5b96-4874-a545-a5367e4e1ac3">
2
+ <topic id="state">
3
+ <event>change</event>
4
+ </topic>
5
+ </subscription>
@@ -0,0 +1 @@
1
+ f7c77861ac613eeac8fb9829c9a545a2
@@ -0,0 +1 @@
1
+ 2a24d172b1aeb05fe94fdc5e095dec32
@@ -0,0 +1,16 @@
1
+ <subscription xmlns="http://riddl.org/ns/common-patterns/notifications-producer/1.0" url="http://localhost:9299/">
2
+ <topic id="activity">
3
+ <event>calling</event>
4
+ <event>receiving</event>
5
+ <event>done</event>
6
+ </topic>
7
+ <topic id="dataelements">
8
+ <event>change</event>
9
+ </topic>
10
+ <topic id="endpoints">
11
+ <event>change</event>
12
+ </topic>
13
+ <topic id="attributes">
14
+ <event>change</event>
15
+ </topic>
16
+ </subscription>
@@ -0,0 +1,80 @@
1
+ <properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
2
+ <attributes>
3
+ <uuid>83f11c93-40b1-4cbd-846e-57dc20b91e2d</uuid>
4
+ <info>Take Time</info>
5
+ <modeltype>CPEE</modeltype>
6
+ <theme>default</theme>
7
+ <customer>pilotfabrik</customer>
8
+ <status>development</status>
9
+ </attributes>
10
+ <state changed="2019-02-13T16:33:09+01:00">finished</state>
11
+ <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
12
+ <positions/>
13
+ <dataelements>
14
+ <a>17</a>
15
+ </dataelements>
16
+ <endpoints>
17
+ <timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
18
+ </endpoints>
19
+ <dsl>call :a1, :timeout, parameters: { :label =&gt; "", :method =&gt; :post, :arguments =&gt; [⭐(:name =&gt; :timeout, :value =&gt; "5")] }, finalize: &lt;&lt;-END
20
+ data.a = 17
21
+ END
22
+ </dsl>
23
+ <dslx>
24
+ <description xmlns="http://cpee.org/ns/description/1.0">
25
+ <call id="a1" endpoint="timeout">
26
+ <parameters>
27
+ <label/>
28
+ <method>:post</method>
29
+ <arguments>
30
+ <timeout>5</timeout>
31
+ </arguments>
32
+ </parameters>
33
+ <finalize output="result">data.a = 17</finalize>
34
+ <update output="result"/>
35
+ <_timing>
36
+ <_timing_min/>
37
+ <_timing_max/>
38
+ <_timing_avg/>
39
+ </_timing>
40
+ <_notes>
41
+ <_notes_general/>
42
+ <_attachments/>
43
+ </_notes>
44
+ </call>
45
+ </description>
46
+ </dslx>
47
+ <status>
48
+ <id>0</id>
49
+ <message>undefined</message>
50
+ </status>
51
+ <description>
52
+ <description xmlns="http://cpee.org/ns/description/1.0">
53
+ <call id="a1" endpoint="timeout">
54
+ <parameters>
55
+ <label/>
56
+ <method>:post</method>
57
+ <arguments>
58
+ <timeout>5</timeout>
59
+ </arguments>
60
+ </parameters>
61
+ <finalize output="result">data.a = 17</finalize>
62
+ <update output="result"/>
63
+ <_timing>
64
+ <_timing_min/>
65
+ <_timing_max/>
66
+ <_timing_avg/>
67
+ </_timing>
68
+ <_notes>
69
+ <_notes_general/>
70
+ <_attachments/>
71
+ </_notes>
72
+ </call>
73
+ </description>
74
+ </description>
75
+ <transformation>
76
+ <description type="copy"/>
77
+ <dataelements type="none"/>
78
+ <endpoints type="none"/>
79
+ </transformation>
80
+ </properties>
@@ -0,0 +1 @@
1
+ f7c77861ac613eeac8fb9829c9a545a2
@@ -0,0 +1 @@
1
+ 2a24d172b1aeb05fe94fdc5e095dec32
@@ -0,0 +1,16 @@
1
+ <subscription xmlns="http://riddl.org/ns/common-patterns/notifications-producer/1.0" url="http://localhost:9299/">
2
+ <topic id="activity">
3
+ <event>calling</event>
4
+ <event>receiving</event>
5
+ <event>done</event>
6
+ </topic>
7
+ <topic id="dataelements">
8
+ <event>change</event>
9
+ </topic>
10
+ <topic id="endpoints">
11
+ <event>change</event>
12
+ </topic>
13
+ <topic id="attributes">
14
+ <event>change</event>
15
+ </topic>
16
+ </subscription>