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
@@ -33,9 +33,11 @@ class FlowTest49 < Test::Unit::TestCase
33
33
  _print "1 ${f:__result__}"
34
34
  _if :test => "false; true"
35
35
  _print "2 ${f:__result__}"
36
- _if :test => "print ''; true"
36
+ #_if :test => "print ''; true"
37
+ _if :test => "''; true"
37
38
  _print "3 ${f:__result__}"
38
- _if :test => "begin print ''; end; true"
39
+ #_if :test => "begin print ''; end; true"
40
+ _if :test => "begin ''; end; true"
39
41
  _print "4 ${f:__result__}"
40
42
 
41
43
  unset :field => "__result__"
@@ -100,7 +100,7 @@ class FlowTest4 < Test::Unit::TestCase
100
100
  """
101
101
  end
102
102
  def test_reval_4
103
- dotest Reval4, [ "hello\n1", "hello\n0" ]
103
+ dotest Reval4, [ "hello\n2", "hello\n1" ]
104
104
  end
105
105
 
106
106
  class Reval5 < OpenWFE::ProcessDefinition
@@ -109,13 +109,34 @@ class FlowTest4 < Test::Unit::TestCase
109
109
  wi.customer_name = 'dubious'
110
110
  'surf'
111
111
  """
112
- _print "${f:customer_name}"
113
112
  _print "${f:__result__}"
113
+ _print "${f:customer_name}"
114
114
  end
115
115
  end
116
116
 
117
117
  def test_reval_5
118
- dotest Reval5, "dubious\nsurf"
118
+ dotest Reval5, "surf\ndubious"
119
+ end
120
+
121
+ class Reval6 < OpenWFE::ProcessDefinition
122
+ sequence do
123
+ set :field => "f0", :value => "3 + 2 + 2"
124
+ set :field => "f1" do
125
+ reval :field_code => "f0"
126
+ end
127
+ _print "${f:f1}"
128
+
129
+ set :variable => "v0", :value => "5 - 5"
130
+ set :variable => "v1" do
131
+ reval :variable_code => "v0"
132
+ end
133
+ _print "${v1}"
134
+ end
135
+ end
136
+
137
+ def test_reval_6
138
+ #log_level_to_debug
139
+ dotest Reval6, "7\n0"
119
140
  end
120
141
 
121
142
  #
@@ -56,7 +56,6 @@ END
56
56
  end
57
57
  end
58
58
 
59
- #def xxxx_0
60
59
  def test_0
61
60
 
62
61
  doc0 = nil
@@ -91,24 +90,19 @@ END
91
90
  #
92
91
  # Against bug #10150
93
92
  #
94
- def test_2
95
-
96
- workitem = OpenWFE::InFlowWorkItem.new
97
- workitem.fei = new_fei
98
-
99
- workitem.result = REXML::Document.new PAT_XML
100
-
101
- s = OpenWFE::XmlCodec::encode workitem
102
-
103
- #puts s
104
-
105
- w = OpenWFE::XmlCodec::decode s
106
-
107
- #puts workitem.to_s
108
- #puts w.to_s
109
-
110
- assert_equal workitem.to_s, w.to_s
111
- end
93
+ #def test_2
94
+ # workitem = OpenWFE::InFlowWorkItem.new
95
+ # workitem.fei = new_fei
96
+ # workitem.result = REXML::Document.new PAT_XML
97
+ # s = OpenWFE::XmlCodec::encode workitem
98
+ # #puts s
99
+ # w = OpenWFE::XmlCodec::decode s
100
+ # w.attributes.delete '___map_type'
101
+ # #puts workitem.to_s
102
+ # #puts
103
+ # #puts w.to_s
104
+ # assert_equal workitem.to_s, w.to_s
105
+ #end
112
106
 
113
107
  def test_3
114
108
 
@@ -125,14 +119,17 @@ END
125
119
  #puts s
126
120
 
127
121
  w = OpenWFE::XmlCodec::decode s
122
+ w.attributes.delete '___map_type'
123
+
124
+ workitem.attributes.delete '___map_type'
128
125
 
129
126
  #puts workitem.to_s
127
+ #puts
130
128
  #puts w.to_s
131
129
 
132
130
  assert_equal workitem.to_s, w.to_s
133
131
  end
134
132
 
135
- #def xxxx_4
136
133
  def test_4
137
134
 
138
135
  doc0 = nil
@@ -121,7 +121,7 @@ class FlowTest54 < Test::Unit::TestCase
121
121
 
122
122
  @engine.register_participant :channel_z, NoOperationParticipant
123
123
 
124
- dotest Test2, "apply\nreply"
124
+ dotest Test2, [ "apply\nreply", "reply\napply" ]
125
125
  end
126
126
 
127
127
 
@@ -39,7 +39,7 @@ class FlowTest54b < Test::Unit::TestCase
39
39
 
40
40
  @engine.launch Test0
41
41
 
42
- sleep 0.200
42
+ sleep 0.350
43
43
 
44
44
  assert_equal @tracer.to_s, ""
45
45
 
@@ -49,7 +49,7 @@ class FlowTest54b < Test::Unit::TestCase
49
49
  r = @engine.reply wi
50
50
  assert r
51
51
 
52
- sleep 0.200
52
+ sleep 0.350
53
53
 
54
54
  #
55
55
  # "post test", checking that engine replies 'false' when
@@ -41,13 +41,20 @@ class FlowTest56 < Test::Unit::TestCase
41
41
  end
42
42
  end
43
43
 
44
- #def xxxx_0
45
44
  def test_0
46
45
 
47
46
  assert_no_jobs_left
48
47
 
49
48
  dotest Test0, "ok\ndone"
50
49
 
50
+ sleep 0.350 # skip one scheduler beat
51
+
52
+ #s = @engine.get_scheduler
53
+ #class << s
54
+ # attr_reader :pending_jobs
55
+ #end
56
+ #p s.pending_jobs.collect { |j| [ j.job_id, j.class.name ] }
57
+
51
58
  assert_no_jobs_left
52
59
  end
53
60
 
@@ -8,7 +8,6 @@
8
8
  require 'flowtestbase'
9
9
  require 'pending'
10
10
  require 'openwfe/def'
11
- #require 'openwfe/participants/participants'
12
11
 
13
12
  include OpenWFE
14
13
 
@@ -52,8 +51,8 @@ class FlowTest57 < Test::Unit::TestCase
52
51
  end
53
52
  end
54
53
 
55
- #def xxxx_0
56
54
  def test_0
55
+
57
56
  dotest(
58
57
  Test0,
59
58
  """
@@ -63,11 +62,11 @@ a|b|3
63
62
  """.strip)
64
63
  end
65
64
 
66
- #def xxxx_1
67
65
  def test_1
66
+
68
67
  dotest(
69
68
  """
70
- <process-definition name='57_a' revision='1'>
69
+ <process-definition name='57_b' revision='1'>
71
70
  <sequence>
72
71
  <set field='list'>
73
72
  <a>
@@ -80,15 +79,15 @@ a|b|3
80
79
  <print>${r:wi.list.join('|')}</print>
81
80
  </sequence>
82
81
  </process-definition>
83
- """.strip,
82
+ """,
84
83
  "c|d|e")
85
84
  end
86
85
 
87
- #def xxxx_2
88
86
  def test_2
87
+
89
88
  dotest(
90
89
  """
91
- <process-definition name='57_a' revision='2'>
90
+ <process-definition name='57_c' revision='2'>
92
91
  <sequence>
93
92
  <set field='list'>
94
93
  <a>
@@ -99,10 +98,10 @@ a|b|3
99
98
  </list>
100
99
  </a>
101
100
  </set>
102
- <print>${r:wi.list.join('|')}</print>
101
+ <print>${r:wi.list.join('|').strip}</print>
103
102
  </sequence>
104
103
  </process-definition>
105
- """.strip,
104
+ """,
106
105
  "a|2|c")
107
106
  end
108
107
 
@@ -120,7 +119,8 @@ a|b|3
120
119
  end
121
120
 
122
121
  def test_3
123
- dotest(Test3, "77")
122
+
123
+ dotest Test3, "77"
124
124
  end
125
125
  end
126
126
 
