openwferu 0.9.16 → 0.9.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. data/examples/about_state.rb +81 -0
  2. data/examples/engine_template.rb +7 -0
  3. data/lib/openwfe/contextual.rb +2 -2
  4. data/lib/openwfe/def.rb +2 -3
  5. data/lib/openwfe/{util/schedulers.rb → engine.rb} +3 -39
  6. data/lib/openwfe/engine/engine.rb +202 -251
  7. data/lib/openwfe/engine/process_status.rb +359 -0
  8. data/lib/openwfe/expool/errorjournal.rb +6 -6
  9. data/lib/openwfe/expool/expressionpool.rb +161 -239
  10. data/lib/openwfe/expool/expstorage.rb +185 -55
  11. data/lib/openwfe/expool/journal.rb +1 -2
  12. data/lib/openwfe/expool/parser.rb +233 -0
  13. data/lib/openwfe/expool/threadedexpstorage.rb +6 -18
  14. data/lib/openwfe/expool/wfidgen.rb +25 -7
  15. data/lib/openwfe/expool/yamlexpstorage.rb +60 -37
  16. data/lib/openwfe/expressions/condition.rb +49 -12
  17. data/lib/openwfe/expressions/environment.rb +45 -15
  18. data/lib/openwfe/expressions/expressionmap.rb +39 -19
  19. data/lib/openwfe/expressions/fe_concurrence.rb +24 -13
  20. data/lib/openwfe/expressions/fe_cron.rb +19 -18
  21. data/lib/openwfe/expressions/fe_cursor.rb +69 -28
  22. data/lib/openwfe/expressions/fe_define.rb +4 -1
  23. data/lib/openwfe/expressions/fe_do.rb +1 -3
  24. data/lib/openwfe/expressions/fe_equals.rb +131 -20
  25. data/lib/openwfe/expressions/fe_fqv.rb +27 -3
  26. data/lib/openwfe/expressions/fe_iterator.rb +14 -7
  27. data/lib/openwfe/expressions/fe_listen.rb +7 -2
  28. data/lib/openwfe/expressions/fe_misc.rb +187 -20
  29. data/lib/openwfe/expressions/fe_participant.rb +8 -7
  30. data/lib/openwfe/expressions/fe_reserve.rb +105 -33
  31. data/lib/openwfe/expressions/fe_save.rb +55 -5
  32. data/lib/openwfe/expressions/{fe_value.rb → fe_set.rb} +6 -82
  33. data/lib/openwfe/expressions/fe_sleep.rb +25 -15
  34. data/lib/openwfe/expressions/fe_subprocess.rb +2 -2
  35. data/lib/openwfe/expressions/fe_wait.rb +3 -2
  36. data/lib/openwfe/expressions/fe_when.rb +7 -15
  37. data/lib/openwfe/expressions/flowexpression.rb +90 -49
  38. data/lib/openwfe/expressions/merge.rb +7 -1
  39. data/lib/openwfe/expressions/raw.rb +261 -63
  40. data/lib/openwfe/expressions/{raw_prog.rb → rprocdef.rb} +94 -179
  41. data/lib/openwfe/expressions/time.rb +36 -12
  42. data/lib/openwfe/expressions/timeout.rb +9 -7
  43. data/lib/openwfe/expressions/value.rb +126 -0
  44. data/lib/openwfe/flowexpressionid.rb +52 -22
  45. data/lib/openwfe/listeners/listeners.rb +3 -3
  46. data/lib/openwfe/listeners/socketlisteners.rb +8 -5
  47. data/lib/openwfe/logging.rb +6 -3
  48. data/lib/openwfe/omixins.rb +8 -6
  49. data/lib/openwfe/orest/xmlcodec.rb +16 -12
  50. data/lib/openwfe/participants.rb +38 -0
  51. data/lib/openwfe/participants/participant.rb +1 -1
  52. data/lib/openwfe/participants/participantmap.rb +24 -10
  53. data/lib/openwfe/participants/participants.rb +4 -3
  54. data/lib/openwfe/participants/soapparticipants.rb +1 -1
  55. data/lib/openwfe/participants/socketparticipants.rb +1 -1
  56. data/lib/openwfe/rudefinitions.rb +7 -5
  57. data/lib/openwfe/storage/yamlcustom.rb +10 -10
  58. data/lib/openwfe/storage/yamlfilestorage.rb +12 -12
  59. data/lib/openwfe/tools/flowtracer.rb +6 -5
  60. data/lib/openwfe/util/dollar.rb +42 -85
  61. data/lib/openwfe/util/ometa.rb +1 -3
  62. data/lib/openwfe/util/workqueue.rb +1 -1
  63. data/lib/openwfe/utils.rb +33 -11
  64. data/lib/openwfe/version.rb +2 -2
  65. data/lib/openwfe/workitem.rb +76 -14
  66. data/lib/openwfe/worklist/storelocks.rb +9 -4
  67. data/lib/openwfe/worklist/storeparticipant.rb +1 -1
  68. data/test/back_0916_test.rb +101 -0
  69. data/test/bm/ft_26_load.rb +1 -1
  70. data/test/bm/ft_26b_load.rb +1 -1
  71. data/test/bm/ft_26c_load.rb +3 -2
  72. data/test/bm/ft_26d_load.rb +97 -0
  73. data/test/bm/ft_recu.rb +71 -0
  74. data/test/concurrence_test.rb +1 -1
  75. data/test/condition_test.rb +152 -0
  76. data/test/description_test.rb +12 -7
  77. data/test/eno_test.rb +1 -1
  78. data/test/expool_20031219_0916.tgz +0 -0
  79. data/test/fe_lookup_att_test.rb +1 -1
  80. data/test/fei_test.rb +16 -0
  81. data/test/file_persistence_test.rb +8 -12
  82. data/test/filep_cancel_test.rb +116 -0
  83. data/test/flowtestbase.rb +47 -25
  84. data/test/ft_0.rb +1 -1
  85. data/test/ft_10_loop.rb +29 -14
  86. data/test/{ft_10b_loop2.rb → ft_10b_loop.rb} +2 -11
  87. data/test/ft_11_ppd.rb +6 -17
  88. data/test/ft_11b_ppd.rb +1 -4
  89. data/test/ft_12_blockparticipant.rb +1 -1
  90. data/test/ft_13_eno.rb +1 -1
  91. data/test/ft_15_iterator.rb +1 -1
  92. data/test/ft_15b_iterator.rb +1 -1
  93. data/test/ft_17_condition.rb +6 -6
  94. data/test/ft_18_pname.rb +1 -1
  95. data/test/ft_20_cron.rb +1 -1
  96. data/test/ft_21_cron.rb +6 -4
  97. data/test/ft_22_history.rb +1 -1
  98. data/test/ft_23_when.rb +1 -1
  99. data/test/ft_23b_when.rb +18 -6
  100. data/test/ft_23c_wait.rb +8 -6
  101. data/test/ft_25_cancel.rb +7 -5
  102. data/test/ft_27_getflowpos.rb +22 -17
  103. data/test/ft_28_fileparticipant.rb +1 -2
  104. data/test/ft_2_concurrence.rb +1 -1
  105. data/test/ft_2b_concurrence.rb +25 -20
  106. data/test/ft_30_socketlistener.rb +0 -3
  107. data/test/ft_34_cancelwfid.rb +9 -9
  108. data/test/ft_35_localdefs.rb +0 -1
  109. data/test/ft_36_subprocids.rb +6 -6
  110. data/test/ft_38_tag.rb +3 -2
  111. data/test/ft_38b_tag.rb +229 -0
  112. data/test/ft_39_reserve.rb +3 -18
  113. data/test/ft_39b_reserve.rb +34 -5
  114. data/test/ft_3b_lookup_vf.rb +83 -0
  115. data/test/ft_40_defined.rb +2 -11
  116. data/test/ft_42_environments.rb +4 -6
  117. data/test/ft_44b_restore.rb +88 -22
  118. data/test/ft_45_citerator.rb +57 -11
  119. data/test/ft_49_condition.rb +4 -2
  120. data/test/ft_4_misc.rb +24 -3
  121. data/test/ft_50_xml_attribute.rb +17 -20
  122. data/test/ft_54_listen.rb +1 -1
  123. data/test/ft_54b_listen.rb +2 -2
  124. data/test/ft_56_timeout.rb +8 -1
  125. data/test/ft_57_a.rb +10 -10
  126. data/test/ft_59_ps.rb +49 -16
  127. data/test/ft_60_ecancel.rb +52 -10
  128. data/test/ft_63_pause.rb +8 -8
  129. data/test/ft_65_stringlaunch.rb +4 -6
  130. data/test/ft_67_schedlaunch.rb +4 -4
  131. data/test/ft_69_cancelmissing.rb +4 -2
  132. data/test/ft_70_lookupvar.rb +2 -2
  133. data/test/ft_72_lookup_processes.rb +2 -2
  134. data/test/ft_73_cancel_sub.rb +8 -8
  135. data/test/ft_77_segments.rb +38 -0
  136. data/test/ft_78_eval.rb +154 -0
  137. data/test/ft_79_tticket.rb +185 -0
  138. data/test/ft_80_spname.rb +95 -0
  139. data/test/ft_81_exp.rb +64 -0
  140. data/test/ft_82_trecu.rb +48 -0
  141. data/test/ft_83_badpause.rb +62 -0
  142. data/test/ft_84_updateexp.rb +125 -0
  143. data/test/ft_9b_cursor.rb +105 -0
  144. data/test/ft_tests.rb +14 -1
  145. data/test/hash_test.rb +7 -7
  146. data/test/hparticipant_test.rb +4 -4
  147. data/test/lookup_vf_test.rb +94 -0
  148. data/test/misc_test.rb +5 -3
  149. data/test/orest_test.rb +4 -3
  150. data/test/param_test.rb +12 -16
  151. data/test/participant_test.rb +36 -0
  152. data/test/pending.rb +10 -10
  153. data/test/rake_ltest.rb +1 -10
  154. data/test/rake_qtest.rb +7 -6
  155. data/test/raw_prog_test.rb +89 -121
  156. data/test/restart_cron_test.rb +84 -36
  157. data/test/restart_paused_test.rb +100 -0
  158. data/test/restart_sleep_test.rb +1 -1
  159. data/test/restart_tests.rb +1 -0
  160. data/test/restart_when_test.rb +33 -22
  161. data/test/ruby_procdef_test.rb +19 -18
  162. data/test/sec_test.rb +74 -35
  163. data/test/storage_test.rb +44 -0
  164. data/test/test.rb +3 -0
  165. data/test/timeout_test.rb +7 -18
  166. data/test/wfid_test.rb +2 -1
  167. data/test/wi_test.rb +29 -18
  168. metadata +121 -57
  169. data/lib/openwfe/expressions/raw_xml.rb +0 -176
  170. data/lib/openwfe/expressions/simplerep.rb +0 -266
  171. data/lib/openwfe/util/kotoba.rb +0 -236
  172. data/lib/openwfe/util/lru.rb +0 -171
  173. data/lib/openwfe/util/otime.rb +0 -246
  174. data/lib/openwfe/util/safe.rb +0 -160
  175. data/lib/openwfe/util/scheduler.rb +0 -1158
  176. data/test/cron_test.rb +0 -113
  177. data/test/cronline_test.rb +0 -60
  178. data/test/dollar_test.rb +0 -90
  179. data/test/kotoba_test.rb +0 -72
  180. data/test/lru_test.rb +0 -79
  181. data/test/safely_test.rb +0 -84
  182. data/test/scheduler_1_test.rb +0 -88
  183. data/test/scheduler_test.rb +0 -363
  184. data/test/time_test.rb +0 -84
