cpee 2.1.136 → 2.1.140
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/cockpit/compliance-view.html +0 -7
- data/cockpit/compliance.html +0 -7
- data/cockpit/css/ui.css +1 -1
- data/cockpit/edit.html +0 -7
- data/cockpit/graph.html +0 -5
- data/cockpit/index.html +0 -7
- data/cockpit/js/instance.js +27 -4
- data/cockpit/js/llm.js +79 -21
- data/cockpit/js/wfadaptor.js +10 -4
- data/cockpit/llm.html +0 -7
- data/cockpit/llmmodel.html +0 -7
- data/cockpit/model.html +0 -7
- data/cockpit/only_llm.html +0 -7
- data/cockpit/themes/THEMES.MD +4 -0
- data/cockpit/themes/presetlr/symbols/loop_end_pre.svg +1 -1
- data/cockpit/track.html +0 -5
- data/cpee.gemspec +2 -2
- data/lib/cpee/implementation.rb +5 -0
- data/lib/cpee/implementation_callbacks.rb +2 -2
- data/lib/cpee/implementation_notifications.rb +4 -1
- data/lib/cpee/implementation_properties.rb +63 -19
- data/lib/cpee/json_pointer.rb +110 -0
- data/lib/cpee/message.rb +22 -2
- data/lib/cpee/persistence.rb +4 -0
- data/lib/cpee/redis.rb +8 -0
- data/lib/properties/t_dslx.rng +11 -1
- data/lib/properties.xml +4 -7
- data/server/executionhandlers/eval/connection.rb +12 -3
- data/server/executionhandlers/ruby/connection.rb +12 -3
- data/server/executionhandlers/ruby/controller.rb +17 -2
- data/server/routing/end.pid +1 -1
- data/server/routing/forward-events-00.pid +1 -1
- data/server/routing/forward-events.rb +30 -19
- data/server/routing/forward-votes.pid +1 -1
- data/server/routing/forward-votes.rb +56 -43
- data/server/routing/persist.pid +1 -1
- data/server/routing/persist.rb +49 -28
- metadata +8 -2
- data/cockpit/js/build-bpmn2.js +0 -302
|
@@ -188,12 +188,15 @@ class Controller
|
|
|
188
188
|
@votes += votes
|
|
189
189
|
psredis = @opts[:redis_dyn].call "Instance #{@id} Vote"
|
|
190
190
|
collect = []
|
|
191
|
+
changes = []
|
|
191
192
|
psredis.subscribe(votes.map{|e| ['vote-response:00:' + e.to_s] }.flatten) do |on|
|
|
192
193
|
on.message do |what, message|
|
|
193
194
|
index = message.index(' ')
|
|
194
195
|
mess = message[index+1..-1]
|
|
195
196
|
m = JSON.parse(mess)
|
|
196
|
-
|
|
197
|
+
cont, chg = vote_parse(m['content'])
|
|
198
|
+
collect << cont
|
|
199
|
+
changes << chg if chg && chg.any?
|
|
197
200
|
@votes.delete m['name']
|
|
198
201
|
cancel_callback m['name']
|
|
199
202
|
if collect.length >= votes.length
|
|
@@ -201,12 +204,24 @@ class Controller
|
|
|
201
204
|
end
|
|
202
205
|
end
|
|
203
206
|
end
|
|
204
|
-
!collect.include?(false)
|
|
207
|
+
ret = !collect.include?(false)
|
|
208
|
+
changes.each { |chg| yield chg } if ret && block_given?
|
|
209
|
+
ret
|
|
205
210
|
else
|
|
206
211
|
true
|
|
207
212
|
end
|
|
208
213
|
end
|
|
209
214
|
|
|
215
|
+
# single value: true / 'true' continues; hash: { 'continue' => true, '/json/pointer' => value, ... }
|
|
216
|
+
def vote_parse(content)
|
|
217
|
+
val = content.is_a?(String) ? (JSON::parse(content) rescue content) : content
|
|
218
|
+
if val.is_a?(Hash)
|
|
219
|
+
[val['continue'] == true || val['continue'] == 'true', val.select { |k,_| k.to_s.start_with?('/') }]
|
|
220
|
+
else
|
|
221
|
+
[val == true || val == 'true', nil]
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
|
|
210
225
|
def callback(hw,key,content)
|
|
211
226
|
CPEE::Message::send(:callback,'activity/content',base,@id,uuid,info,content.merge(:key => key),@redis)
|
|
212
227
|
@callback_keys[key] = hw
|
data/server/routing/end.pid
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3635871
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3635891
|
|
@@ -18,10 +18,26 @@ require 'redis'
|
|
|
18
18
|
require 'daemonite'
|
|
19
19
|
require 'concurrent-ruby'
|
|
20
20
|
require 'riddl/client'
|
|
21
|
+
require 'digest/sha1'
|
|
21
22
|
require_relative '../../lib/cpee/redis'
|
|
22
23
|
|
|
23
24
|
HTTP_POOL = Concurrent::FixedThreadPool.new(32)
|
|
24
25
|
|
|
26
|
+
# one round trip per event: KEYS[1] is the reverse index (subscription keys for exactly
|
|
27
|
+
# this topic/type/name), ARGV[1] the instance prefix. Returns key, url, sseq per match.
|
|
28
|
+
# GET needs the or '', a nil (false) would truncate the returned array.
|
|
29
|
+
MATCH = <<~LUA.freeze
|
|
30
|
+
local res = {}
|
|
31
|
+
for _, k in ipairs(redis.call('SMEMBERS', KEYS[1])) do
|
|
32
|
+
local b = ARGV[1] .. '/handlers/' .. k
|
|
33
|
+
res[#res+1] = k
|
|
34
|
+
res[#res+1] = redis.call('GET', b .. '/url') or ''
|
|
35
|
+
res[#res+1] = redis.call('INCR', b .. '/seq')
|
|
36
|
+
end
|
|
37
|
+
return res
|
|
38
|
+
LUA
|
|
39
|
+
MATCH_SHA = Digest::SHA1.hexdigest(MATCH).freeze
|
|
40
|
+
|
|
25
41
|
Daemonite.new do |opts|
|
|
26
42
|
opts[:runtime_opts] += [
|
|
27
43
|
["--url=URL", "-uURL", "Specify redis url", ->(p){ opts[:redis_url] = p }],
|
|
@@ -46,26 +62,27 @@ Daemonite.new do |opts|
|
|
|
46
62
|
on.pmessage do |pat, what, message|
|
|
47
63
|
index = message.index(' ')
|
|
48
64
|
mess = message[index+1..-1]
|
|
49
|
-
instance, uuid = message[0...index].split(',')
|
|
65
|
+
instance, uuid, seq = message[0...index].split(',')
|
|
50
66
|
type, worker, event = what.split(':',3)
|
|
51
67
|
topic = ::File::dirname(event)
|
|
52
68
|
name = ::File::basename(event)
|
|
53
69
|
long = File.join(topic,type,name)
|
|
54
70
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
matched.zip(urls).each do |key, url|
|
|
71
|
+
# per subscription sequence (sseq): gapless per subscription, so subscribers can detect missing messages; seq gives the order
|
|
72
|
+
res = CPEE::redis_script(opts[:redis], MATCH_SHA, MATCH, ["instance:#{instance}/handlers/#{long}"], ["instance:#{instance}"])
|
|
73
|
+
forwards = []
|
|
74
|
+
res.each_slice(3) do |key, url, sseq|
|
|
60
75
|
if url.nil? || url == ""
|
|
61
|
-
|
|
76
|
+
forwards << ["forward:#{instance}/#{key}","#{seq},#{sseq} #{mess}"]
|
|
62
77
|
else
|
|
63
78
|
# Ractor.new(url,type,topic,name,mess) do |url,type,topic,name,mess|
|
|
64
79
|
# sadly typhoes does not support ractors
|
|
65
80
|
HTTP_POOL.post do
|
|
66
|
-
Riddl::Client.new(url).post [
|
|
81
|
+
Riddl::Client.new(url, nil, ignore_response: true).post [
|
|
67
82
|
Riddl::Header.new("CPEE-INSTANCE",instance),
|
|
68
83
|
Riddl::Header.new("CPEE-INSTANCE-UUID",uuid),
|
|
84
|
+
Riddl::Header.new("CPEE-SEQ",seq),
|
|
85
|
+
Riddl::Header.new("CPEE-SSEQ",sseq),
|
|
69
86
|
Riddl::Parameter::Simple::new('type',type),
|
|
70
87
|
Riddl::Parameter::Simple::new('topic',topic),
|
|
71
88
|
Riddl::Parameter::Simple::new('event',name),
|
|
@@ -74,17 +91,11 @@ Daemonite.new do |opts|
|
|
|
74
91
|
end
|
|
75
92
|
end
|
|
76
93
|
end
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
opts[:redis].del(*empt) unless empt.empty?
|
|
83
|
-
end
|
|
84
|
-
rescue => e
|
|
85
|
-
puts e.message
|
|
86
|
-
puts e.backtrace
|
|
87
|
-
p '-----------------'
|
|
94
|
+
# all sse subscribers in one round trip
|
|
95
|
+
opts[:redis].pipelined { |p| forwards.each { |c,m| p.publish(c,m) } } unless forwards.empty?
|
|
96
|
+
rescue
|
|
97
|
+
# deliberately silent: an exception must not end the psubscribe loop (and the
|
|
98
|
+
# worker), and subscribers detect missing messages through gaps in sseq
|
|
88
99
|
end
|
|
89
100
|
end
|
|
90
101
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3635884
|
|
@@ -18,17 +18,29 @@ require 'redis'
|
|
|
18
18
|
require 'daemonite'
|
|
19
19
|
require 'riddl/client'
|
|
20
20
|
require 'json'
|
|
21
|
+
require 'digest/sha1'
|
|
21
22
|
require_relative '../../lib/cpee/message'
|
|
22
23
|
require_relative '../../lib/cpee/redis'
|
|
23
24
|
|
|
25
|
+
# one round trip per vote: the controller sends one vote message per subscriber
|
|
26
|
+
# (content.subscription), so only check if that subscriber is still subscribed to
|
|
27
|
+
# exactly this topic/type/name (KEYS[1] is the reverse index). Returns url, sseq
|
|
28
|
+
# or {} if gone. GET needs the or '', a nil (false) would truncate the array.
|
|
29
|
+
MATCH = <<~LUA.freeze
|
|
30
|
+
if redis.call('SISMEMBER', KEYS[1], ARGV[2]) == 0 then return {} end
|
|
31
|
+
local b = ARGV[1] .. '/handlers/' .. ARGV[2]
|
|
32
|
+
return { redis.call('GET', b .. '/url') or '', redis.call('INCR', b .. '/seq') }
|
|
33
|
+
LUA
|
|
34
|
+
MATCH_SHA = Digest::SHA1.hexdigest(MATCH).freeze
|
|
35
|
+
|
|
24
36
|
def persist_handler(instance,key,mess,redis) #{{{
|
|
25
37
|
redis.multi do |multi|
|
|
26
38
|
multi.sadd("instance:#{instance}/callbacks",key)
|
|
27
|
-
multi.set("instance:#{instance}/callbacks/#{key}/subscription",mess.dig('content','subscription'))
|
|
28
|
-
multi.set("instance:#{instance}/callbacks/#{key}/uuid",mess.dig('content','activity-uuid'))
|
|
29
|
-
multi.set("instance:#{instance}/callbacks/#{key}/label",mess.dig('content','label'))
|
|
30
|
-
multi.set("instance:#{instance}/callbacks/#{key}/position",mess.dig('content','activity'))
|
|
31
|
-
multi.set("instance:#{instance}/callbacks/#{key}/type",'vote')
|
|
39
|
+
multi.set("instance:#{instance}/callbacks/#{key}/subscription",mess.dig('content','subscription'),keepttl: true)
|
|
40
|
+
multi.set("instance:#{instance}/callbacks/#{key}/uuid",mess.dig('content','activity-uuid'),keepttl: true)
|
|
41
|
+
multi.set("instance:#{instance}/callbacks/#{key}/label",mess.dig('content','label'),keepttl: true)
|
|
42
|
+
multi.set("instance:#{instance}/callbacks/#{key}/position",mess.dig('content','activity'),keepttl: true)
|
|
43
|
+
multi.set("instance:#{instance}/callbacks/#{key}/type",'vote',keepttl: true)
|
|
32
44
|
end
|
|
33
45
|
end #}}}
|
|
34
46
|
|
|
@@ -64,7 +76,7 @@ Daemonite.new do |opts|
|
|
|
64
76
|
opts[:pubsubredis].psubscribe('vote:*') do |on|
|
|
65
77
|
on.pmessage do |pat, what, message|
|
|
66
78
|
index = message.index(' ')
|
|
67
|
-
instance, uuid = message[0...index].split(',')
|
|
79
|
+
instance, uuid, seq = message[0...index].split(',')
|
|
68
80
|
mess = message[index+1..-1]
|
|
69
81
|
|
|
70
82
|
type, worker, event = what.split(':',3)
|
|
@@ -72,46 +84,47 @@ Daemonite.new do |opts|
|
|
|
72
84
|
name = ::File::basename(event)
|
|
73
85
|
long = File.join(topic,type,name)
|
|
74
86
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
url = opts[:redis].get("instance:#{instance}/handlers/#{subscription_key}/url")
|
|
87
|
+
m = JSON.parse(mess)
|
|
88
|
+
callback_key = m.dig('content','key')
|
|
89
|
+
subscription_key = m.dig('content','subscription')
|
|
90
|
+
url, sseq = CPEE::redis_script(opts[:redis], MATCH_SHA, MATCH, ["instance:#{instance}/handlers/#{long}"], ["instance:#{instance}", subscription_key.to_s])
|
|
80
91
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
92
|
+
if url.nil? # unsubscribed in the meantime, nobody would ever answer, so let the instance continue
|
|
93
|
+
send_response instance, callback_key, m['cpee'], true, opts[:redis]
|
|
94
|
+
elsif url == ""
|
|
95
|
+
persist_handler instance, callback_key, m, opts[:redis]
|
|
96
|
+
opts[:redis].publish("forward:#{instance}/#{subscription_key}","#{seq},#{sseq} #{mess}")
|
|
97
|
+
else
|
|
98
|
+
client = Riddl::Client.new(url)
|
|
99
|
+
callback = File.join(m['instance-url'],'/callbacks/',callback_key,'/')
|
|
100
|
+
status, result, headers = (client.post [
|
|
101
|
+
Riddl::Header.new("CPEE-BASE",File.join(m['cpee'],'/')),
|
|
102
|
+
Riddl::Header.new("CPEE-INSTANCE",m['instance']),
|
|
103
|
+
Riddl::Header.new("CPEE-INSTANCE-URL",File.join(m['instance-url'],'/')),
|
|
104
|
+
Riddl::Header.new("CPEE-INSTANCE-UUID",m['instance-uuid']),
|
|
105
|
+
Riddl::Header.new("CPEE-CALLBACK",callback),
|
|
106
|
+
Riddl::Header.new("CPEE-CALLBACK-ID",callback_key),
|
|
107
|
+
Riddl::Header.new("CPEE-SEQ",seq),
|
|
108
|
+
Riddl::Header.new("CPEE-SSEQ",sseq),
|
|
109
|
+
Riddl::Parameter::Simple::new('type',type),
|
|
110
|
+
Riddl::Parameter::Simple::new('topic',topic),
|
|
111
|
+
Riddl::Parameter::Simple::new('vote',name),
|
|
112
|
+
Riddl::Parameter::Simple::new('callback',callback),
|
|
113
|
+
Riddl::Parameter::Complex::new('notification','application/json',mess)
|
|
114
|
+
] rescue [ 0, [], []])
|
|
115
|
+
if status >= 200 && status < 300
|
|
116
|
+
val = if result[0].class == Riddl::Parameter::Simple
|
|
117
|
+
result[0].value
|
|
84
118
|
else
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Riddl::Header.new("CPEE-INSTANCE-UUID",m['instance-uuid']),
|
|
92
|
-
Riddl::Header.new("CPEE-CALLBACK",callback),
|
|
93
|
-
Riddl::Header.new("CPEE-CALLBACK-ID",subscription_key),
|
|
94
|
-
Riddl::Parameter::Simple::new('type',type),
|
|
95
|
-
Riddl::Parameter::Simple::new('topic',topic),
|
|
96
|
-
Riddl::Parameter::Simple::new('vote',name),
|
|
97
|
-
Riddl::Parameter::Simple::new('callback',callback),
|
|
98
|
-
Riddl::Parameter::Complex::new('notification','application/json',mess)
|
|
99
|
-
] rescue [ 0, [], []])
|
|
100
|
-
if status >= 200 && status < 300
|
|
101
|
-
val = if result[0].class == Riddl::Parameter::Simple
|
|
102
|
-
result[0].value
|
|
103
|
-
else
|
|
104
|
-
result[0].value.read
|
|
105
|
-
end
|
|
106
|
-
if (headers["CPEE_CALLBACK"] && headers["CPEE_CALLBACK"] == 'true') || val == 'callback'
|
|
107
|
-
persist_handler instance, callback_key, m, opts[:redis]
|
|
108
|
-
else # they may send true or false
|
|
109
|
-
send_response instance, callback_key, m['cpee'], val, opts[:redis]
|
|
110
|
-
end
|
|
111
|
-
else
|
|
112
|
-
send_response instance, callback_key, m['cpee'], true, opts[:redis]
|
|
113
|
-
end
|
|
119
|
+
result[0].value.read
|
|
120
|
+
end
|
|
121
|
+
if (headers["CPEE_CALLBACK"] && headers["CPEE_CALLBACK"] == 'true') || val == 'callback'
|
|
122
|
+
persist_handler instance, callback_key, m, opts[:redis]
|
|
123
|
+
else # they may send true or false
|
|
124
|
+
send_response instance, callback_key, m['cpee'], val, opts[:redis]
|
|
114
125
|
end
|
|
126
|
+
else
|
|
127
|
+
send_response instance, callback_key, m['cpee'], true, opts[:redis]
|
|
115
128
|
end
|
|
116
129
|
end
|
|
117
130
|
rescue => e
|
data/server/routing/persist.pid
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3635877
|
data/server/routing/persist.rb
CHANGED
|
@@ -38,6 +38,7 @@ Daemonite.new do |opts|
|
|
|
38
38
|
'event:' + ('%02i' % w) + ':state/change',
|
|
39
39
|
'event:' + ('%02i' % w) + ':executionhandler/change',
|
|
40
40
|
'event:' + ('%02i' % w) + ':description/change',
|
|
41
|
+
'event:' + ('%02i' % w) + ':description/sync',
|
|
41
42
|
'event:' + ('%02i' % w) + ':dataelements/change',
|
|
42
43
|
'event:' + ('%02i' % w) + ':documents/change',
|
|
43
44
|
'event:' + ('%02i' % w) + ':endpoints/change',
|
|
@@ -67,25 +68,41 @@ Daemonite.new do |opts|
|
|
|
67
68
|
key = mess.dig('content','key')
|
|
68
69
|
opts[:redis].multi do |multi|
|
|
69
70
|
multi.sadd("instance:#{instance}/callbacks",key)
|
|
70
|
-
multi.set("instance:#{instance}/callbacks/#{key}/uuid",mess.dig('content','activity-uuid'))
|
|
71
|
-
multi.set("instance:#{instance}/callbacks/#{key}/label",mess.dig('content','label'))
|
|
72
|
-
multi.set("instance:#{instance}/callbacks/#{key}/position",mess.dig('content','activity'))
|
|
73
|
-
multi.set("instance:#{instance}/callbacks/#{key}/type",'callback')
|
|
71
|
+
multi.set("instance:#{instance}/callbacks/#{key}/uuid",mess.dig('content','activity-uuid'),keepttl: true)
|
|
72
|
+
multi.set("instance:#{instance}/callbacks/#{key}/label",mess.dig('content','label'),keepttl: true)
|
|
73
|
+
multi.set("instance:#{instance}/callbacks/#{key}/position",mess.dig('content','activity'),keepttl: true)
|
|
74
|
+
multi.set("instance:#{instance}/callbacks/#{key}/type",'callback',keepttl: true)
|
|
74
75
|
end
|
|
75
76
|
when /event:\d+:state\/change/
|
|
76
77
|
opts[:redis].multi do |multi|
|
|
77
78
|
unless mess.dig('content','state') == 'purged'
|
|
78
|
-
multi.set("instance:#{instance}/state",mess.dig('content','state'))
|
|
79
|
-
multi.set("instance:#{instance}/state/@changed",mess.dig('timestamp'))
|
|
79
|
+
multi.set("instance:#{instance}/state",mess.dig('content','state'),keepttl: true)
|
|
80
|
+
multi.set("instance:#{instance}/state/@changed",mess.dig('timestamp'),keepttl: true)
|
|
80
81
|
end
|
|
81
82
|
end
|
|
82
83
|
when /event:\d+:executionhandler\/change/
|
|
83
|
-
opts[:redis].set("instance:#{instance}/executionhandler",mess.dig('content','executionhandler'))
|
|
84
|
+
opts[:redis].set("instance:#{instance}/executionhandler",mess.dig('content','executionhandler'),keepttl: true)
|
|
84
85
|
when /event:\d+:description\/change/
|
|
85
86
|
opts[:redis].multi do |multi|
|
|
86
|
-
multi.set("instance:#{instance}/description",mess.dig('content','description'))
|
|
87
|
-
multi.set("instance:#{instance}/dslx",mess.dig('content','dslx'))
|
|
88
|
-
multi.set("instance:#{instance}/dsl",mess.dig('content','dsl'))
|
|
87
|
+
multi.set("instance:#{instance}/description",mess.dig('content','description'),keepttl: true)
|
|
88
|
+
multi.set("instance:#{instance}/dslx",mess.dig('content','dslx'),keepttl: true)
|
|
89
|
+
multi.set("instance:#{instance}/dsl",mess.dig('content','dsl'),keepttl: true)
|
|
90
|
+
multi.set("instance:#{instance}/dslx/@change_uuid",mess.dig('content','change_uuid'),keepttl: true)
|
|
91
|
+
unless mess.dig('content','change_pending') # otherwise description/sync brings it
|
|
92
|
+
multi.set("instance:#{instance}/description/@change_uuid",mess.dig('content','change_uuid'),keepttl: true)
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
when /event:\d+:description\/sync/
|
|
96
|
+
# asynchronous result, only valid when the dslx did not change in the meantime
|
|
97
|
+
opts[:redis].watch("instance:#{instance}/dslx/@change_uuid") do |rd|
|
|
98
|
+
if rd.get("instance:#{instance}/dslx/@change_uuid") == mess.dig('content','change_uuid')
|
|
99
|
+
rd.multi do |multi|
|
|
100
|
+
multi.set("instance:#{instance}/description",mess.dig('content','description'),keepttl: true)
|
|
101
|
+
multi.set("instance:#{instance}/description/@change_uuid",mess.dig('content','change_uuid'),keepttl: true)
|
|
102
|
+
end
|
|
103
|
+
else
|
|
104
|
+
rd.unwatch
|
|
105
|
+
end
|
|
89
106
|
end
|
|
90
107
|
when /event:\d+:dataelements\/change/, /event:\d+:documents\/change/, /event:\d+:endpoints\/change/, /event:\d+:attributes\/change/
|
|
91
108
|
topic = mess.dig('topic')
|
|
@@ -101,7 +118,7 @@ Daemonite.new do |opts|
|
|
|
101
118
|
mess.dig('content','changed')&.each_with_index do |c,i|
|
|
102
119
|
unless what =~ /event:\d+:attributes\/change/ && c == 'uuid'
|
|
103
120
|
multi.zadd("instance:#{instance}/#{topic}",max + 1 + i,c,nx: true)
|
|
104
|
-
multi.set("instance:#{instance}/#{topic}/#{c}",CPEE::ValueHelper::generate(mess.dig('content','values',c)))
|
|
121
|
+
multi.set("instance:#{instance}/#{topic}/#{c}",CPEE::ValueHelper::generate(mess.dig('content','values',c)),keepttl: true)
|
|
105
122
|
end
|
|
106
123
|
end
|
|
107
124
|
mess.dig('content','deleted')&.to_a&.each do |c|
|
|
@@ -115,19 +132,22 @@ Daemonite.new do |opts|
|
|
|
115
132
|
opts[:redis].publish('event:' + $1 + ':transaction/finished',message)
|
|
116
133
|
when /event:\d+:transformation\/change/
|
|
117
134
|
opts[:redis].multi do |multi|
|
|
118
|
-
multi.set("instance:#{instance}/transformation/description",mess.dig('content','description'))
|
|
119
|
-
multi.set("instance:#{instance}/transformation/description/@type",mess.dig('content','description_type'))
|
|
120
|
-
multi.set("instance:#{instance}/transformation/dataelements",mess.dig('content','dataelements'))
|
|
121
|
-
multi.set("instance:#{instance}/transformation/dataelements/@type",mess.dig('content','dataelements_type'))
|
|
122
|
-
multi.set("instance:#{instance}/transformation/endpoints",mess.dig('content','endpoints'))
|
|
123
|
-
multi.set("instance:#{instance}/transformation/endpoints/@type",mess.dig('content','endpoints_type'))
|
|
124
|
-
multi.set("instance:#{instance}/transformation/dslx",mess.dig('content','dslx'))
|
|
125
|
-
multi.set("instance:#{instance}/transformation/dslx/@type",mess.dig('content','dslx_type'))
|
|
135
|
+
multi.set("instance:#{instance}/transformation/description",mess.dig('content','description'),keepttl: true)
|
|
136
|
+
multi.set("instance:#{instance}/transformation/description/@type",mess.dig('content','description_type'),keepttl: true)
|
|
137
|
+
multi.set("instance:#{instance}/transformation/dataelements",mess.dig('content','dataelements'),keepttl: true)
|
|
138
|
+
multi.set("instance:#{instance}/transformation/dataelements/@type",mess.dig('content','dataelements_type'),keepttl: true)
|
|
139
|
+
multi.set("instance:#{instance}/transformation/endpoints",mess.dig('content','endpoints'),keepttl: true)
|
|
140
|
+
multi.set("instance:#{instance}/transformation/endpoints/@type",mess.dig('content','endpoints_type'),keepttl: true)
|
|
141
|
+
multi.set("instance:#{instance}/transformation/dslx",mess.dig('content','dslx'),keepttl: true)
|
|
142
|
+
multi.set("instance:#{instance}/transformation/dslx/@type",mess.dig('content','dslx_type'),keepttl: true)
|
|
143
|
+
if mess.dig('content','change_pending') # same dslx, but the description is no longer the one for it
|
|
144
|
+
multi.del("instance:#{instance}/description/@change_uuid")
|
|
145
|
+
end
|
|
126
146
|
end
|
|
127
147
|
when /event:\d+:status\/change/
|
|
128
148
|
opts[:redis].multi do |multi|
|
|
129
|
-
multi.set("instance:#{instance}/status/id",mess.dig('content','id'))
|
|
130
|
-
multi.set("instance:#{instance}/status/message",mess.dig('content','message'))
|
|
149
|
+
multi.set("instance:#{instance}/status/id",mess.dig('content','id'),keepttl: true)
|
|
150
|
+
multi.set("instance:#{instance}/status/message",mess.dig('content','message'),keepttl: true)
|
|
131
151
|
end
|
|
132
152
|
when /event:\d+:position\/change/
|
|
133
153
|
opts[:redis].multi do |multi|
|
|
@@ -139,21 +159,21 @@ Daemonite.new do |opts|
|
|
|
139
159
|
end
|
|
140
160
|
c.dig('before')&.each do |ele|
|
|
141
161
|
multi.sadd("instance:#{instance}/positions",ele['position'])
|
|
142
|
-
multi.set("instance:#{instance}/positions/#{ele['position']}",'before')
|
|
162
|
+
multi.set("instance:#{instance}/positions/#{ele['position']}",'before',keepttl: true)
|
|
143
163
|
end
|
|
144
164
|
c.dig('at')&.each do |ele|
|
|
145
165
|
multi.sadd("instance:#{instance}/positions",ele['position'])
|
|
146
|
-
multi.set("instance:#{instance}/positions/#{ele['position']}",'at')
|
|
147
|
-
multi.set("instance:#{instance}/positions/#{ele['position']}/@passthrough",ele['passthrough']) if ele['passthrough']
|
|
166
|
+
multi.set("instance:#{instance}/positions/#{ele['position']}",'at',keepttl: true)
|
|
167
|
+
multi.set("instance:#{instance}/positions/#{ele['position']}/@passthrough",ele['passthrough'],keepttl: true) if ele['passthrough']
|
|
148
168
|
end
|
|
149
169
|
c.dig('wait')&.each do |ele|
|
|
150
170
|
multi.sadd("instance:#{instance}/positions",ele['position'])
|
|
151
|
-
multi.set("instance:#{instance}/positions/#{ele['position']}",'at')
|
|
152
|
-
multi.set("instance:#{instance}/positions/#{ele['position']}/@passthrough",ele['passthrough']) if ele['passthrough']
|
|
171
|
+
multi.set("instance:#{instance}/positions/#{ele['position']}",'at',keepttl: true)
|
|
172
|
+
multi.set("instance:#{instance}/positions/#{ele['position']}/@passthrough",ele['passthrough'],keepttl: true) if ele['passthrough']
|
|
153
173
|
end
|
|
154
174
|
c.dig('after')&.each do |ele|
|
|
155
175
|
multi.sadd("instance:#{instance}/positions",ele['position'])
|
|
156
|
-
multi.set("instance:#{instance}/positions/#{ele['position']}",'after')
|
|
176
|
+
multi.set("instance:#{instance}/positions/#{ele['position']}",'after',keepttl: true)
|
|
157
177
|
end
|
|
158
178
|
end
|
|
159
179
|
when /event:\d+:handler\/change/
|
|
@@ -161,7 +181,7 @@ Daemonite.new do |opts|
|
|
|
161
181
|
mess.dig('content','changed').each do |c|
|
|
162
182
|
multi.sadd("instance:#{instance}/handlers",mess.dig('content','key'))
|
|
163
183
|
multi.sadd("instance:#{instance}/handlers/#{mess.dig('content','key')}",c)
|
|
164
|
-
multi.set("instance:#{instance}/handlers/#{mess.dig('content','key')}/url",mess.dig('content','url'))
|
|
184
|
+
multi.set("instance:#{instance}/handlers/#{mess.dig('content','key')}/url",mess.dig('content','url'),keepttl: true)
|
|
165
185
|
multi.sadd("instance:#{instance}/handlers/#{c}",mess.dig('content','key'))
|
|
166
186
|
end
|
|
167
187
|
mess.dig('content','deleted').to_a.each do |c|
|
|
@@ -172,6 +192,7 @@ Daemonite.new do |opts|
|
|
|
172
192
|
if opts[:redis].scard("instance:#{instance}/handlers/#{mess.dig('content','key')}") < 1
|
|
173
193
|
opts[:redis].multi do |multi|
|
|
174
194
|
multi.del("instance:#{instance}/handlers/#{mess.dig('content','key')}/url")
|
|
195
|
+
multi.del("instance:#{instance}/handlers/#{mess.dig('content','key')}/seq")
|
|
175
196
|
multi.srem("instance:#{instance}/handlers",mess.dig('content','key'))
|
|
176
197
|
end
|
|
177
198
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cpee
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.140
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juergen eTM Mangler
|
|
@@ -18,6 +18,9 @@ dependencies:
|
|
|
18
18
|
- - "~>"
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
20
|
version: '1.0'
|
|
21
|
+
- - ">="
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: 1.0.21
|
|
21
24
|
type: :runtime
|
|
22
25
|
prerelease: false
|
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -25,6 +28,9 @@ dependencies:
|
|
|
25
28
|
- - "~>"
|
|
26
29
|
- !ruby/object:Gem::Version
|
|
27
30
|
version: '1.0'
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 1.0.21
|
|
28
34
|
- !ruby/object:Gem::Dependency
|
|
29
35
|
name: weel
|
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -267,7 +273,6 @@ files:
|
|
|
267
273
|
- cockpit/edit.html
|
|
268
274
|
- cockpit/graph.html
|
|
269
275
|
- cockpit/index.html
|
|
270
|
-
- cockpit/js/build-bpmn2.js
|
|
271
276
|
- cockpit/js/compliance.js
|
|
272
277
|
- cockpit/js/details.js
|
|
273
278
|
- cockpit/js/edit.js
|
|
@@ -1244,6 +1249,7 @@ files:
|
|
|
1244
1249
|
- lib/cpee/implementation_callbacks.rb
|
|
1245
1250
|
- lib/cpee/implementation_notifications.rb
|
|
1246
1251
|
- lib/cpee/implementation_properties.rb
|
|
1252
|
+
- lib/cpee/json_pointer.rb
|
|
1247
1253
|
- lib/cpee/message.rb
|
|
1248
1254
|
- lib/cpee/persistence.rb
|
|
1249
1255
|
- lib/cpee/redis.rb
|