cpee 2.0.6 → 2.0.13

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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/config.json +3 -0
  3. data/cockpit/css/track.css +17 -6
  4. data/cockpit/css/ui.css +6 -2
  5. data/cockpit/css/wfadaptor.css +1 -1
  6. data/cockpit/edit.html +1 -0
  7. data/cockpit/index.html +2 -2
  8. data/cockpit/js/instance.js +75 -55
  9. data/cockpit/js/track.js +10 -0
  10. data/cockpit/js/ui.js +47 -16
  11. data/cockpit/templates/Track Test Local.xml +82 -0
  12. data/cockpit/templates/Track Test.xml +82 -0
  13. data/cockpit/templates/instantiate.local/Take_Sub.xml +59 -0
  14. data/cockpit/templates/instantiate/Take_Perf.xml +46 -0
  15. data/cockpit/templates/instantiate/Take_Sub.xml +58 -0
  16. data/cockpit/templates/instantiate/Take_X.xml +48 -0
  17. data/cockpit/themes/compact/rngs/call.rng +5 -0
  18. data/cockpit/themes/compact/rngs/callmanipulate.rng +6 -1
  19. data/cockpit/themes/compact/rngs/loop.rng +1 -1
  20. data/cockpit/themes/compact/rngs/parallel.rng +1 -1
  21. data/cockpit/themes/default/rngs/call.rng +5 -0
  22. data/cockpit/themes/default/rngs/callmanipulate.rng +6 -1
  23. data/cockpit/themes/default/rngs/loop.rng +1 -1
  24. data/cockpit/themes/default/rngs/parallel.rng +1 -1
  25. data/cockpit/themes/extended/rngs/call.rng +5 -0
  26. data/cockpit/themes/extended/rngs/callmanipulate.rng +6 -1
  27. data/cockpit/themes/extended/rngs/loop.rng +1 -1
  28. data/cockpit/themes/extended/rngs/parallel.rng +1 -1
  29. data/cockpit/themes/extended/theme.js +4 -0
  30. data/cockpit/themes/model/theme.js +1 -1
  31. data/cockpit/themes/packed/rngs/call.rng +5 -0
  32. data/cockpit/themes/packed/rngs/callmanipulate.rng +6 -1
  33. data/cockpit/themes/packed/rngs/loop.rng +1 -1
  34. data/cockpit/themes/packed/rngs/parallel.rng +1 -1
  35. data/cockpit/themes/preset/rngs/call.rng +5 -0
  36. data/cockpit/themes/preset/rngs/callmanipulate.rng +6 -1
  37. data/cockpit/themes/preset/rngs/loop.rng +1 -1
  38. data/cockpit/themes/preset/rngs/parallel.rng +1 -1
  39. data/cockpit/track.html +37 -8
  40. data/cpee.gemspec +3 -3
  41. data/lib/cpee/implementation.rb +15 -6
  42. data/lib/cpee/implementation_notifications.rb +80 -51
  43. data/lib/cpee/implementation_properties.rb +5 -2
  44. data/lib/cpee/persistence.rb +3 -0
  45. data/server/handlerwrappers/default.rb +3 -0
  46. data/server/routing/forward-events.rb +2 -1
  47. data/server/routing/forward-votes.rb +1 -1
  48. data/server/server.conf +4 -0
  49. data/tools/cpee +17 -9
  50. metadata +17 -10
  51. data/cockpit/templates/convert_cpee2.rb +0 -15
  52. data/cockpit/themes/convert_cpee2.rb +0 -8
@@ -126,6 +126,9 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
126
126
  if headers['CPEE_INSTANTIATION']
127
127
  @controller.notify("task/instantiation", :activity_uuid => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint, :received => CPEE::ValueHelper.parse(headers['CPEE_INSTANTIATION']))
128
128
  end
129
+ if headers['CPEE_EVENT']
130
+ @controller.notify("task/#{headers['CPEE_EVENT'].gsub(/[^\w_-]/,'')}", :activity_uuid => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint)
131
+ end
129
132
  if headers['CPEE_CALLBACK'] && headers['CPEE_CALLBACK'] == 'true' && result.any?
130
133
  headers['CPEE_UPDATE'] = true
131
134
  callback result, headers
@@ -39,7 +39,8 @@ Daemonite.new do |opts|
39
39
  if url.nil? || url == ""
40
40
  redis.publish("forward:#{instance}/#{key}",mess)
41
41
  else
