weel 1.99.77 → 1.99.78

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 +80 -90
  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: 9e5703894ec21b4ed491f3cc7da6ca0e4db0d7e8524b1af3d3b6be84c8f54bcc
4
- data.tar.gz: '0958b8ab64692f7fab4496fc88f572461fc6f53a4d83e5e21ca9919db685940e'
3
+ metadata.gz: 7ba66fd2448bc777292487140faac23d6f0fd00a264953dff4b16e302a6a9344
4
+ data.tar.gz: 93a76802212618b1e5fb20dd29475ee671a2d5d53bc7595655b9a8d751332765
5
5
  SHA512:
6
- metadata.gz: 75d51aaf2ce50bf9eedb4c7454bce2ad5b9da95868b2c7616509a8e265fdb8185f0f8dc68a0d8768fda685f392e863ccb6eb3a0ee18dbd36e68f9884d114cfe4
7
- data.tar.gz: 7798fc30a7a05af902462ba5daf3243c66dd28fd12897d3e199fe3b8430a6141f6c73fd5eb5470063620884529e43d375d4e12d203baa278e4ae15945878aaa7
6
+ metadata.gz: 6a8773185c37a30e34a6f8712cd9c7ad41bd44f6a76bb99e7ab41839448846c1b8a3a4a1285700c913b6a5a2b169b4fe3e38be2e688fc3e42cd08e3dea9b41c6
7
+ data.tar.gz: 243c9322426d3db3ee97d9e78cf9dd5f9221dab1c7206ce49a983406acf59bcc3f6275a4d95177d4ea9aa70d440a841ad1d8ff1d052fc52849daa65ec9431a75
@@ -243,7 +243,7 @@ end # }}}
243
243
  def callback(result=nil,options={}); end
244
244
 
245
245
  def test_condition(mr,code); mr.instance_eval(code); end
246
- def manipulate(mr,code,result=nil); mr.instance_eval(code); end
246
+ def manipulate(mr,code,result=nil,options=nil); mr.instance_eval(code); end
247
247
  end # }}}
248
248
 
249
249
  class Position # {{{
@@ -706,104 +706,94 @@ end # }}}
706
706
  @__weel_handlerwrapper::inform_position_change @__weel_handlerwrapper_args, :after => [wp]
707
707
  end
708
708
  when :call
709
- params = { }
710
- case parameters
711
- when Hash
712
- parameters.each do |k,p|
713
- if p.is_a?(Symbol) && @__weel_data.include?(p)
714
- params[k] = @__weel_data[p]
715
- else
716
- params[k] = p
709
+ begin
710
+ again = catch Signal::Again do
711
+ rs = ReadStructure.new(@__weel_data,@__weel_endpoints)
712
+ if prepare
713
+ if prepare.is_a?(Proc)
714
+ rs.instance_exec &prepare
715
+ elsif prepare.is_a?(String)
716
+ rs.instance_eval prepare
717
717
  end
718
718
  end
719
- when Array
720
- parameters.each_with_index do |p,i|
721
- if p.is_a?(Symbol) && @__weel_data.include?(p)
722
- params[p] = @__weel_data[p]
723
- else
724
- params[i] = p
725
- end
719
+ params = handlerwrapper.prepare(rs,endpoint,parameters)
720
+ raise Signal::Stop unless handlerwrapper.vote_sync_before(params)
721
+ raise Signal::Skip if self.__weel_state == :stopping || self.__weel_state == :finishing
722
+
723
+ if @__weel_search_positions[position]
724
+ passthrough = @__weel_search_positions[position].passthrough
725
+ @__weel_search_positions[position].passthrough = nil
726
+ else
727
+ passthrough = nil
726
728
  end
727
- else
728
- raise("invalid parameters")
729
- end
730
- rs = ReadStructure.new(@__weel_data,@__weel_endpoints)
731
- if prepare
732
- if prepare.is_a?(Proc)
733
- rs.instance_exec &prepare
734
- elsif prepare.is_a?(String)
735
- rs.instance_eval prepare
736
- end
737
- end
738
- params = handlerwrapper.prepare(rs,endpoint,params)
739
- raise Signal::Stop unless handlerwrapper.vote_sync_before(params)
740
- raise Signal::Skip if self.__weel_state == :stopping || self.__weel_state == :finishing
741
-
742
- if @__weel_search_positions[position]
743
- passthrough = @__weel_search_positions[position].passthrough
744
- @__weel_search_positions[position].passthrough = nil
745
- else
746
- passthrough = nil
747
- end
748
729
 
749
- handlerwrapper.activity_handle passthrough, params
750
- wp.passthrough = handlerwrapper.activity_passthrough_value
751
- unless wp.passthrough.nil?
752
- @__weel_handlerwrapper::inform_position_change @__weel_handlerwrapper_args, :wait => [wp]
753
- end
754
- begin
755
- # with loop if catching Signal::Again
756
- # handshake call and wait until it finished
757
- waitingresult = nil
758
- waitingresult = Thread.current[:continue].wait unless Thread.current[:nolongernecessary] || self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped
759
- raise waitingresult[1] if !waitingresult.nil? && waitingresult.is_a?(Array) && waitingresult.length == 2 && waitingresult[0] == WEEL::Signal::Error
760
-
761
- if Thread.current[:nolongernecessary]
762
- handlerwrapper.activity_no_longer_necessary
763
- raise Signal::NoLongerNecessary
764
- end
765
- if self.__weel_state == :stopping || self.__weel_state == :finishing
766
- handlerwrapper.activity_stop
730
+ handlerwrapper.activity_handle passthrough, params
767
731
  wp.passthrough = handlerwrapper.activity_passthrough_value
