ruote 2.3.0.1 → 2.3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/CHANGELOG.txt +23 -0
  2. data/CREDITS.txt +4 -0
  3. data/LICENSE.txt +1 -1
  4. data/lib/ruote.rb +2 -0
  5. data/lib/ruote/context.rb +2 -1
  6. data/lib/ruote/dashboard.rb +169 -13
  7. data/lib/ruote/dboard/mutation.rb +282 -0
  8. data/lib/ruote/dboard/process_error.rb +1 -1
  9. data/lib/ruote/dboard/process_status.rb +61 -48
  10. data/lib/ruote/engine.rb +1 -1
  11. data/lib/ruote/exp/command.rb +1 -1
  12. data/lib/ruote/exp/commanded.rb +1 -1
  13. data/lib/ruote/exp/condition.rb +2 -1
  14. data/lib/ruote/exp/fe_add_branches.rb +1 -1
  15. data/lib/ruote/exp/fe_apply.rb +1 -1
  16. data/lib/ruote/exp/fe_await.rb +97 -48
  17. data/lib/ruote/exp/fe_cancel_process.rb +1 -1
  18. data/lib/ruote/exp/fe_command.rb +2 -3
  19. data/lib/ruote/exp/fe_concurrence.rb +162 -66
  20. data/lib/ruote/exp/fe_concurrent_iterator.rb +25 -7
  21. data/lib/ruote/exp/fe_cron.rb +1 -1
  22. data/lib/ruote/exp/fe_cursor.rb +10 -11
  23. data/lib/ruote/exp/fe_define.rb +1 -1
  24. data/lib/ruote/exp/fe_echo.rb +1 -1
  25. data/lib/ruote/exp/fe_equals.rb +1 -1
  26. data/lib/ruote/exp/fe_error.rb +1 -1
  27. data/lib/ruote/exp/fe_filter.rb +1 -1
  28. data/lib/ruote/exp/fe_forget.rb +1 -1
  29. data/lib/ruote/exp/fe_given.rb +1 -1
  30. data/lib/ruote/exp/fe_if.rb +87 -7
  31. data/lib/ruote/exp/fe_inc.rb +1 -1
  32. data/lib/ruote/exp/fe_iterator.rb +1 -1
  33. data/lib/ruote/exp/fe_listen.rb +1 -1
  34. data/lib/ruote/exp/fe_lose.rb +1 -1
  35. data/lib/ruote/exp/fe_noop.rb +1 -1
  36. data/lib/ruote/exp/fe_on_error.rb +1 -1
  37. data/lib/ruote/exp/fe_once.rb +1 -1
  38. data/lib/ruote/exp/fe_participant.rb +49 -16
  39. data/lib/ruote/exp/fe_read.rb +1 -1
  40. data/lib/ruote/exp/fe_redo.rb +1 -1
  41. data/lib/ruote/exp/fe_ref.rb +1 -1
  42. data/lib/ruote/exp/fe_registerp.rb +1 -1
  43. data/lib/ruote/exp/fe_reserve.rb +1 -1
  44. data/lib/ruote/exp/fe_restore.rb +1 -7
  45. data/lib/ruote/exp/fe_save.rb +1 -1
  46. data/lib/ruote/exp/fe_sequence.rb +1 -1
  47. data/lib/ruote/exp/fe_set.rb +1 -1
  48. data/lib/ruote/exp/fe_stall.rb +1 -1
  49. data/lib/ruote/exp/fe_subprocess.rb +1 -1
  50. data/lib/ruote/exp/fe_that.rb +1 -1
  51. data/lib/ruote/exp/fe_undo.rb +1 -1
  52. data/lib/ruote/exp/fe_unregisterp.rb +1 -1
  53. data/lib/ruote/exp/fe_wait.rb +1 -1
  54. data/lib/ruote/exp/flow_expression.rb +117 -8
  55. data/lib/ruote/exp/iterator.rb +1 -1
  56. data/lib/ruote/exp/ro_attributes.rb +1 -1
  57. data/lib/ruote/exp/ro_filters.rb +1 -1
  58. data/lib/ruote/exp/ro_on_x.rb +4 -2
  59. data/lib/ruote/exp/ro_persist.rb +1 -1
  60. data/lib/ruote/exp/ro_timers.rb +1 -1
  61. data/lib/ruote/exp/ro_variables.rb +1 -1
  62. data/lib/ruote/extract.rb +125 -0
  63. data/lib/ruote/fei.rb +10 -73
  64. data/lib/ruote/id/mnemo_wfid_generator.rb +1 -1
  65. data/lib/ruote/id/wfid_generator.rb +1 -1
  66. data/lib/ruote/log/default_history.rb +17 -3
  67. data/lib/ruote/log/fancy_printing.rb +12 -32
  68. data/lib/ruote/log/storage_history.rb +1 -1
  69. data/lib/ruote/log/wait_logger.rb +15 -7
  70. data/lib/ruote/merge.rb +123 -0
  71. data/lib/ruote/observer.rb +1 -1
  72. data/lib/ruote/part/block_participant.rb +1 -1
  73. data/lib/ruote/part/code_participant.rb +1 -1
  74. data/lib/ruote/part/engine_participant.rb +1 -1
  75. data/lib/ruote/part/local_participant.rb +9 -1
  76. data/lib/ruote/part/no_op_participant.rb +1 -1
  77. data/lib/ruote/part/null_participant.rb +1 -1
  78. data/lib/ruote/part/participant.rb +1 -1
  79. data/lib/ruote/part/rev_participant.rb +1 -1
  80. data/lib/ruote/part/smtp_participant.rb +1 -1
  81. data/lib/ruote/part/storage_participant.rb +18 -1
  82. data/lib/ruote/part/template.rb +1 -1
  83. data/lib/ruote/reader.rb +1 -1
  84. data/lib/ruote/reader/json.rb +1 -1
  85. data/lib/ruote/reader/radial.rb +4 -4
  86. data/lib/ruote/reader/ruby_dsl.rb +1 -1
  87. data/lib/ruote/reader/xml.rb +1 -1
  88. data/lib/ruote/receiver/base.rb +13 -1
  89. data/lib/ruote/storage/base.rb +8 -14
  90. data/lib/ruote/storage/composite_storage.rb +1 -1
  91. data/lib/ruote/storage/fs_storage.rb +1 -1
  92. data/lib/ruote/storage/hash_storage.rb +2 -1
  93. data/lib/ruote/svc/dispatch_pool.rb +29 -18
  94. data/lib/ruote/svc/dollar_sub.rb +5 -8
  95. data/lib/ruote/svc/error_handler.rb +1 -1
  96. data/lib/ruote/svc/expression_map.rb +1 -1
  97. data/lib/ruote/svc/participant_list.rb +8 -5
  98. data/lib/ruote/svc/tracker.rb +154 -56
  99. data/lib/ruote/svc/treechecker.rb +1 -1
  100. data/lib/ruote/tree_dot.rb +1 -1
  101. data/lib/ruote/util/deep.rb +4 -2
  102. data/lib/ruote/util/filter.rb +1 -1
  103. data/lib/ruote/util/hashdot.rb +1 -1
  104. data/lib/ruote/util/look.rb +1 -1
  105. data/lib/ruote/util/lookup.rb +1 -1
  106. data/lib/ruote/util/misc.rb +51 -1
  107. data/lib/ruote/util/mpatch.rb +1 -1
  108. data/lib/ruote/util/ometa.rb +1 -1
  109. data/lib/ruote/util/subprocess.rb +1 -1
  110. data/lib/ruote/util/time.rb +3 -3
  111. data/lib/ruote/util/tree.rb +43 -4
  112. data/lib/ruote/version.rb +2 -2
  113. data/lib/ruote/worker.rb +30 -18
  114. data/lib/ruote/workitem.rb +1 -1
  115. data/ruote.gemspec +6 -2
  116. data/test/functional/base.rb +0 -1
  117. data/test/functional/concurrent_base.rb +1 -1
  118. data/test/functional/eft_14_cursor.rb +42 -52
  119. data/test/functional/eft_16_if.rb +24 -16
  120. data/test/functional/eft_18_concurrent_iterator.rb +31 -1
  121. data/test/functional/eft_6_concurrence.rb +149 -34
  122. data/test/functional/ft_10_dollar.rb +14 -30
  123. data/test/functional/ft_12_launchitem.rb +15 -0
  124. data/test/functional/ft_1_process_status.rb +62 -13
  125. data/test/functional/ft_20_storage_participant.rb +25 -0
  126. data/test/functional/ft_38_participant_more.rb +1 -1
  127. data/test/functional/ft_42_storage_copy.rb +1 -3
  128. data/test/functional/ft_43_participant_on_reply.rb +63 -5
  129. data/test/functional/ft_66_flank.rb +41 -0
  130. data/test/functional/ft_6_on_cancel.rb +9 -18
  131. data/test/functional/ft_71_retries.rb +25 -12
  132. data/test/functional/ft_79_attach.rb +138 -0
  133. data/test/functional/ft_7_tags.rb +27 -0
  134. data/test/functional/ft_80_pause_on_apply.rb +64 -0
  135. data/test/functional/ft_81_mutation.rb +417 -0
  136. data/test/functional/ft_82_await_attribute.rb +84 -0
  137. data/test/functional/ft_83_trackers.rb +79 -0
  138. data/test/functional/storage.rb +3 -4
  139. data/test/unit/ut_12_wait_logger.rb +41 -3
  140. data/test/unit/ut_15_util.rb +30 -0
  141. data/test/unit/ut_17_merge.rb +54 -53
  142. data/test/unit/ut_1_fei.rb +2 -2
  143. data/test/unit/ut_24_radial_reader.rb +7 -0
  144. data/test/unit/ut_26_deep.rb +14 -0
  145. data/test/unit/ut_5_tree.rb +38 -28
  146. metadata +206 -169
  147. data/couch_url.txt +0 -1
  148. data/lib/ruote/exp/merge.rb +0 -134
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2005-2013, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2005-2013, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2005-2013, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2005-2013, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -69,7 +69,7 @@ module Ruote
69
69
  #
