cpee 2.1.35 → 2.1.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/css/track.css +1 -1
  3. data/cockpit/js/details.js +2 -2
  4. data/cockpit/templates/Subprocess.xml +3 -0
  5. data/cockpit/themes/compact/rngs/call.rng +107 -86
  6. data/cockpit/themes/compact/rngs/callmanipulate.rng +10 -6
  7. data/cockpit/themes/compact/rngs/start.rng +94 -73
  8. data/cockpit/themes/compact/symbols/call_sensor.svg +9 -0
  9. data/cockpit/themes/compact/symbols/callmanipulate.svg +3 -3
  10. data/cockpit/themes/compact/symbols/callmanipulate_sensor.svg +11 -0
  11. data/cockpit/themes/compact/theme.js +25 -5
  12. data/cockpit/themes/control/rngs/call.rng +107 -86
  13. data/cockpit/themes/control/rngs/callmanipulate.rng +10 -6
  14. data/cockpit/themes/control/rngs/start.rng +94 -73
  15. data/cockpit/themes/control/symbols/call_sensor.svg +9 -0
  16. data/cockpit/themes/control/symbols/callmanipulate.svg +3 -3
  17. data/cockpit/themes/control/symbols/callmanipulate_sensor.svg +11 -0
  18. data/cockpit/themes/default/rngs/call.rng +107 -86
  19. data/cockpit/themes/default/rngs/callmanipulate.rng +10 -6
  20. data/cockpit/themes/default/rngs/start.rng +94 -73
  21. data/cockpit/themes/default/symbols/call_sensor.svg +9 -0
  22. data/cockpit/themes/default/symbols/callmanipulate.svg +3 -3
  23. data/cockpit/themes/default/symbols/callmanipulate_sensor.svg +11 -0
  24. data/cockpit/themes/default/theme.js +25 -5
  25. data/cockpit/themes/extended/rngs/call.rng +107 -86
  26. data/cockpit/themes/extended/rngs/callmanipulate.rng +10 -6
  27. data/cockpit/themes/extended/rngs/start.rng +94 -73
  28. data/cockpit/themes/extended/symbols/call_sensor.svg +9 -0
  29. data/cockpit/themes/extended/symbols/callmanipulate.svg +3 -3
  30. data/cockpit/themes/extended/symbols/callmanipulate_sensor.svg +11 -0
  31. data/cockpit/themes/extended/theme.js +25 -5
  32. data/cockpit/themes/model/symbols/call_sensor.svg +9 -0
  33. data/cockpit/themes/model/symbols/callmanipulate.svg +3 -3
  34. data/cockpit/themes/model/symbols/callmanipulate_sensor.svg +11 -0
  35. data/cockpit/themes/packed/rngs/call.rng +107 -86
  36. data/cockpit/themes/packed/rngs/callmanipulate.rng +10 -6
  37. data/cockpit/themes/packed/rngs/start.rng +94 -73
  38. data/cockpit/themes/packed/symbols/call_sensor.svg +9 -0
  39. data/cockpit/themes/packed/symbols/callmanipulate.svg +3 -3
  40. data/cockpit/themes/packed/symbols/callmanipulate_sensor.svg +11 -0
  41. data/cockpit/themes/packed/theme.js +25 -5
  42. data/cockpit/themes/preset/rngs/call.rng +107 -86
  43. data/cockpit/themes/preset/rngs/callmanipulate.rng +10 -6
  44. data/cockpit/themes/preset/rngs/start.rng +94 -73
  45. data/cockpit/themes/preset/symbols/call_sensor.svg +9 -0
  46. data/cockpit/themes/preset/symbols/callmanipulate.svg +3 -3
  47. data/cockpit/themes/preset/symbols/callmanipulate_sensor.svg +11 -0
  48. data/cockpit/themes/preset/theme.js +25 -5
  49. data/cpee.gemspec +1 -1
  50. data/lib/cpee/implementation.rb +25 -14
  51. data/lib/cpee/message.rb +0 -1
  52. data/server/executionhandlers/ruby/connection.rb +29 -17
  53. data/server/resources/states.xml +3 -0
  54. data/server/routing/end.pid +1 -0
  55. data/server/routing/forward-events.pid +1 -0
  56. data/server/routing/forward-votes.pid +1 -0
  57. data/server/routing/persist.pid +1 -0
  58. data/tools/cpee +6 -4
  59. metadata +20 -2
