cpee 2.1.63 → 2.1.64

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a5ad9138a6f01a5ba60605774e91f89ec66bbfdd2532a5a238fce58c51fc5c9
4
- data.tar.gz: 9d860c0c30b9842f2d4944273ac3114e8ba5652ccf2451382a843fec1036a132
3
+ metadata.gz: 6d5e5c7b5da8458c5a7e2101d018337ba353c6a5d5e3fe5e359456aba9693f02
4
+ data.tar.gz: f74517ec8299ce372750c0d4e6cce29d678ae328a96942cac80c3e86d73f9a1b
5
5
  SHA512:
6
- metadata.gz: 49532083471afbc1a14f19da6ffeadd54e7034fa42ef34de67ba2af4dc7dc2e6d619dc3045600fdfba098c2b4ce7c51c13460a12e771353ad042b568ee1088f8
7
- data.tar.gz: f3098595f22d252ecc793da1a0b68d8a5facc69baddb2a01e14b0ba678c5b53e7e95be5a9b01e6f9bea00b741866be44407eab8d491855785fb5d2b1c30a5500
6
+ metadata.gz: 2a382615beced6f3af27bee42068b8000d22bc1d9694351659d97b7013ac11b6c8ab34bcadb29789b3f8f46d29b1e19a9f380903f7a04bf19a03c10b70557a96
7
+ data.tar.gz: 003f97f1487e72749878bf00e34c1d557da3381b325879e3575f2b690584baf65a0b81c0e57490345e289a6c42108a319761bf5a5ec38ce796665ed273fdcc5d
data/cpee.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "2.1.63"
3
+ s.version = "2.1.64"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0-or-later"
6
6
  s.summary = "The cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.homepage = 'http://cpee.org/'
23
23
 
24
24
  s.add_runtime_dependency 'riddl', '~> 1.0'
25
- s.add_runtime_dependency 'weel', '~> 1.99', '>= 1.99.121'
25
+ s.add_runtime_dependency 'weel', '~> 1.99', '>= 1.99.123'
26
26
  s.add_runtime_dependency 'highline', '~> 2.0'
27
27
  s.add_runtime_dependency 'redis', '~> 5.0'
28
28
  s.add_runtime_dependency 'rubyzip', '~>2'
@@ -68,24 +68,6 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
68
68
  @guard_items = []
69
69
  end # }}}
70
70
 
71
- def prepare(readonly, endpoints, parameters) #{{{
72
- @handler_endpoint = endpoints.is_a?(Array) ? endpoints.map{ |ep| readonly.endpoints[ep] }.compact : readonly.endpoints[endpoints]
73
- if @controller.attributes['twin_engine']
74
- @handler_endpoint_orig = @handler_endpoint
75
- @handler_endpoint = @controller.attributes['twin_engine'].to_s + '?original_endpoint=' + Riddl::Protocols::Utils::escape(@handler_endpoint)
76
- end
77
- params = parameters.dup
78
- params[:arguments] = params[:arguments].dup if params[:arguments]
79
- params[:arguments]&.map! do |ele|
80
- t = ele.dup
81
- if t.value.is_a?(Proc)
82
- t.value = readonly.instance_exec &t.value
83
- end
84
- t
85
- end
86
- params
87
- end #}}}
88
-
89
71
  def additional #{{{