@@ -0,0 +1,95 @@
1
+
2
+ #
3
+ # Testing OpenWFEru
4
+ #
5
+ # John Mettraux at openwfe.org
6
+ #
7
+ # Fri Jan 4 15:00:26 JST 2008
8
+ #
9
+ # Fighting bug #16791
10
+ # http://rubyforge.org/tracker/index.php?func=detail&aid=16791&group_id=2609&atid=10023
11
+ #
12
+
13
+ require 'flowtestbase'
14
+ #require 'openwfe/def'
15
+ #require 'openwfe/worklist/storeparticipant'
16
+
17
+ #include OpenWFE
18
+
19
+
20
+ class FlowTest80 < Test::Unit::TestCase
21
+ include FlowTestBase
22
+
23
+ #def setup
24
+ #end
25
+
26
+ #def teardown
27
+ #end
28
+
29
+ #
30
+ # Test 0
31
+ #
32
+
33
+ class Def0 < OpenWFE::ProcessDefinition
34
+ sequence do
35
+ subprocess :ref => "last_step"
36
+ last_step
37
+ end
38
+ process_definition :name => "last_step" do
39
+ _print "last_step"
40
+ end
41
+ end
42
+
43
+ def test_0
44
+ dotest Def0, ([ "last_step" ] * 2).join("\n")
45
+ end
46
+
47
+ TEST0B = %{
48
+ <process-definition name="def" revision="0b">
49
+ <sequence>
50
+ <subprocess ref="last_step" />
51
+ <last_step />
52
+ </sequence>
53
+ <process-definition name="last_step">
54
+ <print>last_step</print>
55
+ </process-definition>
56
+ </process-definition>
57
+ }.strip
58
+
59
+ def test_0b
60
+ dotest TEST0B, ([ "last_step" ] * 2).join("\n")
61
+ end
62
+
63
+ #
64
+ # Test 1
65
+ #
66
+ # Checking with participants
67
+ #
68
+
69
+ class Def1 < OpenWFE::ProcessDefinition
70
+ sequence do
71
+ mister_alpha
72
+ participant :ref => :mister_alpha
73
+ participant :ref => "mister_alpha"
74
+ #participant :ref => "mister-alpha"
75
+ mister_bravo
76
+ #participant :ref => :mister_bravo
77
+ #participant :ref => "mister_bravo"
78
+ participant :ref => "mister-bravo"
79
+ end
80
+ end
81
+
82
+ def test_1
83
+
84
+ @engine.register_participant :mister_alpha do
85
+ @tracer << "alpha\n"
86
+ end
87
+ @engine.register_participant "mister-bravo" do
88
+ @tracer << "bravo\n"
89
+ end
90
+
91
+ dotest Def1, ([ "alpha" ] * 3 + [ "bravo" ] * 2).join("\n")
92
+ end
93
+
94
+ end
95
+
@@ -0,0 +1,64 @@
1
+
2
+ #
3
+ # Testing OpenWFEru
4
+ #
5
+ # John Mettraux at openwfe.org
6
+ #
7
+ # Sat Jan 5 22:57:53 JST 2008
8
+ #
9
+
10
+ require 'flowtestbase'
11
+ #require 'openwfe/def'
12
+ #require 'openwfe/worklist/storeparticipant'
13
+
14
+ #include OpenWFE
15
+
16
+
17
+ class FlowTest81 < Test::Unit::TestCase
18
+ include FlowTestBase
19
+
20
+ #def setup
21
+ #end
22
+
23
+ #def teardown
24
+ #end
25
+
26
+ #
27
+ # Test 0
28
+ #
29
+
30
+ class Def0 < OpenWFE::ProcessDefinition
31
+
32
+ sequence do
33
+
34
+ exp :name => "p0"
35
+ exp :name => "sub0"
36
+
37
+ exp :name => "sequence" do
38
+ p0
39
+ sub0
40
+ end
41
+
42
+ set :var => "a", :value => { "ref" => "p0" }
43
+ exp :name => "participant", :variable_attributes => "a"
44
+
45
+ exp :default => "p0"
46
+ exp :name => " ", :default => "p0"
47
+ end
48
+
49
+ process_definition :name => "sub0" do
50
+ _print "sub0"
51
+ end
52
+ end
53
+
54
+ def test_0
55
+
56
+ @engine.register_participant :p0 do
57
+ @tracer << "p0\n"
58
+ end
59
+
60
+ dotest Def0, %w{ p0 sub0 p0 sub0 p0 p0 p0 }.join("\n")
61
+ end
62
+
63
+ end
64
+
@@ -0,0 +1,48 @@
1
+
2
+ #
3
+ # Testing OpenWFEru
4
+ #
5
+ # John Mettraux at openwfe.org
6
+ #
7
+ # Sat Feb 16 19:07:42 JST 2008
8
+ #
9
+
10
+ require 'flowtestbase'
11
+ #require 'openwfe/def'
12
+ #require 'openwfe/worklist/storeparticipant'
13
+
14
+ #include OpenWFE
15
+
16
+
17
+ class FlowTest82 < Test::Unit::TestCase
18
+ include FlowTestBase
19
+
20
+ #def setup
21
+ #end
22
+
23
+ #def teardown
24
+ #end
25
+
26
+ #
27
+ # Test 0
28
+ #
29
+
30
+ class Test0 < OpenWFE::ProcessDefinition
31
+ sequence do
32
+ #_print "${r:fei.wfname}"
33
+ _print do
34
+ reval "$i += 1"
35
+ end
36
+ subprocess :ref => "Test", :unless => "${r:$i} == 3"
37
+ end
38
+ end
39
+
40
+ def test_0
41
+
42
+ $i = 0
43
+
44
+ dotest Test0, "1\n2\n3"
45
+ end
46
+
47
+ end
48
+
@@ -0,0 +1,62 @@
1
+
2
+ #
3
+ # Testing OpenWFEru
4
+ #
5
+ # John Mettraux at openwfe.org
6
+ #
7
+ # Sat Feb 16 19:07:42 JST 2008
8
+ #
9
+
10
+ require 'flowtestbase'
11
+ #require 'openwfe/def'
12
+ #require 'openwfe/worklist/storeparticipant'
13
+
14
+ #include OpenWFE
15
+
16
+
17
+ class FlowTest83 < Test::Unit::TestCase
18
+ include FlowTestBase
19
+
20
+ #def setup
21
+ #end
22
+
23
+ #def teardown
24
+ #end
25
+
26
+ #
27
+ # Test 0
28
+ #
29
+
30
+ class Test0 < OpenWFE::ProcessDefinition
31
+ concurrence do
32
+ _loop do
33
+ alpha
34
+ end
35
+ _loop do
36
+ alpha
37
+ end
38
+ end
39
+ end
40
+
41
+ def test_0
42
+
43
+ @engine.register_participant :alpha do
44
+ sleep 0.002
45
+ end
46
+
47
+ fei = @engine.launch Test0
48
+
49
+ sleep 0.350
50
+
51
+ 1000.times do |i|
52
+ print "."
53
+ ps = @engine.process_status fei
54
+ assert ( ! ps.paused?)
55
+ #p ps.expressions.size
56
+ end
57
+
58
+ #dotest Test0, "1\n2\n3"
59
+ end
60
+
61
+ end
62
+
@@ -0,0 +1,125 @@
1
+
2
+ #
3
+ # Testing OpenWFE
4
+ #
5
+ # John Mettraux at openwfe.org
6
+ #
7
+ # Sun Mar 9 20:43:02 JST 2008
8
+ #
9
+
10
+ require 'flowtestbase'
11
+
12
+ require 'openwfe/def'
13
+ require 'openwfe/worklist/storeparticipant'
14
+ require 'openwfe/storage/yamlcustom'
15
+
16
+
17
+ class FlowTest84 < Test::Unit::TestCase
18
+ include FlowTestBase
19
+
20
+ #def teardown
21
+ #end
22
+
23
+ #def setup
24
+ #end
25
+
26
+ #
27
+ # TEST 0
28
+
29
+ class TestDefinition0 < ProcessDefinition
30
+ sequence do
31
+ set :var => "v0", :val => "val0"
32
+ store_p
33
+ end
34
+ end
35
+
36
+ def test_0
37
+
38
+ #sp = @engine.register_participant("store_p", OpenWFE::YamlParticipant)
39
+ sp = @engine.register_participant("store_p", OpenWFE::HashParticipant)
40
+
41
+ fei = @engine.launch TestDefinition0
42
+
43
+ sleep 0.350
44
+
45
+ s = @engine.process_stack fei, true
46
+
47
+ env = s.find { |fexp| fexp.is_a?(OpenWFE::Environment) }
48
+ par = s.find { |fexp| fexp.is_a?(OpenWFE::ParticipantExpression) }
49
+
50
+ #
51
+ # testing update on env
52
+
53
+ assert_equal "val0", @engine.lookup_variable("v0", fei)
54
+
55
+ @engine.update_expression_data(
56
+ env.fei, { "v0" => "val0b", "v1" => "val1" })
57
+
58
+ assert_equal "val0b", @engine.lookup_variable("v0", fei)
59
+ assert_equal "val1", @engine.lookup_variable("v1", fei)
60
+
61
+ #
62
+ # testing update on participant expression
63
+
64
+ assert [ 1, 2 ], par.applied_workitem.attributes
65
+
66
+ @engine.update_expression_data par.fei, { 'f0' => 'val0' }
67
+
68
+ s = @engine.process_stack fei
69
+ par = s.find { |fexp| fexp.is_a?(OpenWFE::ParticipantExpression) }
70
+
71
+ assert_equal 'val0', par.applied_workitem.attributes['f0']
72
+
73
+ @engine.cancel_process fei.wfid
74
+
75
+ sleep 0.350
76
+ end
77
+
78
+ #
79
+ # TEST 1
80
+
81
+ class TestDefinition1 < ProcessDefinition
82
+ sequence do
83
+ participant "alpha"
84
+ participant "bravo"
85
+ end
86
+ end
87
+
88
+ def test_1
89
+
90
+ %w{ alpha bravo charly }.each do |pname|
91
+ @engine.register_participant pname, OpenWFE::HashParticipant
92
+ end
93
+
94
+ fei = @engine.launch TestDefinition1
95
+
96
+ sleep 0.350
97
+
98
+ assert 1, @engine.get_participant("alpha").size
99
+ assert 0, @engine.get_participant("bravo").size
100
+ assert 0, @engine.get_participant("charly").size
101
+
102
+ ps = @engine.process_stack fei.wfid, true
103
+ #puts ps.collect { |fexp| fexp.to_yaml }.join("\n")
104
+
105
+ ebravo = ps.find { |fexp| fexp.fei.expid == '0.0.1' }
106
+ scharly = ebravo.to_yaml.gsub /bravo/, "charly"
107
+
108
+ @engine.update_expression(YAML.load(scharly))
109
+
110
+ wi = @engine.get_participant("alpha").first_workitem
111
+ @engine.get_participant("alpha").forward(wi)
112
+
113
+ sleep 0.350
114
+
115
+ assert 0, @engine.get_participant("alpha").size
116
+ assert 0, @engine.get_participant("bravo").size
117
+ assert 1, @engine.get_participant("charly").size
118
+
119
+ @engine.cancel_process fei.wfid
120
+
121
+ sleep 0.350
122
+ end
123
+
124
+ end
125
+
@@ -0,0 +1,105 @@
1
+
2
+ #
3
+ # Testing OpenWFE
4
+ #
5
+ # John Mettraux at openwfe.org
6
+ #
7
+ # Thu Nov 22 11:53:13 JST 2007
8
+ #
9
+
10
+ require 'flowtestbase'
11
+ require 'openwfe/def'
12
+
13
+
14
+ class FlowTest9b < Test::Unit::TestCase
15
+ include FlowTestBase
16
+
17
+ #def setup
18
+ #end
19
+
20
+ #def teardown
21
+ #end
22
+
23
+ #
24
+ # Test 0
25
+ #
26
+
27
+ class Test0 < ProcessDefinition
28
+ cursor do
29
+ set :v => "v0", :val => "x"
30
+ _print "${v0}"
31
+ end
32
+ end
33
+
34
+ def test_0
35
+
36
+ dotest Test0, "x"
37
+ end
38
+
39
+ #
40
+ # Test 1
41
+ #
42
+
43
+ class Test1 < ProcessDefinition
44
+ cursor do
45
+ my_participant
46
+ end
47
+ end
48
+
49
+ def test_1
50
+
51
+ @engine.register_participant :my_participant do |fexp, wi|
52
+ #puts fexp.to_s
53
+ #puts fexp.environment_id.to_s
54
+ @tracer << "ok0\n" if fexp.environment_id.expid != fexp.fei.expid
55
+ @tracer << "ok1\n" if fexp.environment_id.expid == "0.0"
56
+ @tracer << "ok2\n" if fexp.environment_id.wfid + ".0" == fexp.fei.wfid
57
+ end
58
+
59
+ dotest Test1, "ok0\nok1\nok2"
60
+ end
61
+
62
+ #
63
+ # Test 2
64
+ #
65
+
66
+ #class Test2 < ProcessDefinition
67
+ # cursor do
68
+ # my_participant
69
+ # end
70
+ #end
71
+ class MyParticipant
72
+ include LocalParticipant
73
+
74
+ def initialize (tracer)
75
+ @tracer = tracer
76
+ end
77
+ def consume (workitem)
78
+ @tracer << "consume\n"
79
+ @workitem = workitem
80
+ end
81
+ def cancel (cancelitem)
82
+ @tracer << @workitem.fei.sub_instance_id
83
+ @tracer << " cancel\n"
84
+ end
85
+ end
86
+
87
+ def test_2
88
+
89
+ log_level_to_debug
90
+
91
+ @engine.register_participant :my_participant, MyParticipant.new(@tracer)
92
+
93
+ fei = @engine.launch Test1
94
+
95
+ sleep 0.350
96
+
97
+ @engine.cancel_process fei
98
+
99
+ sleep 0.350
100
+
101
+ assert_equal "consume\n.0 cancel", @tracer.to_s
102
+ end
103
+
104
+ end
105
+