weel 1.99.6 → 1.99.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +7 -3
- data/lib/weel.rb +45 -31
- data/test/README +7 -0
- data/test/TestHandlerWrapper.rb +9 -0
- data/test/TestWorkflow.rb +1 -0
- data/test/basic/tc_endpoint.rb +1 -1
- data/test/exec/tc_again.rb +20 -0
- data/test/exec/tc_exec.rb +25 -0
- data/weel.gemspec +1 -1
- metadata +57 -51
data/Changelog
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
1.
|
1
|
+
1.99.x
|
2
2
|
-----
|
3
3
|
|
4
|
-
Ruby >= 1.9.3 only, use Queue instead of Threads and Mutexes of Weel::Continue
|
5
|
-
LGPL-3 to achive Aapache 2 compatibility
|
4
|
+
* Ruby >= 1.9.3 only, use Queue instead of Threads and Mutexes of Weel::Continue
|
5
|
+
* LGPL-3 to achive Aapache 2 compatibility
|
6
|
+
* Raise Weel::Signal::Again in HandlerWrapper, to trigger Manipulation and then
|
7
|
+
redo the activity. HandlerWrapper is not discarded inbetween, so it is possible
|
8
|
+
to continue receiving multiple callbacks. Basically sequential multi instance
|
9
|
+
task.
|
6
10
|
|
7
11
|
1.1.x
|
8
12
|
-----
|
data/lib/weel.rb
CHANGED
@@ -69,6 +69,7 @@ class WEEL
|
|
69
69
|
class Stop < Exception; end
|
70
70
|
class Proceed < Exception; end
|
71
71
|
class NoLongerNecessary < Exception; end
|
72
|
+
class Again < Exception; end
|
72
73
|
end # }}}
|
73
74
|
|
74
75
|
class ReadStructure # {{{
|
@@ -243,6 +244,9 @@ class WEEL
|
|
243
244
|
def continue
|
244
245
|
@q.push nil
|
245
246
|
end
|
247
|
+
def clear
|
248
|
+
@q.clear
|
249
|
+
end
|
246
250
|
def wait
|
247
251
|
@q.deq
|
248
252
|
end
|
@@ -616,40 +620,48 @@ class WEEL
|
|
616
620
|
raise Signal::Stop unless handlerwrapper.vote_sync_before(params)
|
617
621
|
|
618
622
|
passthrough = @__weel_search_positions[position] ? @__weel_search_positions[position].passthrough : nil
|
619
|
-
|
620
|
-
|
621
|
-
|
623
|
+
begin
|
624
|
+
# with loop if catch Signal::Again
|
625
|
+
begin
|
626
|
+
# handshake call and wait until it finished
|
627
|
+
handlerwrapper.activity_handle passthrough, params
|
628
|
+
Thread.current[:continue].wait unless Thread.current[:nolongernecessary] || self.__weel_state == :stopping || self.__weel_state == :stopped
|
629
|
+
again = false
|
630
|
+
rescue Signal::Again
|
631
|
+
again = true
|
632
|
+
end
|
622
633
|
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
634
|
+
if Thread.current[:nolongernecessary]
|
635
|
+
handlerwrapper.activity_no_longer_necessary
|
636
|
+
raise Signal::NoLongerNecessary
|
637
|
+
end
|
638
|
+
if self.__weel_state == :stopping
|
639
|
+
handlerwrapper.activity_stop
|
640
|
+
wp.passthrough = handlerwrapper.activity_passthrough_value
|
641
|
+
end
|
631
642
|
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
643
|
+
if wp.passthrough.nil? && (code.is_a?(Proc) || code.is_a?(String))
|
644
|
+
handlerwrapper.inform_activity_manipulate
|
645
|
+
status = handlerwrapper.activity_result_status
|
646
|
+
if code.is_a?(Proc)
|
647
|
+
mr = ManipulateStructure.new(@__weel_data,@__weel_endpoints,@__weel_status)
|
648
|
+
case code.arity
|
649
|
+
when 1; mr.instance_exec(handlerwrapper.activity_result_value,&code)
|
650
|
+
when 2; mr.instance_exec(handlerwrapper.activity_result_value,(status.is_a?(Status)?status:nil),&code)
|
651
|
+
else
|
652
|
+
mr.instance_eval(&code)
|
653
|
+
end
|
654
|
+
elsif code.is_a?(String)
|
655
|
+
mr = ManipulateStructure.new(@__weel_data,@__weel_endpoints,@__weel_status)
|
656
|
+
handlerwrapper.manipulate(mr,code,handlerwrapper.activity_result_value,(status.is_a?(Status)?status:nil))
|
657
|
+
end
|
658
|
+
handlerwrapper.inform_manipulate_change(
|
659
|
+
(mr.changed_status ? @__weel_status : nil),
|
660
|
+
(mr.changed_data.any? ? mr.changed_data.uniq : nil),
|
661
|
+
(mr.changed_endpoints.any? ? mr.changed_endpoints.uniq : nil)
|
662
|
+
)
|
646
663
|
end
|
647
|
-
|
648
|
-
(mr.changed_status ? @__weel_status : nil),
|
649
|
-
(mr.changed_data.any? ? mr.changed_data.uniq : nil),
|
650
|
-
(mr.changed_endpoints.any? ? mr.changed_endpoints.uniq : nil)
|
651
|
-
)
|
652
|
-
end
|
664
|
+
end while wp.passthrough.nil? && again
|
653
665
|
if wp.passthrough.nil?
|
654
666
|
handlerwrapper.inform_activity_done
|
655
667
|
wp.detail = :after
|
@@ -672,6 +684,8 @@ class WEEL
|
|
672
684
|
rescue => err
|
673
685
|
handlerwrapper.inform_activity_failed err
|
674
686
|
self.__weel_state = :stopping
|
687
|
+
ensure
|
688
|
+
Thread.current[:continue].clear if Thread.current[:continue] && Thread.current[:continue].is_a?(Continue)
|
675
689
|
end
|
676
690
|
end # }}}
|
677
691
|
|
data/test/README
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
basic ... Basic WEEL tests
|
2
|
+
complex ... Complex WEEL tests
|
3
|
+
exec ... Different Activity types
|
4
|
+
wfp_basic ... Basic Van der Aalst WF patterns
|
5
|
+
wfp_iteration ... Iteration related Van der Aalst WF patterns
|
6
|
+
wfp_state_based ... State Based Van der Aalst WF patterns
|
7
|
+
wfp_adv_branching ... Advanced Branching Van der Aalst WF patterns
|
data/test/TestHandlerWrapper.rb
CHANGED
@@ -16,6 +16,15 @@ class TestHandlerWrapper < WEEL::HandlerWrapperBase
|
|
16
16
|
if @__myhandler_endpoint == 'stop it'
|
17
17
|
raise WEEL::Signal::Stop
|
18
18
|
end
|
19
|
+
if @__myhandler_endpoint == 'again'
|
20
|
+
@__myhandler_returnValue = parameters.has_key?(:result) ? parameters[:result] : 'Handler_Dummy_Result'
|
21
|
+
if parameters[:call].call
|
22
|
+
raise WEEL::Signal::Again
|
23
|
+
else
|
24
|
+
@__myhandler_continue.continue
|
25
|
+
end
|
26
|
+
return
|
27
|
+
end
|
19
28
|
if parameters[:call]
|
20
29
|
@t = Thread.new do
|
21
30
|
parameters[:call].call
|
data/test/TestWorkflow.rb
CHANGED
data/test/basic/tc_endpoint.rb
CHANGED
@@ -33,7 +33,7 @@ class TestEndpoint < Test::Unit::TestCase
|
|
33
33
|
@wf.endpoints[:endpoint1]="http://www.test2.com" # asure that ep1 has original value
|
34
34
|
eps = @wf.endpoints
|
35
35
|
assert(eps.is_a?(Hash), "Endpoints should result a Hash but returns a #{eps.class}")
|
36
|
-
assert(eps.size ==
|
36
|
+
assert(eps.size == 4, "Endpoints should have two entries: #{eps.inspect}")
|
37
37
|
assert(eps[:endpoint1] == "http://www.test2.com", "Endpoint 1 has wrong value or does not exist: #{eps.inspect}")
|
38
38
|
assert(eps[:endpoint2] == "http://www.test.at", "Endpoint 2 has wrong value or does not exist: #{eps.inspect}")
|
39
39
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.expand_path(::File.dirname(__FILE__) + '/../TestWorkflow')
|
3
|
+
|
4
|
+
class TestChoose < Test::Unit::TestCase
|
5
|
+
include TestMixin
|
6
|
+
|
7
|
+
def test_again
|
8
|
+
@wf.data[:a] = 0
|
9
|
+
@wf.description do
|
10
|
+
call :a_1, :again, :call => Proc.new{data.a < 2} do
|
11
|
+
data.a += 1
|
12
|
+
end
|
13
|
+
end
|
14
|
+
@wf.start.join
|
15
|
+
wf_assert("CALL a_1")
|
16
|
+
wf_sassert("|running|Ca_1Ma_1Ca_1Ma_1Ca_1Ma_1Da_1|finished|")
|
17
|
+
assert(@wf.data[:a] == 3)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.expand_path(::File.dirname(__FILE__) + '/../TestWorkflow')
|
3
|
+
|
4
|
+
class TestChoose < Test::Unit::TestCase
|
5
|
+
include TestMixin
|
6
|
+
|
7
|
+
def test_exec
|
8
|
+
@wf.data[:a] = 0
|
9
|
+
@wf.data[:b] = 0
|
10
|
+
@wf.description do
|
11
|
+
manipulate :a_1, <<-end
|
12
|
+
data.a = 1
|
13
|
+
end
|
14
|
+
call :a_2, :endpoint1, <<-end
|
15
|
+
data.b = 1
|
16
|
+
end
|
17
|
+
end
|
18
|
+
@wf.start.join
|
19
|
+
wf_assert("MANIPULATE a_1")
|
20
|
+
wf_assert("CALL a_2")
|
21
|
+
assert(@wf.data[:a] == 1)
|
22
|
+
assert(@wf.data[:b] == 1)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/weel.gemspec
CHANGED
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.
|
4
|
+
version: 1.99.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2014-04-02 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: see http://cpee.org
|
16
16
|
email: juergen.mangler@gmail.com
|
@@ -19,9 +19,9 @@ extensions: []
|
|
19
19
|
extra_rdoc_files:
|
20
20
|
- README
|
21
21
|
files:
|
22
|
+
- example/SimpleHandlerWrapper.rb
|
22
23
|
- example/SimpleWorkflow.rb
|
23
24
|
- example/runme.rb
|
24
|
-
- example/SimpleHandlerWrapper.rb
|
25
25
|
- lib/weel.rb
|
26
26
|
- COPYING
|
27
27
|
- Changelog
|
@@ -31,37 +31,40 @@ files:
|
|
31
31
|
- weel.gemspec
|
32
32
|
- README
|
33
33
|
- AUTHORS
|
34
|
-
- test/TestHandlerWrapper.rb
|
35
34
|
- test/SimHandlerWrapper.rb
|
36
|
-
- test/ContinueTest.rb
|
37
35
|
- test/TestMixin.rb
|
36
|
+
- test/TestHandlerWrapper.rb
|
37
|
+
- test/ContinueTest.rb
|
38
|
+
- test/README
|
38
39
|
- test/TestWorkflow.rb
|
39
|
-
- test/complex/tc_parallel_stop.rb
|
40
|
-
- test/complex/tc_generalsynchonizingmerge_loopsearch.rb
|
41
|
-
- test/wfp_state_based/tc_interleavedparallelrouting.rb
|
42
|
-
- test/wfp_state_based/tc_deferredchoice.rb
|
43
|
-
- test/wfp_basic/tc_parallelsplit_synchronization.rb
|
44
|
-
- test/wfp_basic/tc_sequence.rb
|
45
|
-
- test/wfp_basic/tc_exclusivechoice_simplemerge.rb
|
46
|
-
- test/basic/tc_data.rb
|
47
|
-
- test/basic/tc_codereplace.rb
|
48
|
-
- test/basic/tc_state.rb
|
49
|
-
- test/basic/tc_wf_control.rb
|
50
|
-
- test/basic/tc_choose.rb
|
51
|
-
- test/basic/tc_search.rb
|
52
|
-
- test/basic/tc_handler.rb
|
53
|
-
- test/basic/tc_endpoint.rb
|
54
|
-
- test/basic/tc_parallel.rb
|
55
|
-
- test/wfp_iteration/tc_structuredloop.rb
|
56
40
|
- test/wfp_adv_branching/tc_threadsplit.rb
|
57
|
-
- test/wfp_adv_branching/
|
58
|
-
- test/wfp_adv_branching/tc_structured_partial_join.rb
|
41
|
+
- test/wfp_adv_branching/tc_structured_discriminator.rb
|
59
42
|
- test/wfp_adv_branching/tc_multichoice_structuredsynchronizingmerge.rb
|
60
|
-
- test/wfp_adv_branching/
|
43
|
+
- test/wfp_adv_branching/tc_multimerge.rb
|
61
44
|
- test/wfp_adv_branching/tc_generalsynchronizingmerge.rb
|
62
45
|
- test/wfp_adv_branching/tc_localsynchronizingmerge.rb
|
63
|
-
- test/wfp_adv_branching/
|
64
|
-
- test/wfp_adv_branching/
|
46
|
+
- test/wfp_adv_branching/tc_generalizedjoin.rb
|
47
|
+
- test/wfp_adv_branching/tc_threadmerge.rb
|
48
|
+
- test/wfp_adv_branching/tc_structured_partial_join.rb
|
49
|
+
- test/wfp_iteration/tc_structuredloop.rb
|
50
|
+
- test/basic/tc_codereplace.rb
|
51
|
+
- test/basic/tc_endpoint.rb
|
52
|
+
- test/basic/tc_handler.rb
|
53
|
+
- test/basic/tc_parallel.rb
|
54
|
+
- test/basic/tc_search.rb
|
55
|
+
- test/basic/tc_state.rb
|
56
|
+
- test/basic/tc_choose.rb
|
57
|
+
- test/basic/tc_data.rb
|
58
|
+
- test/basic/tc_wf_control.rb
|
59
|
+
- test/exec/tc_exec.rb
|
60
|
+
- test/exec/tc_again.rb
|
61
|
+
- test/wfp_basic/tc_sequence.rb
|
62
|
+
- test/wfp_basic/tc_parallelsplit_synchronization.rb
|
63
|
+
- test/wfp_basic/tc_exclusivechoice_simplemerge.rb
|
64
|
+
- test/wfp_state_based/tc_interleavedparallelrouting.rb
|
65
|
+
- test/wfp_state_based/tc_deferredchoice.rb
|
66
|
+
- test/complex/tc_generalsynchonizingmerge_loopsearch.rb
|
67
|
+
- test/complex/tc_parallel_stop.rb
|
65
68
|
homepage: http://cpee.org/
|
66
69
|
licenses:
|
67
70
|
- LGPL-3
|
@@ -88,34 +91,37 @@ signing_key:
|
|
88
91
|
specification_version: 3
|
89
92
|
summary: Preliminary release of the Workflow Execution Engine Library (WEEL)
|
90
93
|
test_files:
|
91
|
-
- test/TestHandlerWrapper.rb
|
92
94
|
- test/SimHandlerWrapper.rb
|
93
|
-
- test/ContinueTest.rb
|
94
95
|
- test/TestMixin.rb
|
96
|
+
- test/TestHandlerWrapper.rb
|
97
|
+
- test/ContinueTest.rb
|
98
|
+
- test/README
|
95
99
|
- test/TestWorkflow.rb
|
96
|
-
- test/complex/tc_parallel_stop.rb
|
97
|
-
- test/complex/tc_generalsynchonizingmerge_loopsearch.rb
|
98
|
-
- test/wfp_state_based/tc_interleavedparallelrouting.rb
|
99
|
-
- test/wfp_state_based/tc_deferredchoice.rb
|
100
|
-
- test/wfp_basic/tc_parallelsplit_synchronization.rb
|
101
|
-
- test/wfp_basic/tc_sequence.rb
|
102
|
-
- test/wfp_basic/tc_exclusivechoice_simplemerge.rb
|
103
|
-
- test/basic/tc_data.rb
|
104
|
-
- test/basic/tc_codereplace.rb
|
105
|
-
- test/basic/tc_state.rb
|
106
|
-
- test/basic/tc_wf_control.rb
|
107
|
-
- test/basic/tc_choose.rb
|
108
|
-
- test/basic/tc_search.rb
|
109
|
-
- test/basic/tc_handler.rb
|
110
|
-
- test/basic/tc_endpoint.rb
|
111
|
-
- test/basic/tc_parallel.rb
|
112
|
-
- test/wfp_iteration/tc_structuredloop.rb
|
113
100
|
- test/wfp_adv_branching/tc_threadsplit.rb
|
114
|
-
- test/wfp_adv_branching/
|
115
|
-
- test/wfp_adv_branching/tc_structured_partial_join.rb
|
101
|
+
- test/wfp_adv_branching/tc_structured_discriminator.rb
|
116
102
|
- test/wfp_adv_branching/tc_multichoice_structuredsynchronizingmerge.rb
|
117
|
-
- test/wfp_adv_branching/
|
103
|
+
- test/wfp_adv_branching/tc_multimerge.rb
|
118
104
|
- test/wfp_adv_branching/tc_generalsynchronizingmerge.rb
|
119
105
|
- test/wfp_adv_branching/tc_localsynchronizingmerge.rb
|
120
|
-
- test/wfp_adv_branching/
|
121
|
-
- test/wfp_adv_branching/
|
106
|
+
- test/wfp_adv_branching/tc_generalizedjoin.rb
|
107
|
+
- test/wfp_adv_branching/tc_threadmerge.rb
|
108
|
+
- test/wfp_adv_branching/tc_structured_partial_join.rb
|
109
|
+
- test/wfp_iteration/tc_structuredloop.rb
|
110
|
+
- test/basic/tc_codereplace.rb
|
111
|
+
- test/basic/tc_endpoint.rb
|
112
|
+
- test/basic/tc_handler.rb
|
113
|
+
- test/basic/tc_parallel.rb
|
114
|
+
- test/basic/tc_search.rb
|
115
|
+
- test/basic/tc_state.rb
|
116
|
+
- test/basic/tc_choose.rb
|
117
|
+
- test/basic/tc_data.rb
|
118
|
+
- test/basic/tc_wf_control.rb
|
119
|
+
- test/exec/tc_exec.rb
|
120
|
+
- test/exec/tc_again.rb
|
121
|
+
- test/wfp_basic/tc_sequence.rb
|
122
|
+
- test/wfp_basic/tc_parallelsplit_synchronization.rb
|
123
|
+
- test/wfp_basic/tc_exclusivechoice_simplemerge.rb
|
124
|
+
- test/wfp_state_based/tc_interleavedparallelrouting.rb
|
125
|
+
- test/wfp_state_based/tc_deferredchoice.rb
|
126
|
+
- test/complex/tc_generalsynchonizingmerge_loopsearch.rb
|
127
|
+
- test/complex/tc_parallel_stop.rb
|