cpee-logging-xes-yaml 1.0.4 → 1.0.6

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: d2a0520ca3fb6ff780ca51eebf84811e8c9fd4df9a111fed58b09ebe63ac747f
4
- data.tar.gz: 4aa2bb2e70e7944cb41155983dc39651b599ee263c7e2c8d2176b1fa40586741
3
+ metadata.gz: 0ba8710880804c7803eea8c127abb88ad8a6ec3d7189b2731127b620c7eaf7fa
4
+ data.tar.gz: acc8a90a7c55119ba9ab9f2e81e170658e39b35aa9e456fc66b69060d43f107d
5
5
  SHA512:
6
- metadata.gz: 7e403723fe26acf2b0588db4ecb18e7577cbb57572b2ca38224e0c8bdec7b753ef366142b1b9ae599921c15ab53e8d73cb36d822af2b112054249538cd3781b7
7
- data.tar.gz: e681120976fbe6308dafbc824eb0fc5787219f071666fe10291d27f98318bed20c584aab4a408f4a23811f4411f08192f4a955ca0ca4f20ccc500628abb1afba
6
+ metadata.gz: 3aca1dfc7ea1fb6cf504d9ca6692da23e017f598b9fed424cfe8caa5e25ebbb7c70bd1e32ab339d704e53d77f187a19050e18df26c4eb8dbb27e267d3d807c1d
7
+ data.tar.gz: 68529513a92e2e3abb3c494ccbaa4965d7230c15fce74e1567f68a45f81c9122fd8730ffed3088d65a52f8f206aa5b2fd58926d985aa72ae79c305f483e0561f
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-logging-xes-yaml"
3
- s.version = "1.0.4"
3
+ s.version = "1.0.6"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Logging for the cloud process execution engine (cpee.org)"
@@ -27,7 +27,8 @@ module CPEE
27
27
  SERVER = File.expand_path(File.join(__dir__,'logging.xml'))
28
28
 
29
29
  class Handler < Riddl::Implementation #{{{
30
- def doc(topic,event_name,log_dir,template,notification)
30
+ def doc(topic,event_name,log_dir,template,payload)
31
+ notification = JSON.parse(payload)
31
32
  instance = notification['instance-uuid']
32
33
  return unless instance
33
34
 
@@ -45,7 +46,7 @@ module CPEE
45
46
  event = {}
46
47
  event["concept:instance"] = instancenr
47
48
  event["concept:name"] = content["label"] if content["label"]
48
- if notification["endpoint"]
49
+ if content["endpoint"]
49
50
  event["concept:endpoint"] = content["endpoint"]
50
51
  end
51
52
  event["id:id"] = (activity.nil? || activity == "") ? 'external' : activity
@@ -63,28 +64,14 @@ module CPEE
63
64
  event["cpee:lifecycle:transition"] = "#{topic}/#{event_name}"
64
65
  event["cpee:state"] = content['state'] if content['state']
65
66
  event["cpee:description"] = content['dslx'] if content['dslx']
66
- data_send = ((parameters["arguments"].nil? ? [] : parameters["arguments"]) rescue [])
67
- event["data"] = {"data_send" => data_send} unless data_send.empty?
68
- if content['changed']&.any?
69
- if event.has_key? "data"
70
- event["data"]["data_changed"] ||= content['changed']
71
- else
72
- event["data"] = {"data_changer" => content['changed']}
73
- end
67
+ unless parameters["arguments"]&.nil?
68
+ event["data"] = parameters["arguments"]
74
69
  end
75
- if content['values']&.any?
76
- if event.has_key? "data"
77
- event["data"]["data_values"] ||= content['values']
78
- else
79
- event["data"] = {"data_values" => content['values']}
80
- end
70
+ if content['changed']&.any?
71
+ event["data"] = content['values']
81
72
  end
82
73
  if receiving && !receiving.empty?
