weel 1.99.122 → 1.99.124

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/weel.rb +15 -36
  3. data/weel.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a667f015c959147b33b0acab3119502d4f62b1b5785836f236819324e9fa2bd
4
- data.tar.gz: a68fc1c9c3a04525b18faca8cd0b9de14c2863746a8b5a010933108a13e9e675
3
+ metadata.gz: de93809f2b1350265c3745e9a31be9ea2c7a6fbd2de4b6c282070e4393138684
4
+ data.tar.gz: 2df4b7700721362353934d54f1a223d4413374b6e6dd54efe5d92ed1fcfac9e8
5
5
  SHA512:
6
- metadata.gz: '09dd1a1407dd46e8361b6d80266c81298503eb67369462db4120405b8a3497fd658a0bd4cf9f5002690b595494ef23597a84090cd7dcfb03b80e106af7444e90'
7
- data.tar.gz: 6fd1dac78629fe28677b0d5fd35ae0d1d802787a1113c6cc765fd8b9d5814c61c6bdf53bf69a188dd9331ed7b2efeb625866c1f49a65ada4579b23bc6fae0731
6
+ metadata.gz: e5f1e42552289504e1c9bb97c8068948cb0c8b7c839d830da987a442956fb0ecf8103f6a59426c324c805f14cde8fdf6b3424e57cdbda78b33f20312374f269a
7
+ data.tar.gz: a6bc3fccb1595040956763c938f179bd894422c196ce06e24fe5d0dea54bb81eb6f25c892a8c56c299ca0005ec958176de0fa95b76abee5526f57e78f42d1b95
data/lib/weel.rb CHANGED
@@ -66,10 +66,6 @@ class WEEL
66
66
  'data' => @__weel_data,
67
67
  'endpoints' => @__weel_endpoints,
68
68
  'additional' => @additional,
69
- 'status' => {
70
- 'id' => @__weel_status.id,
71
- 'message' => @__weel_status.message
72
- }
73
69
  }.to_json(*a)
74
70
  end
75
71
 
@@ -94,9 +90,6 @@ class WEEL
94
90
  e.each do |k,v|
95
91
  endpoints.send(k+'=',v)
96
92
  end if e
97
- if s
98
- status.update(s['id'],s['message'])
99
- end
100
93
  end
101
94
  def data
102
95
  ReadHash.new(@__weel_data)
@@ -105,8 +98,9 @@ class WEEL
105
98
  ReadHash.new(@__weel_endpoints)
106
99
  end
107
100
  def local
108
- @__weel_local.first
101
+ @__weel_local&.first
109
102
  end
103
+ attr_reader :additional
110
104
  end # }}}
111
105
  class ManipulateStructure # {{{
112
106
  def initialize(data,endpoints,status,local,additional)
@@ -195,11 +189,12 @@ class WEEL
195
189
  ManipulateHash.new(@__weel_endpoints,@touched_endpoints,@changed_endpoints)
196
190
  end
197
191
  def local
198
- @__weel_local.first
192
+ @__weel_local&.first
199
193
  end
200
194
  def status
201
195
  @__weel_status
202
196
  end
197
+ attr_reader :additional
203
198
  end # }}}
204
199
  class ManipulateHash # {{{
205
200
  attr_reader :__weel_touched, :__weel_changed
@@ -295,7 +290,6 @@ class WEEL
295
290
  end
296
291
  end
297
292
  end # }}}
298
-
299
293
  class ReadOnlyHash # {{{
300
294
  def initialize(values)
301
295
  @__weel_values = values.transform_values do |v|
@@ -333,6 +327,13 @@ class WEEL
333
327
  end
334
328
  end # }}}
335
329
 
330
+ class ProcString #{{{
331
+ attr_reader :code
332
+ def initialize(code)
333
+ @code = code
334
+ end
335
+ end #}}}
336
+
336
337
  class ConnectionWrapperBase # {{{
337
338
  def self::loop_guard(arguments,lid,count); false; end
338
339
  def self::inform_state_change(arguments,newstate); end
@@ -342,7 +343,6 @@ class WEEL
342
343
 
343
344
  def initialize(arguments,position=nil,continue=nil); end