@@ -32,7 +32,6 @@ class FlowTest59 < Test::Unit::TestCase
32
32
  end
33
33
  end
34
34
 
35
- #def xxxx_0
36
35
  def test_0
37
36
 
38
37
  sa = @engine.register_participant("store_a", OpenWFE::HashParticipant)
@@ -40,13 +39,13 @@ class FlowTest59 < Test::Unit::TestCase
40
39
 
41
40
  fei = @engine.launch Def59
42
41
 
43
- sleep 0.250
42
+ sleep 0.350
44
43
 
45
- ps = @engine.list_process_status
44
+ ps = @engine.process_statuses
46
45
  #puts ps
47
46
 
48
- assert_equal ps[fei.wfid].expressions.size, 2
49
- assert_equal ps[fei.wfid].errors.size, 0
47
+ assert_equal 2, ps[fei.wfid].expressions.size
48
+ assert_equal 0, ps[fei.wfid].errors.size
50
49
 
51
50
  @engine.cancel_process fei
52
51
  end
@@ -61,21 +60,20 @@ class FlowTest59 < Test::Unit::TestCase
61
60
  end
62
61
  end
63
62
 
64
- #def xxxx_0b
65
63
  def test_0b
66
64
 
67
- a = @engine.register_participant(:alpha, OpenWFE::HashParticipant)
68
- b = @engine.register_participant(:bravo, OpenWFE::HashParticipant)
65
+ a = @engine.register_participant :alpha, OpenWFE::HashParticipant
66
+ b = @engine.register_participant :bravo, OpenWFE::HashParticipant
69
67
 
70
68
  fei = @engine.launch Def59b
71
69
 
72
- sleep 0.250
70
+ sleep 0.350
73
71
 
74
- ps = @engine.list_process_status
72
+ ps = @engine.process_statuses
75
73
  #puts ps
76
74
 
77
- assert_equal ps[fei.wfid].expressions.size, 1
78
- assert_equal ps[fei.wfid].errors.size, 0
75
+ assert_equal 1, ps[fei.wfid].expressions.size
76
+ assert_equal 0, ps[fei.wfid].errors.size
79
77
 
80
78
  @engine.cancel_process fei
81
79
  end
@@ -98,14 +96,15 @@ class FlowTest59 < Test::Unit::TestCase
98
96
 
99
97
  fei = @engine.launch Def59_1
100
98
 
101
- sleep 0.250
99
+ sleep 0.350
102
100
 
103
- ps = @engine.list_process_status
101
+ ps = @engine.process_statuses
104
102
  #puts ps
105
103
  #puts ps[fei.wfid].errors
106
104
 
107
- assert_equal ps[fei.wfid].expressions.size, 1
108
- assert_equal ps[fei.wfid].errors.size, 1
105
+ assert_equal 1, ps[fei.wfid].expressions.size
106
+ assert_equal 1, ps[fei.wfid].branches
107
+ assert_equal 1, ps[fei.wfid].errors.size
109
108
 
110
109
  #puts
111
110
  #puts ps.to_s
@@ -113,5 +112,39 @@ class FlowTest59 < Test::Unit::TestCase
113
112
  @engine.cancel_process fei.wfid
114
113
  end
115
114
 
115
+ #
116
+ # TEST 2
117
+
118
+ class Def59c < ProcessDefinition
119
+ sequence do
120
+ bravo
121
+ alpha
122
+ end
123
+ end
124
+
125
+ def test_2
126
+
127
+ a = @engine.register_participant :alpha, OpenWFE::HashParticipant
128
+ b = @engine.register_participant :bravo, OpenWFE::HashParticipant
129
+
130
+ feis = []
131
+ feis << @engine.launch(Def59b)
132
+ feis << @engine.launch(Def59b)
133
+ feis << @engine.launch(Def59c)
134
+
135
+ sleep 0.350
136
+
137
+ assert_equal 3, @engine.list_processes(:wfname => "Def").size
138
+ assert_equal 2, @engine.list_processes(:wfrevision => "59b").size
139
+ assert_equal 1, @engine.list_processes(:wfrevision => "59c").size
140
+ assert_equal 2, @engine.list_processes(:wfname => "Def", :wfrevision => "59b").size
141
+
142
+ feis.each do |fei|
143
+ @engine.cancel_process fei
144
+ end
145
+
146
+ sleep 0.350
147
+ end
148
+
116
149
  end