768
- raise Signal::Proceed
769
- end
732
+ unless wp.passthrough.nil?
733
+ @__weel_handlerwrapper::inform_position_change @__weel_handlerwrapper_args, :wait => [wp]
734
+ end
735
+ begin
736
+ # with loop if catching Signal::Again
737
+ # handshake call and wait until it finished
738
+ waitingresult = nil
739
+ waitingresult = Thread.current[:continue].wait unless Thread.current[:nolongernecessary] || self.__weel_state == :stopping || self.__weel_state == :finishing || self.__weel_state == :stopped
740
+ raise waitingresult[1] if !waitingresult.nil? && waitingresult.is_a?(Array) && waitingresult.length == 2 && waitingresult[0] == WEEL::Signal::Error
741
+
742
+ if Thread.current[:nolongernecessary]
743
+ handlerwrapper.activity_no_longer_necessary
744
+ raise Signal::NoLongerNecessary
745
+ end
746
+ if self.__weel_state == :stopping || self.__weel_state == :finishing
747
+ handlerwrapper.activity_stop
748
+ wp.passthrough = handlerwrapper.activity_passthrough_value
749
+ raise Signal::Proceed
750
+ end
770
751
 
771
- code = if waitingresult == WEEL::Signal::Again
772
- update
773
- elsif waitingresult == WEEL::Signal::Salvage
774
- salvage || raise('HTTP Error. The service return status was not between 200 and 300.')
775
- else
776
- finalize
777
- end
778
- if code.is_a?(Proc) || code.is_a?(String)
779
- handlerwrapper.inform_activity_manipulate
780
- if code.is_a?(Proc)
781
- mr = ManipulateStructure.new(@__weel_data,@__weel_endpoints,@__weel_status)
782
- case code.arity
783
- when 1; mr.instance_exec(handlerwrapper.activity_result_value,&code)
784
- when 2; mr.instance_exec(handlerwrapper.activity_result_value,&code)
785
- else
786
- mr.instance_exec(&code)
752
+ code = if waitingresult == WEEL::Signal::Again
753
+ update
754
+ elsif waitingresult == WEEL::Signal::Salvage
755
+ salvage || raise('HTTP Error. The service return status was not between 200 and 300.')
756
+ else
757
+ finalize
758
+ end
759
+ if code.is_a?(Proc) || code.is_a?(String)
760
+ handlerwrapper.inform_activity_manipulate
761
+ if code.is_a?(Proc)
762
+ mr = ManipulateStructure.new(@__weel_data,@__weel_endpoints,@__weel_status)
763
+ case code.arity
764
+ when 1; mr.instance_exec(handlerwrapper.activity_result_value,&code)
765
+ when 2; mr.instance_exec(handlerwrapper.activity_result_value,&code)
766
+ else
767
+ ma = catch Signal::Again do
768
+ mr.instance_exec(&code)
769
+ 'yes' # ma sadly will have nil when i just throw
770
+ end
771
+ end
772
+ elsif code.is_a?(String)
773
+ mr = ManipulateStructure.new(@__weel_data,@__weel_endpoints,@__weel_status)
774
+ ma = catch Signal::Again do
775
+ handlerwrapper.manipulate(mr,code,handlerwrapper.activity_result_value,handlerwrapper.activity_result_options)
776
+ 'yes' # ma sadly will have nil when i just throw
777
+ end
778
+ end
779
+ handlerwrapper.inform_manipulate_change(
780
+ (mr.changed_status ? @__weel_status : nil),
781
+ (mr.changed_data.any? ? mr.changed_data.uniq : nil),
782
+ (mr.changed_endpoints.any? ? mr.changed_endpoints.uniq : nil),
783
+ @__weel_data,
784
+ @__weel_endpoints
785
+ )
786
+ throw(Signal::Again, Signal::Again) if ma.nil?
787
787
  end
788
- elsif code.is_a?(String)
789
- mr = ManipulateStructure.new(@__weel_data,@__weel_endpoints,@__weel_status)
790
- handlerwrapper.manipulate(mr,code,handlerwrapper.activity_result_value)
788
+ end while waitingresult == Signal::Again
789
+ if handlerwrapper.activity_passthrough_value.nil?
790
+ handlerwrapper.inform_activity_done
791
+ wp.passthrough = nil
792
+ wp.detail = :after
793
+ @__weel_handlerwrapper::inform_position_change @__weel_handlerwrapper_args, :after => [wp]
791
794
  end
792
- handlerwrapper.inform_manipulate_change(
793
- (mr.changed_status ? @__weel_status : nil),
794
- (mr.changed_data.any? ? mr.changed_data.uniq : nil),
795
- (mr.changed_endpoints.any? ? mr.changed_endpoints.uniq : nil),
796
- @__weel_data,
797
- @__weel_endpoints
798
- )
799
795
  end
800
- end while waitingresult == Signal::Again
801
- if handlerwrapper.activity_passthrough_value.nil?
802
- handlerwrapper.inform_activity_done
803
- wp.passthrough = nil
804
- wp.detail = :after
805
- @__weel_handlerwrapper::inform_position_change @__weel_handlerwrapper_args, :after => [wp]
806
- end
796
+ end while again == Signal::Again
807
797
  end
808
798
  raise Signal::Proceed
809
799
  rescue Signal::SkipManipulate, Signal::Proceed
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "weel"
3
- s.version = "1.99.77"
3
+ s.version = "1.99.78"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Preliminary release of the 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.77
4
+ version: 1.99.78
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: 2019-10-10 00:00:00.000000000 Z
12
+ date: 2019-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit