rbpm 0.0.1 → 0.0.2

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.
@@ -1,9 +1,14 @@
1
1
  require 'test/unit'
2
- require 'rbpm'
2
+
3
+ begin
4
+ require 'rbpm'
5
+ rescue LoadError
6
+ require '../lib/rbpm'
7
+ end
3
8
 
4
9
  $mylog = {}
5
10
 
6
- class TWf1 < Workflow
11
+ class TWf1 < Rbpm::Workflow
7
12
  start_node :start,
8
13
  :trans => :end,
9
14
  :trans_action => :my_trans_action
@@ -14,7 +19,7 @@ class TWf1 < Workflow
14
19
  end
15
20
  end
16
21
 
17
- class TWf2 < Workflow
22
+ class TWf2 < Rbpm::Workflow
18
23
  start_node :start,
19
24
  :trans => :end,
20
25
  :trans_action => :my_trans_action
@@ -25,7 +30,7 @@ class TWf2 < Workflow
25
30
  end
26
31
  end
27
32
 
28
- class TWf3 < Workflow
33
+ class TWf3 < Rbpm::Workflow
29
34
  start_node :start, :trans => :end
30
35
  end_node :end
31
36
 
@@ -34,7 +39,7 @@ class TWf3 < Workflow
34
39
  end
35
40
  end
36
41
 
37
- class TWf4 < Workflow
42
+ class TWf4 < Rbpm::Workflow
38
43
  start_node :start, :foo_trans => :end
39
44
  end_node :end
40
45
 
@@ -43,7 +48,7 @@ class TWf4 < Workflow
43
48
  end
44
49
  end
45
50
 
46
- class TWf5 < Workflow
51
+ class TWf5 < Rbpm::Workflow
47
52
  start_node :start, :trans => :end
48
53
  end_node :end
49
54
 
@@ -52,14 +57,14 @@ class TWf5 < Workflow
52
57
  end
53
58
  end
54
59
 
55
- class TWf6 < Workflow
60
+ class TWf6 < Rbpm::Workflow
56
61
  start_node :start,
57
62
  :trans => :end,
58
63
  :trans_action => lambda { $mylog[:trans_action] = true }
59
64
  end_node :end
60
65
  end
61
66
 
62
- class TWf7 < Workflow
67
+ class TWf7 < Rbpm::Workflow
63
68
  start_node :start,
64
69
  :no_trans => :no_end,
65
70
  :no_trans_cond => '"no" == token[:my_cond]',
@@ -69,10 +74,19 @@ class TWf7 < Workflow
69
74
  end_node :yes_end
70
75
  end
71
76
 
72
- class FewMoreRbpm2Test < Test::Unit::TestCase
77
+ class TransitTestWf < Rbpm::Workflow
78
+ start_node :start, :foo_bar_trans => :end
79
+ end_node :end
80
+
81
+ transit(:start, :foo_bar) do |token,caller|
82
+ $mylog[:trans_action] = "foo"
83
+ end
84
+ end
85
+
86
+ class RbpmTransitionActionTests < Test::Unit::TestCase
73
87
 
74
- def test_transition_ctions
75
- [TWf1, TWf2, TWf3, TWf4, TWf5, TWf6].each do |workflow|
88
+ def test_transition_actions
89
+ [TWf1, TWf2, TWf3, TWf4, TWf5, TWf6, TransitTestWf].each do |workflow|
76
90
  wf1 = workflow.new
77
91
 
78
92
  $mylog.clear
@@ -1,5 +1,10 @@
1
1
  require 'test/unit'
2
- require 'rbpm'
2
+
3
+ begin
4
+ require 'rbpm'
5
+ rescue LoadError
6
+ require '../lib/rbpm'
7
+ end
3
8
 
4
9
  module FooBarWorkflowVersion1
5
10
  class FooBarWorkflow
@@ -7,7 +12,7 @@ module FooBarWorkflowVersion1
7
12
  "v1"
8
13
  end
9
14
  def bar
10
- WorkflowVersionManager.create_workflow_instance('FooBarWorkflow', 1).foo
15
+ Rbpm::WorkflowVersionManager.create_workflow_instance('FooBarWorkflow', 1).foo
11
16
  end
12
17
  end
13
18
  end
@@ -26,19 +31,19 @@ module FooBarWorkflowVersion2
26
31
  "v2"
27
32
  end
28
33
  def bar
29
- WorkflowVersionManager.create_workflow_instance('FooBarWorkflow').foo
34
+ Rbpm::WorkflowVersionManager.create_workflow_instance('FooBarWorkflow').foo
30
35
  end
