ruote 2.1.11 → 2.2.0

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.
Files changed (217) hide show
  1. data/CHANGELOG.txt +60 -0
  2. data/CREDITS.txt +22 -4
  3. data/LICENSE.txt +1 -1
  4. data/README.rdoc +6 -7
  5. data/Rakefile +58 -59
  6. data/TODO.txt +137 -65
  7. data/couch_url.txt +1 -0
  8. data/jruby_issue.txt +32 -0
  9. data/lib/ruote.rb +1 -1
  10. data/lib/ruote/context.rb +12 -10
  11. data/lib/ruote/engine.rb +280 -145
  12. data/lib/ruote/engine/process_error.rb +5 -5
  13. data/lib/ruote/engine/process_status.rb +47 -28
  14. data/lib/ruote/exp/command.rb +7 -10
  15. data/lib/ruote/exp/commanded.rb +2 -2
  16. data/lib/ruote/exp/condition.rb +130 -43
  17. data/lib/ruote/exp/fe_add_branches.rb +2 -2
  18. data/lib/ruote/exp/fe_apply.rb +1 -1
  19. data/lib/ruote/exp/fe_cancel_process.rb +3 -3
  20. data/lib/ruote/exp/fe_command.rb +3 -3
  21. data/lib/ruote/exp/fe_concurrence.rb +4 -4
  22. data/lib/ruote/exp/fe_concurrent_iterator.rb +17 -5
  23. data/lib/ruote/exp/fe_cron.rb +3 -3
  24. data/lib/ruote/exp/fe_cursor.rb +5 -5
  25. data/lib/ruote/exp/fe_define.rb +3 -3
  26. data/lib/ruote/exp/fe_echo.rb +3 -3
  27. data/lib/ruote/exp/fe_equals.rb +2 -2
  28. data/lib/ruote/exp/fe_error.rb +2 -2
  29. data/lib/ruote/exp/fe_filter.rb +519 -0
  30. data/lib/ruote/exp/fe_forget.rb +9 -2
  31. data/lib/ruote/exp/fe_given.rb +154 -0
  32. data/lib/ruote/exp/fe_if.rb +16 -13
  33. data/lib/ruote/exp/fe_inc.rb +3 -3
  34. data/lib/ruote/exp/fe_iterator.rb +4 -4
  35. data/lib/ruote/exp/fe_let.rb +75 -0
  36. data/lib/ruote/exp/fe_listen.rb +68 -12
  37. data/lib/ruote/exp/fe_lose.rb +110 -0
  38. data/lib/ruote/exp/fe_noop.rb +1 -1
  39. data/lib/ruote/exp/{fe_when.rb → fe_once.rb} +25 -21
  40. data/lib/ruote/exp/fe_participant.rb +14 -17
  41. data/lib/ruote/exp/fe_redo.rb +10 -6
  42. data/lib/ruote/exp/fe_ref.rb +1 -1
  43. data/lib/ruote/exp/fe_registerp.rb +112 -0
  44. data/lib/ruote/exp/fe_reserve.rb +3 -3
  45. data/lib/ruote/exp/fe_restore.rb +2 -2
  46. data/lib/ruote/exp/fe_save.rb +2 -2
  47. data/lib/ruote/exp/fe_sequence.rb +3 -4
  48. data/lib/ruote/exp/fe_set.rb +16 -7
  49. data/lib/ruote/exp/fe_subprocess.rb +23 -1
  50. data/lib/ruote/exp/fe_that.rb +92 -0
  51. data/lib/ruote/exp/fe_undo.rb +3 -3
  52. data/lib/ruote/exp/fe_unregisterp.rb +71 -0
  53. data/lib/ruote/exp/fe_wait.rb +2 -2
  54. data/lib/ruote/exp/flowexpression.rb +153 -78
  55. data/lib/ruote/exp/iterator.rb +2 -2
  56. data/lib/ruote/exp/merge.rb +2 -2
  57. data/lib/ruote/exp/ro_attributes.rb +14 -12
  58. data/lib/ruote/exp/ro_filters.rb +136 -0
  59. data/lib/ruote/exp/ro_persist.rb +51 -35
  60. data/lib/ruote/exp/ro_variables.rb +18 -27
  61. data/lib/ruote/fei.rb +73 -33
  62. data/lib/ruote/id/mnemo_wfid_generator.rb +1 -1
  63. data/lib/ruote/id/wfid_generator.rb +11 -4
  64. data/lib/ruote/log/default_history.rb +122 -0
  65. data/lib/ruote/log/pretty.rb +36 -8
  66. data/lib/ruote/log/storage_history.rb +37 -5
  67. data/lib/ruote/log/test_logger.rb +26 -24
  68. data/lib/ruote/log/wait_logger.rb +5 -3
  69. data/lib/ruote/part/block_participant.rb +22 -11
  70. data/lib/ruote/part/engine_participant.rb +6 -7
  71. data/lib/ruote/part/local_participant.rb +6 -12
  72. data/lib/ruote/part/no_op_participant.rb +4 -4
  73. data/lib/ruote/part/null_participant.rb +4 -4
  74. data/lib/ruote/part/smtp_participant.rb +4 -4
  75. data/lib/ruote/part/storage_participant.rb +40 -20
  76. data/lib/ruote/part/template.rb +4 -4
  77. data/lib/ruote/participant.rb +0 -1
  78. data/lib/ruote/{parser.rb → reader.rb} +30 -25
  79. data/lib/ruote/{parser → reader}/ruby_dsl.rb +28 -11
  80. data/lib/ruote/{parser → reader}/xml.rb +6 -5
  81. data/lib/ruote/receiver/base.rb +35 -13
  82. data/lib/ruote/storage/base.rb +20 -18
  83. data/lib/ruote/storage/composite_storage.rb +10 -10
  84. data/lib/ruote/storage/fs_storage.rb +17 -10
  85. data/lib/ruote/storage/hash_storage.rb +29 -18
  86. data/lib/ruote/svc/dispatch_pool.rb +41 -14
  87. data/lib/ruote/svc/dollar_sub.rb +50 -17
  88. data/lib/ruote/svc/error_handler.rb +19 -11
  89. data/lib/ruote/svc/expression_map.rb +4 -4
  90. data/lib/ruote/svc/participant_list.rb +105 -100
  91. data/lib/ruote/svc/tracker.rb +58 -18
  92. data/lib/ruote/svc/treechecker.rb +51 -24
  93. data/lib/ruote/tree_dot.rb +4 -4
  94. data/lib/ruote/util/filter.rb +440 -0
  95. data/lib/ruote/util/hashdot.rb +4 -4
  96. data/lib/ruote/util/look.rb +2 -6
  97. data/lib/ruote/util/lookup.rb +9 -7
  98. data/lib/ruote/util/misc.rb +40 -8
  99. data/lib/ruote/util/ometa.rb +1 -1
  100. data/lib/ruote/util/serializer.rb +4 -4
  101. data/lib/ruote/util/subprocess.rb +29 -9
  102. data/lib/ruote/util/time.rb +4 -4
  103. data/lib/ruote/util/tree.rb +3 -3
  104. data/lib/ruote/version.rb +2 -2
  105. data/lib/ruote/worker.rb +55 -32
  106. data/lib/ruote/workitem.rb +64 -11
  107. data/ruote.gemspec +31 -302
  108. data/test/bm/launch_bench.rb +37 -0
  109. data/test/functional/base.rb +60 -18
  110. data/test/functional/concurrent_base.rb +2 -2
  111. data/test/functional/ct_0_concurrence.rb +1 -1
  112. data/test/functional/ct_1_iterator.rb +1 -1
  113. data/test/functional/ct_2_cancel.rb +1 -1
  114. data/test/functional/eft_0_process_definition.rb +2 -2
  115. data/test/functional/eft_10_cancel_process.rb +1 -1
  116. data/test/functional/eft_11_wait.rb +19 -11
  117. data/test/functional/eft_12_listen.rb +79 -13
  118. data/test/functional/eft_13_iterator.rb +13 -10
  119. data/test/functional/eft_14_cursor.rb +98 -9
  120. data/test/functional/eft_15_loop.rb +6 -4
  121. data/test/functional/eft_16_if.rb +12 -0
  122. data/test/functional/eft_18_concurrent_iterator.rb +31 -32
  123. data/test/functional/eft_19_reserve.rb +4 -4
  124. data/test/functional/eft_1_echo.rb +9 -0
  125. data/test/functional/eft_20_save.rb +4 -4
  126. data/test/functional/{eft_28_when.rb → eft_28_once.rb} +33 -7
  127. data/test/functional/eft_30_ref.rb +17 -2
  128. data/test/functional/eft_31_registerp.rb +130 -0
  129. data/test/functional/eft_32_lose.rb +93 -0
  130. data/test/functional/eft_33_let.rb +31 -0
  131. data/test/functional/eft_34_given.rb +123 -0
  132. data/test/functional/eft_35_filter.rb +269 -0
  133. data/test/functional/eft_3_participant.rb +4 -6
  134. data/test/functional/eft_4_set.rb +16 -2
  135. data/test/functional/eft_5_subprocess.rb +2 -4
  136. data/test/functional/eft_6_concurrence.rb +29 -29
  137. data/test/functional/eft_8_undo.rb +39 -3
  138. data/test/functional/eft_9_redo.rb +94 -2
  139. data/test/functional/ft_10_dollar.rb +81 -2
  140. data/test/functional/ft_11_recursion.rb +13 -17
  141. data/test/functional/ft_12_launchitem.rb +9 -5
  142. data/test/functional/ft_13_variables.rb +7 -9
  143. data/test/functional/ft_14_re_apply.rb +6 -9
  144. data/test/functional/ft_15_timeout.rb +18 -18
  145. data/test/functional/ft_16_participant_params.rb +1 -3
  146. data/test/functional/ft_17_conditional.rb +25 -2
  147. data/test/functional/ft_18_kill.rb +65 -12
  148. data/test/functional/ft_1_process_status.rb +147 -71
  149. data/test/functional/ft_20_storage_participant.rb +0 -1
  150. data/test/functional/ft_21_forget.rb +82 -1
  151. data/test/functional/{ft_24_block_participants.rb → ft_24_block_participant.rb} +42 -11
  152. data/test/functional/ft_25_receiver.rb +47 -17
  153. data/test/functional/{ft_26_participant_timeout.rb → ft_26_participant_rtimeout.rb} +56 -19
  154. data/test/functional/ft_29_part_template.rb +6 -5
  155. data/test/functional/ft_2_errors.rb +21 -37
  156. data/test/functional/ft_30_smtp_participant.rb +1 -1
  157. data/test/functional/ft_31_part_blocking.rb +8 -6
  158. data/test/functional/ft_34_cursor_rewind.rb +13 -10
  159. data/test/functional/ft_35_add_service.rb +1 -1
  160. data/test/functional/ft_36_storage_history.rb +24 -1
  161. data/test/functional/ft_37_default_history.rb +109 -0
  162. data/test/functional/ft_38_participant_more.rb +10 -10
  163. data/test/functional/ft_39_wait_for.rb +12 -9
  164. data/test/functional/ft_3_participant_registration.rb +111 -32
  165. data/test/functional/ft_40_wait_logger.rb +2 -1
  166. data/test/functional/ft_41_participants.rb +30 -4
  167. data/test/functional/ft_43_participant_on_reply.rb +6 -23
  168. data/test/functional/ft_45_participant_accept.rb +4 -4
  169. data/test/functional/ft_46_launch_single.rb +36 -2
  170. data/test/functional/ft_47_wfid_generator.rb +54 -0
  171. data/test/functional/ft_48_lose.rb +112 -0
  172. data/test/functional/ft_49_engine_on_error.rb +201 -0
  173. data/test/functional/ft_4_cancel.rb +66 -6
  174. data/test/functional/ft_50_engine_config.rb +22 -0
  175. data/test/functional/ft_51_misc.rb +67 -0
  176. data/test/functional/ft_52_case.rb +134 -0
  177. data/test/functional/ft_53_engine_on_terminate.rb +95 -0
  178. data/test/functional/ft_54_patterns.rb +104 -0
  179. data/test/functional/{ft_37_engine_participant.rb → ft_55_engine_participant.rb} +4 -5
  180. data/test/functional/ft_56_filter_attribute.rb +259 -0
  181. data/test/functional/ft_5_on_error.rb +77 -30
  182. data/test/functional/ft_6_on_cancel.rb +66 -11
  183. data/test/functional/ft_7_tags.rb +94 -5
  184. data/test/functional/ft_8_participant_consumption.rb +36 -5
  185. data/test/functional/ft_9_subprocesses.rb +10 -10
  186. data/test/functional/rt_1_listen.rb +3 -3
  187. data/test/functional/{rt_3_when.rb → rt_3_once.rb} +4 -4
  188. data/test/functional/storage_helper.rb +15 -13
  189. data/test/functional/test.rb +1 -3
  190. data/test/test_helper.rb +0 -8
  191. data/test/unit/storage.rb +154 -10
  192. data/test/unit/{ut_0_ruby_parser.rb → ut_0_ruby_reader.rb} +61 -11
  193. data/test/unit/ut_11_lookup.rb +7 -0
  194. data/test/unit/ut_13_serializer.rb +1 -1
  195. data/test/unit/ut_15_util.rb +23 -0
  196. data/test/unit/{ut_16_parser.rb → ut_16_reader.rb} +11 -13
  197. data/test/unit/ut_1_fei.rb +57 -10
  198. data/test/unit/ut_20_composite_storage.rb +25 -11
  199. data/test/unit/ut_21_participant_list.rb +47 -0
  200. data/test/unit/ut_22_filter.rb +903 -0
  201. data/test/unit/ut_3_wait_logger.rb +2 -6
  202. data/test/unit/ut_6_condition.rb +164 -17
  203. data/test/unit/ut_7_workitem.rb +28 -0
  204. data/test/unit/ut_8_tree_to_dot.rb +1 -1
  205. data/test/unit/{ut_9_xml_parser.rb → ut_9_xml_reader.rb} +5 -5
  206. metadata +108 -84
  207. data/.gitignore +0 -4
  208. data/examples/barley.rb +0 -391
  209. data/examples/flickr_report.rb +0 -107
  210. data/examples/pong.rb +0 -37
  211. data/examples/ruote_quickstart.rb +0 -43
  212. data/examples/web_first_page.rb +0 -68
  213. data/lib/ruote/part/hash_participant.rb +0 -91
  214. data/test/README.rdoc +0 -15
  215. data/test/functional/crunner.sh +0 -19
  216. data/test/pdef.xml +0 -7
  217. data/test/unit/ut_2_wfidgen.rb +0 -21
data/CHANGELOG.txt CHANGED
@@ -2,6 +2,66 @@
2
2
  = ruote - CHANGELOG.txt
3
3
 
4
4
 
5
+ == ruote - 2.2.0 not yet released
6
+
7
+ - Engine#participant(name) returns an instance of any participant
8
+ - :filter => 'participant_name' (consume(wi) / filter(fields))
9
+ - listen block and forget issue fixed (Thanks Nando Sola)
10
+ - @msg always set in FlowExpression
11
+ - aliased 'cancel_process' to 'terminate'
12
+ - Engine#leftovers (Thanks Iuri)
13
+ - $x, $f:x and $v:y vs ${x}, ${f:x} and ${v:y} (literally)
14
+ - :filter common attribute
15
+ - Participant#do_not_thread : optional workitem parameter
16
+ - filter expression
17
+ - LocalParticipant / Receiver #applied_workitem(fei)
18
+ - using Sourcify to store block participant's code as a string
19
+ - CompositeStorage#delete bug fix (Thanks Claudio)
20
+ - ParticipantList#register bug fix (Thanks 'sandbox')
21
+ - StorageHistory#wfids and DefaultHistory#wfids
22
+ - Engine#history -> DefaultHistory (keeping the last 1000 msgs)
23
+ - 'citerator' alias to 'concurrent_iterator'
24
+ - Participant#rtimeout(workitem) (optional)
25
+ - moved Engine#workitem(fei) to ReceiverMixin
26
+ - storage#delete_schedule ignoring nil schedule_id
27
+ - Participant #rtimeout instead of #timeout
28
+ - StorageParticipant making @options available
29
+ - Engine#register, allowing block participants (Thanks Hery)
30
+ - fixed Engine#launch_single relaunch issue (Thanks Gonzalo)
31
+ - 'rset', an alias for the 'set' expression (Thanks Rebo)
32
+ - listen :to => /x/ or "/x/" required for regular expressions
33
+ - engine#on_terminate = participant_name / subprocess_name / tree
34
+ - listen :to => 'tagname', :upon => 'entering' / 'leaving'
35
+ - Ruote::Parser becomes Ruote::Reader
36
+ - :if => "${customer} in ${customer_list}", :if => "4 in {4 => 5}"
37
+ - Ruote::Workitem .from_json #as_json
38
+ - :on_error => redo/retry // undo/pass
39
+ - given : a case/switch ruote equivalent
40
+ - conditionals : "${x} is empty" and "${x} is null"
41
+ - once expression (once, _when, as_soon_as)
42
+ - let expression (a sequence with its own variable scope)
43
+ - engine.ps(wfid=nil)
44
+ - once : made sure child is cancelled as well
45
+ - :if => '${f:a} and ${f:b}'
46
+ - workitem.tags (workitem['fields']['__tags__']
47
+ - better participant initialization (Thanks Neil Pennell)
48
+ - Engine #cancel and #kill (expression or process, whichever)
49
+ - subid (sub_wfid) for every expression
50
+ - undo and redo : more robust (broken tags)
51
+ - cursor : giving a sub_wfid to children (play nice with :forget)
52
+ - Ruote.is_tree?(o) .is_definition_tree?(o) consolidated
53
+ - engine#on_error = [] registering error notifications and the like
54
+ - engine#configuration(key) (counterpart to engine#configure(key, value))
55
+ - implemented the :lose attribute
56
+ - implemented the 'lose' expression
57
+ - fixed issue with "over" (Thanks Daniel 'hassox' Neighman)
58
+ - fixed issue with workitem.command = 'jump to x' (Thanks Fix Peña)
59
+ - fixed issue with ProcessStatus#position and errors in ParticipantExpression
60
+ (Thanks Eric Smith)
61
+ - 'registerp' and 'unregisterp' expressions
62
+ - ${r:xxx} when ruby_eval_allowed == false now raises an error
63
+
64
+
5
65
  == ruote - 2.1.11 released 2010/10/01
6
66
 
7
67
  - Engine#process broken with process where schedule count > 1 (Thanks David)
data/CREDITS.txt CHANGED
@@ -2,20 +2,24 @@
2
2
  CREDITS
3
3
  =======
4
4
 
5
- Ruote (OpenWFEru) is an open source Ruby workflow (and sometimes BPM) engine.
5
+ Ruote is an open source Ruby workflow engine.
6
6
 
7
7
 
8
8
  The main project team
9
9
  ---------------------
10
10
 
11
11
  John Mettraux - http://jmettraux.wordpress.com
12
- Kenneth Kalmer - http://www.opensourcery.co.za
13
12
  Torsten Schoenebaum - http://github.com/tosch
13
+ Kenneth Kalmer - http://www.opensourcery.co.za
14
14
 
15
15
 
16
16
  Contributors
17
17
  ------------
18
18
 
19
+ Neil Pennell - http://github.com/npennel
20
+ Patrick Gannon - fix for compatibility with ruote-mongodb
21
+ Fix Peña - 'jump to' bug patch
22
+ Eric Smith - position when error patch
19
23
  David Goodlad - http://github.com/dgoodlad
20
24
  Eric Dennis - http://github.com/threetee
21
25
  David Greaves - http://github.com/lbt
@@ -43,6 +47,16 @@ Richard Jennings
43
47
  Feedback
44
48
  --------
45
49
 
50
+ Nando Sola - many help
51
+ Iuri Gagnidze - ProcessStatus#definition_name issues, Engine#leftovers
52
+ John Le - https://github.com/sandbox
53
+ Sean Johnson - https://github.com/belucid
54
+ Hery - Engine#register and block participants
55
+ Gonzalo Suarez - many many help
56
+ Rebo - 'set' issue with Sinatra
57
+ Copper Hill - test coverage enhancements
58
+ Claudio Petasecca Donati - many help
59
+ Daniel Neighman "hassox" - :on_timeout => "error" and many issue reports
46
60
  Eric Platon - engine.launch_single idea
47
61
  Marc Lee - storage.clear consistency
48
62
  Nathan Stults - enhanced dollar substitution and service
@@ -50,12 +64,10 @@ Don H. French - Engine#register_from_dir idea
50
64
  Kaspar Schiess - http://github.com/kschiess
51
65
  Oleg (foenixx) - many suggestions and bug reports
52
66
  Avishai Shalom - discussion and ideas about participant/worker locality
53
- Gonzalo Suarez - many help
54
67
  Francisco Kiko - many help
55
68
  David Goldhirsch - EM participant block
56
69
  dlamotte - set :val => nil
57
70
  jpr5 + asm
58
- Daniel Neighman "hassox" - :on_timeout => "error"
59
71
  Jason Allen - multi-instance considerations
60
72
  Petia Wohed - workflow patterns implementation evaluation
61
73
  Ralph DeGuelle - sleep silent death report
@@ -78,3 +90,9 @@ Jon "Compensator" - first report of the "yamlextras" issue
78
90
 
79
91
  (see the mailing list at : http://groups.google.com/group/openwferu-users )
80
92
 
93
+
94
+ Last but not least
95
+ ------------------
96
+
97
+ Many thanks to the authors, the contributors and the community of the Ruby language, the various json gems, the builder, mailtrap, sourcify, parsetree gems, and many more.
98
+
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- Copyright (c) 2001-2010, John Mettraux, jmettraux@gmail.com
2
+ Copyright (c) 2001-2011, 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/README.rdoc CHANGED
@@ -74,16 +74,15 @@ see http://github.com/jmettraux/ruote/tree/ruote2.1/test
74
74
  MIT
75
75
 
76
76
 
77
- == Links
77
+ == links
78
78
 
79
- http://ruote.rubyforge.org
80
- http://github.com/jmettraux/ruote
81
-
82
- http://jmettraux.wordpress.com (blog)
79
+ * http://ruote.rubyforge.org
80
+ * http://github.com/jmettraux/ruote
81
+ * http://jmettraux.wordpress.com (blog)
83
82
 
84
83
 
85
84
  == feedback
86
85
 
87
- mailing list : http://groups.google.com/group/openwferu-users
88
- irc : irc.freenode.net #ruote
86
+ * mailing list : http://groups.google.com/group/openwferu-users
87
+ * irc : irc.freenode.net #ruote
89
88
 
data/Rakefile CHANGED
@@ -1,80 +1,64 @@
1
1
 
2
- require 'lib/ruote/version.rb'
2
+ $:.unshift('.') # 1.9.2
3
3
 
4
4
  require 'rubygems'
5
+ require 'rubygems/user_interaction' if Gem::RubyGemsVersion == '1.5.0'
6
+
5
7
  require 'rake'
8
+ require 'rake/clean'
9
+ require 'rake/rdoctask'
10
+
6
11
 
7
12
  #
8
13
  # clean
9
14
 
10
- require 'rake/clean'
11
- CLEAN.include('pkg', 'rdoc', 'ruote_work', 'ruote_data', 'logs')
12
-
13
- task :default => [ :clean ]
15
+ CLEAN.include('pkg', 'rdoc', 'ruote_work', 'ruote_data')
14
16
 
15
17
 
16
18
  #
17
- # jeweler tasks
18
-
19
- begin
20
-
21
- require 'jeweler'
22
-
23
- Jeweler::Tasks.new do |gem|
24
-
25
- gem.version = Ruote::VERSION
26
- gem.name = 'ruote'
27
- gem.summary = 'an open source ruby workflow engine'
28
- gem.description = %{
29
- ruote is an open source ruby workflow engine.
30
- }
31
- gem.email = 'jmettraux@gmail.com'
32
- gem.homepage = 'http://ruote.rubyforge.org'
33
- gem.authors = [ 'John Mettraux', 'Kenneth Kalmer', 'Torsten Schoenebaum' ]
34
- gem.rubyforge_project = 'ruote'
35
- gem.test_file = 'test/test.rb'
36
-
37
- gem.add_dependency 'rufus-json', '>= 0.2.5'
38
- gem.add_dependency 'rufus-cloche', '>= 0.1.20'
39
- gem.add_dependency 'rufus-dollar'
40
- gem.add_dependency 'rufus-mnemo', '>= 1.1.0'
41
- gem.add_dependency 'rufus-scheduler', '>= 2.0.5'
42
- gem.add_dependency 'rufus-treechecker', '>= 1.0.3'
43
-
44
- gem.add_development_dependency 'rake'
45
- gem.add_development_dependency 'yard'
46
- gem.add_development_dependency 'json'
47
- gem.add_development_dependency 'builder'
48
- gem.add_development_dependency 'mailtrap'
49
- gem.add_development_dependency 'jeweler'
50
-
51
- # Gem::Specification http://www.rubygems.org/read/chapter/20
52
- end
53
- Jeweler::GemcutterTasks.new
19
+ # test
54
20
 
55
- rescue LoadError
56
- puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
21
+ task :test do
22
+
23
+ sh 'ruby -I. test/unit/test.rb'
24
+ sh 'ruby -I. test/functional/test.rb'
57
25
  end
58
26
 
27
+ task :default => [ :test ]
28
+
59
29
 
60
30
  #
61
- # rdoc
31
+ # gem
32
+
33
+ GEMSPEC_FILE = Dir['*.gemspec'].first
34
+ GEMSPEC = eval(File.read(GEMSPEC_FILE))
35
+ GEMSPEC.validate
36
+
37
+
38
+ desc %{
39
+ builds the gem and places it in pkg/
40
+ }
41
+ task :build do
42
+
43
+ sh "gem build #{GEMSPEC_FILE}"
44
+ sh "mkdir pkg" rescue nil
45
+ sh "mv #{GEMSPEC.name}-#{GEMSPEC.version}.gem pkg/"
46
+ end
47
+
48
+ desc %{
49
+ builds the gem and pushes it to rubygems.org
50
+ }
51
+ task :push => :build do
52
+
53
+ sh "gem push pkg/#{GEMSPEC.name}-#{GEMSPEC.version}.gem"
54
+ end
62
55
 
63
- #begin
64
- # require 'yard'
65
- # YARD::Rake::YardocTask.new do |doc|
66
- # doc.options = [ '-o', 'rdoc', '--title', "ruote #{Ruote::VERSION}" ]
67
- # end
68
- #rescue LoadError
69
- # task :yard do
70
- # abort 'YARD is not available. In order to run yardoc, you must: sudo gem install yard'
71
- # end
72
- #end
73
56
 
74
57
  #
75
- # make sure to have rdoc 2.5.x to run that
58
+ # rdoc
76
59
  #
77
- require 'rake/rdoctask'
60
+ # make sure to have rdoc 2.5.x to run that
61
+
78
62
  Rake::RDocTask.new do |rd|
79
63
 
80
64
  rd.main = 'README.rdoc'
@@ -83,14 +67,16 @@ Rake::RDocTask.new do |rd|
83
67
  rd.rdoc_files.include(
84
68
  'README.rdoc', 'CHANGELOG.txt', 'CREDITS.txt', 'lib/**/*.rb')
85
69
 
86
- rd.title = "ruote #{Ruote::VERSION}"
70
+ rd.title = "#{GEMSPEC.name} #{GEMSPEC.version}"
87
71
  end
88
72
 
89
73
 
90
74
  #
91
75
  # upload_rdoc
92
76
 
93
- desc 'Upload the documentation to rubyforge'
77
+ desc %{
78
+ upload the rdoc to rubyforge
79
+ }
94
80
  task :upload_rdoc => [ :clean, :rdoc ] do
95
81
 
96
82
  account = 'jmettraux@rubyforge.org'
@@ -99,3 +85,16 @@ task :upload_rdoc => [ :clean, :rdoc ] do
99
85
  sh "rsync -azv -e ssh rdoc #{account}:#{webdir}/"
100
86
  end
101
87
 
88
+
89
+ desc %{
90
+ attempt at detecting test methods with the same name
91
+ }
92
+ task :doublons do
93
+
94
+ lines = `grep -r " def test_" test/ | sort`.split("\n")
95
+ lines.inject(nil) do |previous, line|
96
+ p line if line == previous
97
+ line
98
+ end
99
+ end
100
+
data/TODO.txt CHANGED
@@ -79,7 +79,6 @@
79
79
  [o] pdef.to_dot (a beginning)
80
80
  [o] @in_cancel, @in_error --> @state (active|cancelling|killing)
81
81
  [o] wait
82
- [o] listen
83
82
  [o] Jason Allen's check about concurrence
84
83
  [x] on_cancel => 'error' NO
85
84
  [o] event on [un]setting variable
@@ -234,12 +233,64 @@
234
233
  [o] lib/ruote/svc for treechecker, error_handler and co (tree_checker)
235
234
  [o] part/template.rb, use Rufus::Json.pretty_encode
236
235
  [o] storage.clear OR storage.purge! OR both (cf discussion with marc_lee) !!
237
-
238
- [ ] exp : exp (restricted form of eval ?)
239
- [ ] exp : case (is it necessary ?)
240
- [ ] exp : filter
241
- [ ] exp : filter-definition
242
- [x] exp : lose ?
236
+ [o] Nathan : throw error on ${ruby:...} when ruby_eval_allowed is not set
237
+ [o] engine.kill and engine.cancel should accept fei, fexp or wfid
238
+ [o] participant params['tags'] = [ a, b, c ] ? costly (x expressions to read)
239
+ but passing them in the workitem could be fun
240
+ field['__tags__'] ?
241
+ [x] use treetop for more complex "${f:x} AND ${f:y}" ?
242
+ (systems like Rails require it anyway)
243
+ NO : using ruby_parser instead
244
+ [o] TreeChecker : exclude_fvccall :at_exit
245
+ [o] _if '${f:x} == ${f:y} || ${f:x} == ${f:z}'
246
+ [x] beanstalk [as a] workqueue ?
247
+ [o] tree.to_xml (require builder ?)
248
+ [o] tree.to_ruby
249
+ [o] __command__ + tag (rewind that cursor there, not the current one)
250
+ [o] rewind 'x' where x is a tagname (command x)
251
+ [o] solve the ps#root_expression_for(fei) dilemma
252
+ [x] condition : "${f:x} [is] empty" / this one is hard
253
+ [o] when : add test for cancelling when child has been triggered / is running
254
+ [o] engine.ps(wfid)
255
+ [x] alias "when" to "whenever" ?
256
+ [x] alias "when" to "on" / "upon"
257
+ [o] alias "when" to "once" "once x == y do"
258
+ [o] condition : "${'x} [is] empty" since ${array} => "[]"
259
+ [x] simple worker hooks ? (as discussed with @hassox)
260
+ on_terminate... ? only works in the same process as the worker
261
+ only for tests...
262
+ [o] on_error => retry / pass
263
+ [o] workitem : #as_json and #from_json
264
+ since ruote depends on rufus-json...
265
+ [x] engine.on_error = 'participant_name' // 'subprocess_name'
266
+ done at : http://github.com/jmettraux/ruote/commit/50292d954ff877f1f6615022216f346a7001b483
267
+ `--> reverting that for now, too dangerous
268
+ [o] process_count and error_count ? (processes(:count => true))
269
+ [o] exp : case (is it necessary ?) (guards ?) (hard for ruote-fluo)
270
+ [o] exp : lose
271
+ [o] conditional : rprefix ! ${r:x} is perhaps sufficient
272
+ [o] implement kill_process! (kill_expression! ?)
273
+ [o] /!\ resurrect CI
274
+ [o] user3 :rif => "!wi.fields['approvers'].include?('user3')" : 'in' operator
275
+ "${customer} in [ 1, 2, 3 ]"
276
+ "${customer} in { 'x' => 1 }"
277
+ [o] rename 'parser' to 'reader'
278
+ [o] ft_42 : maybe require storage to output ids already sorted
279
+ [o] Participant#rtimeout(workitem=nil)
280
+ [o] alias concurrent-iterator to citerator
281
+ [o] like we have a default WaitLogger, why not have a default HistoryLogger ?
282
+ so that context.history always returns something...
283
+ the default history would be storage based but with LRU turned on
284
+ for the HashStorage one...
285
+ like WaitLogger only remembers 147 msgs...
286
+ [o] StorageHistory : add a method to list all wfids (for by_wfid)
287
+ [o] DefaultHistory : add a method to list all wfids (for by_wfid)
288
+ [x] issue with ruote-kit and inpa participants...
289
+ [x] .nil? .empty? .set? for "${x}.nil?"
290
+
291
+ [ ] exp : exp (restricted form of eval ?) (is it apply ?)
292
+ [x] exp : filter
293
+ [x] exp : filter-definition
243
294
  [x] exp : parameter
244
295
  [ ] exp : log : or could it be a participant ?
245
296
 
@@ -248,25 +299,15 @@
248
299
  [ ] exp : field / attribute (not really necessary)
249
300
  [ ] exp : variable (not really necessary)
250
301
 
251
- [ ] conditional : rprefix ! ${r:x} is perhaps sufficient
252
-
253
302
  [ ] define without name (__result__)
254
303
 
255
- [ ] pooltool.ru
256
-
257
304
  [ ] participant dispatch thread throttling ?
258
305
 
259
306
  [ ] tailcall
260
307
  [ ] subprocesses participants (alias ?)
261
308
 
262
- [ ] __command__ + tag (rewind that cursor there, not the current one)
263
-
264
- [ ] beanstalk [as a] workqueue ?
265
-
266
309
  [ ] recursion : should cope with modified trees 'main' => :tree ??
267
310
 
268
- [ ] user3 :rif => "!wi.fields['approvers'].include?('user3')" : 'in' operator
269
-
270
311
  [ ] set :var => 'y' { '2342342' }
271
312
 
272
313
  [ ] pause engine
@@ -277,9 +318,6 @@
277
318
 
278
319
  [ ] file/fs_listener [example] ?
279
320
 
280
- [ ] tree.to_xml (require builder ?)
281
- [ ] tree.to_rb
282
-
283
321
  [ ] concurrence / concurrent_iterator : merge plugin ?
284
322
  use participant for that ?
285
323
 
@@ -300,26 +338,11 @@
300
338
 
301
339
  [ ] @children diff/undiff idea ?
302
340
 
303
- [ ] write doc about engine options (multi-process !)
304
- [ ] _if '${f:x} == ${f:y} || ${f:x} == ${f:z}'
305
-
306
- [ ] document the dollar notation / substitution / extrapolation
307
-
308
- [ ] condition : "${f:x} [is] empty" / this one is hard
309
-
310
- [ ] ruote/exp/fe_set.rb:147: warning: already initialized constant PREFIX_REGEX
311
-
312
- [ ] implement kill_process! (kill_expression! ?)
313
-
314
- [ ] engine.force_reply_to_parent(fei) ?
315
-
316
341
  [ ] :on_timeout => :rewind (break, jump to x)...
317
- [ ] rewind 'x' where x is a tagname (command x)
342
+ [ ] :on_error => :rewind (break, jump to x)...
318
343
 
319
344
  [ ] repeat : have a counter in a variable (:to => x maybe) (subprocessid ?)
320
345
 
321
- [ ] when : add test for cancelling when child has been triggered / is running
322
-
323
346
  [ ] engine.cancel_forgotten_children(wfid) ?
324
347
 
325
348
  [ ] port subprocess on_cancel test from ruote 0.9 http://groups.google.com/group/openwferu-users/t/75f02bdadf7b93eb
@@ -327,30 +350,19 @@
327
350
  [ ] double-check on_cancel rewrite (ft_1_process_status)
328
351
 
329
352
  [ ] verify get_last/get_raw logic, no + 0.0001...
330
- [ ] case exp : smarter one ?
331
353
  [ ] spare 1 get_msg by caching msg (but keep 'deleting')
332
354
  [ ] [un]set_var : via message ? should be ok like that... Not much traffic there
333
355
 
334
356
  [ ] empty iterator or concurrent-iterator, log ? crash ? empty while...
335
- [ ] at expression ?
336
357
 
337
358
  [ ] remove abort_on_exception=true
338
359
 
339
360
  [ ] shell ? irb ? Shell.new(storage)
340
361
  [ ] focus on fulldup or json.dup (via fulldup ?)
341
362
 
342
- [ ] listen to participants/errors/tags {in|out}
343
-
344
- [x] engine.on_error = 'participant_name' // 'subprocess_name'
345
- done at : http://github.com/jmettraux/ruote/commit/50292d954ff877f1f6615022216f346a7001b483
346
- `--> reverting that for now, too dangerous
347
-
348
- [ ] should __error__ contain the tree ?
363
+ [ ] should __error__ contain the tree ?
349
364
  [ ] engine.on_cancel = 'participant_name' // 'subprocess_name'
350
-
351
- [ ] "business days" plugin
352
-
353
- [ ] issue with ruote-kit and inpa participants...
365
+ bof
354
366
 
355
367
  [ ] participant :ref => '${f:nada}', :or => 'xyz'
356
368
  (look at OpenWFE manual, this feature already existed in there)
@@ -360,8 +372,6 @@
360
372
 
361
373
  [ ] LocalParticipant def consume; handle; reply; end
362
374
 
363
- [ ] lib/ruote/part/participant_list.rb l176 better error message !
364
-
365
375
  [ ] find better solution than "get all schedules"
366
376
 
367
377
  [ ] worker : minuteman, make it cron triggerable
@@ -369,14 +379,10 @@
369
379
  maybe it's expensive to fire a [worker] process each minute
370
380
  have to write the $$ (pid) somewhere for cron to pick it up
371
381
 
372
- [ ] detach / attach segments of processes
373
- [ ] clone process ? (could be used by {de|at}tach)
374
-
375
- [ ] dollar.rb ${timestamp} ?
376
-
377
382
  [ ] toto :task => 'maw the lawn', :within => '3d'
378
-
379
- [ ] solve the ps#root_expression_for(fei) dilemma
383
+ alias to timeout
384
+ [ ] "business days" plugin
385
+ [ ] participant 'toto', :while => '${not_good}' (really ?)
380
386
 
381
387
  [ ] re_apply_stalled
382
388
  http://groups.google.com/group/openwferu-users/browse_thread/thread/ff29f26d6b5fd135
@@ -387,21 +393,87 @@
387
393
  configuration issue
388
394
  maybe fail with a good error message when registering service...
389
395
 
390
- [ ] participant 'toto', :while => '${not_good}' (really ?)
391
-
392
396
  [ ] engine.register_from_dir() have a way to re-evaluate the dir
393
397
  [o] OR remove engine.register_from_dir()
394
398
  [o] AND provide a better register &block
395
399
  [o] provide a mean for a participant to reject a workitem (intra plist)
396
400
  on_reply and now filter ?
397
401
 
398
- [ ] rw : upgrade [register_]participant documentation
399
-
400
402
  [ ] StorageParticipant#by_store[_name]
401
403
  maybe : reform the store_name system !
402
404
 
403
- [ ] rename 'parser' to 'reader'
405
+ [ ] a run of ruby -w
406
+
407
+ [x] cursor : previous_command field ? not really necessary with :break_if => x
408
+
409
+ [ ] register :overwrite { ... } ? (wipes all the participants)
410
+
411
+ [ ] storage_participant.by_participant([ a, b, c, d ], opts)
412
+ storage_participant.by_participant(a, b, c, d, opts) too
413
+ leverage things like
414
+ http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options
415
+ 2.1.12
416
+
417
+ [ ] receiver/base.rb : fexp.lookup_variable --> lookup_variable ?
418
+
419
+ [ ] engine/receiver #reply(workitem or fexp or fei) ?
420
+ [ ] workitem : short constructor, cf http://groups.google.com/group/openwferu-users/browse_thread/thread/c52d207d85e4b93e
421
+ [ ] engine.force_reply_to_parent(fei) ?
422
+ but, this is a cancel_expression(fei)
423
+
424
+ [ ] at expression ? :names :wait, :at
425
+
426
+ [ ] concurrence : add_child ?
427
+ How would that impact concurrent_iterator's add_branches ?
428
+ [ ] detach / attach segments of processes
429
+ [ ] clone process ? (could be used by {de|at}tach)
430
+
431
+ [ ] console for InformatiQ / console or dashboard or tool ?
432
+ [ ] pooltool.ru : there are already storage copy methods
433
+
434
+ [ ] BlockParticipant : proc.to_source thanks to sourcify
435
+
436
+ [o] doc : enhance doc on conditional (and, empty, null, ...)
437
+ [o] doc : document engine.on_{error|terminate}
438
+ [o] doc : document on_error = retry and on_error = pass
439
+ [ ] doc : add piece of doc about running workers on their own
440
+
441
+ [ ] listen to errors {in|out}
442
+ well... there is already on_error...
443
+ but on_error is for nested stuff...
444
+ [o] listen to tags {entering|leaving}
445
+ [x] listen to launch/terminate, listen :process => :x, :upon => 'launching'
446
+ you can now set :tag on a subprocess' define
447
+ [ ] listen to [un]set variable (the events are already in there)
448
+ not really necessary... there is already 'once' (when)
449
+ [o] listen condition ? :when => '${x} == y', :constraint, :only, ...
450
+ it's :where and it's not documented :-( but it's tested :-)
451
+ [o] engine#on_terminate, similar to on_error
452
+ [o] let engine#on_error use svc/tracker.rb instead of 'notifications'
453
+
454
+ [ ] ruote cheatsheet
455
+ [ ] ruote slides
456
+
457
+ [ ] process supervise other process, listen...
458
+ launch a process with a designed 'supervisor' ?
459
+
460
+ [x] ci : ruote-amqp
461
+ [ ] ci : ruote-mongodb
462
+ [ ] ci : jruby
463
+
464
+ [ ] StorageParticipant#reply : raise if workitem not found ?
465
+ [ ] StorageParticipant#reply : accept fei ?
466
+ [ ] Engine#reply(wi), should remove from storage...
467
+
468
+ [ ] eft_18 weak with jruby-1.5.1 and 1.5.6
469
+
470
+ [ ] participant : consume/cancel/accept?/on_reply without params
471
+
472
+ [ ] worker identification/registration
473
+ http://groups.google.com/group/openwferu-users/browse_thread/thread/c51b94fb8bb685da
474
+ [ ] worker shutdown initiated by engine (same thread)
475
+
476
+ [ ] wait_for(:participant) what about 'dispatched' instead of 'dispatch' ?
404
477
 
405
- [ ] process_count and error_count ? (processes(:count => true))
406
- [ ] engine.ps(wfid) (shortcut ?)
478
+ [ ] expression :concurrent => true idea (reply immediately, cancellable)
407
479