70
70
  # date
71
71
 
72
- Rufus.to_ruby_time(s)# rescue nil
72
+ DateTime.parse(s)
73
73
 
74
74
  else
75
75
  #
@@ -87,7 +87,7 @@ module Ruote
87
87
 
88
88
  # Waiting for a better implementation of it in rufus-scheduler 2.0.4
89
89
  #
90
- def self.is_cron_string(s)
90
+ def self.cron_string?(s)
91
91
 
92
92
  ss = s.split(' ')
93
93
 
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2005-2013, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -38,7 +38,10 @@ module Ruote
38
38
  # end
39
39
  #
40
40
  # p pdef
41
- # # => ["define", {"name"=>"def0"}, [["sequence", {}, [["alpha", {}, []], ["bravo", {}, []]]]]]
41
+ # # => ["define", {"name"=>"def0"}, [
42
+ # # ["sequence", {}, [
43
+ # # ["alpha", {}, []],
44
+ # # ["bravo", {}, []]]]]]
42
45
  #
43
46
  # puts Ruote.tree_to_s(pdef)
44
47
  # # =>
@@ -55,7 +58,43 @@ module Ruote
55
58
  s
56
59
  end
57
60
 
58
- # Used by Ruote::ProcessStatus.
61
+ # Compacts
62
+ #
63
+ # [ 'participant', { 'ref' => 'sam' }, [] ] # and
64
+ # [ 'subprocess', { 'ref' => 'compute_prime' }, [] ]
65
+ #
66
+ # into
67
+ #
68
+ # [ 'sam', {}, [] ] # and
69
+ # [ 'compute_prime', {}, [] ]
70
+ #
71
+ # to simplify tree comparisons.
72
+ #
73
+ def self.compact_tree(tree)
74
+
75
+ tree = tree.dup
76
+
77
+ if %w[ participant subprocess ].include?(tree[0])
78
+
79
+ ref =
80
+ tree[1].delete('ref') ||
81
+ begin
82
+ kv = tree[1].find { |k, v| v == nil }
83
+ tree[1].delete(kv[0])
84
+ kv[0]
85
+ end
86
+
87
+ tree[0] = ref
88
+
89
+ else
90
+
91
+ tree[2] = tree[2].collect { |t| compact_tree(t) }
92
+ end
93
+
94
+ tree
95
+ end
96
+
97
+ # Used by some projects, used to be called from Ruote::ProcessStatus.
59
98
  #
