cpee-logging-xes-yaml 1.3.14 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eef13eff4942a9f42979d5cf9f6bcd6b18138e45f430b2d0eaf314261552875f
4
- data.tar.gz: f38d433ce4c2d03ebd6e3c5ad70067a02855ac4ad05a82390ed559f23d66afc5
3
+ metadata.gz: 57268eb5b34557dd4f6d496033c026965be162de70f9bd76197b5299bf681c3e
4
+ data.tar.gz: 795924403cc65799cc01cd2f5522757aecb9ab43d3447409545fd6c4776476e0
5
5
  SHA512:
6
- metadata.gz: f8855de7b6cd340b6d7579c6ef0ed83da5f717648b364a4fd9b939b4eebb9898c6159c9db3e139332df4debc5170dd8c72dfd2a059101c0b13efdca2119c873b
7
- data.tar.gz: 3fb011c791d2a29140ba81328672b7be78c398b869eb3a7e6d8e5538ea0b35fd10e41607f41db960636262135cc023a627e2571ba41b886d73f8f412d2874c20
6
+ metadata.gz: 642455b3f54dc1f8f7298f0fe4030287efca8cc97a2d56b6c3109919d0ba87580f05f98b19e0bc2d808ba981601ace0aec361b192c9da233b429c46ad096c750
7
+ data.tar.gz: b83200a4293de12b50763727df58d977662c08cb1ce6ccc898663b40c7eb553163131371523b876591c91384f0c741069549381c32c134e6bbf569a56c323f3c
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-logging-xes-yaml"
3
- s.version = "1.3.14"
3
+ s.version = "1.3.15"
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)"
@@ -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.strftime("%Y-%m-%dT%H:%M:%S.%L%:z")
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
@@ -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','raw')
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.14
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: 2024-07-17 00:00:00.000000000 Z
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.9
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)