cpee-logging-xes-yaml 1.3.13 → 1.3.15
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 +1 -1
- data/tools/cpee-logging-xes-yaml +30 -9
- 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: 57268eb5b34557dd4f6d496033c026965be162de70f9bd76197b5299bf681c3e
|
4
|
+
data.tar.gz: 795924403cc65799cc01cd2f5522757aecb9ab43d3447409545fd6c4776476e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 642455b3f54dc1f8f7298f0fe4030287efca8cc97a2d56b6c3109919d0ba87580f05f98b19e0bc2d808ba981601ace0aec361b192c9da233b429c46ad096c750
|
7
|
+
data.tar.gz: b83200a4293de12b50763727df58d977662c08cb1ce6ccc898663b40c7eb553163131371523b876591c91384f0c741069549381c32c134e6bbf569a56c323f3c
|
@@ -348,7 +348,7 @@ module CPEE
|
|
348
348
|
if receiving && !receiving.empty?
|
349
349
|
event["data"] = receiving
|
350
350
|
end
|
351
|
-
event["time:timestamp"]= notification['timestamp'] || Time.now.
|
351
|
+
event["time:timestamp"]= notification['timestamp'] || Time.now.xmlschema(4)
|
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
@@ -113,7 +113,7 @@ def rec_insert(event,node,level=0)
|
|
113
113
|
tnode = node.add('x:list', 'key' => k)
|
114
114
|
rec_a_insert(v,tnode,level+1)
|
115
115
|
when Hash
|
116
|
-
tnode = node.add('x:
|
116
|
+
tnode = node.add('x:list', 'key' => k)
|
117
117
|
rec_insert(v,tnode)
|
118
118
|
end
|
119
119
|
end
|
@@ -134,7 +134,7 @@ def follow(fname,io,copy,deep=0,index=nil)
|
|
134
134
|
index.write " " * deep + name + " (#{tname}) - #{e.dig('log','trace','concept:name')}\n"
|
135
135
|
end
|
136
136
|
if e.dig('event','cpee:lifecycle:transition') == 'task/instantiation'
|
137
|
-
base = e.dig('event','
|
137
|
+
base = e.dig('event','data')
|
138
138
|
val = base.dig('CPEE-INSTANCE') rescue nil
|
139
139
|
if val.nil?
|
140
140
|
val = File.basename(base)
|
@@ -195,14 +195,14 @@ def extract(path)
|
|
195
195
|
info = yaml.shift
|
196
196
|
uuid = info.dig('log','trace','cpee:instance')
|
197
197
|
yaml.each do |el|
|
198
|
-
if el['event']['id:id'] == 'external' && (el.dig('event','cpee:lifecycle:transition') == 'endpoints/change' || el.dig('event','cpee:lifecycle:transition') == 'dataelements/change'|| el.dig('event','cpee:lifecycle:transition') == 'description/change')
|
198
|
+
if el['event']['id:id'] == 'external' && (el.dig('event','cpee:lifecycle:transition') == 'endpoints/change' || el.dig('event','cpee:lifecycle:transition') == 'attributes/change' || el.dig('event','cpee:lifecycle:transition') == 'dataelements/change'|| el.dig('event','cpee:lifecycle:transition') == 'description/change')
|
199
199
|
changes.push(el)
|
200
200
|
end
|
201
201
|
end
|
202
202
|
|
203
203
|
changes.sort! { |a,b| DateTime.strptime(a.dig('event','time:timestamp'),'%Y-%m-%dT%H:%M:%S.%L%:z') <=> DateTime.strptime(b.dig('event','time:timestamp'),'%Y-%m-%dT%H:%M:%S.%L%:z') }
|
204
204
|
|
205
|
-
de = ep = desc = nil
|
205
|
+
de = ep = desc = at = nil
|
206
206
|
counter = 0
|
207
207
|
changes.each do |change|
|
208
208
|
if change.dig('event','cpee:lifecycle:transition') == 'dataelements/change'
|
@@ -211,11 +211,14 @@ def extract(path)
|
|
211
211
|
if change.dig('event','cpee:lifecycle:transition') == 'endpoints/change'
|
212
212
|
ep = change.dig('event','data')
|
213
213
|
end
|
214
|
+
if change.dig('event','cpee:lifecycle:transition') == 'attributes/change'
|
215
|
+
at = change.dig('event','data')
|
216
|
+
end
|
214
217
|
if change.dig('event','cpee:lifecycle:transition') == 'description/change'
|
215
218
|
desc = change.dig('event','cpee:description')
|
216
219
|
end
|
217
220
|
if change.dig('event','cpee:lifecycle:transition') == 'description/change' || change.dig('event','cpee:lifecycle:transition') == 'endpoints/change'
|
218
|
-
yield uuid, de, ep, desc, counter if block_given?
|
221
|
+
yield uuid, de, ep, desc, at, counter if block_given?
|
219
222
|
counter += 1
|
220
223
|
end
|
221
224
|
end
|
@@ -223,10 +226,11 @@ def extract(path)
|
|
223
226
|
text.close
|
224
227
|
text.unlink if unlink
|
225
228
|
|
226
|
-
[de, ep, desc]
|
229
|
+
[de, ep, desc, at]
|
227
230
|
end
|
228
231
|
|
229
232
|
exname = File.basename($0)
|
233
|
+
attr = {}
|
230
234
|
|
231
235
|
ARGV.options { |opt|
|
232
236
|
opt.summary_indent = ' ' * 2
|
@@ -234,6 +238,7 @@ ARGV.options { |opt|
|
|
234
238
|
opt.banner = "Usage:\n#{opt.summary_indent}#{exname} new [DIR] | view [URI] | copy [URI]\n"
|
235
239
|
opt.on("Options:")
|
236
240
|
opt.on("--help", "-h", "This text") { puts opt; exit }
|
241
|
+
opt.on("--add [STRING]", "-a [STRING]", "Add attribute for extract-all and extract-last. Example: -a 'filter=me'") { |a| x,y = a.split('='); attr[x] = y }
|
237
242
|
opt.on("")
|
238
243
|
opt.on(wrap("\"#{exname}\" will be call \"c\" in the examples for each command."))
|
239
244
|
exname = 'c'
|
@@ -260,7 +265,7 @@ if (ARGV.length < 1 || ARGV.length > 2)
|
|
260
265
|
elsif ARGV.length == 2
|
261
266
|
command = ARGV[0]
|
262
267
|
path = ARGV[1]
|
263
|
-
elsif ARGV.length == 1 && %w{index extract-last to-xes-xml}.include?(ARGV[0])
|
268
|
+
elsif (ARGV.length == 1 || ARGV.length == 2) && %w{index extract-last to-xes-xml}.include?(ARGV[0])
|
264
269
|
command = ARGV[0]
|
265
270
|
end
|
266
271
|
|
@@ -276,7 +281,7 @@ elsif command == 'view'
|
|
276
281
|
elsif command == 'copy'
|
277
282
|
react path, true
|
278
283
|
elsif command == 'extract-all'
|
279
|
-
extract(path) do |uuid, de, ep, desc, version|
|
284
|
+
extract(path) do |uuid, de, ep, desc, at, version|
|
280
285
|
xml = XML::Smart.string('<testset xmlns="http://cpee.org/ns/properties/2.0"><executionhandler>ruby</executionhandler></testset>')
|
281
286
|
dataelements = xml.root().add('dataelements')
|
282
287
|
endpoints = xml.root().add('endpoints')
|
@@ -291,6 +296,11 @@ elsif command == 'extract-all'
|
|
291
296
|
endpoints.add(e['name'],e['value'])
|
292
297
|
end
|
293
298
|
end
|
299
|
+
unless at.nil?
|
300
|
+
at.each do |e|
|
301
|
+
attributes.add(e['name'],e['value'])
|
302
|
+
end
|
303
|
+
end
|
294
304
|
unless desc.nil?
|
295
305
|
description.replace_by(XML::Smart.string(desc).root())
|
296
306
|
end
|
@@ -307,12 +317,13 @@ elsif command == 'extract-last'
|
|
307
317
|
end
|
308
318
|
|
309
319
|
path.each do |f|
|
310
|
-
de, ep, desc = extract(f)
|
320
|
+
de, ep, desc, at = extract(f)
|
311
321
|
|
312
322
|
xml = XML::Smart.string('<testset xmlns="http://cpee.org/ns/properties/2.0"><executionhandler>ruby</executionhandler></testset>')
|
313
323
|
dataelements = xml.root().add('dataelements')
|
314
324
|
endpoints = xml.root().add('endpoints')
|
315
325
|
description = xml.root().add('description').add(XML::Smart.string('<description xmlns="http://cpee.org/ns/description/1.0"/>').root())
|
326
|
+
attributes = xml.root().add('attributes')
|
316
327
|
unless de.nil?
|
317
328
|
de.each do |d|
|
318
329
|
dataelements.add(d['name'],d['value'])
|
@@ -326,6 +337,16 @@ elsif command == 'extract-last'
|
|
326
337
|
unless desc.nil?
|
327
338
|
description.replace_by(XML::Smart.string(desc).root())
|
328
339
|
end
|
340
|
+
unless at.nil?
|
341
|
+
attr.each do |k,v|
|
342
|
+
attributes.add(k,v)
|
343
|
+
end
|
344
|
+
at.each do |e|
|
345
|
+
unless attr.keys.include? e['name']
|
346
|
+
attributes.add(e['name'],e['value'])
|
347
|
+
end
|
348
|
+
end
|
349
|
+
end
|
329
350
|
|
330
351
|
File.write(f + '.model', xml.to_s)
|
331
352
|
end
|
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.
|
4
|
+
version: 1.3.15
|
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: 2025-02-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: riddl
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.5.
|
121
|
+
rubygems_version: 3.5.22
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Logging for the cloud process execution engine (cpee.org)
|