data/lib/cpee/message.rb CHANGED
@@ -42,7 +42,6 @@ module CPEE
42
42
  def self::send_url(type, event, cpee, content={}, backend)
43
43
  topic = ::File::dirname(event)
44
44
  name = ::File::basename(event)
45
- client = Riddl::Client.new(backend)
46
45
  payload = {
47
46
  WHO => cpee,
48
47
  'topic' => topic,
@@ -85,6 +85,10 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
85
85
  'instance' => @controller.instance_id,
86
86
  'instance_url' => @controller.instance_url,
87
87
  'instance_uuid' => @controller.uuid
88
+ },
89
+ :task => {
90
+ 'label' => @label,
91
+ 'id' => @handler_position
88
92
  }
89
93
  }
90
94
  end #}}}
@@ -138,16 +142,16 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
138
142
  c = c.read if c.respond_to? :read
139
143
  callback([ Riddl::Parameter::Complex.new('error','application/json',StringIO.new(JSON::generate({ 'status' => status, 'error' => c }))) ], headers)
140
144
  else
141
- if headers['CPEE_INSTANTIATION']
142
- @controller.notify("task/instantiation", :'activity-uuid' => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint, :received => CPEE::ValueHelper.parse(headers['CPEE_INSTANTIATION']))
143
- end
144
- if headers['CPEE_EVENT']
145
- @controller.notify("task/#{headers['CPEE_EVENT'].gsub(/[^\w_-]/,'')}", :'activity-uuid' => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint)
146
- end
147
145
  if headers['CPEE_CALLBACK'] && headers['CPEE_CALLBACK'] == 'true' && result.any?
148
146
  headers['CPEE_UPDATE'] = true
149
147
  callback result, headers
150
148
  elsif headers['CPEE_CALLBACK'] && headers['CPEE_CALLBACK'] == 'true' && result.empty?
149
+ if headers['CPEE_INSTANTIATION']
150
+ @controller.notify("task/instantiation", :'activity-uuid' => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint, :received => CPEE::ValueHelper.parse(headers['CPEE_INSTANTIATION']))
151
+ end
152
+ if headers['CPEE_EVENT']
153
+ @controller.notify("task/#{headers['CPEE_EVENT'].gsub(/[^\w_-]/,'')}", :'activity-uuid' => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint)
154
+ end
151
155
  # do nothing, later on things will happend
152
156
  else
153
157
  callback result, headers
@@ -159,6 +163,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
159
163
  raise "Wrong endpoint" if @handler_endpoint.nil? || @handler_endpoint.empty?
160
164
  @label = parameters[:label]
161
165
  @anno = parameters.delete(:annotations) rescue nil
166
+ @controller.notify("status/resource_utilization", :mib => GetProcessMem.new.mb, **Process.times.to_h)
162
167
  @controller.notify("activity/calling", :'activity-uuid' => @handler_activity_uuid, :label => @label, :activity => @handler_position, :passthrough => passthrough, :endpoint => @handler_endpoint, :parameters => parameters, :annotations => @anno)
163
168
  if passthrough.to_s.empty?
164
169
  proto_curl parameters
@@ -230,6 +235,8 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
230
235
  elsif result[0].is_a? Riddl::Parameter::Complex
231
236
  if result[0].mimetype == 'application/json'
232
237
  result = JSON::parse(result[0].value.read) rescue nil
238
+ elsif result[0].mimetype == 'text/csv'
239
+ result = result[0].value.read
233
240
  elsif result[0].mimetype == 'text/yaml'
234
241
  result = YAML::load(result[0].value.read) rescue nil
235
242
  elsif result[0].mimetype == 'application/xml' || result[0].mimetype == 'text/xml'
@@ -251,7 +258,12 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
251
258
  end
252
259
  end
253
260
  end
254
- result
261
+ if result.is_a? String
262
+ enc = detect_encoding(result)
263
+ enc == 'OTHER' ? result : (result.encode('UTF-8',enc) rescue convert_to_base64(result))
264
+ else
265
+ result
266
+ end
255
267
  end
