bpm_manager 1.0.33 → 1.0.34

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: c066d17bc7d2a371a8ed9dea729e9fb18c4b5c79
4
- data.tar.gz: 292340924dcd4fc2ea9ec5d885d122c84eb03071
3
+ metadata.gz: 07c1950751ee223cb54bf0ce7f3b13507246ee52
4
+ data.tar.gz: 0ae5ec464f7664d1163d6934a7c1f1576e6b70ee
5
5
  SHA512:
6
- metadata.gz: 1db1c0a42eada5c8b25c1110fc2571e1d8204c6762112288695054996057fa0ef8eeb3004c14b102ac7cdd8e960959729022434d2c92d4cf35fd1d66bf57d1ce
7
- data.tar.gz: e264684823e32353a3aaa770828ddbe2248d00db70887381bbd64e0270316f9152ef9a658d0284040a5f77918d52666d12b7026932397cd37ea7f346601b9549
6
+ metadata.gz: c0bda7deec6389c254f7e9d8208d2b088a0b38ab4526545726a9764ca1ca416de99279894645a05307bd0df8ee389bd471b9ca18c2e1e5cd1a60dfd200270ae6
7
+ data.tar.gz: 4dd8b4aae8bf142120912d076840cd6c191f3073d9b09ceebb49f3d5e017c69eb36b915f1817570644415add0ad5732a1865de4120b5f9652f98f07a6a0dd7b1
@@ -167,10 +167,11 @@ module BpmManager
167
167
  def self.get_process_sla(process_instance_id, process_sla_hours = 0, warning_offset_percent = 20)
168
168
  my_process = self.process_instance(process_instance_id)
169
169
 
170
+
170
171
  unless my_process.nil?
171
172
  sla = OpenStruct.new(:process => OpenStruct.new)
172
173
  start_time = Time.at(my_process['start']/1000)
173
- end_time = my_process['start'].nil? ? Time.now : Time.at(my_process['start']/1000)
174
+ end_time = my_process['end'].nil? ? Time.now : Time.at(my_process['end']/1000)
174
175
 
175
176
  # Calculates the process sla
176
177
  sla.process.status = calculate_sla(start_time, end_time, process_sla_hours, warning_offset_percent)
@@ -188,6 +189,8 @@ module BpmManager
188
189
  unless my_task.nil?
189
190
  sla = OpenStruct.new(:task => OpenStruct.new, :process => OpenStruct.new)
190
191
 
192
+ puts '-----> Ends on: ' + my_task.process.end_on.to_s
193
+
191
194
  # Calculates the process sla
192
195
  sla.process.status = calculate_sla(my_task.process.start_on, my_task.process.end_on, process_sla_hours, warning_offset_percent)
193
196
  sla.process.status_name = (calculate_sla(my_task.process.start_on, my_task.process.end_on, process_sla_hours, warning_offset_percent) == 0) ? 'ok' : (calculate_sla(my_task.process.start_on, my_task.process.end_on, process_sla_hours, warning_offset_percent) == 1 ? 'warning' : 'due')
@@ -212,7 +215,7 @@ module BpmManager
212
215
  # Returns the status
213
216
  end_time.utc <= warn ? 0 : ( warn < end_time.utc && end_time.utc <= total ? 1 : 2 )
214
217
  end
215
- #private_class_method :calculate_sla
218
+ private_class_method :calculate_sla
216
219
 
217
220
  def self.calculate_sla_percent(start_time, end_time = Time.now, sla_hours = 0.0, offset = 20)
218
221
  end_time = Time.now if end_time.nil?
@@ -245,7 +248,7 @@ module BpmManager
245
248
 
246
249
  return percent
247
250
  end
248
- #private_class_method :calculate_sla_percent
251
+ private_class_method :calculate_sla_percent
249
252
 
250
253
  private
251
254
  def self.structure_task_data(input)
@@ -1,3 +1,3 @@
1
1
  module BpmManager
2
- VERSION = "1.0.33"
2
+ VERSION = "1.0.34"
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.33
4
+ version: 1.0.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Presa