31
36
  end
32
37
  end
33
38
 
34
- class VersionningTests < Test::Unit::TestCase
39
+ class RbpmVersionningTests < Test::Unit::TestCase
35
40
 
36
41
  def test_versionning
37
- assert_equal "v3", WorkflowVersionManager.create_workflow_instance('FooBarWorkflow').foo
38
- assert_equal "v3", WorkflowVersionManager.create_workflow_instance('FooBarWorkflow', 2).bar
39
- assert_equal "v1", WorkflowVersionManager.create_workflow_instance('FooBarWorkflow', 1).bar
42
+ assert_equal "v3", Rbpm::WorkflowVersionManager.create_workflow_instance('FooBarWorkflow').foo
43
+ assert_equal "v3", Rbpm::WorkflowVersionManager.create_workflow_instance('FooBarWorkflow', 2).bar
44
+ assert_equal "v1", Rbpm::WorkflowVersionManager.create_workflow_instance('FooBarWorkflow', 1).bar
40
45
  (1..3).each do |version|
41
- assert_equal "v#{version}", WorkflowVersionManager.create_workflow_instance('FooBarWorkflow', version).foo
46
+ assert_equal "v#{version}", Rbpm::WorkflowVersionManager.create_workflow_instance('FooBarWorkflow', version).foo
42
47
  end
43
48
  end
44
49
  end
@@ -1,14 +1,34 @@
1
1
  require 'test/unit'
2
2
 
3
- require 'test/rbpm_action_tests'
4
- require 'test/rbpm_ctxvars_tests.rb'
5
- require 'test/rbpm_simple_tests.rb'
6
- require 'test/rbpm_versionning_tests.rb'
7
- require 'test/rbpm_call_tests.rb'
8
- require 'test/rbpm_exceptions_tests.rb'
9
- require 'test/rbpm_state_tests.rb'
10
- require 'test/rbpm_condition_tests.rb'
11
- require 'test/rbpm_fork_join_tests.rb'
12
- require 'test/rbpm_transition_tests.rb'
3
+ begin
4
+ require 'test/rbpm_action_tests'
5
+ require 'test/rbpm_ctxvars_tests.rb'
6
+ require 'test/rbpm_simple_tests.rb'
7
+ require 'test/rbpm_versionning_tests.rb'
8
+ require 'test/rbpm_call_tests.rb'
9
+ require 'test/rbpm_exceptions_tests.rb'
10
+ require 'test/rbpm_state_tests.rb'
11
+ require 'test/rbpm_condition_tests.rb'
12
+ require 'test/rbpm_fork_join_tests.rb'
13
+ require 'test/rbpm_transition_tests.rb'
14
+ require 'test/rbpm_task_role_tests.rb'
13
15
 
14
- require 'test/ruby_lang_tests.rb'
16
+ require 'test/ruby_lang_tests.rb'
17
+ rescue LoadError
18
+
19
+ #there must be a better way ;)
20
+
21
+ require 'rbpm_action_tests'
22
+ require 'rbpm_ctxvars_tests.rb'
23
+ require 'rbpm_simple_tests.rb'
24
+ require 'rbpm_versionning_tests.rb'
25
+ require 'rbpm_call_tests.rb'
26
+ require 'rbpm_exceptions_tests.rb'
27
+ require 'rbpm_state_tests.rb'
28
+ require 'rbpm_condition_tests.rb'
29
+ require 'rbpm_fork_join_tests.rb'
30
+ require 'rbpm_transition_tests.rb'
31
+ require 'rbpm_task_role_tests.rb'
32
+
33
+ require 'ruby_lang_tests.rb'
34
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: rbpm
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1
7
- date: 2006-01-05
6
+ version: 0.0.2
7
+ date: 2006-01-08
8
8
  summary: lightweight (jbpm-like) workflow framework
9
9
  require_paths:
10
10
  - lib
@@ -35,12 +35,13 @@ files:
35
35
  - test/rbpm_fork_join_tests.rb
36
36
  - test/rbpm_simple_tests.rb
37
37
  - test/rbpm_state_tests.rb
38
+ - test/rbpm_task_role_tests.rb
38
39
  - test/rbpm_transition_tests.rb
39
40
  - test/rbpm_versionning_tests.rb
40
41
  - test/ruby_lang_tests.rb
41
42
  - test/ts_all.rb
42
43
  - lib/rbpm.rb
43
- - docs/sub_processes.png
44
+ - docs/rbpm-0.0.2-manual--wiki-snapshot.pdf
44
45
  - docs/todo.txt
45
46
  - README
46
47
  test_files:
Binary file