libis-workflow 2.1.8 → 2.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/libis/workflow/task.rb +16 -2
- data/lib/libis/workflow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2074a9c80b7a99a427641c2a92d910ee47cf9bb4c9c212d207a27a6b8ea07a3f
|
4
|
+
data.tar.gz: ef7374f1aa151f0502849059e63e97cf6faf144b2b662e4246ddc50e1027f3b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aa230d3a1524e1cc72a8a539aa9fa575bbd6f239298ad0b183632c3a7fadd33120048e02e86a7fd7c8072880548835a93afc79819a7af7c3bd0d037d7b35b0e
|
7
|
+
data.tar.gz: 98419ed9d9736a21941bcf7033f9ad293c4caf1859c382845cc3e6a72caea98547d84246ef5b7606655a7b5bee283a406e979294ea6dafa487a89f9103642861
|
data/lib/libis/workflow/task.rb
CHANGED
@@ -38,6 +38,10 @@ module Libis
|
|
38
38
|
raise Libis::WorkflowError, "Processing task '#{namepath}' is not allowed to have subtasks."
|
39
39
|
end
|
40
40
|
|
41
|
+
def root_task
|
42
|
+
parent&.root_task || self
|
43
|
+
end
|
44
|
+
|
41
45
|
# @param [Libis::Workflow::Base::WorkItem] item
|
42
46
|
def run(item)
|
43
47
|
check_item_type ::Libis::Workflow::Base::WorkItem, item
|
@@ -232,11 +236,17 @@ module Libis
|
|
232
236
|
|
233
237
|
end
|
234
238
|
|
235
|
-
# noinspection RubyScope
|
236
|
-
debug '%d of %d subitems passed', parent_item, status_count[:DONE], items.size
|
237
239
|
substatus_check(status_count, parent_item, 'item')
|
238
240
|
end
|
239
241
|
|
242
|
+
def global_status(item)
|
243
|
+
results = Hash.new(0)
|
244
|
+
self.tasks.each { |subtask| results[item.status(subtask.namepath)] += 1 }
|
245
|
+
[:FAILED, :ASYNC_WAIT, :ASYNC_HALT].each { |status| return status if results[status] > 0 }
|
246
|
+
return :FAILED if results[:STARTED] > 1
|
247
|
+
:DONE
|
248
|
+
end
|
249
|
+
|
240
250
|
def substatus_check(status_count, item, task_or_item)
|
241
251
|
item_status = :DONE
|
242
252
|
|
@@ -264,6 +274,10 @@ module Libis
|
|
264
274
|
item_status = :FAILED
|
265
275
|
end
|
266
276
|
|
277
|
+
if (done = status_count[:DONE]) > 0
|
278
|
+
debug "%d sub#{task_or_item}(s) passed", item, done
|
279
|
+
end
|
280
|
+
|
267
281
|
set_status(item, item_status)
|
268
282
|
end
|
269
283
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Libis
|
2
2
|
module Workflow
|
3
|
-
VERSION = '2.1.
|
3
|
+
VERSION = '2.1.9' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
|
4
4
|
end
|
5
5
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libis-workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kris Dekeyser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|