cpee-logging-xes-yaml 1.3.21 → 1.3.22

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: 781e1920d2f1c740b9266c8b6c16e8f6deb515abd8496bc2e235b3f0016790b6
4
- data.tar.gz: e17203546cdc764602584353ae8bffdf66b85040e0928a18b8467571b0c10475
3
+ metadata.gz: 11477530cd78ec82f59b567b61c0755707b0630f6ccbc0b78add32d433e3e513
4
+ data.tar.gz: 3fc565df213205479e7b429cd75d89a5822610807c25057c9712ef647eb3e304
5
5
  SHA512:
6
- metadata.gz: e94e0a10e89ea868f533fa5186596bab4ba448bea86e6efeb5fa33f08df4fcff5f94aafbb5d95eb850c803b696f4c21222e1a1fefd69151d2488bfd1573faa68
7
- data.tar.gz: 3578abef72c8f7eef3b3874a31bf1f70b89429beeab58509b10f8a8b66bc35bf954d086b2fbe89d09fbeb67ad0efb8ce134e01394f07baea428ee603f0c1dbe0
6
+ metadata.gz: 990680c3ecd793d57f373a3daf61c21917180c8cf6536c108e2d1e7b3e580d363b81d77f10604f66561cc2c52e135a43a4e251121408ffa4771b4fdad266094d
7
+ data.tar.gz: f70324579374e104b6f326c3699135dd04eac678e9e5ff6040ff5db0b728fc638de3fe1bf8a60f7c2f851130720fe6d7372af5ab001b854a80a0e899958a8ae0
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-logging-xes-yaml"
3
- s.version = "1.3.21"
3
+ s.version = "1.3.22"
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)"
@@ -92,7 +92,7 @@ module CPEE
92
92
  end
93
93
  end
94
94
 
95
- def self::val_merge(target,val,tid,tso)
95
+ def self::merge_val(target,val,tid,tso)
96
96
  if val.is_a? Stream
97
97
  val.source = tso if val.source.nil?
98
98
  target.push *val.to_list
@@ -114,7 +114,7 @@ module CPEE
114
114
  def self::extract_probes(where,xml)
115
115
  XML::Smart::string(xml) do |doc|
116
116
  doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
117
- doc.find('//d:call').each do |c|
117
+ doc.find('//d:call | //d:manipulate').each do |c|
118
118
  File.unlink(where + '_' + c.attributes['id'] + '.probe') rescue nil
119
119
  c.find('d:annotations/d:_context_data_analysis/d:probes[d:probe]').each do |p|
120
120
  File.write(where + '_' + c.attributes['id'] + '.probe', p.dump)
@@ -126,10 +126,10 @@ module CPEE
126
126
  ret = {}
127
127
  XML::Smart::string(xml) do |doc|
128
128
  doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
129
- doc.find('/d:description | //d:call').each do |c|
130
- tid = c.attributes['id'] || 'start'
129
+ doc.find('/d:description | //d:call | //d:manipulate').each do |c|
130
+ tid = c.attributes['id'] || 'complex'
131
131
  fname = where + '_' + tid + '.anno'
132
- nset = if tid == 'start'
132
+ nset = if tid == 'complex'
133
133
  c.find('d:*[starts-with(name(),"_")]')
134
134
  else
135
135
  c.find('d:annotations')
@@ -143,7 +143,7 @@ module CPEE
143
143
  if ret[tid].length > 1
144
144
  ret[tid] = "<annotations xmlns=\"http://cpee.org/ns/description/1.0\">\n" +
145
145
  ret[tid].join("\n") + "\n" +
146
- "</annotations>"
146
+ '</annotations>'
147
147
  else
148
148
  ret[tid] = ret[tid][0]
149
149
  end
@@ -169,7 +169,7 @@ module CPEE
169
169
  YAML::load(res['data']) rescue nil
170
170
  elsif res['mimetype'] == 'text/plain'
171
171
  t = res['data']
172
- if t.start_with?("<?xml version=")
172
+ if t.start_with?('<?xml version=')
173
173
  t = XML::Smart::string(t)
174
174
  else
175
175
  t = t.to_f if t == t.to_f.to_s
@@ -188,7 +188,7 @@ module CPEE
188
188
  ret.length == 1 ? ret[0] : ret
189
189
  end
190
190
 
191
- def self::extract_sensor(rs,code,pid,result)
191
+ def self::extract_val(rs,code,pid,result)
192
192
  rs.instance_eval(code,'probe',1)
193
193
  rescue => e
194
194
  e.backtrace[0].gsub(/(\w+):(\d+):in.*/,'Probe ' + pid + ' Line \2: ') + e.message
@@ -257,37 +257,37 @@ module CPEE
257
257
  end
258
258
 
259
259
  event = {}
260
- event["concept:instance"] = instancenr
261
- event["concept:name"] = content["label"] if content["label"]
262
- if content["endpoint"]
263
- event["concept:endpoint"] = content["endpoint"]
260
+ event['concept:instance'] = instancenr
261
+ event['concept:name'] = content['label'] if content['label']
262
+ if content['endpoint']
263
+ event['concept:endpoint'] = content['endpoint']
264
264
  end
265
- event["id:id"] = (activity.nil? || activity == "") ? 'external' : activity
266
- event["cpee:activity"] = event["id:id"]
267
- event["cpee:activity_uuid"] = content['activity-uuid'] if content['activity-uuid']
268
- event["cpee:instance"] = instance
265
+ event['id:id'] = (activity.nil? || activity == '') ? 'external' : activity
266
+ event['cpee:activity'] = event['id:id']
267
+ event['cpee:activity_uuid'] = content['activity-uuid'] if content['activity-uuid']
268
+ event['cpee:instance'] = instance
269
269
  case event_name
270
270
  when 'calling'
271
- event["lifecycle:transition"] = "start"
271
+ event['lifecycle:transition'] = 'start'
272
272
  when 'done'
273
- event["lifecycle:transition"] = "complete"
273
+ event['lifecycle:transition'] = 'complete'
274
274
  else
275
- event["lifecycle:transition"] = "unknown"
275
+ event['lifecycle:transition'] = 'unknown'
276
276
  end
277
- event["cpee:lifecycle:transition"] = "#{topic}/#{event_name}"
278
- event["cpee:state"] = content['state'] if content['state']
279
- event["cpee:description"] = content['dslx'] if content['dslx']
280
- event["cpee:change_uuid"] = content['change_uuid'] if content['change_uuid']
281
- event["cpee:exposition"] = content['exposition'] if content['exposition']
282
- unless parameters["arguments"]&.nil?
283
- event["data"] = parameters["arguments"]
277
+ event['cpee:lifecycle:transition'] = "#{topic}/#{event_name}"
278
+ event['cpee:state'] = content['state'] if content['state']
279
+ event['cpee:description'] = content['dslx'] if content['dslx']
280
+ event['cpee:change_uuid'] = content['change_uuid'] if content['change_uuid']
281
+ event['cpee:exposition'] = content['exposition'] if content['exposition']
282
+ unless parameters['arguments']&.nil?
283
+ event['data'] = parameters['arguments']
284
284
  end if parameters
285
285
  if content['changed']&.any?
286
- event["data"] = content['values'].map do |k,v|
286
+ event['data'] = content['values'].map do |k,v|
287
287
  { 'name' => k, 'value' => v }
288
288
  end
289
289
 
290
- fname = File.join(log_dir,instance + '_' + event["id:id"] + '.probe')
290
+ fname = File.join(log_dir,instance + '_' + event['id:id'] + '.probe')
291
291
  dname = File.join(log_dir,instance + '.data.json')
292
292
 
293
293
  if File.exist?(fname)
@@ -295,10 +295,12 @@ module CPEE
295
295
  XML::Smart::open_unprotected(fname) do |doc|
296
296
  doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
297
297
  doc.find('//d:probe[d:extractor_type="intrinsic"]').each do |p|
298
- pid = p.find('string(d:id)')
298
+ pid = p.find('string(d:id)')
299
+ source = p.find('string(d:source)')
300
+ val = CPEE::Logging::extract_val(rs,p.find('string(d:extractor_code)'),pid,nil) rescue nil
301
+
299
302
  event['stream:datastream'] ||= []
300
- val = CPEE::Logging::extract_sensor(rs,p.find('string(d:extractor_code)'),pid,nil) rescue nil
301
- CPEE::Logging::val_merge(event['stream:datastream'],val,pid,p.find('string(d:source)'))
303
+ CPEE::Logging::merge_val(event['stream:datastream'],val,pid,source)
302
304
  end
303
305
  end
304
306
  notification['datastream'] = event['stream:datastream']
@@ -310,7 +312,7 @@ module CPEE
310
312
  end
311
313
  end
312
314
  if topic == 'activity' && event_name == 'receiving' && receiving && !receiving.empty?
313
- fname = File.join(log_dir,instance + '_' + event["id:id"] + '.probe')
315
+ fname = File.join(log_dir,instance + '_' + event['id:id'] + '.probe')
314
316
  dname = File.join(log_dir,instance + '.data.json')
315
317
 
316
318
  if File.exist?(fname)
@@ -324,13 +326,13 @@ module CPEE
324
326
  doc.find('//d:probe[d:extractor_type="extrinsic"]').each do |p|
325
327
  pid = p.find('string(d:id)')
326
328
  te['stream:datastream'] ||= []
327
- val = CPEE::Logging::extract_sensor(rs,p.find('string(d:extractor_code)'),pid,rc) rescue nil
328
- CPEE::Logging::val_merge(te['stream:datastream'],val,pid,p.find('string(d:source)'))
329
+ val = CPEE::Logging::extract_val(rs,p.find('string(d:extractor_code)'),pid,rc) rescue nil
330
+ CPEE::Logging::merge_val(te['stream:datastream'],val,pid,p.find('string(d:source)'))
329
331
  end
330
332
  end
331
333
  end
332
334
  if te['stream:datastream']
333
- te["cpee:lifecycle:transition"] = "stream/data"
335
+ te['cpee:lifecycle:transition'] = 'stream/data'
334
336
  File.open(File.join(log_dir,instance+'.xes.yaml'),'a') do |f|
335
337
  f << {'event' => te}.to_yaml
336
338
  end
@@ -344,9 +346,12 @@ module CPEE
344
346
  end
345
347
  end
346
348
  if receiving && !receiving.empty?
347
- event["data"] = receiving
349
+ event['data'] = receiving
350
+ end
351
+ if content['data'] && !content['data'].empty?
352
+ event['data'] = content['data']
348
353
  end
349
- event["time:timestamp"]= notification['timestamp'] || Time.now.xmlschema(4)
354
+ event['time:timestamp']= notification['timestamp'] || Time.now.xmlschema(4)
350
355
  File.open(File.join(log_dir,instance+'.xes.yaml'),'a') do |f|
351
356
  f << {'event' => event}.to_yaml
352
357
  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.21
4
+ version: 1.3.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler