bpm_manager 1.0.9 → 1.0.10

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: c337e7b1d763cf0cdbebd80030b1c17edbc43cb8
4
- data.tar.gz: db47232b551c4f64d61e1e673ba0100df63f6f0f
3
+ metadata.gz: 0c3093ffd4c9a482ab67fefb213f6888be530e91
4
+ data.tar.gz: 3e97aaf101a90bfa9eba9b5a8288cdc0a18f05ea
5
5
  SHA512:
6
- metadata.gz: bd22300c48aa2907828bbcb7ada80f626a1bb0f57499cc176b710d5ba187916811bf8f5f4c2a19bdcd37e9aeb2bc3b208950c9fb3c33ba67bf16071c7081486a
7
- data.tar.gz: df28ae08fd585d3dbf73e1a8a319f69fa7f7507d3ba0735e6575ae7eeae92610520039a3cd66f99da13d773e35b9be9733e64b2e2755fd38b35cab9eb3bc7c2e
6
+ metadata.gz: 9e478ac8aafd73cc9653b44694b22aae5d343c2908679618241d0ef33d12cbf3d90ce9475a60256f259b946d71f1643901d429f816518994fde75ef24dd79f87
7
+ data.tar.gz: 67d95b7740fa9d3fafa23a31be5e7c7e2783e9c224903998bfc8e92eefe60e9744cc333ff9e0b98ffe2b4895ef7e1c95268da41a620b0466d818e9a89a7b430b
@@ -81,8 +81,8 @@ module BpmManager
81
81
  end
82
82
 
83
83
  # Gets all the runtime Tasks with query options
84
- def self.task_query_with_opts(opts = {})
85
- JSON.parse(BpmManager.server['/query/runtime/task/' + (opts.empty? ? '' : '?' + opts.map{|k,v| (v.class == Array) ? v.map{|e| k.to_s + '=' + e.to_s}.join('&') : k.to_s + '=' + v.to_s}.join('&'))].get)['taskInfoList']
84
+ def self.tasks_query_with_opts(opts = {})
85
+ structure_task_query_data(JSON.parse(BpmManager.server['/query/runtime/task/' + (opts.empty? ? '' : '?' + opts.map{|k,v| (v.class == Array) ? v.map{|e| k.to_s + '=' + e.to_s}.join('&') : k.to_s + '=' + v.to_s}.join('&'))].get))
86
86
  end
87
87
 
88
88
  # Starts a Task
@@ -223,6 +223,7 @@ module BpmManager
223
223
 
224
224
  unless input['taskSummaryList'].nil? || input['taskSummaryList'].empty?
225
225
  input['taskSummaryList'].each do |task|
226
+ task_query = self.task_query(task['id'])
226
227
  my_task = OpenStruct.new
227
228
  my_task.id = task['id']
228
229
  my_task.name = task['name']
@@ -239,8 +240,53 @@ module BpmManager
239
240
  my_task.deployment_id = task['deployment-id']
240
241
  my_task.quick_task_summary = task['quick-task-summary']
241
242
  my_task.parent_id = task['parent_id']
242
- my_task.form_name = self.task_query(task['id'])['form-name']
243
- my_task.creator = self.task_query(task['id'])['taskData']['created-by']
243
+ my_task.form_name = task_query(task['id'])['form-name']
244
+ my_task.creator = task_query(task['id'])['taskData']['created-by']
245
+ my_task.owner = task['actual-owner']
246
+ my_task.data = task
247
+
248
+ my_task.process = OpenStruct.new
249
+ my_task.process.data = self.process_instance(task['process-instance-id'])
250
+ my_task.process.deployment_id = task['deployment-id']
251
+ my_task.process.id = my_task.process.data['process-id']
252
+ my_task.process.instance_id = my_task.process.data['process-instance-id']
253
+ my_task.process.start_on = Time.at(my_task.process.data['start']/1000)
254
+ my_task.process.name = my_task.process.data['process-name']
255
+ my_task.process.version = my_task.process.data['process-version']
256
+ my_task.process.creator = my_task.process.data['identity']
257
+ my_task.process.variables = self.process_instance_variables(my_task.process.instance_id)
258
+ tasks << my_task
259
+ end
260
+ end
261
+
262
+ return tasks
263
+ end
264
+
265
+ def self.structure_task_query_data(input)
266
+ tasks = []
267
+
268
+ unless input['taskInfoList'].nil? || input['taskInfoList'].empty?
269
+ input['taskInfoList'].each do |tasks_array|
270
+ task = tasks_array['taskSummaries'].map{|e| e['id']}.max # Selects only the last active task
271
+ task_query = self.task_query(task['id'])
272
+ my_task = OpenStruct.new
273
+ my_task.id = task['id']
274
+ my_task.name = task['name']
275
+ my_task.subject = task['subject']
276
+ my_task.description = task['description']
277
+ my_task.status = task['status']
278
+ my_task.priority = task['priority']
279
+ my_task.skippable = task['skippable']
280
+ my_task.created_on = Time.at(task['created-on']/1000)
281
+ my_task.active_on = Time.at(task['activation-time']/1000)
282
+ my_task.process_instance_id = task['process-instance-id']
283
+ my_task.process_id = task['process-id']
284
+ my_task.process_session_id = task['process-session-id']
285
+ my_task.deployment_id = task['deployment-id']
286
+ my_task.quick_task_summary = task['quick-task-summary']
287
+ my_task.parent_id = task['parent_id']
288
+ my_task.form_name = task_query['form-name']
289
+ my_task.creator = task_query['taskData']['created-by']
244
290
  my_task.owner = task['actual-owner']
245
291
  my_task.data = task
246
292
 
@@ -1,3 +1,3 @@
1
1
  module BpmManager
2
- VERSION = "1.0.9"
2
+ VERSION = "1.0.10"
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: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Presa