60
99
  # Given a tree
61
100
  #
@@ -81,7 +120,7 @@ module Ruote
81
120
  h
82
121
  end
83
122
 
84
- # Used by Ruote::ProcessStatus.
123
+ # Used by some projects, used to be called from Ruote::ProcessStatus.
85
124
  #
86
125
  # Given a decomposed tree like
87
126
  #
data/lib/ruote/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2005-2013, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -24,6 +24,6 @@
24
24
 
25
25
  module Ruote
26
26
 
27
- VERSION = '2.3.0.1'
27
+ VERSION = '2.3.0.2'
28
28
  end
29
29
 
data/lib/ruote/worker.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2005-2013, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -27,6 +27,21 @@ require 'ruote/fei'
27
27
 
28
28
  module Ruote
29
29
 
30
+ # A helper for the #worker method, it returns that dummy worker
31
+ # when there is no reference to the calling worker in the current
32
+ # thread's local variables.
33
+ #
34
+ DUMMY_WORKER = OpenStruct.new(
35
+ :name => 'worker', :identity => 'unknown', :state => 'running')
36
+
37
+ # Warning, this is not equivalent to doing @context.worker, this method
38
+ # fetches the worker from the local thread variables.
39
+ #
40
+ def self.current_worker
41
+
42
+ Thread.current['ruote_worker'] || DUMMY_WORKER
43
+ end
44
+
30
45
  #