83
- if event.has_key? "data"
84
- event["data"]["data_received"] ||= receiving
85
- else
86
- event["data"] = {"data_receiver" => receiving}
87
- end
74
+ event["raw"] = receiving
88
75
  end
89
76
  event["time:timestamp"]= event['cpee:timestamp'] || Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z")
90
77
  File.open(File.join(log_dir,instance+'.xes.yaml'),'a') do |f|
@@ -98,8 +85,11 @@ module CPEE
98
85
  event_name = @p[2].value
99
86
  log_dir = @a[0]
100
87
  template = @a[1]
101
- notification = JSON.parse(@p[3].value.read)
102
- doc topic, event_name, log_dir, template, notification
88
+ notification = @p[3].value.read
89
+ EM.defer do
90
+ doc topic, event_name, log_dir, template, notification
91
+ end
92
+ nil
103
93
  end
104
94
  end #}}}
105
95
 
@@ -1,11 +1,19 @@
1
1
  ---
2
2
  log:
3
+ namespaces:
4
+ stream: https://cpee.org/sensorstream/
5
+ ssn: http://www.w3.org/ns/ssn/
6
+ sosa: http://www.w3.org/ns/sosa/
7
+ xes:
8
+ creator: cpee.org
9
+ features: nested-attributes
3
10
  extension:
4
11
  time: http://www.xes-standard.org/time.xesext
5
12
  concept: http://www.xes-standard.org/concept.xesext
6
- organisational: http://www.xes-standard.org/org.xesext
13
+ id: http://www.xes-standard.org/identity.xesext
7
14
  lifecycle: http://www.xes-standard.org/lifecycle.xesext
8
15
  cpee: http://cpee.org/cpee.xesext
16
+ stream: https://cpee.org/sensorstream/sensorstream.xesext
9
17
  global:
10
18
  trace:
11
19
  concept:name: __INVALID__
@@ -19,10 +27,4 @@ log:
19
27
  lifecycle:transition: complete
20
28
  cpee:lifecycle:transition: activity/calling
21
29
  time:timestamp: ''
22
- classifier:
23
- Data: data_send data_received data_changed data_values
24
- Data_Received: data_receiver
25
- Data_Send: data_send
26
- Data_Changed: data_changer
27
- Data_Values: data_values
28
30
  trace: {}
@@ -35,20 +35,16 @@ def follow(fname,io,copy,deep=0)
35
35
  if name = e.dig('log','trace','cpee:name')
36
36
  puts " " * deep + name + " (#{File.basename(fname,'.xes.yaml')}) - #{e.dig('log','trace','concept:name')}"
37
37
  end
38
- if e.dig('event','concept:endpoint') == 'https://centurio.work/flow/start/url/' && e.dig('event','cpee:lifecycle:transition') == 'task/instantiation'
38
+ if e.dig('event','cpee:lifecycle:transition') == 'task/instantiation'
39
39
  base = e.dig('event','data','data_receiver')
40
40
  val = base.dig('CPEE-INSTANCE') rescue nil
41
41
  if val.nil?
42
42
  val = File.basename(base)
43
43
  end
44
44
  uuid = base.dig('CPEE-INSTANCE-UUID') rescue nil
45
- unless uuid
46
- res = Typhoeus.get(File.join('https://centurio.work/flow/engine/',val,'/properties/values/attributes/uuid/'))
47
- if res.success?
48
- uuid = XML::Smart.string(res.body).find('string(/*)')
49
- end
45
+ if uuid
46
+ react File.dirname(fname) + "/#{uuid}.xes.yaml",copy,deep + 2
50
47
  end
51
- react File.dirname(fname) + "/#{uuid}.xes.yaml",copy,deep + 2
52
48
  end
53
49
  end
54
50
  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.0.4
4
+ version: 1.0.6
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: 2021-11-03 00:00:00.000000000 Z
12
+ date: 2022-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: riddl
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubygems_version: 3.2.22
99
+ rubygems_version: 3.3.7
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: Logging for the cloud process execution engine (cpee.org)