bpm_manager 0.10.9 → 0.11.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 857cb1c869a64a93422f52258c7862563af045fb
4
- data.tar.gz: 3e62f0ecab5c59a0e4a715bb700514a5e8246456
3
+ metadata.gz: bfc7b76cfb8d6ee4c28fb91dd6b4b9e2b0d3a2df
4
+ data.tar.gz: 5ae2d40c2ba43d0c2f0676e9ebb93713eddbd4d3
5
5
  SHA512:
6
- metadata.gz: df9b3d534da5fe1be16fa045457cee954156475b235005a12284f0e9a3f81df8af56a13241df3048cfb05a1dbaf2b046a081b403a0c2c6a9774c1e514beffea0
7
- data.tar.gz: bd5738bc71ba9b7301e73884643f7e580b5414c71918ed7fca9d18eabfd58cbe3d0364cdf5038b7c97e4373fb3c4b038e77981034b06f460f6ae98eee67be9bf
6
+ metadata.gz: f56f5f58d4c6f650b631465d3e5875e14097a819a9ab7afba8ca9c2c702285067af036bc2980d7b003bc6a85061f5373cd182f0a46f9c9f396e4b236666e2ab4
7
+ data.tar.gz: fca596b7c2fba721a7ded2cb8e9c60b58f61cc4038cff3a227dfd97b00a55fdcc1475832d130740c7a2012aa3774781c6df2549f8d66cbf6b8b34785045cd79b
@@ -6,7 +6,7 @@ module BpmManager
6
6
  module RedHat
7
7
  # Gets all server deployments
8
8
  def self.deployments()
9
- return JSON.parse(RestClient.get(BpmManager.uri('/deployment'), :accept => :json))
9
+ return JSON.parse(BpmManager.server['/deployment'].get)
10
10
  end
11
11
 
12
12
  # Creates a new Process
@@ -21,14 +21,14 @@ module BpmManager
21
21
 
22
22
  # Gets a Process Instance
23
23
  def self.process_instance(process_instance_id)
24
- JSON.parse(RestClient.get(BpmManager.uri('/history/instance/' + process_instance_id.to_s), :accept => :json))
24
+ JSON.parse(BpmManager.server['/history/instance/' + process_instance_id.to_s].get)
25
25
  end
26
26
 
27
27
  # Gets a Process Instance Variables
28
28
  def self.process_instance_variables(process_instance_id)
29
29
  begin
30
30
  result = Hash.new
31
- JSON.parse(RestClient.get(BpmManager.uri('/history/instance/' + process_instance_id.to_s + '/variable'), :accept => :json))['historyLogList'].each{|e| result[e['variable-instance-log']['variable-id']] = e['variable-instance-log']['value']}
31
+ JSON.parse(BpmManager.server['/history/instance/' + process_instance_id.to_s + '/variable'].get)['historyLogList'].each{|e| result[e['variable-instance-log']['variable-id']] = e['variable-instance-log']['value']}
32
32
 
33
33
  return result
34
34
  rescue
@@ -38,88 +38,88 @@ module BpmManager
38
38
 
39
39
  # Gets all tasks, optionally you could specify an user id
40
40
  def self.tasks(user_id = "")
41
- self.structure_task_data(JSON.parse(RestClient.get(BpmManager.uri('/task/query' + (user_id.empty? ? '' : '?taskOwner=' + user_id)), :accept => :json)))
41
+ self.structure_task_data(JSON.parse(BpmManager.server['/task/query' + (user_id.empty? ? '' : '?taskOwner=' + user_id)].get))
42
42
  end
43
43
 
44
44
  # Gets all tasks with options
45
45
  def self.tasks_with_opts(opts = {})
46
- 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)))
46
+ self.structure_task_data(JSON.parse(BpmManager.server['/task/query'].get(opts)))
47
47
  end
48
48
 
49
49
  # Assigns a Task for an User
50
50
  def self.assign_task(task_id, user_id)
51
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/delegate?targetEntityId=' + user_id.to_s)), :headers => {:content_type => :json, :accept => :json})
51
+ BpmManager.server['/task/' + task_id.to_s + '/delegate'].post(:targetEntityId => user_id.to_s)
52
52
  end
53
53
 
54
54
  # Gets all the information for a Task ID
55
55
  def self.task_query(task_id)
