bpm_manager 0.9.1 → 0.9.2

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: 2447f095243eadeb0cdb652f998b53887e402665
4
- data.tar.gz: 902c7dd6e4e5bc891ba40cdb48cca5ce309c63a4
3
+ metadata.gz: 96799d8871d846b9ea01b32e0aba3f672b8f44e3
4
+ data.tar.gz: 3435d5d53cc227dcb2c6e4c18aad543f059c5a6b
5
5
  SHA512:
6
- metadata.gz: 5796302fb793aa29dc042864ad1c46585251f059e8362f7cd1adc5c0bb4ab9dbd0f0d64d4390207a805ed9c38e5fd1b381961bdba9f628651e9b99d16ca513d0
7
- data.tar.gz: 1c05c05830789c068b2a020f65f006a12318fbd9256cb55c1ba35b2b8a727d491965daaa436a2d8da1f6c1251b84a20df61fd1aade49fd6089c59e962569c1ed
6
+ metadata.gz: cb652a2e8b5e296f5dddf6f909162378084e8151edfb45f2ea0e6a61585b7900a726f561add9fa6e8611326b96df512145431ae986b529d5cafd3738a2a84d5b
7
+ data.tar.gz: f2044662fcc92f4683aca25d802a7836af7492750891c4e9c018d37ae087f2ecf1add6a8dcd468686e8af7f4b94d160ae6505fe664880dd9dcfbc18700d0512c
@@ -124,13 +124,11 @@ module BpmManager
124
124
 
125
125
  # Gets the SLA for a Process Instance
126
126
  def self.get_task_sla(task_instance_id, process_sla_hours = 0, task_sla_hours = 0, warning_offset_percent = 20)
127
- sla = OpenStruct.new
128
- sla.task = OpenStruct.new
129
- sla.process = OpenStruct.new
130
- my_task = self.tasks_with_opts(:taskId => task_instance_id).first
127
+ my_task = self.tasks_with_opts('taskId' => task_instance_id).first
131
128
 
132
129
  unless my_task.nil?
133
- else
130
+ sla = OpenStruct.new(:task => OpenStruct.new, :process => OpenStruct.new)
131
+
134
132
  # Calculates the process sla
135
133
  sla.process.status = calculate_sla(my_task.process.start_on, process_sla_hours, warning_offset_percent)
136
134
  sla.process.status_name = (calculate_sla(my_task.process.start_on, process_sla_hours, warning_offset_percent) == 0) ? 'ok' : (calculate_sla(my_task.process.start_on, process_sla_hours, warning_offset_percent) == 1 ? 'warning' : 'due')
@@ -140,6 +138,8 @@ module BpmManager
140
138
  sla.task.status = calculate_sla(my_task.task.created_on, task_sla_hours, warning_offset_percent)
141
139
  sla.task.status_name = (calculate_sla(my_task.created_on, task_sla_hours, warning_offset_percent) == 0) ? 'ok' : (calculate_sla(my_task.created_on, task_sla_hours, warning_offset_percent) == 1 ? 'warning' : 'due')
142
140
  sla.task.percent = calculate_sla_percent(my_task.created_on, task_sla_hours, warning_offset_percent)
141
+ else
142
+ sla = nil
143
143
  end
144
144
 
145
145
  return sla
@@ -1,3 +1,3 @@
1
1
  module BpmManager
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
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.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Presa