31
46
  # Workers fetch 'msgs' and 'schedules' from the storage and process them.
32
47
  #
@@ -339,10 +354,10 @@ module Ruote
339
354
  #
340
355
  def turn_schedule_to_msg(schedule)
341
356
 
342
- msg = Ruote.fulldup(schedule['msg'])
343
-
344
357
  return false unless @storage.reserve(schedule)
345
358
 
359
+ msg = Ruote.fulldup(schedule['msg'])
360
+
346
361
  @storage.put_msg(msg.delete('action'), msg)
347
362
 
348
363
  true
@@ -390,7 +405,7 @@ module Ruote
390
405
 
391
406
  when 'raise'
392
407
 
393
- handle_msg_error(msg['msg'], msg['error'])
408
+ @context.error_handler.msg_handle(msg['msg'], msg['error'])
394
409
 
395
410
  when 'respark'
396
411
 
@@ -406,7 +421,7 @@ module Ruote
406
421
 
407
422
  rescue => err
408
423
 
409
- handle_msg_error(msg, err)
424
+ @context.error_handler.msg_handle(msg, err)
410
425
  end
411
426
 
412
427
  @context.storage.done(msg) if @context.storage.respond_to?(:done)
@@ -417,15 +432,6 @@ module Ruote
417
432
  true
418
433
  end
419
434
 
420
- # Passes the msg and the err it resulted in to the error_handler.
421
- #
422
- # Some storage/worker implementation may want to override this.
423
- #
424
- def handle_msg_error(msg, err)
425
-
426
- @context.error_handler.msg_handle(msg, err)
427
- end
428
-
429
435
  # Works for both the 'launch' and the 'apply' msgs.
430
436
  #
431
437
  # Creates a new expression, gives and applies it with the