56
- JSON.parse(RestClient.get(BpmManager.uri('/task/' + task_id.to_s), :accept => :json))
56
+ JSON.parse(BpmManager.server['/task/' + task_id.to_s].get)
57
57
  end
58
58
 
59
59
  # Starts a Task
60
60
  def self.start_task(task_id)
61
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/start')), :headers => {:content_type => :json, :accept => :json})
61
+ BpmManager.server['/task/' + task_id.to_s + '/start'].post
62
62
  end
63
63
 
64
64
  # Releases a Task
65
65
  def self.release_task(task_id)
66
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/release')), :headers => {:content_type => :json, :accept => :json})
66
+ BpmManager.server['/task/' + task_id.to_s + '/release'].post
67
67
  end
68
68
 
69
69
  # Stops a Task
70
70
  def self.stop_task(task_id)
71
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/stop')), :headers => {:content_type => :json, :accept => :json})
71
+ BpmManager.server['/task/' + task_id.to_s + '/stop'].post
72
72
  end
73
73
 
74
74
  # Suspends a Task
75
75
  def self.suspend_task(task_id)
76
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/suspend')), :headers => {:content_type => :json, :accept => :json})
76
+ BpmManager.server['/task/' + task_id.to_s + '/suspend'].post
77
77
  end
78
78
 
79
79
  # Resumes a Task
80
80
  def self.resume_task(task_id)
81
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/resumes')), :headers => {:content_type => :json, :accept => :json})
81
+ BpmManager.server['/task/' + task_id.to_s + '/resumes'].post
82
82
  end
83
83
 
84
84
  # Skips a Task
85
85
  def self.skip_task(task_id)
86
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/skip')), :headers => {:content_type => :json, :accept => :json})
86
+ BpmManager.server['/task/' + task_id.to_s + '/skip'].post
87
87
  end
88
88
 
89
89
  # Completes a Task
90
90
  def self.complete_task(task_id, opts = {})
91
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/complete' + (opts.empty? ? '' : '?' + opts.map{|k,v| k.to_s + '=' + v.to_s}.join('&')))), :headers => {:content_type => :json, :accept => :json})
91
+ BpmManager.server['/task/' + task_id.to_s + '/complete'].post(opts)
92
92
  end
93
93
 
94
94
  # Completes a Task as Administrator
95
95
  def self.complete_task_as_admin(task_id, opts = {})
96
96
  self.release_task(task_id)
97
97
  self.start_task(task_id)
98
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/complete' + (opts.empty? ? '' : '?' + opts.map{|k,v| k.to_s + '=' + v.to_s}.join('&')))), :headers => {:content_type => :json, :accept => :json})
98
+ BpmManager.server['/task/' + task_id.to_s + '/complete'].post(opts)
99
99
  end
100
100
 
101
101
  # Fails a Task
102
102
  def self.fail_task(task_id)
103
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/fail')), :headers => {:content_type => :json, :accept => :json})
103
+ BpmManager.server['/task/' + task_id.to_s + '/fail'].post
104
104
  end
105
105
 
106
106
  # Exits a Task
107
107
  def self.exit_task(task_id)
108
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/exit')), :headers => {:content_type => :json, :accept => :json})
108
+ BpmManager.server['/task/' + task_id.to_s + '/exit'].post
109
109
  end
110
110
 
111
111
  # Gets the Process History
112
112
  def self.get_history(process_definition_id = "")
113
113
  if process_definition_id.empty?
114
- JSON.parse(RestClient.get(BpmManager.uri('/history/instances'), :accept => :json))
114
+ JSON.parse(BpmManager.server['/history/instances'].get)
115
115
  else
116
- JSON.parse(RestClient.get(BpmManager.uri('/history/process/' + process_definition_id.to_s), :accept => :json))
116
+ JSON.parse(BpmManager.server['/history/process/' + process_definition_id.to_s].get)
117
117
  end
118
118
  end
119
119
 
120
120
  # Clears all the History --WARNING: Destructive action!--
121
121
  def self.clear_all_history()
122
- RestClient.post(URI.encode(BpmManager.uri('/history/clear')), :headers => {:content_type => :json, :accept => :json})
122
+ BpmManager.server['/history/clear'].post
123
123
  end
124
124
 
125
125
  # Gets the SLA for a Process Instance
@@ -1,3 +1,3 @@
1
1
  module BpmManager
2
- VERSION = "0.10.9"
2
+ VERSION = "0.11.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bpm_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.9
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Presa