cpee-logging-xes-yaml 1.3.22 → 1.3.24
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 +4 -4
- data/cpee-logging-xes-yaml.gemspec +1 -1
- data/lib/cpee-logging-xes-yaml/tools.rb +21 -10
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 42085fa1e29bb009a3c99ef29a8a6e8d509b1f15558dc60cf6c74c9e6ec293da
|
|
4
|
+
data.tar.gz: 89130cd5b9825e6272fbf70cf90710db693842a6208522e803698b88f7083105
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d1087dd2be29bdef6fe61830aa1c8d5f253065cb1e82de2ed406f1b851db73017b828864bb875d4390d280c11dc76f75b8596e5c891a501c00128cb7312d72bc
|
|
7
|
+
data.tar.gz: e7f1df21643dff8e4831639887f29c6065b49614eb9530eeb9862fe2fffbcfa9292ea6e812010e9b3099881c97222883c667eee1441d9b46ed9e9fc38e2c9b58
|
|
@@ -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
|
-
|
|
303
|
-
|
|
304
|
+
# Do not add datastream entries if the dataprobes return nil
|
|
305
|
+
if val != nil
|
|
306
|
+
event['stream:datastream'] ||= []
|
|
307
|
+
CPEE::Logging::merge_val(event['stream:datastream'],val,pid,source)
|
|
308
|
+
end
|
|
304
309
|
end
|
|
305
310
|
end
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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
|
-
|
|
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
|