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 +4 -4
- data/lib/bpm_manager/red_hat.rb +6 -3
- data/lib/bpm_manager/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07c1950751ee223cb54bf0ce7f3b13507246ee52
|
4
|
+
data.tar.gz: 0ae5ec464f7664d1163d6934a7c1f1576e6b70ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0bda7deec6389c254f7e9d8208d2b088a0b38ab4526545726a9764ca1ca416de99279894645a05307bd0df8ee389bd471b9ca18c2e1e5cd1a60dfd200270ae6
|
7
|
+
data.tar.gz: 4dd8b4aae8bf142120912d076840cd6c191f3073d9b09ceebb49f3d5e017c69eb36b915f1817570644415add0ad5732a1865de4120b5f9652f98f07a6a0dd7b1
|
data/lib/bpm_manager/red_hat.rb
CHANGED
@@ -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['
|
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
|
-
|
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
|
-
|
251
|
+
private_class_method :calculate_sla_percent
|
249
252
|
|
250
253
|
private
|
251
254
|
def self.structure_task_data(input)
|
data/lib/bpm_manager/version.rb
CHANGED