42
- client = Riddl::Client.new(url,'http://riddl.org/ns/common-patterns/notifications-consumer/2.0/consumer.xml')
42
+ p "#{type}/#{topic}/#{event}-#{url}"
43
+ client = Riddl::Client.new(url)
43
44
  client.post [
44
45
  Riddl::Parameter::Simple::new('type',type),
45
46
  Riddl::Parameter::Simple::new('topic',topic),
@@ -70,7 +70,7 @@ Daemonite.new do |opts|
70
70
  persist_handler instance, callback_key, m, redis
71
71
  redis.publish("forward:#{instance}/#{subscription_key}",mess)
72
72
  else
73
- client = Riddl::Client.new(url,'http://riddl.org/ns/common-patterns/notifications-consumer/2.0/consumer.xml')
73
+ client = Riddl::Client.new(url)
74
74
  callback = m['instance-url'] + '/callbacks/' + subscription_key
75
75
  status, result, headers = (client.post [
76
76
  Riddl::Header.new("CPEE-BASE",m['cpee']),
@@ -0,0 +1,4 @@
1
+ :host: tango.wst.univie.ac.at
2
+ :port: 8298
3
+ :url: http://tango.wst.univie.ac.at:8298
4
+ :secure: false
data/tools/cpee CHANGED
@@ -117,6 +117,16 @@ elsif command == 'convert'
117
117
  doc.find('//x:start_git').each do |e|
118
118
  e.text = 'https://centurio.work/flow-test/start/git/'
119
119
  end rescue nil
120
+ doc.find('//d:finalize | //d:update | //d:prepare | //d:rescue').each do |e|
121
+ if e.parent.qname.name != 'code'
122
+ n = e.parent
123
+ if (x = n.find('d:code')).any?
124
+ x.first.add(e)
125
+ else
126
+ n.add('d:code').add(e)
127
+ end
128
+ end
129
+ end rescue nil
120
130
 
121
131
  doc.find('//p:*').each do |e|
122
132
  e.namespaces.delete_all!
@@ -152,7 +162,7 @@ elsif command == 'archive'
152
162
  XML::Smart.string(res.response_body) do |doc|
153
163
  if doc.root.qname.to_s == "instances"
154
164
  doc.root.children.each do |i|
155
- if ["finished","abandoned"].include?(i.attributes['state'])
165
+ if ["finished","abandoned"].include?(i.attributes['state']) || (["ready"].include?(i.attributes['state']) && Time.parse(i.attributes['changed']).to_i < Time.now-(60*60*24))
156
166
  prop = Typhoeus.get(File.join(base,name.to_s,i.attributes['id'],'properties','/'))
157
167
  if prop.success?
158
168
  File.write(File.join(p1,i.attributes['uuid'] + '.xml'),prop.response_body) if prop.headers['Content-Type'] =~ /^(text|application)\/xml/
@@ -165,11 +175,10 @@ elsif command == 'archive'
165
175
  if prop.success?
166
176
  xprop = XML::Smart::string(prop.response_body)
167
177
  xprop.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
168
- if ["finished","abandoned"].include?(xprop.find("string(/p:properties/p:state)"))
178
+ if ["finished","abandoned"].include?(xprop.find("string(/p:properties/p:state)")) || (["ready"].include?(xprop.find("string(/p:properties/p:state)")) && Time.parse(xprop.find("string(/p:properties/p:state/@changed)")) < Time.now-(60*60*12))
169
179
  uuid = xprop.find("string(/p:properties/p:attributes/p:uuid)")
170
180
  id = name.to_s
171
181
  File.write(File.join(p1,uuid + '.xml'),prop.response_body) if prop.headers['Content-Type'] =~ /^(text|application)\/xml/
172
- p File.join(base,name.to_s,'/')
173
182
  Typhoeus.delete(File.join(base,name.to_s,'/'))
174
183
  end
175
184
  end
@@ -200,11 +209,10 @@ elsif command == 'abandon'
200
209
  names << File.basename(p1)
201
210
  end
202
211
  names.each do |name|
203
- res = Typhoeus.get(File.join(base,name.to_s,'properties','state','/'))
204
- if res.success?
205
- case res.response_body
206
- when "ready", "stopped" then
207
- Typhoeus.put(File.join(base,name.to_s,'properties','state','/'), headers: {'Content-Type' => 'application/x-www-form-urlencoded'}, body: "value=abandoned")
212
+ res1 = Typhoeus.get(File.join(base,name.to_s,'properties','state','/'))
213
+ if res1.success?
214
+ if res1.response_body == 'ready' || res1.response_body == 'stopped'
215
+ Typhoeus.put(File.join(base,name.to_s,'properties','state','/'), headers: {'Content-Type' => 'application/x-www-form-urlencoded'}, body: "value=abandoned")
208
216
  end
209
217
  end
210
218
  end
@@ -246,7 +254,7 @@ elsif command == 'delete!'
246
254
  elsif command == 'new'
247
255
  if !File.exists?(p1)
248
256
  FileUtils.cp_r("#{curpath}/server/",p1)
249
- FileUtils.cp_r("#{curpath}/archive/",p1)
257
+ FileUtils.mkdir("#{p1}/archive") rescue nil
250
258
  FileUtils.mkdir("#{p1}/instances") rescue nil
251
259
  FileUtils.mkdir("#{p1}/resources") rescue nil
252
260
  FileUtils.mkdir("#{p1}/handlerwrappers") rescue nil
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
8
8
  - Ralph Vigne
9
9
  - Gerhard Stuermer
10
- autorequire:
10
+ autorequire:
11
11
  bindir: tools
12
12
  cert_chain: []
13
- date: 2020-10-09 00:00:00.000000000 Z
13
+ date: 2020-11-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: riddl
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '0.105'
21
+ version: '0.108'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '0.105'
28
+ version: '0.108'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: weel
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -117,6 +117,7 @@ files:
117
117
  - README.md
118
118
  - Rakefile
119
119
  - cockpit/README
120
+ - cockpit/config.json
120
121
  - cockpit/contrib/graph_example.svg
121
122
  - cockpit/contrib/legend.svg
122
123
  - cockpit/contrib/symbols.svg
@@ -127,6 +128,7 @@ files:
127
128
  - cockpit/css/track.css
128
129
  - cockpit/css/ui.css
129
130
  - cockpit/css/wfadaptor.css
131
+ - cockpit/edit.html
130
132
  - cockpit/graph.html
131
133
  - cockpit/index.html
132
134
  - cockpit/js/details.js
@@ -192,8 +194,13 @@ files:
192
194
  - cockpit/templates/IUPC arXiv:1104.3609 P34 1.xml
193
195
  - cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml
194
196
  - cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml
197
+ - cockpit/templates/Track Test Local.xml
198
+ - cockpit/templates/Track Test.xml
195
199
  - cockpit/templates/Worklist.xml
196
- - cockpit/templates/convert_cpee2.rb
200
+ - cockpit/templates/instantiate.local/Take_Sub.xml
201
+ - cockpit/templates/instantiate/Take_Perf.xml
202
+ - cockpit/templates/instantiate/Take_Sub.xml
203
+ - cockpit/templates/instantiate/Take_X.xml
197
204
  - cockpit/themes/compact/rngs/alternative.rng
198
205
  - cockpit/themes/compact/rngs/call.rng
199
206
  - cockpit/themes/compact/rngs/callmanipulate.rng
@@ -234,7 +241,6 @@ files:
234
241
  - cockpit/themes/compact/symbols/stop.svg
235
242
  - cockpit/themes/compact/symbols/terminate.svg
236
243
  - cockpit/themes/compact/theme.js
237
- - cockpit/themes/convert_cpee2.rb
238
244
  - cockpit/themes/default/rngs/alternative.rng
239
245
  - cockpit/themes/default/rngs/call.rng
240
246
  - cockpit/themes/default/rngs/callmanipulate.rng
@@ -506,6 +512,7 @@ files:
506
512
  - server/routing/forward-events.rb
507
513
  - server/routing/forward-votes.rb
508
514
  - server/routing/persist.rb
515
+ - server/server.conf
509
516
  - server/server.rb
510
517
  - tools/cpee
511
518
  - tools/server/resources/notifications/logging/subscription.xml
@@ -515,7 +522,7 @@ homepage: http://cpee.org/
515
522
  licenses:
516
523
  - LGPL-3.0
517
524
  metadata: {}
518
- post_install_message:
525
+ post_install_message:
519
526
  rdoc_options: []
520
527
  require_paths:
521
528
  - lib
@@ -530,8 +537,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
530
537
  - !ruby/object:Gem::Version
531
538
  version: '0'
532
539
  requirements: []
533
- rubygems_version: 3.1.2
534
- signing_key:
540
+ rubygems_version: 3.1.4
541
+ signing_key:
535
542
  specification_version: 4
536
543
  summary: Preliminary release of cloud process execution engine (cpee.org). If you
537
544
  just need workflow execution, without a rest service exposing it, then use WEEL.
@@ -1,15 +0,0 @@
1
- #!/usr/bin/ruby
2
- require 'xml/smart'
3
-
4
- Dir['*.xml'].each do |f|
5
- XML::Smart.modify(f) do |doc|
6
- doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
7
- doc.register_namespace 'p', 'http://riddl.org/ns/common-patterns/properties/1.0'
8
- if doc.root.qname.name == 'testset'
9
- doc.find('//attributes | //endpoints | //dataelements | //positions | //transformation | //handlerwrapper | //description').each do |e|
10
- e.namespaces[nil] = 'http://cpee.org/ns/properties/2.0'
11
- e.namespace = nil
12
- end
13
- end
14
- end
15
- end
@@ -1,8 +0,0 @@
1
- #!/usr/bin/ruby
2
- require 'xml/smart'
3
-
4
- Dir['*.rng'].each do |f|
5
- XML::Smart.modify(f) do |doc|
6
- doc.root.attributes['ns'] = 'http://cpee.org/ns/description/1.0'
7
- end
8
- end