libis-workflow 2.1.8 → 2.1.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
  SHA256:
3
- metadata.gz: 0ca60cb469baf356cfdbfc24d5b67213b407d1a03d31aac4282fef76e618ee21
4
- data.tar.gz: 3d63a8d33290b99cd93c96881dc9bff5bc3d8931430ab81563d5f9db80903127
3
+ metadata.gz: 1dc320ccf41f1ec673274778ff2cec80ff5d4e0833706b019e2fa6faa34c9cd6
4
+ data.tar.gz: 94142b587e3722ff66d5b0c9c5217d58985b067809360152a4079707f169091e
5
5
  SHA512:
6
- metadata.gz: 88de25eccc8af1d2e57d70cd97687c1b7d37ef086d1b3315398836c6e00277645f128d5718d316b1f5445e4320ab14c0c4b30bc482ae69a3a04e57f0c26073c4
7
- data.tar.gz: c69167119af26dc0fd7d0c526bfdf117c4fec427a296c54576bc5a96eb160b5667600f20c5d97208516296d0c09f00b8454791055bb5e006dcdff52349037e69
6
+ metadata.gz: ba1df60123766f9af303be678988bf390eb83cd8df6e63108bede48bb157f2fd4fee206e6778fd5d7c029221f176e484608fd3704d909ca2886360d723d8a524
7
+ data.tar.gz: d28c97c7b4907241ca2bb9920e9cfb912381db8a48ee6638f5e063d6c93975b8bfa91319d56869b22c01ca09244298061352487aae8f120b73e988a29a395f7d
@@ -64,8 +64,10 @@ module Libis
64
64
 
65
65
  run.job = self
66
66
  (opts.delete('run_config') || {}).each { |key,value| run.send("#{key}=", value) }
67
+ (opts.delete('run_properties') || {}).each { |key,value| run.properties[key] = value }
67
68
  run.options = self.input.merge(opts)
68
69
  run.save!
70
+ run.reload
69
71
 
70
72
  run.run
71
73
 
@@ -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,16 +236,22 @@ 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
 
243
253
  if (not_started = status_count[:NOT_STARTED]) > 0
244
- error "%d sub#{task_or_item}(s) skipped", item, not_started
254
+ debug "%d sub#{task_or_item}(s) skipped", item, not_started
245
255
  end
246
256
 
247
257
  if (started = status_count[:STARTED]) > 0
@@ -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.8' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
3
+ VERSION = '2.1.10' 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.8
4
+ version: 2.1.10
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-09 00:00:00.000000000 Z
11
+ date: 2023-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake