weel 1.99.111 → 1.99.113

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: b06de4e72e80c63aa6cd62cb267e837823a6099ef8b100031eeb5e817f950ff2
4
- data.tar.gz: f227674b5d4f22a49d6d96e823a618fc508e48e250a50dee08603d128d30d5f4
3
+ metadata.gz: ccdb4515278ad68f38a35abef85197ca3f0732131f93c2323fe3e8cb1123df39
4
+ data.tar.gz: c436c8bf90eca6a370d67a71c14ef094507b43802ce2bf6b10bb9d863034a814
5
5
  SHA512:
6
- metadata.gz: 23321928b269cfb7358187d79e786fd6efef7b0ad4694b35d71af6f0e63f175a2228356ee8a781de4f64d106dc84d790c585a89468065ac37b07dd3cf60c550e
7
- data.tar.gz: 8881323b085b5e928412476f21e5ebe5d2f5fd9a9da0f30c65d2da16643c88bd21507331d9ee6b097d99643d25aefa6882cc4a11eb7e4faf32cd4a32f2bc2460
6
+ metadata.gz: 055bc4890e45536bd725110f837b57f6fb810811ae9b17ce94c9f0f286ba73e3dc19bf6d6170455f3a687d3dac500e2dac6e5886922ba17e601034a562f808ff
7
+ data.tar.gz: 9e18656c48d1e8bb0d580e2eb0336161df469a38da3964eab0af0fa4d19593f85c40a20a55cd5a6299d113ccb4a1ef023531bf47d031f2ef5a0469ea8f23e13a
data/lib/weel.rb CHANGED
@@ -322,7 +322,7 @@ class WEEL
322
322
 
323
323
  def initialize(arguments,position=nil,continue=nil); end
324
324
 
325
- def prepare(readonly, endpoints, parameters, replay=false); parameters; end
325
+ def prepare(readonly, endpoints, parameters); parameters; end
326
326
  def additional; {}; end
327
327
 
328
328
  def activity_handle(passthrough, parameters); end
@@ -460,10 +460,9 @@ class WEEL
460
460
  @__weel_connectionwrapper_args = []
461
461
  @__weel_state = :ready
462
462
  @__weel_status = Status.new(0,"undefined")
463
- @__weel_replay = false
464
463
  @__weel_sim = -1
465
464
  end #}}}
466
- attr_accessor :__weel_search_positions, :__weel_positions, :__weel_main, :__weel_data, :__weel_endpoints, :__weel_connectionwrapper, :__weel_connectionwrapper_args, :__weel_replay
465
+ attr_accessor :__weel_search_positions, :__weel_positions, :__weel_main, :__weel_data, :__weel_endpoints, :__weel_connectionwrapper, :__weel_connectionwrapper_args
467
466
  attr_reader :__weel_state, :__weel_status
468
467
 
469
468
  # DSL-Constructs for atomic calls to external services (calls) and pure context manipulations (manipulate).
@@ -885,7 +884,7 @@ class WEEL
885
884
  connectionwrapper.manipulate(rs,prepare,'Activity ' + position.to_s)
886
885
  end
887
886
  end
888
- params = connectionwrapper.prepare(rs,endpoint,parameters,@__weel_replay)
887
+ params = connectionwrapper.prepare(rs,endpoint,parameters)
889
888
  raise Signal::Stop unless connectionwrapper.vote_sync_before(params)
890
889
  raise Signal::Skip if self.__weel_state == :stopping || self.__weel_state == :finishing
891
890
 
@@ -895,6 +894,9 @@ class WEEL
895
894
  @__weel_connectionwrapper::inform_position_change @__weel_connectionwrapper_args, :wait => [wp]
896
895
  end
897
896
  begin
897
+ # cleanup after callback updates
898
+ connectionwrapper.mem_guard
899
+
898
900
  # with loop if catching Signal::Again
899
901
  # handshake call and wait until it finished
900
902
  waitingresult = nil
@@ -1098,7 +1100,6 @@ class WEEL
1098
1100
  if newState == :stopping || newState == :finishing
1099
1101
  @__weel_status.nudge!
1100
1102
  __weel_recursive_continue(@__weel_main)
1101
- __weel_replay = false
1102
1103
  end
1103
1104
 
1104
1105
  @__weel_connectionwrapper::inform_state_change @__weel_connectionwrapper_args, @__weel_state
@@ -1255,11 +1256,6 @@ public
1255
1256
  end
1256
1257
  end # }}}
1257
1258
 
1258
- def replay
1259
- @dslr.__weel_replay = true
1260
- start
1261
- end
1262
-
1263
1259
  def sim # {{{
1264
1260
  stat = @dslr.__weel_state
1265
1261
  return nil unless stat == :ready || stat == :stopped
@@ -18,26 +18,26 @@ class TestWorkflowControl < Test::Unit::TestCase
18
18
  assert(@wf.data[:x] == "begin_Handler_Dummy_Result_end", "Ending environment not correct, see result=#{@wf.data[:x].inspect}")
19
19
  end
20
20
 
