bpm_manager 0.6.23 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d461fdb436ac8465e308fccb930e2d1305b8090
4
- data.tar.gz: 40877ccba15a20fb877f38234966b81c025bca31
3
+ metadata.gz: 190ad4dda987cf37039386593d1d6b842a5e525f
4
+ data.tar.gz: aae78fb85b839344b095071ed6df0ae76e35e5aa
5
5
  SHA512:
6
- metadata.gz: 999bfbab6ce771769ce0d0a5b9f250a23eedc5bfbbe35e4c1fd7ddfbc718607575ad509d4344b218c29a959b9a2020471c8257978c851c3e5c6d122b7b5e15cf
7
- data.tar.gz: 6079a569195ae222592d110f6946c81c6523c456bbc89dcf6b8c5eb50d79e8d7338c3005229944a18989dbf9cdb0afc147d1cfc71235941557ad77a80280961c
6
+ metadata.gz: 330c360022504a9415184a61acd10f854d3baac20f96650a00f7516d11599ce77290d0d4be5576d93576c7698e1bcc28f2b02a559bbeb338652d425e17de65f4
7
+ data.tar.gz: 6b55ccd22bf13c275e7a7d64b35a29a0564949fd50b3bf66ab119073feba86956280e356d0dc9999774fa1809a02846a10898160b318f6023ce1d5c670227437
@@ -9,14 +9,9 @@ module BpmManager
9
9
  return JSON.parse(RestClient.get(BpmManager.uri('/deployment'), :accept => :json))
10
10
  end
11
11
 
12
- # Gets all tasks, optionally you could specify an user id
13
- def self.tasks(user_id = "")
14
- self.structure_task_data(JSON.parse(RestClient.get(BpmManager.uri('/task/query' + (user_id.empty? ? '' : '?taskOwner=' + user_id)), :accept => :json)))
15
- end
16
-
17
- # Gets all tasks with options
18
- def self.tasks_with_opts(opts = {})
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)))
12
+ # Creates a new Process
13
+ def self.create_process(deployment_id, process_definition_id, opts = {})
14
+ RestClient.post(URI.encode(BpmManager.uri('/runtime/' + deployment_id.to_s + '/process/' + process_definition_id.to_s + '/start' + (opts.empty? ? '' : '?' + opts.map{|k,v| k.to_s + '=' + v.to_s}.join('&')))), :headers => {:content_type => :json, :accept => :json})
20
15
  end
21
16
 
22
17
  # Gets all Process Instances
@@ -38,6 +33,16 @@ module BpmManager
38
33
  end
39
34
  end
40
35
 
36
+ # Gets all tasks, optionally you could specify an user id
37
+ def self.tasks(user_id = "")
38
+ self.structure_task_data(JSON.parse(RestClient.get(BpmManager.uri('/task/query' + (user_id.empty? ? '' : '?taskOwner=' + user_id)), :accept => :json)))
39
+ end
40
+
41
+ # Gets all tasks with options
42
+ def self.tasks_with_opts(opts = {})
43
+ 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)))
44
+ end
45
+
41
46
  # Assigns a Task for an User
42
47
  def self.assign_task(task_id, user_id)
43
48
  RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/delegate?targetEntityId=' + user_id.to_s)), :headers => {:content_type => :json, :accept => :json})
@@ -75,7 +80,14 @@ module BpmManager
75
80
 
76
81
  # Completes a Task
77
82
  def self.complete_task(task_id, opts = {})
78
- RestClient.post(URI.encode(BpmManager.uri('/task/' + task_id.to_s + '/complete')), :headers => {:content_type => :json, :accept => :json})
83
+ 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})
84
+ end
85
+
86
+ # Completes a Task as Administrator
87
+ def self.complete_task_as_admin(task_id, opts = {})
88
+ self.assign_task(task_id, 'Administrator')
89
+ self.start_task(task_id)
90
+ 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})
79
91
  end
80
92
 
81
93
  # Fails a Task
@@ -1,3 +1,3 @@
1
1
  module BpmManager
2
- VERSION = "0.6.23"
2
+ VERSION = "0.7.0"
3
3
  end
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.6.23
4
+ version: 0.7.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-04-16 00:00:00.000000000 Z
11
+ date: 2015-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client