90
72
  {
91
73
  :attributes => @controller.attributes,
@@ -256,9 +238,9 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
256
238
  true
257
239
  end # }}}
258
240
 
259
- def activity_uuid
241
+ def activity_uuid #{{{
260
242
  @handler_activity_uuid
261
- end
243
+ end #}}}
262
244
 
263
245
  def inform_activity_done # {{{
264
246
  @controller.notify("activity/done", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position)
@@ -292,7 +274,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
292
274
  @controller.vote("activity/syncing_before", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :activity => @handler_position, :label => @label, :parameters => parameters)
293
275
  end # }}}
294
276
 
295
- def callback(result=nil,options={})
277
+ def callback(result=nil,options={}) #{{{
296
278
  recv = CPEE::EvalRuby::Translation::structurize_result(result)
297
279
  @controller.notify("activity/receiving", :'activity-uuid' => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint, :received => recv, :annotations => @anno)
298
280
 
@@ -323,7 +305,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
323
305
  @handler_continue.continue
324
306
  end
325
307
  end
326
- end
308
+ end #}}}
327
309
 
328
310
  def mem_guard() #{{{
329
311
  @guard_files.delete_if do |p|
@@ -337,29 +319,43 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
337
319
  GC.start
338
320
  end #}}}
339
321
 
340
- def test_condition(dataelements,endpoints,local,additional,code,args={})
341
- res = WEEL::ReadStructure.new(dataelements,endpoints,local,additional).instance_eval(code,'Condition',1)
342
- @controller.notify("gateway/decide", :instance_uuid => @controller.uuid, :code => code, :condition => (res ? "true" : "false"))
343
- res
344
- end
345
- def eval_expression(dataelements,endpoints,local,additional,code)
346
- WEEL::ReadStructure.new(dataelements,endpoints,local,additional).instance_eval(code)
347
- end
348
- def manipulate(readonly,lock,dataelements,endpoints,status,local,additional,code,where,result=nil,options=nil)
349
- result = CPEE::EvalRuby::Translation::simplify_structurized_result(result)
350
- struct = if readonly
351
- WEEL::ReadStructure.new(dataelements,endpoints,local,additional)
322
+ def prepare(__struct, __endpoints, __parameters) #{{{
323
+ @handler_endpoint = __endpoints.is_a?(Array) ? __endpoints.map{ |ep| __struct.endpoints[ep] }.compact : __struct.endpoints[__endpoints]
324
+ if @controller.attributes['twin_engine']
325
+ @handler_endpoint_orig = @handler_endpoint
326
+ @handler_endpoint = @controller.attributes['twin_engine'].to_s + '?original_endpoint=' + Riddl::Protocols::Utils::escape(@handler_endpoint)
327
+ end
328
+ __params = __parameters.dup
329
+ __params[:arguments] = __params[:arguments].dup if __params[:arguments]
330
+ __params[:arguments]&.map! do |__ele|
331
+ __tmp = __ele.dup
332
+ if __tmp.value.is_a?(WEEL::ProcString)
333
+ __tmp.value = __struct.instance_eval __tmp.value.code, 'Parameter', 1
334
+ end
335
+ __tmp
336
+ end
337
+ __params
338
+ end #}}}
339
+ def test_condition(__dataelements,__endpoints,__local,__additional,__code,__args={}) #{{{
340
+ __struct = WEEL::ReadStructure.new(__dataelements,__endpoints,__local,__additional).instance_eval(__code,'Condition',1)
341
+ @controller.notify("gateway/decide", :instance_uuid => @controller.uuid, :code => code, :condition => (__struct ? "true" : "false"))
342
+ __struct
343
+ end #}}}
344
+ def manipulate(__readonly,__lock,__dataelements,__endpoints,__status,__local,__additional,__code,__where,__result=nil,__options=nil) #{{{
345
+ result = CPEE::EvalRuby::Translation::simplify_structurized_result(__result)
346
+ __struct = if __readonly
347
+ WEEL::ReadStructure.new(__dataelements,__endpoints,__local,__additional)
352
348
  else
353
- WEEL::ManipulateStructure.new(dataelements,endpoints,status,local,additional)
349
+ WEEL::ManipulateStructure.new(__dataelements,__endpoints,__status,__local,__additional)
354
350
  end
355
- struct.instance_eval(code,where,1)
356
- struct
357
- end
351
+ __struct.instance_eval(__code,__where,1)
352
+ __struct
353
+ end #}}}
358
354
 
359
- def split_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]
355
+ def split_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]{{{
360
356
  @controller.notify("gateway/split", :instance_uuid => @controller.uuid, :branches => branches)
361
- end
362
- def join_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]
357
+ end #}}}
358
+ def join_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]{{{
363
359
  @controller.notify("gateway/join", :instance_uuid => @controller.uuid, :branches => branches)
364
- end
360
+ end #}}}
365
361
  end
@@ -68,24 +68,6 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
68
68
  @guard_items = []
69
69
  end # }}}
70
70
 
71
- def prepare(readonly, endpoints, parameters) #{{{
72
- @handler_endpoint = endpoints.is_a?(Array) ? endpoints.map{ |ep| readonly.endpoints[ep] }.compact : readonly.endpoints[endpoints]
73
- if @controller.attributes['twin_engine']
74
- @handler_endpoint_orig = @handler_endpoint
75
- @handler_endpoint = @controller.attributes['twin_engine'].to_s + '?original_endpoint=' + Riddl::Protocols::Utils::escape(@handler_endpoint)
76
- end
77
- params = parameters.dup
78
- params[:arguments] = params[:arguments].dup if params[:arguments]
79
- params[:arguments]&.map! do |ele|
80
- t = ele.dup
81
- if t.value.is_a?(Proc)
82
- t.value = readonly.instance_exec &t.value
83
- end
84
- t
85
- end
86
- params
87
- end #}}}
88
-
89
71
  def additional #{{{
90
72
  {
91
73
  :attributes => @controller.attributes,
@@ -256,9 +238,9 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
256
238
  true
257
239
  end # }}}
258
240
 
259
- def activity_uuid
241
+ def activity_uuid #{{{
260
242
  @handler_activity_uuid
261
- end
243
+ end #}}}
262
244
 
263
245
  def inform_activity_done # {{{
264
246
  @controller.notify("activity/done", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position)
@@ -292,7 +274,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
292
274
  @controller.vote("activity/syncing_before", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :activity => @handler_position, :label => @label, :parameters => parameters)
293
275
  end # }}}
294
276
 
295
- def callback(result=nil,options={})
277
+ def callback(result=nil,options={}) #{{{
296
278
  status, ret, headers = Riddl::Client.new(@controller.url_result_transformation).request 'put' => result
297
279
  recv = if status >= 200 && status < 300
298
280
  JSON::parse(ret[0].value.read)
@@ -330,7 +312,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
330
312
  @handler_continue.continue
331
313
  end
332
314
  end
333
- end
315
+ end #}}}
334
316
 
335
317
  def mem_guard() #{{{
336
318
  @guard_files.delete_if do |p|
@@ -344,7 +326,37 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
344
326
  GC.start
345
327
  end #}}}
346
328
 
347
- def test_condition(dataelements,endpoints,local,additional,code,args={})
329
+ def prepare(struct, endpoints, parameters) #{{{
330
+ @handler_endpoint = endpoints.is_a?(Array) ? endpoints.map{ |ep| struct.endpoints[ep] }.compact : struct.endpoints[endpoints]
331
+ if @controller.attributes['twin_engine']
332
+ @handler_endpoint_orig = @handler_endpoint
333
+ @handler_endpoint = @controller.attributes['twin_engine'].to_s + '?original_endpoint=' + Riddl::Protocols::Utils::escape(@handler_endpoint)
334
+ end
335
+ params = parameters.dup
336
+ params[:arguments] = params[:arguments].dup if params[:arguments]
337
+ params[:arguments]&.map! do |ele|
338
+ t = ele.dup
339
+ if t.value.is_a?(WEEL::ProcString)
340
+ send = []
341
+ send.push Riddl::Parameter::Simple::new('code',t.value.code)
342
+ send.push Riddl::Parameter::Complex::new('dataelements','application/json', JSON::generate(struct.data))
343
+ send.push Riddl::Parameter::Complex::new('local','application/json', JSON::generate(struct.local)) if struct.local
344
+ send.push Riddl::Parameter::Complex::new('endpoints','application/json', JSON::generate(struct.endpoints))
345
+ send.push Riddl::Parameter::Complex::new('additional','application/json', JSON::generate(struct.additional))
346
+
347
+ status, ret, headers = Riddl::Client.new(@controller.url_code).request 'put' => send
348
+ recv = if status >= 200 && status < 300
349
+ ret[0].value
350
+ else
351
+ nil
352
+ end
353
+ t.value = recv
354
+ end
355
+ t
356
+ end
357
+ params
358
+ end #}}}
359
+ def test_condition(dataelements,endpoints,local,additional,code,args={}) #{{{
348
360
  send = []
349
361
  send.push Riddl::Parameter::Simple::new('code',code)
350
362
  send.push Riddl::Parameter::Complex::new('dataelements','application/json', JSON::generate(dataelements))
@@ -362,24 +374,8 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
362
374
  recv = (recv == 'false' || recv == 'null' || recv == 'nil' ? false : true)
363
375
  @controller.notify("gateway/decide", :instance_uuid => @controller.uuid, :code => code, :condition => recv)
364
376
  recv
365
- end
366
- def eval_expression(dataelements,endpoints,local,additional,code)
367
- send = []
368
- send.push Riddl::Parameter::Simple::new('code',code)
369
- send.push Riddl::Parameter::Complex::new('dataelements','application/json', JSON::generate(dataelements))
370
- send.push Riddl::Parameter::Complex::new('local','application/json', JSON::generate(local)) if local
371
- send.push Riddl::Parameter::Complex::new('endpoints','application/json', JSON::generate(endpoints))
372
- send.push Riddl::Parameter::Complex::new('additional','application/json', JSON::generate(additional))
373
-
374
- status, ret, headers = Riddl::Client.new(@controller.url_code).request 'put' => send
375
- recv = if status >= 200 && status < 300
376
- ret[0].value
377
- else
378
- nil
379
- end
380
- recv
381
- end
382
- def manipulate(readonly,lock,dataelements,endpoints,status,local,additional,code,where,result=nil,options=nil)
377
+ end #}}}
378
+ def manipulate(readonly,lock,dataelements,endpoints,status,local,additional,code,where,result=nil,options=nil) #{{{
383
379
  lock.synchronize do
384
380
  send = []
385
381
  send.push Riddl::Parameter::Simple::new('code',code)
@@ -413,12 +409,12 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
413
409
  nil
414
410
  end
415
411
  end
416
- end
412
+ end #}}}
417
413
 
418
- def split_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]
414
+ def split_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]{{{
419
415
  @controller.notify("gateway/split", :instance_uuid => @controller.uuid, :branches => branches)
420
- end
421
- def join_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]
416
+ end #}}}
417
+ def join_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]{{{
422
418
  @controller.notify("gateway/join", :instance_uuid => @controller.uuid, :branches => branches)
423
- end
419
+ end #}}}
424
420
  end
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.63
4
+ version: 2.1.64
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: 2024-09-17 00:00:00.000000000 Z
13
+ date: 2024-09-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: riddl
@@ -35,7 +35,7 @@ dependencies:
35
35
  version: '1.99'
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
- version: 1.99.121
38
+ version: 1.99.123
39
39
  type: :runtime
40
40
  prerelease: false
41
41
  version_requirements: !ruby/object:Gem::Requirement
@@ -45,7 +45,7 @@ dependencies:
45
45
  version: '1.99'
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 1.99.121
48
+ version: 1.99.123
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: highline
51
51
  requirement: !ruby/object:Gem::Requirement