cpee-logging-xes-yaml 1.3.22 → 1.3.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11477530cd78ec82f59b567b61c0755707b0630f6ccbc0b78add32d433e3e513
4
- data.tar.gz: 3fc565df213205479e7b429cd75d89a5822610807c25057c9712ef647eb3e304
3
+ metadata.gz: '0826aa750d298fd8ec36f2e650295d8584d5861b9db5f9043ce7aa4bdd211f95'
4
+ data.tar.gz: 949622e3a7b0c311d6f3c959c7cf3e702c010d09730801b60436cbd9f3840e60
5
5
  SHA512:
6
- metadata.gz: 990680c3ecd793d57f373a3daf61c21917180c8cf6536c108e2d1e7b3e580d363b81d77f10604f66561cc2c52e135a43a4e251121408ffa4771b4fdad266094d
7
- data.tar.gz: f70324579374e104b6f326c3699135dd04eac678e9e5ff6040ff5db0b728fc638de3fe1bf8a60f7c2f851130720fe6d7372af5ab001b854a80a0e899958a8ae0
6
+ metadata.gz: e193a45610da57a8384a4e7efc9611b68e6f5280f7ffdbf03f2a0e4ea726f261c7ba5cc8d291b49a4e80e783e1f3e9a8805b9288e368fcd6d47861de1ec4fc0f
7
+ data.tar.gz: e9e0a9b52b398c87872f4a692ae42440e6eea1c265603c5d48f5776288a13a0af4148fa5dbf01d8cc7be6a557846045c0333e00fa163ce83d6a27b9ed741487a
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-logging-xes-yaml"
3
- s.version = "1.3.22"
3
+ s.version = "1.3.23"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0-or-later"
6
6
  s.summary = "Logging for the cloud process execution engine (cpee.org)"
@@ -76,6 +76,7 @@ end
76
76
  module CPEE
77
77
  module Logging
78
78
 
79
+ # Forward event to subscriptions
79
80
  def self::notify(opts,topic,event_name,payload)
80
81
  opts[:subscriptions].each do |e,urls|
81
82
  if e == topic + '/' + event_name
@@ -122,6 +123,7 @@ module CPEE
122
123
  end
123
124
  end
124
125
  end
126
+
125
127
  def self::extract_annotations(where,xml)
126
128
  ret = {}
127
129
  XML::Smart::string(xml) do |doc|
@@ -290,6 +292,7 @@ module CPEE
290
292
  fname = File.join(log_dir,instance + '_' + event['id:id'] + '.probe')
291
293
  dname = File.join(log_dir,instance + '.data.json')
292
294
 
295
+ # Handle intrinsic data probes
293
296
  if File.exist?(fname)
294
297
  rs = WEEL::ReadStructure.new(File.exist?(dname) ? JSON::load(File::open(dname)) : {},{},{},{})
295
298
  XML::Smart::open_unprotected(fname) do |doc|
@@ -298,19 +301,24 @@ module CPEE
298
301
  pid = p.find('string(d:id)')
299
302
  source = p.find('string(d:source)')
300
303
  val = CPEE::Logging::extract_val(rs,p.find('string(d:extractor_code)'),pid,nil) rescue nil
301
-
302
304
  event['stream:datastream'] ||= []
303
- CPEE::Logging::merge_val(event['stream:datastream'],val,pid,source)
305
+ # Do not add datastream entries if the dataprobes return nil
306
+ if val != nil
307
+ CPEE::Logging::merge_val(event['stream:datastream'],val,pid,source)
308
+ end
304
309
  end
305
310
  end
306
- notification['datastream'] = event['stream:datastream']
307
- EM.defer do
308
- notification['topic'] = 'stream'
309
- notification['name'] = 'extraction'
310
- self::notify(opts,'stream','extraction',notification.to_json)
311
+ if event['stream:datastream'] && event['stream:datastream'].any?
312
+ notification['datastream'] = event['stream:datastream']
313
+ EM.defer do
314
+ notification['topic'] = 'stream'
315
+ notification['name'] = 'extraction'
316
+ self::notify(opts,'stream','extraction',notification.to_json)
317
+ end
311
318
  end
312
319
  end
313
320
  end
321
+ # Handle extrinsic data probes
314
322
  if topic == 'activity' && event_name == 'receiving' && receiving && !receiving.empty?
315
323
  fname = File.join(log_dir,instance + '_' + event['id:id'] + '.probe')
316
324
  dname = File.join(log_dir,instance + '.data.json')
@@ -327,11 +335,14 @@ module CPEE
327
335
  pid = p.find('string(d:id)')
328
336
  te['stream:datastream'] ||= []
329
337
  val = CPEE::Logging::extract_val(rs,p.find('string(d:extractor_code)'),pid,rc) rescue nil
330
- CPEE::Logging::merge_val(te['stream:datastream'],val,pid,p.find('string(d:source)'))
338
+ if not val.nil?
339
+ # Do not add datastream entries if the dataprobes return nil
340
+ CPEE::Logging::merge_val(te['stream:datastream'],val,pid,p.find('string(d:source)'))
341
+ end
331
342
  end
332
343
  end
333
344
  end
334
- if te['stream:datastream']
345
+ if te['stream:datastream'] && te['stream:datastream'].any?
335
346
  te['cpee:lifecycle:transition'] = 'stream/data'
336
347
  File.open(File.join(log_dir,instance+'.xes.yaml'),'a') do |f|
337
348
  f << {'event' => te}.to_yaml
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee-logging-xes-yaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.22
4
+ version: 1.3.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler