cpee-logging-xes-yaml 1.4.1 → 1.5.0
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/access.xml +36 -0
- data/lib/cpee-logging-xes-yaml/{logging.rb → implementation.rb} +95 -22
- data/lib/cpee-logging-xes-yaml/{logging.xml → implementation.xml} +6 -0
- data/lib/cpee-logging-xes-yaml/tools.rb +57 -162
- data/server/log +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 67349c15e1ff6d822febc79b960677462af169351a9b51c2cd44d55108e7d648
|
|
4
|
+
data.tar.gz: 363d7980e7e6c545bab3012471bd710b90b4e72b3601a6f7acccaceba9681503
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b45a7d336194bcc4fcd797762dcfd8b01f07576beec18f32d6815702058013963270b88b0c589da51f435058bd0e104d89fbdac80d3247eaa2410c936aa25236
|
|
7
|
+
data.tar.gz: e4b0e88672ff0221fecbc8821a12b1bb3776386b27c3d1fd02f9645d86fd8612b004799892ff4e0a5f170d5ea2c69175083b09f25d7d22950e2fc14bf2f2a005
|
|
@@ -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
|
+
<description datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:doc="http://cpee.org/ns/documentation">
|
|
20
|
+
|
|
21
|
+
<message name="yaml">
|
|
22
|
+
<parameter name="log" mimetype="text/yaml"/>
|
|
23
|
+
</message>
|
|
24
|
+
<message name="xml">
|
|
25
|
+
<parameter name="log" mimetype="application/xml"/>
|
|
26
|
+
</message>
|
|
27
|
+
|
|
28
|
+
<resource>
|
|
29
|
+
<resource relative="[a-f0-9-]+.xes.yaml">
|
|
30
|
+
<get out="yaml"/>
|
|
31
|
+
</resource>
|
|
32
|
+
<resource relative="[a-f0-9-]+.xes.xml">
|
|
33
|
+
<get out="xml"/>
|
|
34
|
+
</resource>
|
|
35
|
+
</resource>
|
|
36
|
+
</description>
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
# CPEE-LOGGING-XES-YAML (file LICENSE in the main directory). If not, see
|
|
15
15
|
# <http://www.gnu.org/licenses/>.
|
|
16
16
|
|
|
17
|
-
require 'rubygems'
|
|
18
17
|
require 'redis'
|
|
19
18
|
require 'json'
|
|
20
19
|
require 'yaml'
|
|
@@ -26,7 +25,71 @@ require_relative 'tools'
|
|
|
26
25
|
module CPEE
|
|
27
26
|
module Logging
|
|
28
27
|
|
|
29
|
-
SERVER = File.expand_path(File.join(__dir__,'
|
|
28
|
+
SERVER = File.expand_path(File.join(__dir__,'implementation.xml'))
|
|
29
|
+
|
|
30
|
+
class HeaderAndFile #{{{
|
|
31
|
+
def initialize(header, io)
|
|
32
|
+
@header = header
|
|
33
|
+
@io = io
|
|
34
|
+
@position = 0
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def read(length = nil, outbuf = nil)
|
|
38
|
+
if @position < @header.bytesize
|
|
39
|
+
data = read_header(length)
|
|
40
|
+
|
|
41
|
+
if length && data.bytesize < length
|
|
42
|
+
remaining_length = length - data.bytesize
|
|
43
|
+
file_data = @io.read
|
|
44
|
+
data << file_data if file_data
|
|
45
|
+
end
|
|
46
|
+
else
|
|
47
|
+
data = @io.read(length)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
return data.nil? || data.empty? && length ? nil : append_to_outbuf(data, outbuf)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def rewind
|
|
54
|
+
@io&.rewind
|
|
55
|
+
@position = 0 # returning position is the way rewind does it
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def close
|
|
59
|
+
@io&.close
|
|
60
|
+
@io = nil
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def read_header(length)
|
|
64
|
+
chunk = if length
|
|
65
|
+
@header.byteslice(@position, length)
|
|
66
|
+
else
|
|
67
|
+
@header.byteslice(@position..-1)
|
|
68
|
+
end
|
|
69
|
+
@position += chunk.bytesize
|
|
70
|
+
chunk
|
|
71
|
+
end
|
|
72
|
+
private :read_header
|
|
73
|
+
|
|
74
|
+
def append_to_outbuf(data, outbuf)
|
|
75
|
+
outbuf ? outbuf.replace(data || '') : data
|
|
76
|
+
end
|
|
77
|
+
private :append_to_outbuf
|
|
78
|
+
end #}}}
|
|
79
|
+
|
|
80
|
+
class DownloadYAML < Riddl::Implementation
|
|
81
|
+
def response
|
|
82
|
+
opts = @a[0]
|
|
83
|
+
fname = File.join(opts[:log_dir],@r[-1])
|
|
84
|
+
if File.exist?(fname)
|
|
85
|
+
io = File.open fname
|
|
86
|
+
header = File.read(fname.sub(/yaml$/,'header')) if File.exist?(fname.sub(/yaml$/,'header'))
|
|
87
|
+
Riddl::Parameter::Complex::new('log','text/yaml',HeaderAndFile.new(header || '',File.open(fname)))
|
|
88
|
+
else
|
|
89
|
+
@status = 404
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
30
93
|
|
|
31
94
|
class Handler < Riddl::Implementation
|
|
32
95
|
def response
|
|
@@ -36,20 +99,20 @@ module CPEE
|
|
|
36
99
|
event_name = @p[2].value
|
|
37
100
|
payload = @p[3].value.read
|
|
38
101
|
|
|
39
|
-
### we
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
102
|
+
### we write headers into its own file. If race condition at first, no problemo
|
|
103
|
+
unless File.exist? File.join(opts[:log_dir],@h['CPEE_INSTANCE_UUID'] + '.xes.header')
|
|
104
|
+
notification = JSON.parse(payload)
|
|
105
|
+
log = YAML::load(File.read(opts[:template]))
|
|
106
|
+
log['log']['trace']['concept:name'] ||= notification['instance']
|
|
107
|
+
log['log']['trace']['cpee:name'] ||= notification['instance-name'] if notification['instance-name']
|
|
108
|
+
log['log']['trace']['cpee:instance'] ||= notification['instance-uuid']
|
|
109
|
+
log['log']['trace']['cpee:parent_instance'] ||= notification.dig('content','attributes','parent_instance').to_i if notification.dig('content','attributes','parent_instance')
|
|
110
|
+
log['log']['trace']['cpee:parent_instance_uuid'] ||= notification.dig('content','attributes','parent_instance_uuid') if notification.dig('content','attributes','parent_instance_uuid')
|
|
111
|
+
log['log']['trace']['cpee:parent_instance_model'] ||= notification.dig('content','attributes','parent_instance_model') if notification.dig('content','attributes','parent_instance_model')
|
|
112
|
+
log['log']['trace']['cpee:parent_instance_task_id'] ||= notification.dig('content','attributes','parent_instance_task_id') if notification.dig('content','attributes','parent_instance_task_id')
|
|
113
|
+
log['log']['trace']['cpee:parent_instance_task_label'] ||= notification.dig('content','attributes','parent_instance_task_label') if notification.dig('content','attributes','parent_instance_task_label')
|
|
114
|
+
File.open(File.join(opts[:log_dir],@h['CPEE_INSTANCE_UUID']+'.xes.header'),'w'){|f| f.puts log.to_yaml}
|
|
115
|
+
end
|
|
53
116
|
|
|
54
117
|
EM.defer do
|
|
55
118
|
CPEE::Logging::forward opts, topic, event_name, payload
|
|
@@ -77,7 +140,7 @@ module CPEE
|
|
|
77
140
|
class Topics < Riddl::Implementation #{{{
|
|
78
141
|
def response
|
|
79
142
|
opts = @a[0]
|
|
80
|
-
Riddl::Parameter::Complex.new(
|
|
143
|
+
Riddl::Parameter::Complex.new('overview','text/xml') do
|
|
81
144
|
File.read(opts[:topics])
|
|
82
145
|
end
|
|
83
146
|
end
|
|
@@ -86,7 +149,7 @@ module CPEE
|
|
|
86
149
|
class Subscriptions < Riddl::Implementation #{{{
|
|
87
150
|
def response
|
|
88
151
|
opts = @a[0]
|
|
89
|
-
Riddl::Parameter::Complex.new(
|
|
152
|
+
Riddl::Parameter::Complex.new('subscriptions','text/xml') do
|
|
90
153
|
ret = XML::Smart::string <<-END
|
|
91
154
|
<subscriptions xmlns='http://riddl.org/ns/common-patterns/notifications-producer/2.0'/>
|
|
92
155
|
END
|
|
@@ -109,7 +172,7 @@ module CPEE
|
|
|
109
172
|
id = @r[-1]
|
|
110
173
|
doc = XML::Smart::open_unprotected(File.join(opts[:notifications_dir],id,'subscription.xml'))
|
|
111
174
|
doc.root.attributes['id'] = id
|
|
112
|
-
Riddl::Parameter::Complex.new(
|
|
175
|
+
Riddl::Parameter::Complex.new('subscriptions','text/xml',doc.to_s)
|
|
113
176
|
end
|
|
114
177
|
end #}}}
|
|
115
178
|
|
|
@@ -120,6 +183,8 @@ module CPEE
|
|
|
120
183
|
opts[:topics] ||= File.expand_path(File.join(__dir__,'topics.xml'))
|
|
121
184
|
opts[:subscriptions] = {}
|
|
122
185
|
|
|
186
|
+
opts[:sse_keepalive_frequency] ||= 10
|
|
187
|
+
|
|
123
188
|
Dir.glob(File.join(opts[:notifications_dir],'*','subscription.xml')).each do |f|
|
|
124
189
|
XML::Smart::open_unprotected(f) do |doc|
|
|
125
190
|
doc.register_namespace :p, 'http://riddl.org/ns/common-patterns/notifications-producer/2.0'
|
|
@@ -133,16 +198,24 @@ module CPEE
|
|
|
133
198
|
end
|
|
134
199
|
|
|
135
200
|
Proc.new do
|
|
201
|
+
interface 'access' do
|
|
202
|
+
on resource '[a-f0-9-]+.xes.yaml' do
|
|
203
|
+
run DownloadYAML, opts if get
|
|
204
|
+
end
|
|
205
|
+
on resource '[a-f0-9-]+.xes.xml' do
|
|
206
|
+
run DownloadXML, opts if get
|
|
207
|
+
end
|
|
208
|
+
end
|
|
136
209
|
interface 'events' do
|
|
137
210
|
run Handler, opts if post 'event'
|
|
138
211
|
end
|
|
139
212
|
interface 'notifications' do
|
|
140
|
-
on resource
|
|
213
|
+
on resource 'notifications' do
|
|
141
214
|
run Overview if get
|
|
142
|
-
on resource
|
|
215
|
+
on resource 'topics' do
|
|
143
216
|
run Topics, opts if get
|
|
144
217
|
end
|
|
145
|
-
on resource
|
|
218
|
+
on resource 'subscriptions' do
|
|
146
219
|
run Subscriptions, opts if get
|
|
147
220
|
run CreateSubscription, opts if post 'create_subscription'
|
|
148
221
|
on resource do
|
|
@@ -23,9 +23,15 @@
|
|
|
23
23
|
<interface name="notifications">
|
|
24
24
|
<xi:include href="http://www.riddl.org/ns/common-patterns/notifications-producer/2.0/producer.xml"/>
|
|
25
25
|
</interface>
|
|
26
|
+
<interface name="access">
|
|
27
|
+
<xi:include href="access.xml"/>
|
|
28
|
+
</interface>
|
|
26
29
|
|
|
27
30
|
<facade>
|
|
28
31
|
<tile>
|
|
32
|
+
<layer name="access">
|
|
33
|
+
<apply-to>/logs</apply-to>
|
|
34
|
+
</layer>
|
|
29
35
|
<layer name="events">
|
|
30
36
|
<apply-to>/</apply-to>
|
|
31
37
|
</layer>
|
|
@@ -114,53 +114,6 @@ module CPEE
|
|
|
114
114
|
end
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
-
def self::extract_probes(where,xml)
|
|
118
|
-
XML::Smart::string(xml) do |doc|
|
|
119
|
-
doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
|
|
120
|
-
doc.find('//d:call | //d:manipulate').each do |c|
|
|
121
|
-
File.unlink(where + '_' + c.attributes['id'] + '.probe') rescue nil
|
|
122
|
-
c.find('d:annotations/d:_context_data_analysis/d:probes[d:probe]').each do |p|
|
|
123
|
-
File.write(where + '_' + c.attributes['id'] + '.probe', p.dump)
|
|
124
|
-
end
|
|
125
|
-
end
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
def self::extract_annotations(where,xml)
|
|
130
|
-
ret = {}
|
|
131
|
-
XML::Smart::string(xml) do |doc|
|
|
132
|
-
doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
|
|
133
|
-
doc.find('/d:description | //d:call | //d:manipulate').each do |c|
|
|
134
|
-
tid = c.attributes['id'] || 'complex'
|
|
135
|
-
fname = where + '_' + tid + '.anno'
|
|
136
|
-
nset = if tid == 'complex'
|
|
137
|
-
c.find('d:*[starts-with(name(),"_")]')
|
|
138
|
-
else
|
|
139
|
-
c.find('d:annotations')
|
|
140
|
-
end
|
|
141
|
-
nset.each do |p|
|
|
142
|
-
anno = p.dump
|
|
143
|
-
ret[tid] ||= []
|
|
144
|
-
ret[tid] << anno
|
|
145
|
-
end
|
|
146
|
-
if ret[tid]
|
|
147
|
-
if ret[tid].length > 1
|
|
148
|
-
ret[tid] = "<annotations xmlns=\"http://cpee.org/ns/description/1.0\">\n" +
|
|
149
|
-
ret[tid].join("\n") + "\n" +
|
|
150
|
-
'</annotations>'
|
|
151
|
-
else
|
|
152
|
-
ret[tid] = ret[tid][0]
|
|
153
|
-
end
|
|
154
|
-
hash = Digest::SHA1.hexdigest(ret[tid])
|
|
155
|
-
if !File.exist?(fname) || File.read(fname) != hash
|
|
156
|
-
File.write(fname,hash)
|
|
157
|
-
end
|
|
158
|
-
end
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
ret
|
|
162
|
-
end
|
|
163
|
-
|
|
164
117
|
def self::extract_result(result)
|
|
165
118
|
ret = result.map do |res|
|
|
166
119
|
if res['mimetype'].nil?
|
|
@@ -198,30 +151,6 @@ module CPEE
|
|
|
198
151
|
e.backtrace[0].gsub(/(\w+):(\d+):in.*/,'Probe ' + pid + ' Line \2: ') + e.message
|
|
199
152
|
end
|
|
200
153
|
|
|
201
|
-
def self::persist_values(where,values)
|
|
202
|
-
unless File.exist?(where)
|
|
203
|
-
File.write(where,'{}')
|
|
204
|
-
end
|
|
205
|
-
f = File.open(where,'r+')
|
|
206
|
-
f.flock(File::LOCK_EX)
|
|
207
|
-
json = JSON::load(f) || {}
|
|
208
|
-
json.merge!(values)
|
|
209
|
-
f.rewind
|
|
210
|
-
f.truncate(0)
|
|
211
|
-
f.write(JSON.generate(json))
|
|
212
|
-
f.flock(File::LOCK_UN)
|
|
213
|
-
f.close
|
|
214
|
-
end
|
|
215
|
-
def self::load_values(where)
|
|
216
|
-
ret = nil
|
|
217
|
-
File.open(where,'r') do |f|
|
|
218
|
-
f.flock(File::LOCK_SH)
|
|
219
|
-
ret = JSON::load(f)
|
|
220
|
-
f.flock(File::LOCK_UN)
|
|
221
|
-
end
|
|
222
|
-
ret
|
|
223
|
-
end
|
|
224
|
-
|
|
225
154
|
def self::forward(opts,topic,event_name,payload)
|
|
226
155
|
if topic == 'state' && event_name == 'change'
|
|
227
156
|
self::notify(opts,topic,event_name,payload)
|
|
@@ -246,29 +175,6 @@ module CPEE
|
|
|
246
175
|
parameters = content['parameters']
|
|
247
176
|
receiving = content['received']
|
|
248
177
|
|
|
249
|
-
if content['dslx']
|
|
250
|
-
CPEE::Logging::extract_probes(File.join(log_dir,instance),content['dslx'])
|
|
251
|
-
CPEE::Logging::extract_annotations(File.join(log_dir,instance),content['dslx']).each do |k,v|
|
|
252
|
-
so = JSON.parse(notification.to_json)
|
|
253
|
-
so['content'].delete('dslx')
|
|
254
|
-
so['content'].delete('dsl')
|
|
255
|
-
so['content'].delete('description')
|
|
256
|
-
so['content']['annotation'] = v
|
|
257
|
-
so['content']['activity'] = k
|
|
258
|
-
so['topic'] = 'annotation'
|
|
259
|
-
so['name'] = 'change'
|
|
260
|
-
EM.defer do
|
|
261
|
-
self::notify(opts,'annotation','change',so.to_json)
|
|
262
|
-
end
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
|
-
|
|
266
|
-
if topic == 'dataelements' && event_name == 'change'
|
|
267
|
-
if content['changed']&.any?
|
|
268
|
-
CPEE::Logging::persist_values(File.join(log_dir,instance + '.data.json'),content['values'])
|
|
269
|
-
end
|
|
270
|
-
end
|
|
271
|
-
|
|
272
178
|
event = {}
|
|
273
179
|
event['concept:instance'] = instancenr
|
|
274
180
|
event['concept:name'] = content['label'] if content['label']
|
|
@@ -298,90 +204,79 @@ module CPEE
|
|
|
298
204
|
unless parameters['arguments']&.nil?
|
|
299
205
|
event['data'] = parameters['arguments']
|
|
300
206
|
end if parameters
|
|
301
|
-
if content['
|
|
207
|
+
if (event_name == 'modify' || event_name == 'change') && content['values']&.any?
|
|
302
208
|
event['data'] = content['values'].map do |k,v|
|
|
303
209
|
{ 'name' => k, 'value' => v }
|
|
304
210
|
end
|
|
211
|
+
end
|
|
305
212
|
|
|
306
|
-
|
|
307
|
-
|
|
213
|
+
if topic == 'task' && event_name == 'probe'
|
|
214
|
+
rs = WEEL::ReadStructure.new(content['data'],{},{},{})
|
|
215
|
+
rc = CPEE::Logging::extract_result(receiving) if receiving && !receiving.empty?
|
|
216
|
+
te = event.dup
|
|
308
217
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if val != nil
|
|
320
|
-
event['stream:datastream'] ||= []
|
|
321
|
-
CPEE::Logging::merge_val(event['stream:datastream'],val,pid,source)
|
|
322
|
-
end
|
|
218
|
+
content['probes'].each do |p|
|
|
219
|
+
|
|
220
|
+
if p.dig('probe','extractor_type') == 'intrinsic'
|
|
221
|
+
pid = p.dig('probe','id')
|
|
222
|
+
source = p.dig('probe','source')
|
|
223
|
+
val = CPEE::Logging::extract_val(rs,p.dig('probe','extractor_code'),pid,nil) rescue nil
|
|
224
|
+
# Do not add datastream entries if the dataprobes return nil
|
|
225
|
+
if val != nil
|
|
226
|
+
event['stream:datastream'] ||= []
|
|
227
|
+
CPEE::Logging::merge_val(event['stream:datastream'],val,pid,source)
|
|
323
228
|
end
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
)
|
|
336
|
-
|
|
229
|
+
if event['stream:datastream'] && event['stream:datastream'].any?
|
|
230
|
+
EM.defer do
|
|
231
|
+
self::notify(
|
|
232
|
+
opts,
|
|
233
|
+
'stream',
|
|
234
|
+
'extraction',
|
|
235
|
+
notification.merge(
|
|
236
|
+
'topic'=>'stream',
|
|
237
|
+
'name'=>'extraction',
|
|
238
|
+
'datastream'=>event['stream:datastream']
|
|
239
|
+
).to_json
|
|
240
|
+
)
|
|
241
|
+
end
|
|
337
242
|
end
|
|
338
243
|
end
|
|
339
|
-
end
|
|
340
|
-
end
|
|
341
|
-
# Handle extrinsic data probes
|
|
342
|
-
if topic == 'activity' && event_name == 'receiving' && receiving && !receiving.empty?
|
|
343
|
-
fname = File.join(log_dir,instance + '_' + event['id:id'] + '.probe')
|
|
344
|
-
dname = File.join(log_dir,instance + '.data.json')
|
|
345
244
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
rc = CPEE::Logging::extract_result(receiving)
|
|
354
|
-
doc.find('//d:probe[d:extractor_type="extrinsic"]').each do |p|
|
|
355
|
-
pid = p.find('string(d:id)')
|
|
245
|
+
if receiving && !receiving.empty?
|
|
246
|
+
if p.dig('probe','extractor_type') == 'extrinsic'
|
|
247
|
+
pid = p.dig('probe','id')
|
|
248
|
+
source = p.dig('probe','source')
|
|
249
|
+
val = CPEE::Logging::extract_val(rs,p.dig('probe','extractor_code'),pid,rc) rescue nil
|
|
250
|
+
# Do not add datastream entries if the dataprobes return nil
|
|
251
|
+
if val != nil
|
|
356
252
|
te['stream:datastream'] ||= []
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
253
|
+
CPEE::Logging::merge_val(te['stream:datastream'],val,pid,source)
|
|
254
|
+
end
|
|
255
|
+
if te['stream:datastream'] && te['stream:datastream'].any?
|
|
256
|
+
te['cpee:lifecycle:transition'] = 'stream/data'
|
|
257
|
+
File.open(File.join(log_dir,instance+'.xes.yaml'),'a') do |f|
|
|
258
|
+
f << {'event' => te}.to_yaml
|
|
259
|
+
end
|
|
260
|
+
EM.defer do
|
|
261
|
+
self::notify(
|
|
262
|
+
opts,
|
|
263
|
+
'stream',
|
|
264
|
+
'extraction',
|
|
265
|
+
notification.merge(
|
|
266
|
+
'topic'=>'stream',
|
|
267
|
+
'name'=>'extraction',
|
|
268
|
+
'datastream'=>te['stream:datastream']
|
|
269
|
+
).to_json
|
|
270
|
+
)
|
|
361
271
|
end
|
|
362
272
|
end
|
|
363
273
|
end
|
|
364
274
|
end
|
|
365
|
-
|
|
366
|
-
te['cpee:lifecycle:transition'] = 'stream/data'
|
|
367
|
-
File.open(File.join(log_dir,instance+'.xes.yaml'),'a') do |f|
|
|
368
|
-
f << {'event' => te}.to_yaml
|
|
369
|
-
end
|
|
370
|
-
EM.defer do
|
|
371
|
-
self::notify(
|
|
372
|
-
opts,
|
|
373
|
-
'stream',
|
|
374
|
-
'extraction',
|
|
375
|
-
notification.merge(
|
|
376
|
-
'topic'=>'stream',
|
|
377
|
-
'name'=>'extraction',
|
|
378
|
-
'datastream'=>te['stream:datastream']
|
|
379
|
-
).to_json
|
|
380
|
-
)
|
|
381
|
-
end
|
|
382
|
-
end
|
|
275
|
+
|
|
383
276
|
end
|
|
277
|
+
|
|
384
278
|
end
|
|
279
|
+
|
|
385
280
|
if receiving && !receiving.empty?
|
|
386
281
|
event['data'] = receiving
|
|
387
282
|
end
|
data/server/log
CHANGED
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.
|
|
4
|
+
version: 1.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juergen eTM Mangler
|
|
@@ -105,8 +105,9 @@ files:
|
|
|
105
105
|
- README.md
|
|
106
106
|
- Rakefile
|
|
107
107
|
- cpee-logging-xes-yaml.gemspec
|
|
108
|
-
- lib/cpee-logging-xes-yaml/
|
|
109
|
-
- lib/cpee-logging-xes-yaml/
|
|
108
|
+
- lib/cpee-logging-xes-yaml/access.xml
|
|
109
|
+
- lib/cpee-logging-xes-yaml/implementation.rb
|
|
110
|
+
- lib/cpee-logging-xes-yaml/implementation.xml
|
|
110
111
|
- lib/cpee-logging-xes-yaml/template.xes_yaml
|
|
111
112
|
- lib/cpee-logging-xes-yaml/tools.rb
|
|
112
113
|
- lib/cpee-logging-xes-yaml/topics.xml
|