cpee-logging-xes-yaml 1.3.23 → 1.3.26
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 +10 -4
- 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: c0718e2aa588fec306eee022e9b7919a1d75d0a5d027ca3f84e571a0f325715e
|
|
4
|
+
data.tar.gz: 6ea9758c42cb2a197fca22be6329c624e3363a0929eef354b3b949a0b1ce2fc0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a559163ce46db6aeba5974dde8f70752e119b7444fa5b6964eb56cedebd014aa564e7a0c82c26e8c9533be7886fe0780e84d9b16af2d97b5dd32002f2b47aa1
|
|
7
|
+
data.tar.gz: 44d86a2b208544ae26e353b39d80d60f23e15ddf7521104448ceec6494ba6a32ee6ab118e7120d26bef80513752609f63851c4710be6fc80117d07f4bf84ac8b
|
|
@@ -209,6 +209,12 @@ module CPEE
|
|
|
209
209
|
f.write(JSON.generate(json))
|
|
210
210
|
f.close
|
|
211
211
|
end
|
|
212
|
+
def self::load_values(where)
|
|
213
|
+
File.open(where,'r') do |f|
|
|
214
|
+
f.flock(File::LOCK_EX)
|
|
215
|
+
return JSON::load(f)
|
|
216
|
+
end
|
|
217
|
+
end
|
|
212
218
|
|
|
213
219
|
def self::forward(opts,topic,event_name,payload)
|
|
214
220
|
if topic == 'state' && event_name == 'change'
|
|
@@ -294,16 +300,16 @@ module CPEE
|
|
|
294
300
|
|
|
295
301
|
# Handle intrinsic data probes
|
|
296
302
|
if File.exist?(fname)
|
|
297
|
-
rs = WEEL::ReadStructure.new(File.exist?(dname) ?
|
|
303
|
+
rs = WEEL::ReadStructure.new(File.exist?(dname) ? CPEE::Logging::load_values(dname) : {},{},{},{})
|
|
298
304
|
XML::Smart::open_unprotected(fname) do |doc|
|
|
299
305
|
doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
|
|
300
306
|
doc.find('//d:probe[d:extractor_type="intrinsic"]').each do |p|
|
|
301
307
|
pid = p.find('string(d:id)')
|
|
302
308
|
source = p.find('string(d:source)')
|
|
303
309
|
val = CPEE::Logging::extract_val(rs,p.find('string(d:extractor_code)'),pid,nil) rescue nil
|
|
304
|
-
event['stream:datastream'] ||= []
|
|
305
310
|
# Do not add datastream entries if the dataprobes return nil
|
|
306
311
|
if val != nil
|
|
312
|
+
event['stream:datastream'] ||= []
|
|
307
313
|
CPEE::Logging::merge_val(event['stream:datastream'],val,pid,source)
|
|
308
314
|
end
|
|
309
315
|
end
|
|
@@ -326,7 +332,7 @@ module CPEE
|
|
|
326
332
|
if File.exist?(fname)
|
|
327
333
|
te = event.dup
|
|
328
334
|
|
|
329
|
-
rs = WEEL::ReadStructure.new(File.exist?(dname) ?
|
|
335
|
+
rs = WEEL::ReadStructure.new(File.exist?(dname) ? CPEE::Logging::load_values(dname) : {},{},{},{})
|
|
330
336
|
XML::Smart::open_unprotected(fname) do |doc|
|
|
331
337
|
doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
|
|
332
338
|
if doc.find('//d:probe/d:extractor_type[.="extrinsic"]').any?
|
|
@@ -342,7 +348,7 @@ module CPEE
|
|
|
342
348
|
end
|
|
343
349
|
end
|
|
344
350
|
end
|
|
345
|
-
if te['stream:datastream'] && te['stream:datastream'].any?
|
|
351
|
+
if te['stream:datastream'] && te['stream:datastream'].any?
|
|
346
352
|
te['cpee:lifecycle:transition'] = 'stream/data'
|
|
347
353
|
File.open(File.join(log_dir,instance+'.xes.yaml'),'a') do |f|
|
|
348
354
|
f << {'event' => te}.to_yaml
|