bpm_manager 0.1.5 → 0.2.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: 25ca95e7d83024dbf4ce887924154ff47992e65f
4
- data.tar.gz: 3f698c2885e605ca75ff388ac33be3f1dfd1dab8
3
+ metadata.gz: 2ba8b2de2e1789997cc3d7d2761ba7435f3c0344
4
+ data.tar.gz: bc922afda55dcf5df17e6f8876347ecb9cfe5a9c
5
5
  SHA512:
6
- metadata.gz: 56927cf8960c6a4a76ae5dc55da1aa098c7a82b145fce1bad04d546b637767422ba88ef6a40028786a1ee9c983ebd7c1e0f1c471bc2a75359a2d62f609436d2e
7
- data.tar.gz: 98d85e3424f8e6f339787166a1b3173b311efb732f03e20ec3fb1f801a831ada2c39555eca6aa3176b0bb94465480281755b51ae1c08e61ec867712fd9cd42ec
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 Example
46
+ ## Quick Examples
47
47
 
48
- Get all the tasks for an user id
49
48
 
50
49
  ```ruby
51
- BpmManager.tasks('foo@bar.com')
52
- ```
50
+ # Get all the Deployments
51
+ BpmManager.deployments
53
52
 
54
- Get all the tasks with options (RedHat example). It support all REST API options for /task/query call:
53
+ # Get all the Tasks for an User ID
54
+ BpmManager.tasks('foo@bar.com')
55
55
 
56
- ```ruby
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
- RailsConfig is released under the MIT License.
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 server deployments
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 server deployments
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
@@ -1,3 +1,3 @@
1
1
  module BpmManager
2
- VERSION = "0.1.5"
2
+ VERSION = "0.2.0"
3
3
  end
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({:ownerId => 'foo@bar.com', :id => 1})
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
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.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Presa