256
268
 
257
269
  def detect_encoding(text)
@@ -283,13 +295,13 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
283
295
  { 'name' => r.name, 'data' => r.value }
284
296
  elsif r.is_a? Riddl::Parameter::Complex
285
297
  res = if r.mimetype == 'application/json'
286
- ttt = JSON::parse(r.value.read) rescue nil
287
- if ttt.nil?
288
- ''
289
- else
290
- enc = detect_encoding(ttt)
291
- enc == 'OTHER' ? ttt : (ttt.encode('UTF-8',enc) rescue convert_to_base64(ttt))
292
- end
298
+ ttt = r.value.read
299
+ enc = detect_encoding(ttt)
300
+ enc == 'OTHER' ? ttt.inspect : (ttt.encode('UTF-8',enc) rescue convert_to_base64(ttt))
301
+ elsif r.mimetype == 'text/csv'
302
+ ttt = r.value.read
303
+ enc = detect_encoding(ttt)
304
+ enc == 'OTHER' ? ttt.inspect : (ttt.encode('UTF-8',enc) rescue convert_to_base64(ttt))
293
305
  elsif r.mimetype == 'text/plain' || r.mimetype == 'text/html'
294
306
  ttt = r.value.read
295
307
  ttt = ttt.to_f if ttt == ttt.to_f.to_s
@@ -298,7 +310,6 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
298
310
  enc == 'OTHER' ? ttt.inspect : (ttt.encode('UTF-8',enc) rescue convert_to_base64(ttt))
299
311
  else
300
312
  convert_to_base64(r.value.read)
301
- r.value.rewind
302
313
  end
303
314
 