21
- # def test_stop
22
- # @wf.description do
23
- # call :a_test_1_1, :endpoint1
24
- # call :a_test_1_2, :endpoint1, parameters: { :call => Proc.new{ sleep 0.5 } }
25
- # call :a_test_1_3, :endpoint1
26
- # end
27
- # @wf.search WEEL::Position.new(:a_test_1_1, :at)
28
- # wf = @wf.start
29
- # sleep(0.2)
30
- # @wf.stop.join
31
- # wf.join
32
- # wf_assert("DONE a_test_1_1")
33
- # wf_assert("STOPPED a_test_1_2")
34
- # wf_assert("DONE a_test_1_2",false)
35
- # wf_assert("CALL a_test_1_2:")
36
- # assert(@wf.state == :stopped, "Stopped workflow has wrong state, #{@wf.state} instead of :stopped")
37
- # assert(@wf.positions.is_a?(Array), "@wf.positions has wrong type, should be an array, it is: #{@wf.positions.inspect}")
38
- # assert(@wf.positions[0].position == :a_test_1_2, "Stop-position has wrong value: #{@wf.positions[0].position} instead of :a_test_2_1")
39
- # assert(@wf.positions[0].detail == :at, "Stop-Position is not :at")
40
- # end
21
+ def test_stop
22
+ @wf.description do
23
+ call :a_test_1_1, :endpoint1
24
+ call :a_test_1_2, :endpoint1, parameters: { :call => Proc.new{ sleep 0.5 } }
25
+ call :a_test_1_3, :endpoint1
26
+ end
27
+ @wf.search WEEL::Position.new(:a_test_1_1, :at)
28
+ wf = @wf.start
29
+ sleep(0.2)
30
+ @wf.stop.join
31
+ wf.join
32
+ wf_assert("DONE a_test_1_1")
33
+ wf_assert("STOPPED a_test_1_2")
34
+ wf_assert("DONE a_test_1_2",false)
35
+ wf_assert("CALL a_test_1_2:")
36
+ assert(@wf.state == :stopped, "Stopped workflow has wrong state, #{@wf.state} instead of :stopped")
37
+ assert(@wf.positions.is_a?(Array), "@wf.positions has wrong type, should be an array, it is: #{@wf.positions.inspect}")
38
+ assert(@wf.positions[0].position == :a_test_1_2, "Stop-position has wrong value: #{@wf.positions[0].position} instead of :a_test_2_1")
39
+ assert(@wf.positions[0].detail == :at, "Stop-Position is not :at")
40
+ end
41
41
  # def test_continue
42
42
  # @wf.description do
43
43
  # call :a_test_1_1, :endpoint1
@@ -0,0 +1,34 @@
1
+ require 'test/unit'
2
+ require File.expand_path(::File.dirname(__FILE__) + '/../TestWorkflow')
3
+
4
+ class TestWorkflowControl < Test::Unit::TestCase
5
+ include TestMixin
6
+
7
+ def test_stop
8
+ @wf.description do
9
+ call :a_test_1_1, :endpoint1
10
+ call :a_test_1_2, :endpoint1, parameters: { :call => Proc.new{ sleep 0.5 } }
11
+ call :a_test_1_3, :endpoint1
12
+ end
13
+ @wf.search WEEL::Position.new(:a_test_1_1, :at)
14
+ wf = @wf.start
15
+ sleep(0.2)
16
+ @wf.stop.join
17
+ wf.join
18
+ wf_assert("DONE a_test_1_1")
19
+ wf_assert("STOPPED a_test_1_2")
20
+ wf_assert("DONE a_test_1_2")
21
+ wf_assert("CALL a_test_1_2:")
22
+ assert(@wf.state == :stopped, "Stopped workflow has wrong state, #{@wf.state} instead of :stopped")
23
+ assert(@wf.positions.is_a?(Array), "@wf.positions has wrong type, should be an array, it is: #{@wf.positions.inspect}")
24
+ assert(@wf.positions[0].position == :a_test_1_2, "Stop-position has wrong value: #{@wf.positions[0].position} instead of :a_test_2_1")
25
+ assert(@wf.positions[0].detail == :after, "Stop-Position is not :at")
26
+ end
27
+
28
+ def test_stops
29
+ 1.upto 1000 do |i|
30
+ puts '.'
31
+ test_stop
32
+ end
33
+ end
34
+ end
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.111"
3
+ s.version = "1.99.113"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
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.111
4
+ version: 1.99.113
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: 2023-08-24 00:00:00.000000000 Z
12
+ date: 2024-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit
@@ -58,6 +58,7 @@ files:
58
58
  - test/basic/tc_search.rb
59
59
  - test/basic/tc_state.rb
60
60
  - test/basic/tc_wf_control.rb
61
+ - test/basic/tc_wf_stop.rb
61
62
  - test/complex/tc_generalsynchonizingmerge_loopsearch.rb
62
63
  - test/complex/tc_parallel_stop.rb
63
64
  - test/complexsearch/tc_search.rb
@@ -122,6 +123,7 @@ test_files:
122
123
  - test/basic/tc_search.rb
123
124
  - test/basic/tc_state.rb
124
125
  - test/basic/tc_wf_control.rb
126
+ - test/basic/tc_wf_stop.rb
125
127
  - test/complex/tc_generalsynchonizingmerge_loopsearch.rb
126
128
  - test/complex/tc_parallel_stop.rb
127
129
  - test/complexsearch/tc_search.rb