@@ -439,8 +445,8 @@ module Ruote
439
445
 
440
446
  exp_class = @context.expmap.expression_class(tree.first)
441
447
 
442
- # msg['wfid'] only : it's a launch
443
- # msg['fei'] : it's a sub launch (a supplant ?)
448
+ # msg['wfid'] only: it's a launch
449
+ # msg['fei']: it's a sub launch (a supplant ?)
444
450
 
445
451
  if is_launch?(msg, exp_class)
446
452
 
@@ -457,21 +463,27 @@ module Ruote
457
463
  end
458
464
 
459
465
  exp_hash = {
466
+
460
467
  'fei' => msg['fei'] || {
461
468
  'engine_id' => @context.engine_id,
462
469
  'wfid' => msg['wfid'],
463
470
  'subid' => Ruote.generate_subid(msg.inspect),
464
471
  'expid' => msg['expid'] || '0' },
472
+
465
473
  'parent_id' => msg['parent_id'],
466
474
  'variables' => variables,
467
475
  'applied_workitem' => wi,
476
+
468
477
  'forgotten' => msg['forgotten'],
469
478
  'lost' => msg['lost'],
470
479
  'flanking' => msg['flanking'],
480
+ 'attached' => msg['attached'],
481
+ 'supplanted' => msg['supplanted'],
482
+
471
483
  'stash' => msg['stash'],
472
484
  'trigger' => msg['trigger'],
473
- 'on_reply' => msg['on_reply'],
474
- 'supplanted' => msg['supplanted'] }
485
+ 'on_reply' => msg['on_reply']
486
+ }
475
487
 
476
488
  if not exp_class
477
489
 
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2005-2013, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
data/ruote.gemspec CHANGED
@@ -24,9 +24,13 @@ ruote is an open source Ruby workflow engine
24
24
  '*.gemspec', '*.txt', '*.rdoc', '*.md'
25
25
  ]
26
26
 
27
+ s.add_runtime_dependency 'ruby_parser', '~> 2.3'
28
+ # ruby_parser 3.x is very different,
29
+ # will rather go the ripper way (full 19 or even 20)...
30
+
27
31
  s.add_runtime_dependency 'blankslate', '2.1.2.4'
28
- s.add_runtime_dependency 'parslet', '>= 1.4.0'
29
- # blankslate 2.1.2.3 is to avoid...
32
+ s.add_runtime_dependency 'parslet', '1.4.0'
33
+ # not yet Parslet 1.5.x ready
30
34
 
31
35
  s.add_runtime_dependency 'sourcify', '0.5.0'
32
36
  s.add_runtime_dependency 'rufus-json', '>= 1.0.1'
@@ -139,7 +139,6 @@ module FunctionalBase
139
139
 
140
140
  def noisy(on=true)
141
141
 
142
- puts "\nnoisy " + caller[0] if on
143
142
  @dashboard.context.logger.noisy = true
144
143
  end
145
144
 
@@ -79,7 +79,7 @@ module ConcurrentBase
79
79
 
80
80
  @dashboard1.context.logger.color = '32' # green
81
81
 
82
- noisy if ARGV.include?('-N')
82
+ noisy if ENV['NOISY'] == 'true'
83
83
  end
84
84
 
85
85
  def teardown
@@ -20,8 +20,6 @@ class EftCursorTest < Test::Unit::TestCase
20
20
  end
21
21
  end
22
22
 
23
- #noisy
24
-
25
23
  assert_trace('', pdef)
26
24
  end
27
25
 
@@ -34,8 +32,6 @@ class EftCursorTest < Test::Unit::TestCase
34
32
  end
35
33
  end
36
34
 
37
- #noisy
38
-
39
35
  assert_trace(%w[ a b ], pdef)
40
36
  end
41
37
 
@@ -50,8 +46,6 @@ class EftCursorTest < Test::Unit::TestCase
50
46
  end
51
47
  end
52
48
 
53
- #noisy
54
-
55
49
  assert_trace(%w[ a c ], pdef)
