bpm_manager 0.6.12 → 0.6.14
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.
- checksums.yaml +4 -4
- data/README.md +13 -2
- data/lib/bpm_manager/oracle.rb +7 -21
- data/lib/bpm_manager/version.rb +1 -1
- data/spec/oracle_spec.rb +36 -36
- 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: 52c9444988d31991bd7f8ca50828801f4cb76aeb
|
4
|
+
data.tar.gz: 184dacdfd79a15cc7dd2cf66cf7616211a73504c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42bae33ce94682a72cb0f3c069a3cfb42063fe592e4007ee1cdd3c3e8b60791b3107ab059c1880cc8db69bc5c2277e1c06c7a69a39ad7121e619d892f106ed71
|
7
|
+
data.tar.gz: 6862ccb3e71dfb6cfb03400c837e204f3ea11a544e38f8f283703a7dafeae70f68b4c25899a166d6fb5df5230b8680877cafd1387bdb34b02dfa078115cc6a8f
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ Also do not forget to execute the initializer with:
|
|
25
25
|
|
26
26
|
## Usage
|
27
27
|
|
28
|
-
First configure properly the gem using the bpm_manager.rb file in 'config/initializers/bpm_manager.rb' or calling
|
28
|
+
First configure properly the gem using the bpm_manager.rb file in 'config/initializers/bpm_manager.rb' or calling:
|
29
29
|
|
30
30
|
```ruby
|
31
31
|
BpmManager.configure do |config|
|
@@ -62,9 +62,20 @@ BpmManager::RedHat.process_instances
|
|
62
62
|
BpmManager::RedHat.process_instance(3)
|
63
63
|
```
|
64
64
|
|
65
|
+
## Quick Examples for Oracle
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
# Get all Tasks
|
69
|
+
BpmManager::Oracle.tasks
|
70
|
+
|
71
|
+
# Get all the Tasks for an User ID
|
72
|
+
BpmManager::Oracle.tasks('foo@bar.com')
|
73
|
+
```
|
74
|
+
|
65
75
|
## Note
|
66
76
|
|
67
|
-
Tasks and Process structures includes a :data method in which returns the JSON raw data from server
|
77
|
+
Tasks and Process structures includes a :data method in which returns the JSON raw data from server.
|
78
|
+
Oracle is only supported by a third-party REST API. The native API do not support all the required features.
|
68
79
|
|
69
80
|
## Contributing
|
70
81
|
|
data/lib/bpm_manager/oracle.rb
CHANGED
@@ -4,11 +4,6 @@ require "ostruct"
|
|
4
4
|
|
5
5
|
module BpmManager
|
6
6
|
module Oracle
|
7
|
-
# Gets all server deployments
|
8
|
-
# def self.deployments()
|
9
|
-
# return JSON.parse(RestClient.get(BpmManager.uri('/deployment'), :accept => :json))
|
10
|
-
# end
|
11
|
-
|
12
7
|
# Gets all tasks, optionally you could specify an user id
|
13
8
|
def self.tasks(user_id = "")
|
14
9
|
self.structure_task_data(JSON.parse(RestClient.get(BpmManager.uri('/tasks' + (user_id.empty? ? '' : '/' + user_id)), :accept => :json)))
|
@@ -29,19 +24,10 @@ module BpmManager
|
|
29
24
|
JSON.parse(RestClient.get(BpmManager.uri('/process/' + process_instance_id.to_s), :accept => :json))
|
30
25
|
end
|
31
26
|
|
32
|
-
# Gets a Process Instance Variables
|
33
|
-
# def self.process_instance_variables(deployment_id, process_instance_id)
|
34
|
-
# begin
|
35
|
-
# JSON.parse(RestClient.get(BpmManager.uri('/runtime/' + deployment_id.to_s + '/withvars/process/instance/' + process_instance_id.to_s), :accept => :json))['variables']
|
36
|
-
# rescue
|
37
|
-
# return nil
|
38
|
-
# end
|
39
|
-
# end
|
40
|
-
|
41
27
|
# Assigns a Task for an User
|
42
|
-
|
43
|
-
|
44
|
-
|
28
|
+
def self.assign_task(task_id, user_id)
|
29
|
+
RestClient.post(URI.encode(BpmManager.uri('/task/assign/' + task_id.to_s + '/' + user_id.to_s)), :headers => {:content_type => :json, :accept => :json})
|
30
|
+
end
|
45
31
|
|
46
32
|
# Starts a Task
|
47
33
|
# def self.start_task(task_id)
|
@@ -64,9 +50,9 @@ module BpmManager
|
|
64
50
|
# end
|
65
51
|
|
66
52
|
# Releases a Task
|
67
|
-
|
68
|
-
|
69
|
-
|
53
|
+
def self.release_task(task_id)
|
54
|
+
RestClient.post(URI.encode(BpmManager.uri('/task/release/' + task_id.to_s)), :headers => {:content_type => :json, :accept => :json})
|
55
|
+
end
|
70
56
|
|
71
57
|
# Skips a Task
|
72
58
|
# def self.skip_task(task_id)
|
@@ -98,7 +84,7 @@ module BpmManager
|
|
98
84
|
my_task.process = OpenStruct.new
|
99
85
|
process_info = (task['processInfo'].nil? || task['processInfo'].empty?) ? '' : JSON.parse(task['processInfo']).first
|
100
86
|
|
101
|
-
my_task.id = task['
|
87
|
+
my_task.id = task['id']
|
102
88
|
my_task.process_instance_id = task['processInstanceId']
|
103
89
|
my_task.parent_id = ''
|
104
90
|
my_task.created_on = Date.parse(task['created_on'])
|
data/lib/bpm_manager/version.rb
CHANGED
data/spec/oracle_spec.rb
CHANGED
@@ -82,34 +82,34 @@ describe BpmManager do
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
85
|
+
describe "#tasks_with_opts" do
|
86
|
+
before :each do
|
87
|
+
@tasks = BpmManager::Oracle.tasks_with_opts(:processInstanceId => 1)
|
88
|
+
end
|
89
89
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
90
|
+
it "task should include the all attributes" do
|
91
|
+
expect(@tasks.first.methods).to include(:id)
|
92
|
+
expect(@tasks.first.methods).to include(:process_instance_id)
|
93
|
+
expect(@tasks.first.methods).to include(:parent_id)
|
94
|
+
expect(@tasks.first.methods).to include(:created_on)
|
95
|
+
expect(@tasks.first.methods).to include(:active_on)
|
96
|
+
expect(@tasks.first.methods).to include(:name)
|
97
|
+
expect(@tasks.first.methods).to include(:owner)
|
98
|
+
expect(@tasks.first.methods).to include(:status)
|
99
|
+
expect(@tasks.first.methods).to include(:subject)
|
100
|
+
expect(@tasks.first.methods).to include(:description)
|
101
|
+
expect(@tasks.first.methods).to include(:data)
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
103
|
+
expect(@tasks.first.process.methods).to include(:id)
|
104
|
+
expect(@tasks.first.process.methods).to include(:deployment_id)
|
105
|
+
expect(@tasks.first.process.methods).to include(:instance_id)
|
106
|
+
expect(@tasks.first.process.methods).to include(:start_on)
|
107
|
+
expect(@tasks.first.process.methods).to include(:name)
|
108
|
+
expect(@tasks.first.process.methods).to include(:version)
|
109
|
+
expect(@tasks.first.process.methods).to include(:creator)
|
110
|
+
expect(@tasks.first.process.methods).to include(:data)
|
111
|
+
end
|
112
|
+
end
|
113
113
|
|
114
114
|
# describe "#process_instances" do
|
115
115
|
# before :each do
|
@@ -141,21 +141,21 @@ describe BpmManager do
|
|
141
141
|
# end
|
142
142
|
# end
|
143
143
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
144
|
+
describe "#assign_task" do
|
145
|
+
before :each do
|
146
|
+
@result = BpmManager::Oracle.assign_task(1,'ariel@beatcoding.com')
|
147
|
+
end
|
148
148
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
149
|
+
it "must return something" do
|
150
|
+
expect(@result.length).to be > 0
|
151
|
+
end
|
152
|
+
end
|
153
153
|
|
154
154
|
# describe "#release_task" do
|
155
155
|
# before :each do
|
156
156
|
# @result = BpmManager::Oracle.release_task(1)
|
157
157
|
# end
|
158
|
-
|
158
|
+
|
159
159
|
# it "must return something" do
|
160
160
|
# expect(@result.length).to be > 0
|
161
161
|
# end
|
@@ -165,7 +165,7 @@ describe BpmManager do
|
|
165
165
|
# before :each do
|
166
166
|
# @result = BpmManager::Oracle.complete_task(1)
|
167
167
|
# end
|
168
|
-
|
168
|
+
|
169
169
|
# it "must return something" do
|
170
170
|
# expect(@result.length).to be > 0
|
171
171
|
# end
|