weel 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +2 -0
- data/COPYING +504 -0
- data/FEATURES +20 -0
- data/INSTALL +7 -0
- data/README +4 -0
- data/Rakefile +15 -0
- data/example/SimpleHandlerWrapper.rb +68 -0
- data/example/SimpleWorkflow.rb +15 -0
- data/example/runme.rb +12 -0
- data/lib/weel.rb +749 -0
- data/test/ContinueTest.rb +25 -0
- data/test/TestHandlerWrapper.rb +120 -0
- data/test/TestWorkflow.rb +35 -0
- data/test/basic/tc_choose.rb +82 -0
- data/test/basic/tc_codereplace.rb +38 -0
- data/test/basic/tc_data.rb +32 -0
- data/test/basic/tc_endpoint.rb +40 -0
- data/test/basic/tc_handler.rb +19 -0
- data/test/basic/tc_parallel.rb +115 -0
- data/test/basic/tc_search.rb +37 -0
- data/test/basic/tc_state.rb +17 -0
- data/test/basic/tc_wf_control.rb +68 -0
- data/test/complex/tc_generalsynchonizingmerge_loopsearch.rb +113 -0
- data/test/complex/tc_parallel_stop.rb +32 -0
- data/test/wfp_adv_branching/tc_generalizedjoin.rb +11 -0
- data/test/wfp_adv_branching/tc_generalsynchronizingmerge.rb +45 -0
- data/test/wfp_adv_branching/tc_localsynchronizingmerge.rb +37 -0
- data/test/wfp_adv_branching/tc_multichoice_structuredsynchronizingmerge.rb +47 -0
- data/test/wfp_adv_branching/tc_multimerge.rb +11 -0
- data/test/wfp_adv_branching/tc_structured_discriminator.rb +28 -0
- data/test/wfp_adv_branching/tc_structured_partial_join.rb +41 -0
- data/test/wfp_adv_branching/tc_threadmerge.rb +11 -0
- data/test/wfp_adv_branching/tc_threadsplit.rb +11 -0
- data/test/wfp_basic/tc_exclusivechoice_simplemerge.rb +22 -0
- data/test/wfp_basic/tc_parallelsplit_synchronization.rb +26 -0
- data/test/wfp_basic/tc_sequence.rb +16 -0
- data/test/wfp_iteration/tc_structuredloop.rb +65 -0
- data/test/wfp_state_based/tc_deferredchoice.rb +38 -0
- data/test/wfp_state_based/tc_interleavedparallelrouting.rb +30 -0
- data/weel.gemspec +25 -0
- metadata +127 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.expand_path(::File.dirname(__FILE__) + '/../TestWorkflow')
|
3
|
+
|
4
|
+
# only variant Cancelling Structured Partial Join is implemented, but that's the coolest one 8)
|
5
|
+
class TestWFPCancellingStructuredPartialJoin < Test::Unit::TestCase
|
6
|
+
include TestMixin
|
7
|
+
|
8
|
+
def test_cancelling_structured_partial_join
|
9
|
+
@wf.description do
|
10
|
+
parallel :wait => 3 do
|
11
|
+
parallel_branch do
|
12
|
+
activity :a_1, :call, :endpoint1
|
13
|
+
end
|
14
|
+
parallel_branch do
|
15
|
+
activity :a_2, :call, :endpoint1, :call => Proc.new{sleep 0.2}
|
16
|
+
end
|
17
|
+
parallel_branch do
|
18
|
+
activity :a_3, :call, :endpoint1
|
19
|
+
end
|
20
|
+
parallel_branch do
|
21
|
+
activity :a_4, :call, :endpoint1, :call => Proc.new{sleep 0.6}
|
22
|
+
end
|
23
|
+
parallel_branch do
|
24
|
+
activity :a_5, :call, :endpoint1
|
25
|
+
end
|
26
|
+
end
|
27
|
+
activity :a_6, :call, :endpoint1, :call => Proc.new{sleep 0.2}
|
28
|
+
end
|
29
|
+
t = @wf.start.join
|
30
|
+
wf_assert("CALL a_1:")
|
31
|
+
wf_assert("CALL a_2:")
|
32
|
+
wf_assert("CALL a_3:")
|
33
|
+
wf_assert("CALL a_4:")
|
34
|
+
wf_assert("CALL a_5:")
|
35
|
+
wf_assert("DONE a_1")
|
36
|
+
wf_assert("DONE a_3")
|
37
|
+
wf_assert("DONE a_5")
|
38
|
+
wf_assert("CALL a_6:")
|
39
|
+
wf_assert("DONE a_6")
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.expand_path(::File.dirname(__FILE__) + '/../TestWorkflow')
|
3
|
+
|
4
|
+
class TestWFPExclusiveChoice < Test::Unit::TestCase
|
5
|
+
include TestMixin
|
6
|
+
|
7
|
+
def test_exclusive_choice
|
8
|
+
@wf.description do
|
9
|
+
choose do
|
10
|
+
alternative(true) do
|
11
|
+
activity :a1_1, :call, :endpoint1
|
12
|
+
end
|
13
|
+
otherwise do
|
14
|
+
activity :a1_2, :call, :endpoint1
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
@wf.start.join
|
19
|
+
wf_assert("CALL a1_1: passthrough=[], endpoint=[http://www.heise.de], parameters=[{}]")
|
20
|
+
wf_assert("CALL a1_2:",false)
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.expand_path(::File.dirname(__FILE__) + '/../TestWorkflow')
|
3
|
+
|
4
|
+
class TestWFPParallel < Test::Unit::TestCase
|
5
|
+
include TestMixin
|
6
|
+
|
7
|
+
def test_parallel_split
|
8
|
+
@wf.description do
|
9
|
+
parallel :wait do
|
10
|
+
parallel_branch do
|
11
|
+
activity :a1_1, :call, :endpoint1
|
12
|
+
end
|
13
|
+
parallel_branch do
|
14
|
+
activity :a1_2, :call, :endpoint1
|
15
|
+
end
|
16
|
+
end
|
17
|
+
activity :a2, :call, :endpoint1
|
18
|
+
end
|
19
|
+
@wf.start.join
|
20
|
+
wf_assert('CALL a1_1')
|
21
|
+
wf_assert('CALL a1_2')
|
22
|
+
wf_assert('DONE a1_1')
|
23
|
+
wf_assert('DONE a1_2')
|
24
|
+
wf_sassert('Ca2Da2|finished|')
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.expand_path(::File.dirname(__FILE__) + '/../TestWorkflow')
|
3
|
+
|
4
|
+
class TestWFPSequence < Test::Unit::TestCase
|
5
|
+
include TestMixin
|
6
|
+
|
7
|
+
def test_sequence
|
8
|
+
@wf.description do
|
9
|
+
activity :a1_1, :call, :endpoint1
|
10
|
+
activity :a1_2, :call, :endpoint1
|
11
|
+
activity :a1_3, :call, :endpoint1
|
12
|
+
end
|
13
|
+
@wf.start.join
|
14
|
+
wf_sassert('|running|Ca1_1Da1_1Ca1_2Da1_2Ca1_3Da1_3|finished|')
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.expand_path(::File.dirname(__FILE__) + '/../TestWorkflow')
|
3
|
+
|
4
|
+
# implemented as a combination of the Cancelling Structured Partial Join and the Exclusive Choice Pattern
|
5
|
+
class TestWFPInterleavedParallelRouting < Test::Unit::TestCase
|
6
|
+
include TestMixin
|
7
|
+
|
8
|
+
def test_loop
|
9
|
+
@wf.description do
|
10
|
+
activity :a1, :manipulate do
|
11
|
+
data.x = 0
|
12
|
+
end
|
13
|
+
loop pre_test{data.x < 3} do
|
14
|
+
activity :a2, :call, :endpoint1 do
|
15
|
+
data.x += 1
|
16
|
+
end
|
17
|
+
end
|
18
|
+
activity :a3, :call, :endpoint1
|
19
|
+
end
|
20
|
+
@wf.start.join
|
21
|
+
wf_sassert('|running|Ma1Da1Ca2Ma2Da2Ca2Ma2Da2Ca2Ma2Da2Ca3Da3|finished|');
|
22
|
+
data = @wf.data
|
23
|
+
assert(data[:x] == 3, "data[:x] has not the correct value [#{data[:x]}]")
|
24
|
+
end
|
25
|
+
def test_loop_search
|
26
|
+
@wf.description do
|
27
|
+
activity :a1, :manipulate do
|
28
|
+
data.x = 0
|
29
|
+
end
|
30
|
+
loop pre_test{data.x < 3} do
|
31
|
+
activity :a2_1, :call, :endpoint1
|
32
|
+
activity :a2_2, :manipulate do
|
33
|
+
data.x += 1
|
34
|
+
end
|
35
|
+
end
|
36
|
+
activity :a3, :call, :endpoint1
|
37
|
+
end
|
38
|
+
@wf.search WEEL::Position.new(:a2_2, :at)
|
39
|
+
@wf.data :x => 2
|
40
|
+
@wf.start.join
|
41
|
+
wf_sassert('|running|Ma2_2Da2_2Ca3Da3|finished|');
|
42
|
+
data = @wf.data
|
43
|
+
assert(data[:x] == 3, "data[:x] has not the correct value [#{data[:x]}]")
|
44
|
+
end
|
45
|
+
def test_loop_jump_over
|
46
|
+
@wf.description do
|
47
|
+
activity :a1, :manipulate do
|
48
|
+
data.x = 0
|
49
|
+
end
|
50
|
+
loop pre_test{data.x < 3} do
|
51
|
+
activity :a2_1, :call, :endpoint1
|
52
|
+
activity :a2_2, :manipulate do
|
53
|
+
data.x += 1
|
54
|
+
end
|
55
|
+
end
|
56
|
+
activity :a3, :call, :endpoint1
|
57
|
+
end
|
58
|
+
@wf.search WEEL::Position.new(:a3, :at)
|
59
|
+
@wf.data :x => 0
|
60
|
+
@wf.start.join
|
61
|
+
wf_sassert('|running|Ca3Da3|finished|');
|
62
|
+
data = @wf.data
|
63
|
+
assert(data[:x] == 0, "data[:x] has not the correct value [#{data[:x]}]")
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.expand_path(::File.dirname(__FILE__) + '/../TestWorkflow')
|
3
|
+
|
4
|
+
# implemented as a combination of the Cancelling Structured Partial Join and the Exclusive Choice Pattern
|
5
|
+
class TestWFPDeferredChoice < Test::Unit::TestCase
|
6
|
+
include TestMixin
|
7
|
+
|
8
|
+
def test_sequence
|
9
|
+
@wf.description do
|
10
|
+
parallel :wait=>1 do
|
11
|
+
parallel_branch do
|
12
|
+
activity :a1_1, :call, :endpoint1 do
|
13
|
+
data.choice = 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
parallel_branch do
|
17
|
+
activity(:a1_2, :call, :endpoint1, :call => Proc.new{sleep 1.0}) do
|
18
|
+
data.choice = 2
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
choose do
|
23
|
+
alternative(data.choice == 1) do
|
24
|
+
activity :a2_1, :call, :endpoint1
|
25
|
+
end
|
26
|
+
alternative(data.choice == 2) do
|
27
|
+
activity :a2_2, :call, :endpoint1
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
@wf.start.join
|
32
|
+
wf_assert('CALL a1_1')
|
33
|
+
wf_assert('CALL a1_2')
|
34
|
+
wf_sassert('Da1_1NLNa1_2Ca2_1Da2_1|finished|')
|
35
|
+
data = @wf.data
|
36
|
+
assert(data[:choice] == 1, "data[:choice] has not the correct value [#{data[:x]}]")
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.expand_path(::File.dirname(__FILE__) + '/../TestWorkflow')
|
3
|
+
|
4
|
+
# implemented as a combination of the Cancelling Structured Partial Join and the Exclusive Choice Pattern
|
5
|
+
class TestWFPInterleavedParallelRouting < Test::Unit::TestCase
|
6
|
+
include TestMixin
|
7
|
+
|
8
|
+
def test_interleaved
|
9
|
+
@wf.description do
|
10
|
+
parallel do
|
11
|
+
parallel_branch do
|
12
|
+
critical(:section1) do
|
13
|
+
activity :a1, :call, :endpoint1
|
14
|
+
end
|
15
|
+
critical(:section1) do
|
16
|
+
activity :a3, :call, :endpoint1
|
17
|
+
end
|
18
|
+
end
|
19
|
+
parallel_branch do
|
20
|
+
critical(:section1) do
|
21
|
+
activity :a2, :call, :endpoint1
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
@wf.start.join
|
27
|
+
nump = $long_track.split("\n").delete_if{|e| !(e =~ /^(DONE|CALL)/)}.map{|e| e.gsub(/ .*/,'')}
|
28
|
+
assert(nump == ["CALL", "DONE", "CALL", "DONE", "CALL", "DONE"], "not in the right order, sorry")
|
29
|
+
end
|
30
|
+
end
|
data/weel.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "weel"
|
3
|
+
s.version = "1.0.3"
|
4
|
+
s.platform = Gem::Platform::RUBY
|
5
|
+
s.summary = "preliminary release of the Workflow Execution Engine Library (WEEL)"
|
6
|
+
|
7
|
+
s.description = <<-EOF
|
8
|
+
For WEE Library specific information see http://cpee.org/.
|
9
|
+
|
10
|
+
Copyright (C) 2008-2013 Jürgen Mangler <juergen.mangler@gmail.com> and others.
|
11
|
+
|
12
|
+
WEE Library is freely distributable according to the terms of the GNU Lesser General Public License (see the file 'COPYING').
|
13
|
+
|
14
|
+
This program is distributed without any warranty. See the file 'COPYING' for details.
|
15
|
+
EOF
|
16
|
+
|
17
|
+
s.files = Dir['{example/**/*,lib/*}'] + %w(COPYING FEATURES INSTALL Rakefile weel.gemspec README AUTHORS)
|
18
|
+
s.require_path = 'lib'
|
19
|
+
s.extra_rdoc_files = ['README']
|
20
|
+
s.test_files = Dir['{test/*,test/*/tc_*.rb}']
|
21
|
+
|
22
|
+
s.authors = ['Juergen eTM Mangler','Gerhard Stuermer']
|
23
|
+
s.email = 'juergen.mangler@gmail.com'
|
24
|
+
s.homepage = 'http://cpee.org'
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: weel
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.3
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Juergen eTM Mangler
|
9
|
+
- Gerhard Stuermer
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2012-12-19 00:00:00.000000000 Z
|
14
|
+
dependencies: []
|
15
|
+
description: ! 'For WEE Library specific information see http://cpee.org/.
|
16
|
+
|
17
|
+
|
18
|
+
Copyright (C) 2008-2013 Jürgen Mangler <juergen.mangler@gmail.com> and others.
|
19
|
+
|
20
|
+
|
21
|
+
WEE Library is freely distributable according to the terms of the GNU Lesser General
|
22
|
+
Public License (see the file ''COPYING'').
|
23
|
+
|
24
|
+
|
25
|
+
This program is distributed without any warranty. See the file ''COPYING'' for details.
|
26
|
+
|
27
|
+
'
|
28
|
+
email: juergen.mangler@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files:
|
32
|
+
- README
|
33
|
+
files:
|
34
|
+
- example/runme.rb
|
35
|
+
- example/SimpleHandlerWrapper.rb
|
36
|
+
- example/SimpleWorkflow.rb
|
37
|
+
- lib/weel.rb
|
38
|
+
- COPYING
|
39
|
+
- FEATURES
|
40
|
+
- INSTALL
|
41
|
+
- Rakefile
|
42
|
+
- weel.gemspec
|
43
|
+
- README
|
44
|
+
- AUTHORS
|
45
|
+
- test/ContinueTest.rb
|
46
|
+
- test/TestHandlerWrapper.rb
|
47
|
+
- test/TestWorkflow.rb
|
48
|
+
- test/complex/tc_generalsynchonizingmerge_loopsearch.rb
|
49
|
+
- test/complex/tc_parallel_stop.rb
|
50
|
+
- test/wfp_basic/tc_parallelsplit_synchronization.rb
|
51
|
+
- test/wfp_basic/tc_sequence.rb
|
52
|
+
- test/wfp_basic/tc_exclusivechoice_simplemerge.rb
|
53
|
+
- test/wfp_adv_branching/tc_generalsynchronizingmerge.rb
|
54
|
+
- test/wfp_adv_branching/tc_generalizedjoin.rb
|
55
|
+
- test/wfp_adv_branching/tc_localsynchronizingmerge.rb
|
56
|
+
- test/wfp_adv_branching/tc_multichoice_structuredsynchronizingmerge.rb
|
57
|
+
- test/wfp_adv_branching/tc_threadmerge.rb
|
58
|
+
- test/wfp_adv_branching/tc_structured_discriminator.rb
|
59
|
+
- test/wfp_adv_branching/tc_structured_partial_join.rb
|
60
|
+
- test/wfp_adv_branching/tc_multimerge.rb
|
61
|
+
- test/wfp_adv_branching/tc_threadsplit.rb
|
62
|
+
- test/basic/tc_wf_control.rb
|
63
|
+
- test/basic/tc_endpoint.rb
|
64
|
+
- test/basic/tc_codereplace.rb
|
65
|
+
- test/basic/tc_search.rb
|
66
|
+
- test/basic/tc_state.rb
|
67
|
+
- test/basic/tc_choose.rb
|
68
|
+
- test/basic/tc_data.rb
|
69
|
+
- test/basic/tc_parallel.rb
|
70
|
+
- test/basic/tc_handler.rb
|
71
|
+
- test/wfp_iteration/tc_structuredloop.rb
|
72
|
+
- test/wfp_state_based/tc_interleavedparallelrouting.rb
|
73
|
+
- test/wfp_state_based/tc_deferredchoice.rb
|
74
|
+
homepage: http://cpee.org
|
75
|
+
licenses: []
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options: []
|
78
|
+
require_paths:
|
79
|
+
- lib
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
requirements: []
|
93
|
+
rubyforge_project:
|
94
|
+
rubygems_version: 1.8.23
|
95
|
+
signing_key:
|
96
|
+
specification_version: 3
|
97
|
+
summary: preliminary release of the Workflow Execution Engine Library (WEEL)
|
98
|
+
test_files:
|
99
|
+
- test/ContinueTest.rb
|
100
|
+
- test/TestHandlerWrapper.rb
|
101
|
+
- test/TestWorkflow.rb
|
102
|
+
- test/complex/tc_generalsynchonizingmerge_loopsearch.rb
|
103
|
+
- test/complex/tc_parallel_stop.rb
|
104
|
+
- test/wfp_basic/tc_parallelsplit_synchronization.rb
|
105
|
+
- test/wfp_basic/tc_sequence.rb
|
106
|
+
- test/wfp_basic/tc_exclusivechoice_simplemerge.rb
|
107
|
+
- test/wfp_adv_branching/tc_generalsynchronizingmerge.rb
|
108
|
+
- test/wfp_adv_branching/tc_generalizedjoin.rb
|
109
|
+
- test/wfp_adv_branching/tc_localsynchronizingmerge.rb
|
110
|
+
- test/wfp_adv_branching/tc_multichoice_structuredsynchronizingmerge.rb
|
111
|
+
- test/wfp_adv_branching/tc_threadmerge.rb
|
112
|
+
- test/wfp_adv_branching/tc_structured_discriminator.rb
|
113
|
+
- test/wfp_adv_branching/tc_structured_partial_join.rb
|
114
|
+
- test/wfp_adv_branching/tc_multimerge.rb
|
115
|
+
- test/wfp_adv_branching/tc_threadsplit.rb
|
116
|
+
- test/basic/tc_wf_control.rb
|
117
|
+
- test/basic/tc_endpoint.rb
|
118
|
+
- test/basic/tc_codereplace.rb
|
119
|
+
- test/basic/tc_search.rb
|
120
|
+
- test/basic/tc_state.rb
|
121
|
+
- test/basic/tc_choose.rb
|
122
|
+
- test/basic/tc_data.rb
|
123
|
+
- test/basic/tc_parallel.rb
|
124
|
+
- test/basic/tc_handler.rb
|
125
|
+
- test/wfp_iteration/tc_structuredloop.rb
|
126
|
+
- test/wfp_state_based/tc_interleavedparallelrouting.rb
|
127
|
+
- test/wfp_state_based/tc_deferredchoice.rb
|