344
345
 
345
- def prepare(readonly, endpoints, parameters); parameters; end
346
346
  def additional; {}; end
347
347
 
348
348
  def activity_handle(passthrough, parameters); end
@@ -368,8 +368,8 @@ class WEEL
368
368
  def callback(result=nil,options={}); end
369
369
  def mem_guard; end
370
370
 
371
+ def prepare(lock,dataelements,endpoints,status,local,additional,code,exec_endpoints,exec_parameters); end
371
372
  def test_condition(dataelements,endpoints,local,additional,code,args={}); ReadStructure.new(dataelements,endpoints,local,additional).instance_eval(code); end
372
- def eval_expression(dataelements,endpoints,local,additional,code); ReadStructure.new(dataelements,endpoints,local,additional).instance_eval(code); end
373
373
  def manipulate(readonly,lock,dataelements,endpoints,status,local,additional,code,where,result=nil,options=nil)
374
374
  lock.synchronize do
375
375
  if readonly
@@ -492,7 +492,7 @@ class WEEL
492
492
  attr_reader :__weel_state, :__weel_status, :__weel_status
493
493
 
494
494
  # DSL-Construct for translating expressions into static parameters
495
- def 🠊(code); __weel_eval_expression(code); end
495
+ def 🠊(code); ProcString.new(code); end
496
496
 
497
497
  # DSL-Constructs for atomic calls to external services (calls) and pure context manipulations (manipulate).
498
498
  # Calls can also manipulate context (after the invoking the external services)
@@ -795,22 +795,6 @@ class WEEL
795
795
  end
796
796
  end #}}}
797
797
 
798
- def __weel_eval_expression(expression) #{{{
799
- begin
800
- connectionwrapper = @__weel_connectionwrapper.new @__weel_connectionwrapper_args
801
- connectionwrapper.eval_expression(@__weel_data,@__weel_endpoints,Thread.current[:local],connectionwrapper.additional,expression)
802
- rescue NameError => err # don't look into it, or it will explode
803
- # if you access $! here, BOOOM
804
- self.__weel_state = :stopping
805
- @__weel_connectionwrapper::inform_syntax_error(@__weel_connectionwrapper_args,Exception.new("eval_expression: `#{err.name}` is not a thing that can be used. Maybe it is meant to be a string and you forgot quotes?"),nil)
806
- nil
807
- rescue => err
808
- self.__weel_state = :stopping
809
- @__weel_connectionwrapper::inform_syntax_error(@__weel_connectionwrapper_args,Exception.new(err.message),nil)
810
- nil
811
- end
812
- end #}}}
813
-
814
798
  def __weel_progress(position, uuid, skip=false) #{{{
815
799
  ipc = {}
816
800
  branch = Thread.current
@@ -889,13 +873,8 @@ class WEEL
889
873
  when :call
890
874
  again = catch Signal::Again do
891
875
  connectionwrapper.mem_guard
892
- struct = if prepare
893
- connectionwrapper.manipulate(true,@__weel_lock,@__weel_data,@__weel_endpoints,@__weel_status,Thread.current[:local],connectionwrapper.additional,prepare,'Activity ' + position.to_s)
894
- else
895
- # just the read structure, no code exec necessary
896
- ReadStructure.new(@__weel_data,@__weel_endpoints,Thread.current[:local],connectionwrapper.additional)
897
- end
898
- params = connectionwrapper.prepare(struct,endpoint,parameters)
876
+ params = connectionwrapper.prepare(@__weel_lock,@__weel_data,@__weel_endpoints,@__weel_status,Thread.current[:local],connectionwrapper.additional,prepare,endpoint,parameters)
877
+
899
878
  raise Signal::Stop unless connectionwrapper.vote_sync_before(params)
900
879
  raise Signal::Skip if self.__weel_state == :stopping || self.__weel_state == :finishing
901
880
 
data/weel.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "weel"
3
- s.version = "1.99.122"
3
+ s.version = "1.99.124"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0-or-later"
6
6
  s.summary = "Workflow Execution Engine Library (WEEL)"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.99.122
4
+ version: 1.99.124
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-09-17 00:00:00.000000000 Z
12
+ date: 2024-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit