bpm_manager 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -7
- data/lib/bpm_manager.rb +12 -2
- data/lib/bpm_manager/version.rb +1 -1
- data/spec/server_spec.rb +21 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ba8b2de2e1789997cc3d7d2761ba7435f3c0344
|
4
|
+
data.tar.gz: bc922afda55dcf5df17e6f8876347ecb9cfe5a9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc8fbc0e9b7937f099da2040ee83390cf527fa6c75036acaba7f489fe7c6e9fc80ce895cb55432cf962b7e39aa45401a7515436eed9ff8bdd2928000e5a5b2fa
|
7
|
+
data.tar.gz: a74982320c8044c4f03f1311911a96c8c6961a3396d08fdf1bd3ec9ba4b4ab2cab4ebaa22275eed855d804d62608ed16dac00ebc5cd8e82b96562057ffc997c0
|
data/README.md
CHANGED
@@ -43,18 +43,24 @@ Then make an API call like this:
|
|
43
43
|
result = BpmManager.deployments()
|
44
44
|
```
|
45
45
|
|
46
|
-
## Quick
|
46
|
+
## Quick Examples
|
47
47
|
|
48
|
-
Get all the tasks for an user id
|
49
48
|
|
50
49
|
```ruby
|
51
|
-
|
52
|
-
|
50
|
+
# Get all the Deployments
|
51
|
+
BpmManager.deployments
|
53
52
|
|
54
|
-
Get all the
|
53
|
+
# Get all the Tasks for an User ID
|
54
|
+
BpmManager.tasks('foo@bar.com')
|
55
55
|
|
56
|
-
|
56
|
+
# Get all the Tasks with options (RedHat example). It supports all REST API options.
|
57
57
|
BpmManager.tasks({:ownerId => 'foo@bar.com', :processInstanceId => 3})
|
58
|
+
|
59
|
+
# Get all the Process Instances
|
60
|
+
BpmManager.process_instances
|
61
|
+
|
62
|
+
# Get the Process Instance with ID = 3
|
63
|
+
BpmManager.process_instance(3)
|
58
64
|
```
|
59
65
|
|
60
66
|
## Contributing
|
@@ -67,4 +73,4 @@ BpmManager.tasks({:ownerId => 'foo@bar.com', :processInstanceId => 3})
|
|
67
73
|
|
68
74
|
## License
|
69
75
|
|
70
|
-
|
76
|
+
BpmManager is released under the MIT License.
|
data/lib/bpm_manager.rb
CHANGED
@@ -41,13 +41,23 @@ module BpmManager
|
|
41
41
|
return JSON.parse(RestClient.get(BpmManager.uri('/deployment'), :accept => :json))
|
42
42
|
end
|
43
43
|
|
44
|
-
# Gets all
|
44
|
+
# Gets all tasks, optionally you could specify an user id
|
45
45
|
def self.tasks(user_id = "")
|
46
46
|
return JSON.parse(RestClient.get(BpmManager.uri('/task/query' + (user_id.empty? ? '' : '?taskOwner=' + user_id)), :accept => :json))
|
47
47
|
end
|
48
48
|
|
49
|
-
# Gets all
|
49
|
+
# Gets all tasks with options
|
50
50
|
def self.tasks_with_opts(opts = {})
|
51
51
|
return JSON.parse(RestClient.get(BpmManager.uri('/task/query' + (opts.empty? ? '' : '?' + opts.map{|k,v| k.to_s + '=' + v.to_s}.join('&'))), :accept => :json))
|
52
52
|
end
|
53
|
+
|
54
|
+
# Gets all Process Instances
|
55
|
+
def self.process_instances
|
56
|
+
return JSON.parse(RestClient.get(BpmManager.uri('/history/instances'), :accept => :json))
|
57
|
+
end
|
58
|
+
|
59
|
+
# Gets a Process Instance
|
60
|
+
def self.process_instance(process_instance_id = 0)
|
61
|
+
return JSON.parse(RestClient.get(BpmManager.uri('/history/instance/' + process_instance_id.to_s), :accept => :json))
|
62
|
+
end
|
53
63
|
end
|
data/lib/bpm_manager/version.rb
CHANGED
data/spec/server_spec.rb
CHANGED
@@ -65,11 +65,31 @@ describe "BpmManager" do
|
|
65
65
|
|
66
66
|
describe "#tasks_with_opts" do
|
67
67
|
before :each do
|
68
|
-
@tasks = BpmManager.tasks_with_opts(
|
68
|
+
@tasks = BpmManager.tasks_with_opts(:ownerId => 'foo@bar.com', :taskId => 1)
|
69
69
|
end
|
70
70
|
|
71
71
|
it "must return something" do
|
72
72
|
expect(@tasks.length).to be > 0
|
73
73
|
end
|
74
74
|
end
|
75
|
+
|
76
|
+
describe "#process_instances" do
|
77
|
+
before :each do
|
78
|
+
@processes = BpmManager.process_instances
|
79
|
+
end
|
80
|
+
|
81
|
+
it "must return something" do
|
82
|
+
expect(@processes.length).to be > 0
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe "#process_instance" do
|
87
|
+
before :each do
|
88
|
+
@process = BpmManager.process_instance(1)
|
89
|
+
end
|
90
|
+
|
91
|
+
it "must return something" do
|
92
|
+
expect(@process.length).to be > 0
|
93
|
+
end
|
94
|
+
end
|
75
95
|
end
|