56
50
  end
57
51
 
@@ -65,8 +59,6 @@ class EftCursorTest < Test::Unit::TestCase
65
59
  end
66
60
  end
67
61
 
68
- #noisy
69
-
70
62
  assert_trace('a', pdef)
71
63
  end
72
64
 
@@ -80,8 +72,6 @@ class EftCursorTest < Test::Unit::TestCase
80
72
  end
81
73
  end
82
74
 
83
- #noisy
84
-
85
75
  assert_trace('a', pdef)
86
76
  end
87
77
 
@@ -95,8 +85,6 @@ class EftCursorTest < Test::Unit::TestCase
95
85
  end
96
86
  end
97
87
 
98
- #noisy
99
-
100
88
  assert_trace('a', pdef)
101
89
  end
102
90
 
@@ -105,14 +93,12 @@ class EftCursorTest < Test::Unit::TestCase
105
93
  pdef = Ruote.process_definition :name => 'test' do
106
94
  cursor do
107
95
  echo 'a'
108
- jump :to => 'c'
96
+ jump :to => 'ctag'
109
97
  echo 'b'
110
- echo 'c', :tag => 'c'
98
+ echo 'c', :tag => 'ctag'
111
99
  end
112
100
  end
113
101
 
114
- #noisy
115
-
116
102
  assert_trace(%w[ a c ], pdef)
117
103
  end
118
104
 
@@ -121,18 +107,14 @@ class EftCursorTest < Test::Unit::TestCase
121
107
  pdef = Ruote.process_definition :name => 'test' do
122
108
  cursor do
123
109
  echo 'a'
124
- jump :to => 'd'
110
+ set :var => 'v0', :val => 'ctag'
111
+ jump :to => '${v:v0}'
125
112
  echo 'b'
126
- set :var => 'v0', :val => 'd'
127
- jump :to => 'd'
128
- echo 'c'
129
- echo 'd', :tag => '${v:v0}'
113
+ echo 'c', :tag => '${v:v0}'
130
114
  end
131
115
  end
132
116
 
133
- #noisy
134
-
135
- assert_trace(%w[ a b d ], pdef)
117
+ assert_trace(%w[ a c ], pdef)
136
118
  end
137
119
 
138
120
  def test_rewind_if
@@ -153,8 +135,6 @@ class EftCursorTest < Test::Unit::TestCase
153
135
  tracer << "a\n"
154
136
  end
155
137
 
156
- #noisy
157
-
158
138
  assert_trace(%w[ a ] * 5, pdef)
159
139
  end
160
140
 
@@ -182,12 +162,46 @@ class EftCursorTest < Test::Unit::TestCase
182
162
  tracer << "p\n"
183
163
  end
184
164
 
185
- #noisy
186
-
187
165
  assert_trace %w[ a r a r a r p ], pdef
188
166
  # ARP nostalgy....
189
167
  end
190
168
 
169
+ def test_jump_to_participant_name
170
+
171
+ @dashboard.register '.+' do |workitem|
172
+ tracer << workitem.participant_name + "\n"
173
+ end
174
+
175
+ pdef = Ruote.define do
176
+ cursor do
177
+ participant 'a'
178
+ jump :to => 'c'
179
+ participant 'b'
180
+ participant 'c'
181
+ end
182
+ end
183
+
184
+ assert_trace %w[ a c ], pdef
185
+ end
186
+
187
+ def test_jump_to_participant_ref_name
188
+
189
+ @dashboard.register '.+' do |workitem|
190
+ tracer << workitem.participant_name + "\n"
191
+ end
192
+
193
+ pdef = Ruote.define do
194
+ cursor do
195
+ participant :ref => 'a'
196
+ jump :to => 'c'
197
+ participant :ref => 'b'
198
+ participant :ref => 'c'
199
+ end
200
+ end
201
+
202
+ assert_trace %w[ a c ], pdef
203
+ end
204
+
191
205
  def test_deep_rewind
192
206
 
193
207
  pdef = Ruote.process_definition :name => 'test' do
@@ -200,8 +214,6 @@ class EftCursorTest < Test::Unit::TestCase
200
214
  end
201
215
  end
202
216
 
203
- #noisy
204
-
205
217
  wfid = @dashboard.launch(pdef)
206
218
 
207
219
  wait_for(14)
@@ -228,8 +240,6 @@ class EftCursorTest < Test::Unit::TestCase
228
240
 
229
241
  @dashboard.register_participant :alpha, Ruote::NoOpParticipant
230
242
 
231
- #noisy
232
-
233
243
  wfid = @dashboard.launch(pdef)
234
244
 
235
245
  wait_for(:alpha)
@@ -255,8 +265,6 @@ class EftCursorTest < Test::Unit::TestCase
255
265
  end
256
266
  end
257
267
 
258
- #noisy
259
-
260
268
  assert_trace %w[ a b ], pdef
261
269
  end
262
270
 
@@ -269,8 +277,6 @@ class EftCursorTest < Test::Unit::TestCase
269
277
  echo 'done.'
270
278
  end
271
279
 
272
- #noisy
273
-
274
280
  assert_trace 'done.', pdef
275
281
  end
276
282
 
@@ -283,8 +289,6 @@ class EftCursorTest < Test::Unit::TestCase
283
289
  echo 'done.'
284
290
  end
285
291
 
286
- #noisy
287
-
288
292
  assert_trace 'done.', pdef
289
293
  end
290
294
 
@@ -317,8 +321,6 @@ class EftCursorTest < Test::Unit::TestCase
317
321
  echo 'done.'
318
322
  end
319
323
 
320
- #noisy
321
-
322
324
  @dashboard.register do
323
325
  alpha EftCursorTest::Alpha
324
326
  bravo EftCursorTest::Bravo
@@ -335,8 +337,6 @@ class EftCursorTest < Test::Unit::TestCase
335
337
  end
336
338
  end
337
339
 
338
- #@dashboard.noisy = true
339
-
340
340
  wfid = @dashboard.launch(pdef)
341
341
 
342
342
  @dashboard.wait_for(9)
@@ -369,8 +369,6 @@ class EftCursorTest < Test::Unit::TestCase
369
369
 
370
370
  def test_workitem_command_and_jump_array
371
371
 
372
- #noisy
373
-
374
372
  @dashboard.register do
375
373
  charly EftCursorTest::Charly, 'command' => [ 'jump', 'delta' ]
376
374
  catchall Ruote::NoOpParticipant
@@ -381,8 +379,6 @@ class EftCursorTest < Test::Unit::TestCase
381
379
 
382
380
  def test_workitem_command_and_jump_string
383
381
 
384
- #noisy
385
-
386
382
  @dashboard.register do
387
383
  charly EftCursorTest::Charly, 'command' => 'jump delta'
388
384
  catchall Ruote::NoOpParticipant
@@ -393,8 +389,6 @@ class EftCursorTest < Test::Unit::TestCase
393
389
 
394
390
  def test_workitem_command_and_jump_to_string
395
391
 
396
- #noisy
397
-
398
392
  @dashboard.register do
399
393
  charly EftCursorTest::Charly, 'command' => 'jump to delta'
400
394
  catchall Ruote::NoOpParticipant
@@ -415,8 +409,6 @@ class EftCursorTest < Test::Unit::TestCase
415
409
 
416
410
  @dashboard.register { catchall }
417
411
 
418
- #@dashboard.noisy = true
419
-
420
412
  wfid = @dashboard.launch(pdef)
421
413
  @dashboard.wait_for(:alpha)
422
414
 
@@ -440,8 +432,6 @@ class EftCursorTest < Test::Unit::TestCase
440
432
 
441
433
  @dashboard.register { catchall }
442
434
 
443
- #@dashboard.noisy = true
444
-
445
435
  wfid = @dashboard.launch(pdef)
446
436
  @dashboard.wait_for(:alpha)
447
437