cpee 2.1.63 → 2.1.66

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: 052d8f4e613153998b5712cadd2204756c242376b4b037e2cb9b8a3a1542116c
4
+ data.tar.gz: 538940981be635be63e6d0790a5f3bac6bbd855a47b2acfc0fc96ddc26dde6d6
5
5
  SHA512:
6
- metadata.gz: 49532083471afbc1a14f19da6ffeadd54e7034fa42ef34de67ba2af4dc7dc2e6d619dc3045600fdfba098c2b4ce7c51c13460a12e771353ad042b568ee1088f8
7
- data.tar.gz: f3098595f22d252ecc793da1a0b68d8a5facc69baddb2a01e14b0ba678c5b53e7e95be5a9b01e6f9bea00b741866be44407eab8d491855785fb5d2b1c30a5500
6
+ metadata.gz: 2dcba10b6275f5cf5f6a7a2fa32fee4439c807cd248e3d22e65ed1a28a9fe6f5c5a1d7f318742ea3154421cbf4dfafe3fd0d96973599339425c7ef1cae4c8d94
7
+ data.tar.gz: 961f0578ee2657dd785494c3a9d61a289a3a29302f2373ef592ab1f1109cd07704737b9035990820de5c042bed72384055c8a08d7facf95430755f5b7825febc
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.66"
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.124'
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,48 @@ 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(__lock,__dataelements,__endpoints,__status,__local,__additional,__code,__exec_endpoints,__exec_parameters) #{{{
323
+ __struct = if __code
324
+ manipulate(true,__lock,__dataelements,__endpoints,__status,__local,__additional,__code,'Parameter')
352
325
  else
353
- WEEL::ManipulateStructure.new(dataelements,endpoints,status,local,additional)
326
+ WEEL::ReadStructure.new(__dataelements,__endpoints,__local,__additional)
354
327
  end
355
- struct.instance_eval(code,where,1)
356
- struct
357
- end
328
+ @handler_endpoint = __exec_endpoints.is_a?(Array) ? __exec_endpoints.map{ |ep| __struct.endpoints[ep] }.compact : __struct.endpoints[__exec_endpoints]
329
+ if @controller.attributes['twin_engine']
330
+ @handler_endpoint_orig = @handler_endpoint
331
+ @handler_endpoint = @controller.attributes['twin_engine'].to_s + '?original_endpoint=' + Riddl::Protocols::Utils::escape(@handler_endpoint)
332
+ end
333
+ __params = __exec_parameters.dup
334
+ __params[:arguments] = __params[:arguments].dup if __params[:arguments]
335
+ __params[:arguments]&.map! do |__ele|
336
+ __tmp = __ele.dup
337
+ if __tmp.value.is_a?(WEEL::ProcString)
338
+ __tmp.value = __struct.instance_eval __tmp.value.code, 'Parameter', 1
339
+ end
340
+ __tmp
341
+ end
342
+ __params
343
+ end #}}}
344
+ def test_condition(__dataelements,__endpoints,__local,__additional,__code,__args={}) #{{{
345
+ __struct = WEEL::ReadStructure.new(__dataelements,__endpoints,__local,__additional).instance_eval(__code,'Condition',1)
346
+ @controller.notify("gateway/decide", :instance_uuid => @controller.uuid, :code => __code, :condition => (__struct ? "true" : "false"))
347
+ __struct
348
+ end #}}}
349
+ def manipulate(__readonly,__lock,__dataelements,__endpoints,__status,__local,__additional,__code,__where,__result=nil,__options=nil) #{{{
350
+ result = CPEE::EvalRuby::Translation::simplify_structurized_result(__result)
351
+ __struct = if __readonly
352
+ WEEL::ReadStructure.new(__dataelements,__endpoints,__local,__additional)
353
+ else
354
+ WEEL::ManipulateStructure.new(__dataelements,__endpoints,__status,__local,__additional)
355
+ end
356
+ __struct.instance_eval(__code,__where,1)
357
+ __struct
358
+ end #}}}
358
359
 
