cpee-logging-xes-yaml 1.2.1 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cpee-logging-xes-yaml.gemspec +1 -1
- data/lib/cpee-logging-xes-yaml/logging.rb +99 -14
- data/lib/cpee-logging-xes-yaml/logging.xml +18 -1
- data/lib/cpee-logging-xes-yaml/template.xes_yaml +2 -2
- data/lib/cpee-logging-xes-yaml/tools.rb +100 -8
- data/lib/cpee-logging-xes-yaml/topics.xml +36 -0
- data/server/log +18 -0
- data/tools/cpee-logging-xes-yaml +21 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b62d072c484be5215020cbe15dfcbc44840d299bda2015d9e8c849e6663d40ad
|
4
|
+
data.tar.gz: 312a095c17bfc8bf5946838d713102f6669e30d5d21d4f6d9a6580569eac7e2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 419ad9a604bcf6a752298cc3f9cd38f18c4e23ec79f1846b773583891639eef79b06eb005969c3345757416cd4a322febbe83bab38a75c81fd1d932b9416bf57
|
7
|
+
data.tar.gz: 929e0c57bfc0ecd888b21e3e76352ff3002d9eef98751a18f64b95fb197fc516f580cd3d4ba1fd4c9b1a12afd822ac706d3347241135407763e4fb81788552e1
|
@@ -1,16 +1,16 @@
|
|
1
1
|
# This file is part of CPEE-LOGGING-XES-YAML.
|
2
2
|
#
|
3
3
|
# CPEE-LOGGING-XES-YAML is free software: you can redistribute it and/or modify it
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
4
|
+
# under the terms of the GNU Lesser General Public License as published by the Free
|
5
5
|
# Software Foundation, either version 3 of the License, or (at your option) any
|
6
6
|
# later version.
|
7
7
|
#
|
8
8
|
# CPEE-LOGGING-XES-YAML is distributed in the hope that it will be useful, but
|
9
9
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
10
|
+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
11
11
|
# more details.
|
12
12
|
#
|
13
|
-
# You should have received a copy of the GNU General Public License along with
|
13
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
14
14
|
# CPEE-LOGGING-XES-YAML (file LICENSE in the main directory). If not, see
|
15
15
|
# <http://www.gnu.org/licenses/>.
|
16
16
|
|
@@ -23,8 +23,6 @@ require 'time'
|
|
23
23
|
|
24
24
|
require_relative 'tools'
|
25
25
|
|
26
|
-
matze = 'localhostr:9318'
|
27
|
-
|
28
26
|
module CPEE
|
29
27
|
module Logging
|
30
28
|
|
@@ -32,25 +30,112 @@ module CPEE
|
|
32
30
|
|
33
31
|
class Handler < Riddl::Implementation
|
34
32
|
def response
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
opts = @a[0]
|
34
|
+
type = @p[0].value
|
35
|
+
topic = @p[1].value
|
36
|
+
event_name = @p[2].value
|
37
|
+
payload = @p[3].value.read
|
38
|
+
EM.defer do
|
39
|
+
CPEE::Logging::forward opts, topic, event_name, payload
|
40
|
+
end if type == 'event'
|
40
41
|
EM.defer do
|
41
|
-
CPEE::Logging::doc topic, event_name,
|
42
|
+
CPEE::Logging::doc opts, topic, event_name, payload
|
42
43
|
end
|
43
44
|
nil
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
48
|
+
class Overview < Riddl::Implementation #{{{
|
49
|
+
def response
|
50
|
+
Riddl::Parameter::Complex.new("overview","text/xml") do
|
51
|
+
<<-END
|
52
|
+
<overview xmlns='http://riddl.org/ns/common-patterns/notifications-producer/2.0'>
|
53
|
+
<topics/>
|
54
|
+
<subscriptions/>
|
55
|
+
</overview>
|
56
|
+
END
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end #}}}
|
60
|
+
|
61
|
+
class Topics < Riddl::Implementation #{{{
|
62
|
+
def response
|
63
|
+
opts = @a[0]
|
64
|
+
Riddl::Parameter::Complex.new("overview","text/xml") do
|
65
|
+
File.read(opts[:topics])
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end #}}}
|
69
|
+
|
70
|
+
class Subscriptions < Riddl::Implementation #{{{
|
71
|
+
def response
|
72
|
+
opts = @a[0]
|
73
|
+
Riddl::Parameter::Complex.new("subscriptions","text/xml") do
|
74
|
+
ret = XML::Smart::string <<-END
|
75
|
+
<subscriptions xmlns='http://riddl.org/ns/common-patterns/notifications-producer/2.0'/>
|
76
|
+
END
|
77
|
+
Dir.glob(File.join(opts[:notifications_dir],'*','subscription.xml')).each do |f|
|
78
|
+
ret.root.add('subscription').tap do |n|
|
79
|
+
n.attributes['id'] = File.basename(File.dirname(f))
|
80
|
+
XML::Smart.open_unprotected(f) do |doc|
|
81
|
+
n.attributes['url'] = doc.root.attributes['url']
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
ret.to_s
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end #}}}
|
89
|
+
|
90
|
+
class Subscription < Riddl::Implementation #{{{
|
91
|
+
def response
|
92
|
+
opts = @a[0]
|
93
|
+
id = @r[-1]
|
94
|
+
doc = XML::Smart::open_unprotected(File.join(opts[:notifications_dir],id,'subscription.xml'))
|
95
|
+
doc.root.attributes['id'] = id
|
96
|
+
Riddl::Parameter::Complex.new("subscriptions","text/xml",doc.to_s)
|
97
|
+
end
|
98
|
+
end #}}}
|
99
|
+
|
47
100
|
def self::implementation(opts)
|
48
|
-
opts[:log_dir]
|
49
|
-
opts[:
|
101
|
+
opts[:log_dir] ||= File.expand_path(File.join(__dir__,'logs'))
|
102
|
+
opts[:notifications_dir] ||= File.expand_path(File.join(__dir__,'notifications'))
|
103
|
+
opts[:template] ||= File.expand_path(File.join(__dir__,'template.xes_yaml'))
|
104
|
+
opts[:topics] ||= File.expand_path(File.join(__dir__,'topics.xml'))
|
105
|
+
opts[:subscriptions] = {}
|
106
|
+
|
107
|
+
Dir.glob(File.join(opts[:notifications_dir],'*','subscription.xml')).each do |f|
|
108
|
+
XML::Smart::open_unprotected(f) do |doc|
|
109
|
+
doc.register_namespace :p, 'http://riddl.org/ns/common-patterns/notifications-producer/2.0'
|
110
|
+
doc.find('/p:subscription/p:topic').each do |t|
|
111
|
+
t.find('p:event').each do |e|
|
112
|
+
opts[:subscriptions][t.attributes['id']+'/'+e.text] ||= []
|
113
|
+
opts[:subscriptions][t.attributes['id']+'/'+e.text] << doc.root.attributes['url']
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
50
118
|
|
51
119
|
Proc.new do
|
52
120
|
interface 'events' do
|
53
|
-
run Handler, opts
|
121
|
+
run Handler, opts if post 'event'
|
122
|
+
end
|
123
|
+
interface 'notifications' do
|
124
|
+
on resource "notifications" do
|
125
|
+
run Overview if get
|
126
|
+
on resource "topics" do
|
127
|
+
run Topics, opts if get
|
128
|
+
end
|
129
|
+
on resource "subscriptions" do
|
130
|
+
run Subscriptions, opts if get
|
131
|
+
run CreateSubscription, opts if post 'create_subscription'
|
132
|
+
on resource do
|
133
|
+
run Subscription, opts if get
|
134
|
+
run UpdateSubscription, opts if put 'change_subscription'
|
135
|
+
run DeleteSubscription, opts if delete
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
54
139
|
end
|
55
140
|
end
|
56
141
|
end
|
@@ -1,3 +1,21 @@
|
|
1
|
+
<!--
|
2
|
+
This file is part of CPEE-LOGGING-XES-YAML.
|
3
|
+
|
4
|
+
CPEE-LOGGING-XES-YAML is free software: you can redistribute it and/or modify
|
5
|
+
it under the terms of the GNU Lesser General Public License as published by the Free
|
6
|
+
Software Foundation, either version 3 of the License, or (at your option) any
|
7
|
+
later version.
|
8
|
+
|
9
|
+
CPEE-LOGGING-XES-YAML is distributed in the hope that it will be useful, but
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
12
|
+
more details.
|
13
|
+
|
14
|
+
You should have received a copy of the GNU Lesser General Public License along with
|
15
|
+
CPEE-LOGGING-XES-YAML (file LICENSE in the main directory). If not, see
|
16
|
+
<http://www.gnu.org/licenses/>.
|
17
|
+
-->
|
18
|
+
|
1
19
|
<declaration xmlns="http://riddl.org/ns/declaration/1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
|
2
20
|
<interface name="events">
|
3
21
|
<xi:include href="http://www.riddl.org/ns/common-patterns/notifications-consumer/2.0/consumer.xml"/>
|
@@ -6,7 +24,6 @@
|
|
6
24
|
<xi:include href="http://www.riddl.org/ns/common-patterns/notifications-producer/2.0/producer.xml"/>
|
7
25
|
</interface>
|
8
26
|
|
9
|
-
|
10
27
|
<facade>
|
11
28
|
<tile>
|
12
29
|
<layer name="events">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
log:
|
3
3
|
namespaces:
|
4
|
-
stream: https://cpee.org/
|
4
|
+
stream: https://cpee.org/datastream/
|
5
5
|
ssn: http://www.w3.org/ns/ssn/
|
6
6
|
sosa: http://www.w3.org/ns/sosa/
|
7
7
|
xes:
|
@@ -13,7 +13,7 @@ log:
|
|
13
13
|
id: http://www.xes-standard.org/identity.xesext
|
14
14
|
lifecycle: http://www.xes-standard.org/lifecycle.xesext
|
15
15
|
cpee: http://cpee.org/cpee.xesext
|
16
|
-
stream: https://cpee.org/
|
16
|
+
stream: https://cpee.org/datastream/datastream.xesext
|
17
17
|
global:
|
18
18
|
trace:
|
19
19
|
concept:name: __INVALID__
|
@@ -1,4 +1,21 @@
|
|
1
|
+
# This file is part of CPEE-LOGGING-XES-YAML.
|
2
|
+
#
|
3
|
+
# CPEE-LOGGING-XES-YAML is free software: you can redistribute it and/or modify it
|
4
|
+
# under the terms of the GNU Lesser General Public License as published by the Free
|
5
|
+
# Software Foundation, either version 3 of the License, or (at your option) any
|
6
|
+
# later version.
|
7
|
+
#
|
8
|
+
# CPEE-LOGGING-XES-YAML is distributed in the hope that it will be useful, but
|
9
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
10
|
+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
11
|
+
# more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
14
|
+
# CPEE-LOGGING-XES-YAML (file LICENSE in the main directory). If not, see
|
15
|
+
# <http://www.gnu.org/licenses/>.
|
16
|
+
|
1
17
|
require 'weel'
|
18
|
+
require 'digest/sha1'
|
2
19
|
|
3
20
|
class StreamPoint
|
4
21
|
attr_accessor :value, :timestamp, :source, :meta
|
@@ -47,7 +64,7 @@ class Stream
|
|
47
64
|
@values.each do |e|
|
48
65
|
if e.is_a? Stream
|
49
66
|
e.source = @source if e.source.nil? && !@source.nil?
|
50
|
-
tp << { 'stream:
|
67
|
+
tp << { 'stream:datastream' => e.to_list }
|
51
68
|
elsif e.is_a? StreamPoint
|
52
69
|
e.source = @source if e.source.nil? && !@source.nil?
|
53
70
|
tp << { 'stream:point' => e.to_h }
|
@@ -60,6 +77,22 @@ end
|
|
60
77
|
module CPEE
|
61
78
|
module Logging
|
62
79
|
|
80
|
+
def self::notify(opts,topic,event_name,payload)
|
81
|
+
opts[:subscriptions].each do |e,urls|
|
82
|
+
if e == topic + '/' + event_name
|
83
|
+
urls.each do |url|
|
84
|
+
client = Riddl::Client.new(url)
|
85
|
+
client.post [
|
86
|
+
Riddl::Parameter::Simple::new('type','event'),
|
87
|
+
Riddl::Parameter::Simple::new('topic',topic),
|
88
|
+
Riddl::Parameter::Simple::new('event',event_name),
|
89
|
+
Riddl::Parameter::Complex::new('notification','application/json',payload)
|
90
|
+
]
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
63
96
|
def self::val_merge(target,val,tid,tso)
|
64
97
|
if val.is_a? Stream
|
65
98
|
val.source = tso if val.source.nil?
|
@@ -89,6 +122,40 @@ module CPEE
|
|
89
122
|
end
|
90
123
|
end
|
91
124
|
end
|
125
|
+
def self::extract_annotations(where,xml)
|
126
|
+
ret = {}
|
127
|
+
XML::Smart::string(xml) do |doc|
|
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'
|
131
|
+
fname = where + '_' + tid + '.anno'
|
132
|
+
nset = if tid == 'start'
|
133
|
+
c.find('d:*[starts-with(name(),"_")]')
|
134
|
+
else
|
135
|
+
c.find('d:annotations')
|
136
|
+
end
|
137
|
+
nset.each do |p|
|
138
|
+
anno = p.dump
|
139
|
+
ret[tid] ||= []
|
140
|
+
ret[tid] << anno
|
141
|
+
end
|
142
|
+
if ret[tid]
|
143
|
+
if ret[tid].length > 1
|
144
|
+
ret[tid] = "<annotations xmlns=\"http://cpee.org/ns/description/1.0\">\n" +
|
145
|
+
ret[tid].join("\n") + "\n" +
|
146
|
+
"</annotations>"
|
147
|
+
else
|
148
|
+
ret[tid] = ret[tid][0]
|
149
|
+
end
|
150
|
+
hash = Digest::SHA1.hexdigest(ret[tid])
|
151
|
+
if !File.exists?(fname) || (File.exists?(fname) && File.read(fname) != hash)
|
152
|
+
File.write(fname,hash)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
ret
|
158
|
+
end
|
92
159
|
|
93
160
|
def self::extract_result(result)
|
94
161
|
ret = result.map do |res|
|
@@ -133,18 +200,32 @@ module CPEE
|
|
133
200
|
end
|
134
201
|
f = File.open(where,'r+')
|
135
202
|
f.flock(File::LOCK_EX)
|
136
|
-
json = JSON::load(f)
|
203
|
+
json = JSON::load(f) || {}
|
204
|
+
json.merge!(values)
|
137
205
|
f.rewind
|
138
206
|
f.truncate(0)
|
139
207
|
f.write(JSON.generate(json))
|
140
208
|
f.close
|
141
209
|
end
|
142
210
|
|
143
|
-
def self::
|
211
|
+
def self::forward(opts,topic,event_name,payload)
|
212
|
+
if topic == 'state' && event_name == 'change'
|
213
|
+
self::notify(opts,topic,event_name,payload)
|
214
|
+
elsif topic == 'state' && event_name == 'change'
|
215
|
+
self::notify(opts,topic,event_name,payload)
|
216
|
+
elsif topic == 'gateway' && event_name == 'join'
|
217
|
+
self::notify(opts,topic,event_name,payload)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
def self::doc(opts,topic,event_name,payload)
|
144
222
|
notification = JSON.parse(payload)
|
145
223
|
instance = notification['instance-uuid']
|
146
224
|
return unless instance
|
147
225
|
|
226
|
+
log_dir = opts[:log_dir]
|
227
|
+
template = opts[:template]
|
228
|
+
|
148
229
|
instancenr = notification['instance']
|
149
230
|
content = notification['content']
|
150
231
|
activity = content['activity']
|
@@ -153,6 +234,17 @@ module CPEE
|
|
153
234
|
|
154
235
|
if content['dslx']
|
155
236
|
CPEE::Logging::extract_probes(File.join(log_dir,instance),content['dslx'])
|
237
|
+
CPEE::Logging::extract_annotations(File.join(log_dir,instance),content['dslx']).each do |k,v|
|
238
|
+
so = Marshal.load(Marshal.dump(notification))
|
239
|
+
so['content'].delete('dslx')
|
240
|
+
so['content'].delete('dsl')
|
241
|
+
so['content'].delete('description')
|
242
|
+
so['content']['annotation'] = v
|
243
|
+
so['content']['activity'] = k
|
244
|
+
so['topic'] = 'annotation'
|
245
|
+
so['name'] = 'change'
|
246
|
+
self::notify(opts,'annotation','change',so.to_json)
|
247
|
+
end
|
156
248
|
end
|
157
249
|
|
158
250
|
if topic == 'dataelements' && event_name == 'change'
|
@@ -204,9 +296,9 @@ module CPEE
|
|
204
296
|
doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
|
205
297
|
doc.find('//d:probe[d:extractor_type="intrinsic"]').each do |p|
|
206
298
|
pid = p.find('string(d:id)')
|
207
|
-
event['stream:
|
299
|
+
event['stream:datastream'] ||= []
|
208
300
|
val = CPEE::Logging::extract_sensor(rs,p.find('string(d:extractor_code)'),pid,nil) rescue nil
|
209
|
-
CPEE::Logging::val_merge(event['stream:
|
301
|
+
CPEE::Logging::val_merge(event['stream:datastream'],val,pid,p.find('string(d:source)'))
|
210
302
|
end
|
211
303
|
end
|
212
304
|
end
|
@@ -225,13 +317,13 @@ module CPEE
|
|
225
317
|
rc = CPEE::Logging::extract_result(receiving)
|
226
318
|
doc.find('//d:probe[d:extractor_type="extrinsic"]').each do |p|
|
227
319
|
pid = p.find('string(d:id)')
|
228
|
-
te['stream:
|
320
|
+
te['stream:datastream'] ||= []
|
229
321
|
val = CPEE::Logging::extract_sensor(rs,p.find('string(d:extractor_code)'),pid,rc) rescue nil
|
230
|
-
CPEE::Logging::val_merge(te['stream:
|
322
|
+
CPEE::Logging::val_merge(te['stream:datastream'],val,pid,p.find('string(d:source)'))
|
231
323
|
end
|
232
324
|
end
|
233
325
|
end
|
234
|
-
if te['stream:
|
326
|
+
if te['stream:datastream']
|
235
327
|
te["cpee:lifecycle:transition"] = "sensor/stream"
|
236
328
|
File.open(File.join(log_dir,instance+'.xes.yaml'),'a') do |f|
|
237
329
|
f << {'event' => te}.to_yaml
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<!--
|
2
|
+
This file is part of CPEE-LOGGING-XES-YAML.
|
3
|
+
|
4
|
+
CPEE-LOGGING-XES-YAML is free software: you can redistribute it and/or modify
|
5
|
+
it under the terms of the GNU Lesser General Public License as published by the Free
|
6
|
+
Software Foundation, either version 3 of the License, or (at your option) any
|
7
|
+
later version.
|
8
|
+
|
9
|
+
CPEE-LOGGING-XES-YAML is distributed in the hope that it will be useful, but
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
12
|
+
more details.
|
13
|
+
|
14
|
+
You should have received a copy of the GNU Lesser General Public License along with
|
15
|
+
CPEE-LOGGING-XES-YAML (file LICENSE in the main directory). If not, see
|
16
|
+
<http://www.gnu.org/licenses/>.
|
17
|
+
-->
|
18
|
+
|
19
|
+
<topics xmlns='http://riddl.org/ns/common-patterns/notifications-producer/2.0'>
|
20
|
+
<topic id='annotation'>
|
21
|
+
<event>change</event>
|
22
|
+
</topic>
|
23
|
+
<topic id='stream'>
|
24
|
+
<event>extraction</event>
|
25
|
+
</topic>
|
26
|
+
<topic id='gateway'>
|
27
|
+
<event>decide</event>
|
28
|
+
<event>join</event>
|
29
|
+
</topic>
|
30
|
+
<topic id='state'>
|
31
|
+
<event>change</event>
|
32
|
+
</topic>
|
33
|
+
<topic id='task'>
|
34
|
+
<event>instantiation</event>
|
35
|
+
</topic>
|
36
|
+
</topics>
|
data/server/log
CHANGED
@@ -1,4 +1,21 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
|
+
#
|
3
|
+
# This file is part of CPEE-LOGGING-XES-YAML.
|
4
|
+
#
|
5
|
+
# CPEE-LOGGING-XES-YAML is free software: you can redistribute it and/or modify it
|
6
|
+
# under the terms of the GNU Lesser General Public License as published by the Free
|
7
|
+
# Software Foundation, either version 3 of the License, or (at your option) any
|
8
|
+
# later version.
|
9
|
+
#
|
10
|
+
# CPEE-LOGGING-XES-YAML is distributed in the hope that it will be useful, but
|
11
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
12
|
+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
13
|
+
# more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
16
|
+
# CPEE-LOGGING-XES-YAML (file LICENSE in the main directory). If not, see
|
17
|
+
# <http://www.gnu.org/licenses/>.
|
18
|
+
|
2
19
|
require 'rubygems'
|
3
20
|
require 'cpee-logging-xes-yaml/logging'
|
4
21
|
|
@@ -13,6 +30,7 @@ Riddl::Server.new(CPEE::Logging::SERVER, options) do
|
|
13
30
|
cross_site_xhr true
|
14
31
|
|
15
32
|
@riddl_opts[:log_dir] ||= File.join(__dir__,'logs')
|
33
|
+
@riddl_opts[:subscriptions_dir] ||= File.join(__dir__,'subscriptions')
|
16
34
|
|
17
35
|
use CPEE::Logging::implementation(@riddl_opts)
|
18
36
|
end.loop!
|
data/tools/cpee-logging-xes-yaml
CHANGED
@@ -1,4 +1,21 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
|
+
#
|
3
|
+
# This file is part of CPEE-LOGGING-XES-YAML.
|
4
|
+
#
|
5
|
+
# CPEE-LOGGING-XES-YAML is free software: you can redistribute it and/or modify it
|
6
|
+
# under the terms of the GNU Lesser General Public License as published by the Free
|
7
|
+
# Software Foundation, either version 3 of the License, or (at your option) any
|
8
|
+
# later version.
|
9
|
+
#
|
10
|
+
# CPEE-LOGGING-XES-YAML is distributed in the hope that it will be useful, but
|
11
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
12
|
+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
13
|
+
# more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
16
|
+
# CPEE-LOGGING-XES-YAML (file LICENSE in the main directory). If not, see
|
17
|
+
# <http://www.gnu.org/licenses/>.
|
18
|
+
|
2
19
|
curpath = __dir__
|
3
20
|
require 'rubygems'
|
4
21
|
require 'optparse'
|
@@ -28,22 +45,22 @@ end
|
|
28
45
|
|
29
46
|
def follow(fname,io,copy,deep=0)
|
30
47
|
if copy
|
31
|
-
File.write(File.basename(fname,'.xes.yaml') + '.xes.yaml',io.read)
|
48
|
+
File.write(File.basename(fname,'.xes.yaml') + '.xes.shift.yaml',io.read)
|
32
49
|
io.rewind
|
33
50
|
end
|
34
51
|
YAML.load_stream(io) do |e|
|
35
52
|
if name = e.dig('log','trace','cpee:name')
|
36
|
-
puts " " * deep + name + " (#{File.basename(fname,'.xes.yaml')}) - #{e.dig('log','trace','concept:name')}"
|
53
|
+
puts " " * deep + name + " (#{File.basename(fname,'.xes.shift.yaml')}) - #{e.dig('log','trace','concept:name')}"
|
37
54
|
end
|
38
55
|
if e.dig('event','cpee:lifecycle:transition') == 'task/instantiation'
|
39
|
-
base = e.dig('event','
|
56
|
+
base = e.dig('event','raw')
|
40
57
|
val = base.dig('CPEE-INSTANCE') rescue nil
|
41
58
|
if val.nil?
|
42
59
|
val = File.basename(base)
|
43
60
|
end
|
44
61
|
uuid = base.dig('CPEE-INSTANCE-UUID') rescue nil
|
45
62
|
if uuid
|
46
|
-
react File.dirname(fname) + "/#{uuid}.xes.yaml",copy,deep + 2
|
63
|
+
react File.dirname(fname) + "/#{uuid}.xes.shift.yaml",copy,deep + 2
|
47
64
|
end
|
48
65
|
end
|
49
66
|
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.2.
|
4
|
+
version: 1.2.3
|
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: 2022-
|
12
|
+
date: 2022-12-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: riddl
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- lib/cpee-logging-xes-yaml/logging.xml
|
77
77
|
- lib/cpee-logging-xes-yaml/template.xes_yaml
|
78
78
|
- lib/cpee-logging-xes-yaml/tools.rb
|
79
|
+
- lib/cpee-logging-xes-yaml/topics.xml
|
79
80
|
- server/log
|
80
81
|
- tools/cpee-logging-xes-yaml
|
81
82
|
homepage: http://cpee.org/
|