304
315
  tmp = {
@@ -318,6 +329,9 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
318
329
  @guard_files += result
319
330
  @handler_returnValue = simplify_result(result)
320
331
  @handler_returnOptions = options
332
+ if options['CPEE_INSTANTIATION']
333
+ @controller.notify("task/instantiation", :'activity-uuid' => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint, :received => CPEE::ValueHelper.parse(options['CPEE_INSTANTIATION']))
334
+ end
321
335
  if options['CPEE_EVENT']
322
336
  @controller.notify("task/#{options['CPEE_EVENT'].gsub(/[^\w_-]/,'')}", :'activity-uuid' => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint, :received => recv)
323
337
  end
@@ -354,8 +368,6 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
354
368
  end
355
369
 
356
370
  def simulate(type,nesting,tid,parent,parameters={}) #{{{
357
- pp "#{type} - #{nesting} - #{tid} - #{parent} - #{parameters.inspect}"
358
-
359
371
  @controller.vote("simulating/step",
360
372
  :'activity-uuid' => @handler_activity_uuid,
361
373
  :label => @label,
@@ -14,6 +14,9 @@
14
14
  <running><!-- in this state you can set the following state -->
15
15
  <stopping/>
16
16
  </running>
17
+ <stopping><!-- in this state you can set the following state -->
18
+ <stopping/>
19
+ </stopping>
17
20
  <stopped><!-- in this state you can set the following four states -->
18
21
  <running/>
19
22
  <simulating/>
@@ -0,0 +1 @@
1
+ 931754
@@ -0,0 +1 @@
1
+ 931760
@@ -0,0 +1 @@
1
+ 931764
@@ -0,0 +1 @@
1
+ 931768
data/tools/cpee CHANGED
@@ -162,7 +162,7 @@ elsif command == 'archive'
162
162
  if File.basename(p2) =~ /(\d+)-(\d+)/
163
163
  names = ($1.to_i..$2.to_i).to_a
164
164
  elsif File.basename(p2) == '*'
165
- res = Typhoeus.get(File.join(base,'/'))
165
+ res = Typhoeus.get(File.join(base,'/'), headers: { 'see-instances' => 'true' })
166
166
  if res.success?
167
167
  XML::Smart.string(res.response_body) do |doc|
168
168
  doc.find('//instance/@id').each do |ele|
@@ -217,7 +217,7 @@ elsif command == 'abandon'
217
217
  if File.basename(p1) =~ /(\d+)-(\d+)/
218
218
  names = ($1.to_i..$2.to_i).to_a
219
219
  elsif File.basename(p1) == '*'
220
- res = Typhoeus.get(File.join(base,'/'))
220
+ res = Typhoeus.get(File.join(base,'/'), headers: { 'see-instances' => 'true' })
221
221
  if res.success?
222
222
  XML::Smart.string(res.response_body) do |doc|
223
223
  doc.find('//instance/@id').each do |ele|
@@ -237,6 +237,8 @@ elsif command == 'abandon'
237
237
  if res1.success?
238
238
  if res1.response_body == 'running'
239
239
  Typhoeus.put(File.join(base,name.to_s,'properties','state','/'), headers: {'Content-Type' => 'application/x-www-form-urlencoded'}, body: "value=stopping")
240
+ elsif res1.response_body == 'stopping'
241
+ Typhoeus.put(File.join(base,name.to_s,'properties','state','/'), headers: {'Content-Type' => 'application/x-www-form-urlencoded'}, body: "value=stopping")
240
242
  elsif res1.response_body == 'ready' || res1.response_body == 'stopped'
241
243
  Typhoeus.put(File.join(base,name.to_s,'properties','state','/'), headers: {'Content-Type' => 'application/x-www-form-urlencoded'}, body: "value=abandoned")
242
244
  end
@@ -250,7 +252,7 @@ elsif command == 'start'
250
252
  if File.basename(p1) =~ /(\d+)-(\d+)/
251
253
  names = ($1.to_i..$2.to_i).to_a
252
254
  elsif File.basename(p1) == '*'
253
- res = Typhoeus.get(File.join(base,'/'))
255
+ res = Typhoeus.get(File.join(base,'/'), headers: { 'see-instances' => 'true' })
254
256
  if res.success?
255
257
  XML::Smart.string(res.response_body) do |doc|
256
258
  doc.find('//instance/@id').each do |ele|
@@ -283,7 +285,7 @@ elsif command == 'delete!'
283
285
  if File.basename(p1) =~ /(\d+)-(\d+)/
284
286
  names = ($1.to_i..$2.to_i).to_a
285
287
  elsif File.basename(p1) == '*'
286
- res = Typhoeus.get(File.join(base,'/'))
288
+ res = Typhoeus.get(File.join(base,'/'), headers: { 'see-instances' => 'true' })
287
289
  if res.success?
288
290
  XML::Smart.string(res.response_body) do |doc|
289
291
  doc.find('//instance/@id').each do |ele|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.35
4
+ version: 2.1.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: tools
12
12
  cert_chain: []
13
- date: 2022-05-04 00:00:00.000000000 Z
13
+ date: 2022-10-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: riddl
@@ -279,7 +279,9 @@ files:
279
279
  - cockpit/themes/compact/symbols/alternative.svg
280
280
  - cockpit/themes/compact/symbols/arrow.svg
281
281
  - cockpit/themes/compact/symbols/call.svg
282
+ - cockpit/themes/compact/symbols/call_sensor.svg
282
283
  - cockpit/themes/compact/symbols/callmanipulate.svg
284
+ - cockpit/themes/compact/symbols/callmanipulate_sensor.svg
283
285
  - cockpit/themes/compact/symbols/choose.svg
284
286
  - cockpit/themes/compact/symbols/choose_exclusive.svg
285
287
  - cockpit/themes/compact/symbols/choose_inclusive.svg
@@ -330,7 +332,9 @@ files:
330
332
  - cockpit/themes/control/symbols/alternative.svg
331
333
  - cockpit/themes/control/symbols/arrow.svg
332
334
  - cockpit/themes/control/symbols/call.svg
335
+ - cockpit/themes/control/symbols/call_sensor.svg
333
336
  - cockpit/themes/control/symbols/callmanipulate.svg
337
+ - cockpit/themes/control/symbols/callmanipulate_sensor.svg
334
338
  - cockpit/themes/control/symbols/choose.svg
335
339
  - cockpit/themes/control/symbols/choose_exclusive.svg
336
340
  - cockpit/themes/control/symbols/choose_inclusive.svg
@@ -381,7 +385,9 @@ files:
381
385
  - cockpit/themes/default/symbols/alternative.svg
382
386
  - cockpit/themes/default/symbols/arrow.svg
383
387
  - cockpit/themes/default/symbols/call.svg
388
+ - cockpit/themes/default/symbols/call_sensor.svg
384
389
  - cockpit/themes/default/symbols/callmanipulate.svg
390
+ - cockpit/themes/default/symbols/callmanipulate_sensor.svg
385
391
  - cockpit/themes/default/symbols/choose.svg
386
392
  - cockpit/themes/default/symbols/choose_exclusive.svg
387
393
  - cockpit/themes/default/symbols/choose_inclusive.svg
@@ -432,7 +438,9 @@ files:
432
438
  - cockpit/themes/extended/symbols/alternative.svg
433
439
  - cockpit/themes/extended/symbols/arrow.svg
434
440
  - cockpit/themes/extended/symbols/call.svg
441
+ - cockpit/themes/extended/symbols/call_sensor.svg
435
442
  - cockpit/themes/extended/symbols/callmanipulate.svg
443
+ - cockpit/themes/extended/symbols/callmanipulate_sensor.svg
436
444
  - cockpit/themes/extended/symbols/choose.svg
437
445
  - cockpit/themes/extended/symbols/choose_exclusive.svg
438
446
  - cockpit/themes/extended/symbols/choose_inclusive.svg
@@ -478,7 +486,9 @@ files:
478
486
  - cockpit/themes/model/symbols/alternative.svg
479
487
  - cockpit/themes/model/symbols/arrow.svg
480
488
  - cockpit/themes/model/symbols/call.svg
489
+ - cockpit/themes/model/symbols/call_sensor.svg
481
490
  - cockpit/themes/model/symbols/callmanipulate.svg
491
+ - cockpit/themes/model/symbols/callmanipulate_sensor.svg
482
492
  - cockpit/themes/model/symbols/choose.svg
483
493
  - cockpit/themes/model/symbols/choose_exclusive.svg
484
494
  - cockpit/themes/model/symbols/choose_inclusive.svg
@@ -529,7 +539,9 @@ files:
529
539
  - cockpit/themes/packed/symbols/alternative.svg
530
540
  - cockpit/themes/packed/symbols/arrow.svg
531
541
  - cockpit/themes/packed/symbols/call.svg
542
+ - cockpit/themes/packed/symbols/call_sensor.svg
532
543
  - cockpit/themes/packed/symbols/callmanipulate.svg
544
+ - cockpit/themes/packed/symbols/callmanipulate_sensor.svg
533
545
  - cockpit/themes/packed/symbols/choose.svg
534
546
  - cockpit/themes/packed/symbols/choose_exclusive.svg
535
547
  - cockpit/themes/packed/symbols/choose_inclusive.svg
@@ -580,7 +592,9 @@ files:
580
592
  - cockpit/themes/preset/symbols/alternative.svg
581
593
  - cockpit/themes/preset/symbols/arrow.svg
582
594
  - cockpit/themes/preset/symbols/call.svg
595
+ - cockpit/themes/preset/symbols/call_sensor.svg
583
596
  - cockpit/themes/preset/symbols/callmanipulate.svg
597
+ - cockpit/themes/preset/symbols/callmanipulate_sensor.svg
584
598
  - cockpit/themes/preset/symbols/choose.svg
585
599
  - cockpit/themes/preset/symbols/choose_exclusive.svg
586
600
  - cockpit/themes/preset/symbols/choose_inclusive.svg
@@ -678,9 +692,13 @@ files:
678
692
  - server/resources/states.xml
679
693
  - server/resources/topics.xml
680
694
  - server/resources/transformation.xml
695
+ - server/routing/end.pid
681
696
  - server/routing/end.rb
697
+ - server/routing/forward-events.pid
682
698
  - server/routing/forward-events.rb
699
+ - server/routing/forward-votes.pid
683
700
  - server/routing/forward-votes.rb
701
+ - server/routing/persist.pid
684
702
  - server/routing/persist.rb
685
703
  - server/server.conf
686
704
  - server/server.rb