117
150
 
@@ -14,10 +14,11 @@ require 'flowtestbase'
14
14
  class FlowTest60 < Test::Unit::TestCase
15
15
  include FlowTestBase
16
16
 
17
- #def teardown
17
+ #def setup
18
18
  #end
19
19
 
20
- #def setup
20
+ #def teardown
21
+ # $OWFE_LOG.level = Logger::INFO # done in FlowTestBase !
21
22
  #end
22
23
 
23
24
  #
@@ -41,7 +42,7 @@ class FlowTest60 < Test::Unit::TestCase
41
42
 
42
43
  fei = @engine.launch TestDefinition0
43
44
 
44
- sleep 0.300
45
+ sleep 0.350
45
46
 
46
47
  #puts
47
48
  #puts @engine.get_process_stack fei.wfid
@@ -51,13 +52,12 @@ class FlowTest60 < Test::Unit::TestCase
51
52
  fei.expression_name = "sequence"
52
53
  @engine.cancel_expression fei
53
54
 
54
- sleep 0.300
55
+ sleep 0.350
55
56
 
56
57
  assert_equal "a\nb.0\nc", @tracer.to_s
57
58
 
58
- assert_equal 0, @engine.get_process_stack(fei.wfid).size
59
-
60
- #$OWFE_LOG.level = Logger::INFO
59
+ assert_equal 0, @engine.process_stack(fei.wfid).size
60
+ assert_equal 1, @engine.get_expression_storage.size
61
61
  end
62
62
 
63
63
  def test_1
@@ -66,7 +66,7 @@ class FlowTest60 < Test::Unit::TestCase
66
66
 
67
67
  fei = @engine.launch TestDefinition0
68
68
 
69
- sleep 0.300
69
+ sleep 0.350
70
70
 
71
71
  fei.expression_id = "0.0.1.2"
72
72
  fei.expression_name = "print"
@@ -76,9 +76,51 @@ class FlowTest60 < Test::Unit::TestCase
76
76
 
77
77
  assert_equal "a\nb.0\nc", @tracer.to_s
78
78
 
79
- assert_equal 0, @engine.get_process_stack(fei.wfid).size
79
+ assert_equal 0, @engine.process_stack(fei.wfid).size
80
+ assert_equal 1, @engine.get_expression_storage.size
81
+ end
82
+
83
+ def test_2
84
+
85
+ #$OWFE_LOG.level = Logger::DEBUG
86
+
87
+ fei = @engine.launch TestDefinition0
88
+
89
+ sleep 0.350
90
+
91
+ fei.expression_id = "0"
92
+ fei.expression_name = "process-definition"
93
+ @engine.cancel_expression fei
94
+
95
+ sleep 0.350
96
+ #puts @engine.get_error_journal.get_error_log(fei.wfid).to_s
97
+
98
+ assert_equal "a\nb.0", @tracer.to_s
99
+
100
+ assert_equal 0, @engine.process_stack(fei.wfid).size
101
+ assert_equal 1, @engine.get_expression_storage.size
102
+ end
103
+
104
+ def test_3
105
+
106
+ #$OWFE_LOG.level = Logger::DEBUG
107
+
108
+ fei = @engine.launch TestDefinition0
109
+
110
+ sleep 0.350
111
+
112
+ fei.expression_id = "0.0"
113
+ fei.expression_name = "sequence"
114
+ @engine.cancel_expression fei
115
+
116
+ @engine.wait_for(fei.wfid)
117
+ #sleep 0.350
118
+ #puts @engine.get_error_journal.get_error_log(fei.wfid).to_s
119
+
120
+ assert_equal "a\nb.0", @tracer.to_s
80
121
 
81
- #$OWFE_LOG.level = Logger::INFO
122
+ assert_equal 0, @engine.process_stack(fei.wfid).size
123
+ assert_equal 1, @engine.get_expression_storage.size
82
124
  end
83
125
 
84
126
  end