359
- def split_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]
360
+ def split_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]{{{
360
361
  @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]]
362
+ end #}}}
363
+ def join_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]{{{
363
364
  @controller.notify("gateway/join", :instance_uuid => @controller.uuid, :branches => branches)
364
- end
365
+ end #}}}
365
366
  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,26 +326,42 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
344
326
  GC.start
345
327
  end #}}}
346
328
 
347
- def test_condition(dataelements,endpoints,local,additional,code,args={})
348
- send = []
349
- send.push Riddl::Parameter::Simple::new('code',code)
350
- send.push Riddl::Parameter::Complex::new('dataelements','application/json', JSON::generate(dataelements))
351
- send.push Riddl::Parameter::Complex::new('local','application/json', JSON::generate(local)) if local
352
- send.push Riddl::Parameter::Complex::new('endpoints','application/json', JSON::generate(endpoints))
353
- send.push Riddl::Parameter::Complex::new('additional','application/json', JSON::generate(additional))
354
-
355
- status, ret, headers = Riddl::Client.new(@controller.url_code).request 'put' => send
356
- recv = if status >= 200 && status < 300
357
- ret[0].value
329
+ def prepare(lock,dataelements,endpoints,status,local,additional,code,exec_endpoints,exec_parameters)
330
+ struct = if code
331
+ manipulate(true,lock,dataelements,endpoints,status,local,additional,code,'Parameter')
358
332
  else
359
- nil
333
+ WEEL::ReadStructure.new(data,endpoints,local,additional)
360
334
  end
361
- recv = 'false' unless receive
362
- recv = (recv == 'false' || recv == 'null' || recv == 'nil' ? false : true)
363
- @controller.notify("gateway/decide", :instance_uuid => @controller.uuid, :code => code, :condition => recv)
364
- recv
365
- end
366
- def eval_expression(dataelements,endpoints,local,additional,code)
335
+ @handler_endpoint = exec_endpoints.is_a?(Array) ? exec_endpoints.map{ |ep| struct.endpoints[ep] }.compact : struct.endpoints[exec_endpoints]
336
+ if @controller.attributes['twin_engine']
337
+ @handler_endpoint_orig = @handler_endpoint
338
+ @handler_endpoint = @controller.attributes['twin_engine'].to_s + '?original_endpoint=' + Riddl::Protocols::Utils::escape(@handler_endpoint)
339
+ end
340
+ params = exec_parameters.dup
341
+ params[:arguments] = params[:arguments].dup if params[:arguments]
342
+ params[:arguments]&.map! do |ele|
343
+ t = ele.dup
344
+ if t.value.is_a?(WEEL::ProcString)
345
+ send = []
346
+ send.push Riddl::Parameter::Simple::new('code',t.value.code)
347
+ send.push Riddl::Parameter::Complex::new('dataelements','application/json', JSON::generate(struct.data))
348
+ send.push Riddl::Parameter::Complex::new('local','application/json', JSON::generate(struct.local)) if struct.local
349
+ send.push Riddl::Parameter::Complex::new('endpoints','application/json', JSON::generate(struct.endpoints))
350
+ send.push Riddl::Parameter::Complex::new('additional','application/json', JSON::generate(struct.additional))
351
+
352
+ status, ret, headers = Riddl::Client.new(@controller.url_code).request 'put' => send
353
+ recv = if status >= 200 && status < 300
354
+ ret[0].value
355
+ else
356
+ nil
357
+ end
358
+ t.value = recv
359
+ end
360
+ t
361
+ end
362
+ params
363
+ end #}}}
364
+ def test_condition(dataelements,endpoints,local,additional,code,args={}) #{{{
367
365
  send = []
368
366
  send.push Riddl::Parameter::Simple::new('code',code)
369
367
  send.push Riddl::Parameter::Complex::new('dataelements','application/json', JSON::generate(dataelements))
@@ -377,9 +375,12 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
377
375
  else
378
376
  nil
379
377
  end
378
+ recv = 'false' unless recv
379
+ recv = (recv == 'false' || recv == 'null' || recv == 'nil' ? false : true)
380
+ @controller.notify("gateway/decide", :instance_uuid => @controller.uuid, :code => code, :condition => recv)
380
381
  recv
381
- end
382
- def manipulate(readonly,lock,dataelements,endpoints,status,local,additional,code,where,result=nil,options=nil)
382
+ end #}}}
383
+ def manipulate(readonly,lock,dataelements,endpoints,status,local,additional,code,where,result=nil,options=nil) #{{{
383
384
  lock.synchronize do
384
385
  send = []
385
386
  send.push Riddl::Parameter::Simple::new('code',code)
@@ -413,12 +414,12 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
413
414
  nil
414
415
  end
415
416
  end
416
- end
417
+ end #}}}
417
418
 
418
- def split_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]
419
+ def split_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]{{{
419
420
  @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]]
421
+ end #}}}
422
+ def join_branches(branches) # factual, so for inclusive or [[a],[b],[c,d,e]]{{{
422
423
  @controller.notify("gateway/join", :instance_uuid => @controller.uuid, :branches => branches)
423
- end
424
+ end #}}}
424
425
  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.66
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.124
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.124
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: highline
51
51
  requirement: !ruby/object:Gem::Requirement