cpee-logging-xes-yaml 1.2.7 → 1.3.1
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 +8 -8
- data/tools/cpee-logging-xes-yaml +9 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 893766061ed759310a44842175708c8f4bfe652e8e1e725688294fcffcfa788f
|
4
|
+
data.tar.gz: 61722b8d998767bec81d2de885e756cb5b611033c4826548d7e4d757a4e61450
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7de187309cbf7eff011cdb955d95ac7054496bed0d5b5c2581d853c8d9d88f030ce072384e5e4413e150c3dc190e3c6a889524451c19a86ee56c7d02ae51f8b5
|
7
|
+
data.tar.gz: 671f0f0cf6f6bb00c94e5bd744440330324ba6f04998a2dc47d60c349984e371c46a77a516e6714b667a10bb0360576969a58de63c8ef892609877ca5692879e
|
@@ -148,7 +148,7 @@ module CPEE
|
|
148
148
|
ret[tid] = ret[tid][0]
|
149
149
|
end
|
150
150
|
hash = Digest::SHA1.hexdigest(ret[tid])
|
151
|
-
if !File.
|
151
|
+
if !File.exist?(fname) || (File.exist?(fname) && File.read(fname) != hash)
|
152
152
|
File.write(fname,hash)
|
153
153
|
end
|
154
154
|
end
|
@@ -195,7 +195,7 @@ module CPEE
|
|
195
195
|
end
|
196
196
|
|
197
197
|
def self::persist_values(where,values)
|
198
|
-
unless File.
|
198
|
+
unless File.exist?(where)
|
199
199
|
File.write(where,'{}')
|
200
200
|
end
|
201
201
|
f = File.open(where,'r+')
|
@@ -259,7 +259,7 @@ module CPEE
|
|
259
259
|
log["log"]["trace"]["concept:name"] ||= instancenr
|
260
260
|
log["log"]["trace"]["cpee:name"] ||= notification['instance-name'] if notification['instance-name']
|
261
261
|
log["log"]["trace"]["cpee:instance"] ||= instance
|
262
|
-
File.open(File.join(log_dir,instance+'.xes.yaml'),'w'){|f| f.puts log.to_yaml} unless File.
|
262
|
+
File.open(File.join(log_dir,instance+'.xes.yaml'),'w'){|f| f.puts log.to_yaml} unless File.exist? File.join(log_dir,instance+'.xes.yaml')
|
263
263
|
event = {}
|
264
264
|
event["concept:instance"] = instancenr
|
265
265
|
event["concept:name"] = content["label"] if content["label"]
|
@@ -292,8 +292,8 @@ module CPEE
|
|
292
292
|
fname = File.join(log_dir,instance + '_' + event["id:id"] + '.probe')
|
293
293
|
dname = File.join(log_dir,instance + '.data.json')
|
294
294
|
|
295
|
-
if File.
|
296
|
-
rs = WEEL::ReadStructure.new(File.
|
295
|
+
if File.exist?(fname)
|
296
|
+
rs = WEEL::ReadStructure.new(File.exist?(dname) ? JSON::load(File::open(dname)) : {},{},{})
|
297
297
|
XML::Smart::open_unprotected(fname) do |doc|
|
298
298
|
doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
|
299
299
|
doc.find('//d:probe[d:extractor_type="intrinsic"]').each do |p|
|
@@ -315,10 +315,10 @@ module CPEE
|
|
315
315
|
fname = File.join(log_dir,instance + '_' + event["id:id"] + '.probe')
|
316
316
|
dname = File.join(log_dir,instance + '.data.json')
|
317
317
|
|
318
|
-
if File.
|
318
|
+
if File.exist?(fname)
|
319
319
|
te = event.dup
|
320
320
|
|
321
|
-
rs = WEEL::ReadStructure.new(File.
|
321
|
+
rs = WEEL::ReadStructure.new(File.exist?(dname) ? JSON::load(File::open(dname)) : {},{},{})
|
322
322
|
XML::Smart::open_unprotected(fname) do |doc|
|
323
323
|
doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
|
324
324
|
if doc.find('//d:probe/d:extractor_type[.="extrinsic"]').any?
|
@@ -348,7 +348,7 @@ module CPEE
|
|
348
348
|
if receiving && !receiving.empty?
|
349
349
|
event["raw"] = receiving
|
350
350
|
end
|
351
|
-
event["time:timestamp"]=
|
351
|
+
event["time:timestamp"]= notification['timestamp'] || Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z")
|
352
352
|
File.open(File.join(log_dir,instance+'.xes.yaml'),'a') do |f|
|
353
353
|
f << {'event' => event}.to_yaml
|
354
354
|
end
|
data/tools/cpee-logging-xes-yaml
CHANGED
@@ -44,13 +44,18 @@ def wrap(s, width=78, indent=18, extra_indent=4)
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def follow(fname,io,copy,deep=0)
|
47
|
+
tname = if fname =~ /\.xes\.shift\.yaml/
|
48
|
+
File.basename(fname,'.xes.shift.yaml')
|
49
|
+
elsif fname =~ /\.xes\.yaml/
|
50
|
+
File.basename(fname,'.xes.yaml')
|
51
|
+
end
|
47
52
|
if copy
|
48
|
-
File.write(
|
53
|
+
File.write(tname + '.xes.shift.yaml',io.read)
|
49
54
|
io.rewind
|
50
55
|
end
|
51
56
|
YAML.load_stream(io) do |e|
|
52
57
|
if name = e.dig('log','trace','cpee:name')
|
53
|
-
puts " " * deep + name + " (#{
|
58
|
+
puts " " * deep + name + " (#{tname}) - #{e.dig('log','trace','concept:name')}"
|
54
59
|
end
|
55
60
|
if e.dig('event','cpee:lifecycle:transition') == 'task/instantiation'
|
56
61
|
base = e.dig('event','raw')
|
@@ -79,7 +84,7 @@ def react(name,copy=false,deep=0)
|
|
79
84
|
file.close
|
80
85
|
file.unlink
|
81
86
|
end
|
82
|
-
elsif File.
|
87
|
+
elsif File.exist? name
|
83
88
|
follow name, File.open(name), copy, deep
|
84
89
|
else
|
85
90
|
help
|
@@ -111,7 +116,7 @@ else
|
|
111
116
|
end
|
112
117
|
|
113
118
|
if command == 'new'
|
114
|
-
if !File.
|
119
|
+
if !File.exist?(dir)
|
115
120
|
FileUtils.cp_r(File.join(curpath,'..','server'),dir)
|
116
121
|
FileUtils.mkdir(File.join(dir,'logs')) rescue nil
|
117
122
|
else
|
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.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: tools
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: riddl
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
|
-
rubygems_version: 3.
|
101
|
+
rubygems_version: 3.4.6
|
102
102
|
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: Logging for the cloud process execution engine (cpee.org)
|