weel 1.99.90 → 1.99.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/weel.rb +22 -15
  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: d75c73b084f3926403dc8938f27a1295d7a36d7ccd2299f5eff2af075808da24
4
- data.tar.gz: d3d5d52b613217a031392c740442bbe6a6d16d64b38b668dca8d15035a86a078
3
+ metadata.gz: 641444781be26b938868f6115466c81870c175948bd664a4b8f4abe2ffd8f4ab
4
+ data.tar.gz: eee050aca5dcb0a5002cbd7b5eb6274d6dc0ed33b50ef89c634b8d4754c2ef43
5
5
  SHA512:
6
- metadata.gz: 710def978b14664c463ea6e87bb88179b2cc2aa01429fa908142b202b75e2ea8831eacd663573252ec5ff9e0dd54e534b965c5033dc68dc675aa3fe7543a32ca
7
- data.tar.gz: 34d4be7d47e4c2ffd243fb1d216c98387de56058dc20bb827085d56dc3e3f08899f1b7bd9ee9d67d39e418ce2b0907f4ccf901ef0484f6d2940d2565bc5ba285
6
+ metadata.gz: '029b33aa91638408cf9994fccb389fda6e0660f02e81fad6bcb2fe2901c6d316e72a3dd2ef9dd6d2ba3ffbff627c8f17820b50db6c27b0a5c16c7860f96ab14e'
7
+ data.tar.gz: a760a8b4665d0587dde85638c680d0277b95de0e0c4a829dab502dcffa0f9f1241d553a942659594b4b825a56c5388679a04ee16f0098ffd82bc490993a07d7b
@@ -238,7 +238,7 @@ class WEEL
238
238
  end # }}}
239
239
 
240
240
  class HandlerWrapperBase # {{{
241
- def self::loop_guard(lid,count); false; end
241
+ def self::loop_guard(arguments,lid,count); false; end
242
242
  def self::inform_state_change(arguments,newstate); end
243
243
  def self::inform_syntax_error(arguments,err,code); end
244
244
  def self::inform_handlerwrapper_error(arguments,err); end
@@ -636,7 +636,7 @@ class WEEL
636
636
  searchmode = __weel_is_in_search_mode(position)
637
637
  return if searchmode
638
638
  return if self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped || Thread.current[:nolongernecessary]
639
- __weel_progress searchmode, position, true
639
+ __weel_progress position, true
640
640
  self.__weel_state = :stopping
641
641
  end #}}}
642
642
 
@@ -681,8 +681,9 @@ class WEEL
681
681
  end
682
682
  end #}}}
683
683
 
684
- def __weel_progress(searchmode, position, skip=false) #{{{
684
+ def __weel_progress(position, skip=false) #{{{
685
685
  ipc = {}
686
+ branch = Thread.current
686
687
  if Thread.current[:branch_parent] && Thread.current[:branch_parent][:branch_position]
687
688
  @__weel_positions.delete Thread.current[:branch_parent][:branch_position]
688
689
  ipc[:unmark] ||= []
@@ -694,15 +695,21 @@ class WEEL
694
695
  ipc[:unmark] ||= []
695
696
  ipc[:unmark] << Thread.current[:branch_position] rescue nil
696
697
  end
697
- wp = WEEL::Position.new(position, skip ? :after : :at, nil)
698
+ wp = if branch[:branch_search_now] == true
699
+ branch[:branch_search_now] = false
700
+ WEEL::Position.new(position, skip ? :after : :at, @__weel_search_positions[position]&.passthrough)
701
+ else
702
+ WEEL::Position.new(position, skip ? :after : :at)
703
+ end
698
704
  ipc[skip ? :after : :at] = [wp]
699
705
 
706
+ @__weel_search_positions.delete(position)
700
707
  @__weel_search_positions.each do |k,ele| # some may still be in active search but lets unmark them for good measure
701
708
  ipc[:unmark] ||= []
702
709
  ipc[:unmark] << ele
703
710
  true
704
711
  end
705
- ipc[:unmark].uniq!
712
+ ipc[:unmark].uniq! if ipc[:unmark]
706
713
 
707
714
  @__weel_positions << wp
708
715
  Thread.current[:branch_position] = wp
@@ -726,7 +733,7 @@ class WEEL
726
733
  return
727
734
  end
728
735
 
729
- wp = __weel_progress searchmode, position
736
+ wp = __weel_progress position
730
737
 
731
738
  # searchmode position is after, jump directly to vote_sync_after
732
739
  raise Signal::Proceed if searchmode == :after
@@ -772,13 +779,7 @@ class WEEL
772
779
  raise Signal::Stop unless handlerwrapper.vote_sync_before(params)
773
780
  raise Signal::Skip if self.__weel_state == :stopping || self.__weel_state == :finishing
774
781
 
775
- if @__weel_search_positions[position]
776
- passthrough = @__weel_search_positions[position].passthrough
777
- @__weel_search_positions[position].passthrough = nil
778
- else
779
- passthrough = nil
780
- end
781
- handlerwrapper.activity_handle passthrough, params
782
+ handlerwrapper.activity_handle wp.passthrough, params
782
783
  wp.passthrough = handlerwrapper.activity_passthrough_value
783
784
  unless wp.passthrough.nil?
784
785
  @__weel_handlerwrapper::inform_position_change @__weel_handlerwrapper_args, :wait => [wp]
@@ -923,9 +924,11 @@ class WEEL
923
924
 
924
925
  if position && @__weel_search_positions.include?(position) # matching searchpos => start execution from here
925
926
  branch[:branch_search] = false # execute all activities in THIS branch (thread) after this point
927
+ branch[:branch_search_now] = true # just now did we switch the search mode
926
928
  while branch.key?(:branch_parent) # also all parent branches should execute activities after this point, additional branches spawned by parent branches should still be in search mode
927
929
  branch = branch[:branch_parent]
928
930
  branch[:branch_search] = false
931
+ branch[:branch_search_now] = true # just now did we switch the search mode
929
932
  end
930
933
  @__weel_search_positions[position].detail == :after
931
934
  else
@@ -1101,8 +1104,12 @@ public
1101
1104
  # Stop the workflow execution
1102
1105
  def stop # {{{
1103
1106
  Thread.new do
1104
- @dslr.__weel_state = :stopping
1105
- @dslr.__weel_main.join if @dslr.__weel_main
1107
+ if @dslr.__weel_state == :running
1108
+ @dslr.__weel_state = :stopping
1109
+ @dslr.__weel_main.join if @dslr.__weel_main
1110
+ elsif @dslr.__weel_state == :ready || dslr.__weel_state == :stopped
1111
+ @dslr.__weel_state = :stopped
1112
+ end
1106
1113
  end
1107
1114
  end # }}}
1108
1115
  # Start the workflow execution
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "weel"
3
- s.version = "1.99.90"
3
+ s.version = "1.99.95"
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.90
4
+ version: 1.99.95
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: 2020-09-24 00:00:00.000000000 Z
12
+ date: 2020-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit