bpm_manager 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bpm_manager/red_hat.rb +41 -8
- data/lib/bpm_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d23c40031bbbc734dd9c42f30ad459792912585
|
4
|
+
data.tar.gz: b486afbd3ec775a3779c28a31adb516889167e9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4f84c75a05f49cae6607886b6fd8ce12dc80cc841222a473d4099df3585ca65437e74ad8858586a58b34861b0a88759232466acaedd4c9484726e0f8b7dac3a
|
7
|
+
data.tar.gz: fd12631bf3cbb938303700ff6e16e2f485e2a8d76db90054db7ab8a90fe2b915cdd6b008b3133f7dc2aecae71f0a89c1714ac321e025cd65778b6640cc70dc54
|
data/lib/bpm_manager/red_hat.rb
CHANGED
@@ -18,17 +18,17 @@ module BpmManager
|
|
18
18
|
def self.tasks_with_opts(opts = {})
|
19
19
|
self.structure_task_data(JSON.parse(RestClient.get(BpmManager.uri('/task/query' + (opts.empty? ? '' : '?' + opts.map{|k,v| k.to_s + '=' + v.to_s}.join('&'))), :accept => :json)))
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
# Gets all Process Instances
|
23
23
|
def self.process_instances
|
24
24
|
JSON.parse(RestClient.get(BpmManager.uri('/history/instances'), :accept => :json))
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
# Gets a Process Instance
|
28
28
|
def self.process_instance(process_instance_id)
|
29
29
|
JSON.parse(RestClient.get(BpmManager.uri('/history/instance/' + process_instance_id.to_s), :accept => :json))
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
# Gets a Process Instance Variables
|
33
33
|
def self.process_instance_variables(deployment_id, process_instance_id)
|
34
34
|
JSON.parse(RestClient.get(BpmManager.uri('/runtime/' + deployment_id.to_s + '/withvars/process/instance/' + process_instance_id.to_s), :accept => :json))['variables']
|
@@ -38,17 +38,52 @@ module BpmManager
|
|
38
38
|
def self.assign_task(task_id, user_id)
|
39
39
|
RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/delegate?targetEntityId=' + user_id.to_s)), :headers => {:content_type => :json, :accept => :json})
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
|
+
# Starts a Task
|
43
|
+
def self.start_task(task_id)
|
44
|
+
RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/start')), :headers => {:content_type => :json, :accept => :json})
|
45
|
+
end
|
46
|
+
|
47
|
+
# Stops a Task
|
48
|
+
def self.stop_task(task_id)
|
49
|
+
RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/stop')), :headers => {:content_type => :json, :accept => :json})
|
50
|
+
end
|
51
|
+
|
52
|
+
# Suspends a Task
|
53
|
+
def self.suspend_task(task_id)
|
54
|
+
RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/suspend')), :headers => {:content_type => :json, :accept => :json})
|
55
|
+
end
|
56
|
+
|
57
|
+
# Resumes a Task
|
58
|
+
def self.suspend_task(task_id)
|
59
|
+
RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/resumes')), :headers => {:content_type => :json, :accept => :json})
|
60
|
+
end
|
61
|
+
|
42
62
|
# Releases a Task
|
43
63
|
def self.release_task(task_id)
|
44
64
|
RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/release')), :headers => {:content_type => :json, :accept => :json})
|
45
65
|
end
|
46
|
-
|
66
|
+
|
67
|
+
# Skips a Task
|
68
|
+
def self.release_task(task_id)
|
69
|
+
RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/skip')), :headers => {:content_type => :json, :accept => :json})
|
70
|
+
end
|
71
|
+
|
47
72
|
# Completes a Task
|
48
|
-
def self.complete_task(task_id)
|
73
|
+
def self.complete_task(task_id, opts = {})
|
49
74
|
RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/complete')), :headers => {:content_type => :json, :accept => :json})
|
50
75
|
end
|
51
76
|
|
77
|
+
# Fails a Task
|
78
|
+
def self.complete_task(task_id)
|
79
|
+
RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/fail')), :headers => {:content_type => :json, :accept => :json})
|
80
|
+
end
|
81
|
+
|
82
|
+
# Exits a Task
|
83
|
+
def self.complete_task(task_id)
|
84
|
+
RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/exit')), :headers => {:content_type => :json, :accept => :json})
|
85
|
+
end
|
86
|
+
|
52
87
|
private
|
53
88
|
def self.structure_task_data(input)
|
54
89
|
tasks = []
|
@@ -57,7 +92,6 @@ module BpmManager
|
|
57
92
|
input['taskSummaryList'].each do |task|
|
58
93
|
my_task = OpenStruct.new
|
59
94
|
my_task.process = OpenStruct.new
|
60
|
-
|
61
95
|
my_task.id = task['task-summary']['id']
|
62
96
|
my_task.process_instance_id = task['task-summary']['process-instance-id']
|
63
97
|
my_task.parent_id = task['task-summary']['parent_id']
|
@@ -78,7 +112,6 @@ module BpmManager
|
|
78
112
|
my_task.process.version = my_task.process.data['process-version']
|
79
113
|
my_task.process.creator = my_task.process.data['identity']
|
80
114
|
my_task.process.variables = self.process_instance_variables(my_task.process.deployment_id, my_task.process.instance_id)
|
81
|
-
|
82
115
|
tasks << my_task
|
83
116
|
end
|
84
117
|
end
|
data/lib/bpm_manager/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bpm_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ariel Presa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|