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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09c40d5c48f505ee3162298297f53a10c6a71b45
4
- data.tar.gz: 119fb5cc854f3b1c40aa1bcaf839a4987f9f5dc4
3
+ metadata.gz: 4d23c40031bbbc734dd9c42f30ad459792912585
4
+ data.tar.gz: b486afbd3ec775a3779c28a31adb516889167e9d
5
5
  SHA512:
6
- metadata.gz: 6ad9f12023283eef3118d31d1309c4fb40ca94724c55d50162930d07c7d1340c6b48ba3500b7d385ca67f2ea1f5c6c7efd06fd02ae75462a0ab69d8a1cfee1ae
7
- data.tar.gz: 58e12db240b074d6a8cf8e314b5cb90039ec9fd20533bf1d4915f0426db7be5565846054dd37678e6f9b5a9d7007a67b635d81f606cdb8b9c45fd264b337108e
6
+ metadata.gz: e4f84c75a05f49cae6607886b6fd8ce12dc80cc841222a473d4099df3585ca65437e74ad8858586a58b34861b0a88759232466acaedd4c9484726e0f8b7dac3a
7
+ data.tar.gz: fd12631bf3cbb938303700ff6e16e2f485e2a8d76db90054db7ab8a90fe2b915cdd6b008b3133f7dc2aecae71f0a89c1714ac321e025cd65778b6640cc70dc54
@@ -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
@@ -1,3 +1,3 @@
1
1
  module BpmManager
2
- VERSION = "0.4.2"
2
+ VERSION = "0.5.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.4.2
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-04 00:00:00.000000000 Z
11
+ date: 2015-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client