public
Description: RESTful workflow / bpm engine based on Rack and OpenWFEru
Homepage: http://openwferu.rubyforge.org
Clone URL: git://github.com/jmettraux/ruote-rest.git
Search Repo:
now returning 303 on delete (Location => containing resource)
jmettraux (author)
Wed Apr 30 18:19:45 -0700 2008
commit  83ff8d09a36abc8452a573179e7a7b2b714f9ffa
tree    8d8324fd5c852a5106fea21c7591dd42fb1b0a7f
parent  a783518e4c3fc5c9937b74a4882ebc8496e6022a
...
19
20
21
22
 
 
23
24
25
...
44
45
46
47
 
 
48
49
50
51
52
53
 
 
54
55
56
...
127
128
129
130
 
 
131
132
133
...
19
20
21
 
22
23
24
25
26
...
45
46
47
 
48
49
50
51
52
53
54
 
55
56
57
58
59
...
130
131
132
 
133
134
135
136
137
0
@@ -19,7 +19,8 @@ To prepare the development database
0
 
0
     rake recreate_mysql_db
0
 
0
-Expects a mysql db with a 'root' admin account with sufficient access rights. It will create a database named "ruoterest_development".
0
+Expects a mysql db with a 'root' admin account with sufficient access rights.
0
+It will create a database named "ruoterest_development".
0
 
0
 (
0
 To prepare the test database
0
@@ -44,13 +45,15 @@ Then head to
0
 
0
 == interface
0
 
0
-By default, XML representations will be returned. The 'Accept' header is used to determine which representation the client expects.
0
+By default, XML representations will be returned. The 'Accept' header is used
0
+to determine which representation the client expects.
0
 
0
 The 'format' query parameter can be used to override that, like in
0
 
0
      GET /processes?format=json
0
 
0
-For debugging purposes, you can force to a text/plain content type with 'plain' :
0
+For debugging purposes, you can force to a text/plain content type
0
+with 'plain' :
0
 
0
     GET /workitems?format=json&plain=true
0
 
0
@@ -127,7 +130,8 @@ GET /workitems?wfid=x
0
 PUT /workitems/{wid}
0
 
0
     updates a workitem
0
- If the workitem field '_state' is set to 'proceeded' the workitem will resume its travel in its business process
0
+ If the workitem field '_state' is set to 'proceeded' the workitem will
0
+ resume its travel in its business process
0
 
0
 
0
 == license
...
69
70
71
72
 
 
 
73
74
75
...
69
70
71
 
72
73
74
75
76
77
0
@@ -69,7 +69,9 @@ delete "/expressions/:wfid/:expid" do
0
 
0
     $engine.cancel_expression e
0
 
0
- response.status = 204
0
+ response.status = 303
0
+ header "Location" => request.link(:expressions, params[:wfid])
0
+ "expression at #{e.link} cancelled (terminated)"
0
 end
0
 
0
 
...
71
72
73
74
 
 
 
75
76
77
...
71
72
73
 
74
75
76
77
78
79
0
@@ -71,7 +71,9 @@ delete "/participants/:pid" do
0
 
0
     $engine.unregister_participant pid
0
 
0
- response.status = 204
0
+ response.status = 303
0
+ header "Location" => request.link(:participants)
0
+ "participant #{pid} removed"
0
 end
0
 
0
 
...
112
113
114
115
 
 
 
116
117
118
...
112
113
114
 
115
116
117
118
119
120
0
@@ -112,7 +112,9 @@ delete "/processes/:wfid" do
0
 
0
     sleep 0.350
0
 
0
- response.status = 204
0
+ response.status = 303
0
+ header "Location" => request.link(:processes)
0
+ "process #{wfid} deleted"
0
 end
0
 
0
 
...
79
80
81
82
 
83
84
85
...
79
80
81
 
82
83
84
85
0
@@ -79,7 +79,7 @@ class StExpressionsTest < Test::Unit::TestCase
0
 
0
         delete_it "/expressions/#{fei.wfid}/0"
0
 
0
- assert_equal 204, @response.status
0
+ assert_equal 303, @response.status
0
 
0
         sleep 0.350
0
 
...
52
53
54
55
 
56
57
58
...
52
53
54
 
55
56
57
58
0
@@ -52,7 +52,7 @@ class StParticipantsTest < Test::Unit::TestCase
0
 
0
         delete_it "/participants/2"
0
 
0
- assert_equal 204, @response.status
0
+ assert_equal 303, @response.status
0
 
0
         get_it "/participants"
0
 
...
87
88
89
90
 
91
92
93
...
87
88
89
 
90
91
92
93
0
@@ -87,7 +87,7 @@ class StProcessesTest < Test::Unit::TestCase
0
 
0
         delete_it "/processes/#{fei.wfid}"
0
 
0
- assert_equal 204, @response.status
0
+ assert_equal 303, @response.status
0
 
0
         sleep 0.350
0
 
...
12
13
14
15
 
16
17
18
...
12
13
14
 
15
16
17
18
0
@@ -12,7 +12,7 @@ module TestBase
0
     def setup
0
 
0
         FileUtils.rm_rf 'work_test'
0
- FileUtils.mkdir 'logs'
0
+ FileUtils.mkdir 'logs' unless File.exist?('logs')
0
 
0
         OpenWFE::Extras::Workitem.delete_all
0
         OpenWFE::Extras::Field.delete_all
...
31
32
33
 
34
35
36
...
31
32
33
34
35
36
37
0
@@ -31,6 +31,7 @@
0
         <% if @expression.children %>
0
             children :
0
             <% @expression.children.each do |eid| %>
0
+ <% next unless eid.respond_to?(:link) %>
0
                 <div>&nbsp;&nbsp;<a href="<%= eid.link %>">GET <%= eid.link %></a></div>
0
             <% end %>
0
         <% end %>
...
37
38
39
40
 
 
 
 
 
 
 
41
42
43
...
37
38
39
 
40
41
42
43
44
45
46
47
48
49
0
@@ -37,7 +37,13 @@
0
 <body>
0
 
0
 <div class="header">
0
- <a href="http://openwferu.rubyforge.org/index.html#rr">OpenWFEru</a> ruote-rest
0
+ <div class="h_left" style="float: left;">
0
+ <a href="http://openwferu.rubyforge.org/index.html#rr">OpenWFEru</a> ruote-rest
0
+ </div>
0
+ <div class="h_right" style="float: right;">
0
+ <span><%= response.status %></span>
0
+ </div>
0
+ <div style="clear: both;"></div>
0
 </div>
0
 <hr/>
0
 

Comments

    No one has commented yet.