cpee 2.1.29 → 2.1.30
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/templates/Worklist.xml +47 -18
- data/cockpit/themes/compact/theme.js +1 -1
- data/cockpit/themes/control/theme.js +1 -1
- data/cockpit/themes/default/theme.js +1 -1
- data/cockpit/themes/extended/theme.js +1 -1
- data/cockpit/themes/model/theme.js +1 -1
- data/cockpit/themes/packed/theme.js +1 -1
- data/cockpit/themes/preset/theme.js +1 -1
- data/cpee.gemspec +1 -1
- data/lib/cpee/fail.rb +23 -0
- data/lib/cpee/implementation.rb +32 -23
- data/lib/cpee/implementation_callbacks.rb +11 -10
- data/lib/cpee/implementation_notifications.rb +4 -3
- data/lib/cpee/implementation_properties.rb +1 -0
- data/lib/cpee/message.rb +15 -13
- data/lib/cpee/persistence.rb +30 -11
- data/server/executionhandlers/ruby/connection.rb +2 -0
- data/server/executionhandlers/ruby/controller.rb +5 -3
- data/server/executionhandlers/ruby/dsl_to_dslx.xsl +2 -2
- data/server/routing/end.pid +1 -0
- data/server/routing/forward-events.pid +1 -0
- data/server/routing/forward-events.rb +6 -0
- data/server/routing/forward-votes.pid +1 -0
- data/server/routing/persist.pid +1 -0
- data/server/routing/persist.rb +4 -2
- data/server/server.conf +1 -1
- metadata +7 -12
- data/cockpit/templates/Coopis 2010.xml.active +0 -1
- data/cockpit/templates/Coopis 2010.xml.active-uuid +0 -1
- data/cockpit/templates/Subprocess.xml.active +0 -1
- data/cockpit/templates/Subprocess.xml.active-uuid +0 -1
- data/cockpit/templates/Track Test.xml.active +0 -1
- data/cockpit/templates/Track Test.xml.active-uuid +0 -1
- data/cockpit/templates/UR-VUE 2020 Solution Baseline.xml.active +0 -1
- data/cockpit/templates/UR-VUE 2020 Solution Baseline.xml.active-uuid +0 -1
- data/cockpit/templates/Wait.xml.active +0 -1
- data/cockpit/templates/Wait.xml.active-uuid +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e5b91153e5d1f79bffd42f93f011cce42a0595f5fe17cfd0b7f6dd5a39852518
|
|
4
|
+
data.tar.gz: 8cfccd832f88ea23ed93d4d5bda91e2b5e9414ca195e797a665911b62b2373f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1e149e8b4ae2b28df6a30d2757b29c54aab7d65ca4f51ee7d9c226b36bceb448064439ae6e93995ee0e32a0fba01b6841ab1fb8b88afbefd2483b38c426b798
|
|
7
|
+
data.tar.gz: 75a3f332f847963e76c1c8557cf14af6f9f6f0b61d7722bdc09a9a864d86ae2593a2f4a695c23e1c30a12c1fa86aa0f2ef2858d8acfeeb6653eee14578d8f03a
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
1
2
|
<testset xmlns="http://cpee.org/ns/properties/2.0">
|
|
2
3
|
<executionhandler>ruby</executionhandler>
|
|
3
4
|
<dataelements>
|
|
@@ -7,7 +8,16 @@
|
|
|
7
8
|
<timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
|
|
8
9
|
<worklist>http://cpee.org:9398</worklist>
|
|
9
10
|
</endpoints>
|
|
10
|
-
<
|
|
11
|
+
<attributes>
|
|
12
|
+
<info>Worklist</info>
|
|
13
|
+
<modeltype>CPEE</modeltype>
|
|
14
|
+
<organisation1>http://cpee.org/~demo/orgviz/organisation_informatik.xml</organisation1>
|
|
15
|
+
<theme>extended</theme>
|
|
16
|
+
<creator>Christine Ashcreek</creator>
|
|
17
|
+
<author>Christine Ashcreek</author>
|
|
18
|
+
<design_stage>development</design_stage>
|
|
19
|
+
<design_dir>Templates.dir</design_dir>
|
|
20
|
+
</attributes>
|
|
11
21
|
<description>
|
|
12
22
|
<description xmlns="http://cpee.org/ns/description/1.0">
|
|
13
23
|
<call id="a1" endpoint="worklist">
|
|
@@ -16,19 +26,48 @@
|
|
|
16
26
|
<method>:post</method>
|
|
17
27
|
<arguments>
|
|
18
28
|
<orgmodel>organisation1</orgmodel>
|
|
19
|
-
<domain>
|
|
20
|
-
<form>
|
|
21
|
-
<role>
|
|
29
|
+
<domain>VirtualBusiness1</domain>
|
|
30
|
+
<form>https://cpee.org/~demo/form/form-f.html</form>
|
|
31
|
+
<role>Assistant</role>
|
|
22
32
|
<schaden>55546</schaden>
|
|
23
33
|
<text>fetzen hin</text>
|
|
24
34
|
</arguments>
|
|
25
35
|
</parameters>
|
|
26
36
|
<code>
|
|
27
|
-
<
|
|
37
|
+
<prepare/>
|
|
38
|
+
<finalize output="result">data.bla = result</finalize>
|
|
39
|
+
<update output="result"/>
|
|
40
|
+
<rescue output="result"/>
|
|
28
41
|
</code>
|
|
29
|
-
<annotations
|
|
30
|
-
|
|
42
|
+
<annotations>
|
|
43
|
+
<_timing>
|
|
44
|
+
<_timing_weight/>
|
|
45
|
+
<_timing_avg/>
|
|
46
|
+
<explanations/>
|
|
47
|
+
</_timing>
|
|
48
|
+
<_context_data_analysis>
|
|
49
|
+
<probes/>
|
|
50
|
+
<ips/>
|
|
51
|
+
</_context_data_analysis>
|
|
52
|
+
<report>
|
|
53
|
+
<url/>
|
|
54
|
+
</report>
|
|
55
|
+
<_notes>
|
|
56
|
+
<_notes_general/>
|
|
57
|
+
</_notes>
|
|
58
|
+
</annotations>
|
|
59
|
+
<documentation>
|
|
60
|
+
<input/>
|
|
61
|
+
<output/>
|
|
62
|
+
<implementation>
|
|
63
|
+
<description/>
|
|
64
|
+
</implementation>
|
|
65
|
+
<code>
|
|
66
|
+
<description/>
|
|
67
|
+
</code>
|
|
68
|
+
</documentation>
|
|
31
69
|
</call>
|
|
70
|
+
<stop id="a2"/>
|
|
32
71
|
</description>
|
|
33
72
|
</description>
|
|
34
73
|
<transformation>
|
|
@@ -36,14 +75,4 @@
|
|
|
36
75
|
<dataelements type="none"/>
|
|
37
76
|
<endpoints type="none"/>
|
|
38
77
|
</transformation>
|
|
39
|
-
|
|
40
|
-
<info>Worklist</info>
|
|
41
|
-
<modeltype>CPEE</modeltype>
|
|
42
|
-
<organisation1>http://cpee.org/~demo/orgviz/organisation_informatik.xml</organisation1>
|
|
43
|
-
<theme>extended</theme>
|
|
44
|
-
<creator>Christine Ashcreek</creator>
|
|
45
|
-
<author>Christine Ashcreek</author>
|
|
46
|
-
<design_stage>development</design_stage>
|
|
47
|
-
<design_dir>Templates.dir</design_dir>
|
|
48
|
-
</attributes>
|
|
49
|
-
</testset>
|
|
78
|
+
</testset>
|
|
@@ -311,7 +311,7 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
311
311
|
},
|
|
312
312
|
'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
|
|
313
313
|
'resolve_symbol': function(node) {
|
|
314
|
-
if($('code', node).length > 0) {
|
|
314
|
+
if($('> code', node).length > 0) {
|
|
315
315
|
return 'callmanipulate';
|
|
316
316
|
} else {
|
|
317
317
|
return 'call';
|
|
@@ -329,7 +329,7 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
329
329
|
},
|
|
330
330
|
'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
|
|
331
331
|
'resolve_symbol': function(node) {
|
|
332
|
-
if($('code', node).length > 0) {
|
|
332
|
+
if($('> code', node).length > 0) {
|
|
333
333
|
return 'callmanipulate';
|
|
334
334
|
} else {
|
|
335
335
|
return 'call';
|
|
@@ -311,7 +311,7 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
311
311
|
},
|
|
312
312
|
'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
|
|
313
313
|
'resolve_symbol': function(node) {
|
|
314
|
-
if($('code', node).length > 0) {
|
|
314
|
+
if($('> code', node).length > 0) {
|
|
315
315
|
return 'callmanipulate';
|
|
316
316
|
} else {
|
|
317
317
|
return 'call';
|
|
@@ -329,7 +329,7 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
329
329
|
},
|
|
330
330
|
'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
|
|
331
331
|
'resolve_symbol': function(node) {
|
|
332
|
-
if($('code', node).length > 0) {
|
|
332
|
+
if($('> code', node).length > 0) {
|
|
333
333
|
return 'callmanipulate';
|
|
334
334
|
} else {
|
|
335
335
|
return 'call';
|
|
@@ -292,7 +292,7 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
292
292
|
},
|
|
293
293
|
'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
|
|
294
294
|
'resolve_symbol': function(node) {
|
|
295
|
-
if($('code', node).length > 0) {
|
|
295
|
+
if($('> code', node).length > 0) {
|
|
296
296
|
return 'callmanipulate';
|
|
297
297
|
} else {
|
|
298
298
|
return 'call';
|
|
@@ -311,7 +311,7 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
311
311
|
},
|
|
312
312
|
'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
|
|
313
313
|
'resolve_symbol': function(node) {
|
|
314
|
-
if($('code', node).length > 0) {
|
|
314
|
+
if($('> code', node).length > 0) {
|
|
315
315
|
return 'callmanipulate';
|
|
316
316
|
} else {
|
|
317
317
|
return 'call';
|
|
@@ -311,7 +311,7 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
311
311
|
},
|
|
312
312
|
'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
|
|
313
313
|
'resolve_symbol': function(node) {
|
|
314
|
-
if($('code', node).length > 0) {
|
|
314
|
+
if($('> code', node).length > 0) {
|
|
315
315
|
return 'callmanipulate';
|
|
316
316
|
} else {
|
|
317
317
|
return 'call';
|
data/cpee.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = "cpee"
|
|
3
|
-
s.version = "2.1.
|
|
3
|
+
s.version = "2.1.30"
|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
|
5
5
|
s.license = "LGPL-3.0"
|
|
6
6
|
s.summary = "Preliminary release of cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
|
data/lib/cpee/fail.rb
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
# This file is part of CPEE.
|
|
3
|
+
#
|
|
4
|
+
# CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
5
|
+
# of the GNU General Public License as published by the Free Software Foundation,
|
|
6
|
+
# either version 3 of the License, or (at your option) any later version.
|
|
7
|
+
#
|
|
8
|
+
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
9
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
10
|
+
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
11
|
+
#
|
|
12
|
+
# You should have received a copy of the GNU General Public License along with
|
|
13
|
+
# CPEE (file COPYING in the main directory). If not, see
|
|
14
|
+
# <http://www.gnu.org/licenses/>.
|
|
15
|
+
|
|
16
|
+
module CPEE
|
|
17
|
+
class FAIL < Riddl::Implementation #{{{
|
|
18
|
+
def response
|
|
19
|
+
@status = 404
|
|
20
|
+
nil
|
|
21
|
+
end
|
|
22
|
+
end #}}}
|
|
23
|
+
end
|
data/lib/cpee/implementation.rb
CHANGED
|
@@ -16,6 +16,7 @@ require 'fileutils'
|
|
|
16
16
|
require 'redis'
|
|
17
17
|
require 'riddl/server'
|
|
18
18
|
require 'riddl/client'
|
|
19
|
+
require_relative 'fail'
|
|
19
20
|
require_relative 'redis'
|
|
20
21
|
require_relative 'message'
|
|
21
22
|
require_relative 'persistence'
|
|
@@ -83,7 +84,7 @@ module CPEE
|
|
|
83
84
|
opts[:sse_connections] = {}
|
|
84
85
|
|
|
85
86
|
opts[:statemachine] = CPEE::StateMachine.new opts[:states], %w{running simulating replaying finishing stopping abandoned finished} do |id|
|
|
86
|
-
opts
|
|
87
|
+
CPEE::Persistence::extract_item(id,opts,"state")
|
|
87
88
|
end
|
|
88
89
|
|
|
89
90
|
opts[:runtime_cmds] << [
|
|
@@ -176,16 +177,14 @@ module CPEE
|
|
|
176
177
|
|
|
177
178
|
class Instances < Riddl::Implementation #{{{
|
|
178
179
|
def response
|
|
179
|
-
|
|
180
|
+
opts = @a[0]
|
|
180
181
|
Riddl::Parameter::Complex.new("wis","text/xml") do
|
|
181
182
|
ins = XML::Smart::string('<instances/>')
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
state = redis.get(statekey)
|
|
188
|
-
state_changed = redis.get(File.join(statekey,'@changed'))
|
|
183
|
+
CPEE::Persistence::each_object(opts) do |instance|
|
|
184
|
+
info = CPEE::Persistence::extract_item(instance,opts,'attributes/info')
|
|
185
|
+
uuid = CPEE::Persistence::extract_item(instance,opts,'attributes/uuid')
|
|
186
|
+
state = CPEE::Persistence::extract_item(instance,opts,'state')
|
|
187
|
+
state_changed = CPEE::Persistence::extract_item(instance,opts,'state/@changed')
|
|
189
188
|
ins.root.add('instance', info, 'uuid' => uuid, 'id' => instance, 'state' => state, 'state_changed' => state_changed )
|
|
190
189
|
end
|
|
191
190
|
ins.to_s
|
|
@@ -209,9 +208,9 @@ module CPEE
|
|
|
209
208
|
doc = XML::Smart::open_unprotected(opts[:properties_init])
|
|
210
209
|
doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
|
|
211
210
|
name = @p[0].value
|
|
212
|
-
id =
|
|
211
|
+
id = CPEE::Persistence::new_object(opts)
|
|
213
212
|
uuid = SecureRandom.uuid
|
|
214
|
-
instance = '
|
|
213
|
+
instance = CPEE::Persistence::OBJ + ':' + id.to_s
|
|
215
214
|
redis.multi do |multi|
|
|
216
215
|
multi.zadd('instances',id,id)
|
|
217
216
|
doc.root.find(PROPERTIES_PATHS_FULL.join(' | ')).each do |e|
|
|
@@ -235,12 +234,12 @@ module CPEE
|
|
|
235
234
|
doc.register_namespace 'np', 'http://riddl.org/ns/common-patterns/notifications-producer/2.0'
|
|
236
235
|
key = File.basename(File.dirname(f))
|
|
237
236
|
url = doc.find('string(/np:subscription/@url)')
|
|
238
|
-
multi.sadd("
|
|
239
|
-
multi.set("
|
|
237
|
+
multi.sadd(CPEE::Persistence::OBJ + ":#{id}/handlers",key)
|
|
238
|
+
multi.set(CPEE::Persistence::OBJ + ":#{id}/handlers/#{key}/url",url)
|
|
240
239
|
doc.find('/np:subscription/np:topic/*').each do |e|
|
|
241
240
|
c = File.join(e.parent.attributes['id'],e.qname.name,e.text)
|
|
242
|
-
multi.sadd("
|
|
243
|
-
multi.sadd("
|
|
241
|
+
multi.sadd(CPEE::Persistence::OBJ + ":#{id}/handlers/#{key}",c)
|
|
242
|
+
multi.sadd(CPEE::Persistence::OBJ + ":#{id}/handlers/#{c}",key)
|
|
244
243
|
end
|
|
245
244
|
end rescue nil # all the ones that are not ok, are ignored
|
|
246
245
|
end
|
|
@@ -251,6 +250,12 @@ module CPEE
|
|
|
251
250
|
multi.set(File.join(instance, 'state', '@changed'), Time.now.xmlschema(3))
|
|
252
251
|
end
|
|
253
252
|
|
|
253
|
+
content = {
|
|
254
|
+
:state => 'ready',
|
|
255
|
+
:attributes => CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
|
256
|
+
}
|
|
257
|
+
CPEE::Message::send(:event,'state/change',File.join(opts[:url],'/'),id,uuid,name,content,redis)
|
|
258
|
+
|
|
254
259
|
@headers << Riddl::Header.new("CPEE-INSTANCE", id.to_s)
|
|
255
260
|
@headers << Riddl::Header.new("CPEE-INSTANCE-URL", File.join(opts[:url].to_s,id.to_s,'/'))
|
|
256
261
|
@headers << Riddl::Header.new("CPEE-INSTANCE-UUID", uuid)
|
|
@@ -289,7 +294,18 @@ module CPEE
|
|
|
289
294
|
@status = 404
|
|
290
295
|
return
|
|
291
296
|
end
|
|
292
|
-
|
|
297
|
+
|
|
298
|
+
content = {
|
|
299
|
+
:state => 'purged',
|
|
300
|
+
:attributes => CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
|
301
|
+
}
|
|
302
|
+
state = CPEE::Persistence::extract_item(id,opts,'state')
|
|
303
|
+
if state == 'stopped' || state == 'ready'
|
|
304
|
+
CPEE::Message::send(:event,'state/change',File.join(opts[:url],'/'),id,content[:attributes]['uuid'],content[:attributes]['info'],content,redis)
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
empt = CPEE::Persistence::keys(id,opts).to_a
|
|
308
|
+
empt.delete_if{|e| e =~ /\/handlers/ }
|
|
293
309
|
redis.multi do |multi|
|
|
294
310
|
multi.del empt
|
|
295
311
|
multi.zrem 'instances', id
|
|
@@ -297,11 +313,4 @@ module CPEE
|
|
|
297
313
|
end
|
|
298
314
|
end #}}}
|
|
299
315
|
|
|
300
|
-
class FAIL < Riddl::Implementation #{{{
|
|
301
|
-
def response
|
|
302
|
-
@status = 404
|
|
303
|
-
nil
|
|
304
|
-
end
|
|
305
|
-
end #}}}
|
|
306
|
-
|
|
307
316
|
end
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
|
14
14
|
|
|
15
15
|
require 'json'
|
|
16
|
+
require_relative 'fail'
|
|
16
17
|
|
|
17
18
|
module CPEE
|
|
18
19
|
module Callbacks
|
|
@@ -54,13 +55,13 @@ module CPEE
|
|
|
54
55
|
opts = @a[1]
|
|
55
56
|
callback = @r[-1]
|
|
56
57
|
|
|
57
|
-
if
|
|
58
|
+
if CPEE::Persistence::is_member?(id,opts,'callbacks',callback)
|
|
58
59
|
res = {}
|
|
59
|
-
res[:uuid]
|
|
60
|
-
res[:type]
|
|
61
|
-
res[:position] = opts
|
|
62
|
-
res[:label]
|
|
63
|
-
if sub = opts
|
|
60
|
+
res[:uuid] = CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/uuid")
|
|
61
|
+
res[:type] = CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type")
|
|
62
|
+
res[:position] = CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/position")
|
|
63
|
+
res[:label] = CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/label")
|
|
64
|
+
if sub = CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/subscription")
|
|
64
65
|
res[:subscription] = sub
|
|
65
66
|
end
|
|
66
67
|
|
|
@@ -77,7 +78,7 @@ module CPEE
|
|
|
77
78
|
opts = @a[1]
|
|
78
79
|
callback = @r[-1]
|
|
79
80
|
|
|
80
|
-
if opts
|
|
81
|
+
if CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'callback'
|
|
81
82
|
CPEE::Message::send(
|
|
82
83
|
:'callback-end',
|
|
83
84
|
callback,
|
|
@@ -88,7 +89,7 @@ module CPEE
|
|
|
88
89
|
{},
|
|
89
90
|
opts[:redis]
|
|
90
91
|
)
|
|
91
|
-
elsif opts
|
|
92
|
+
elsif CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'vote'
|
|
92
93
|
CPEE::Message::send(
|
|
93
94
|
:'vote-response',
|
|
94
95
|
callback,
|
|
@@ -112,7 +113,7 @@ module CPEE
|
|
|
112
113
|
opts = @a[1]
|
|
113
114
|
callback = @r[-1]
|
|
114
115
|
|
|
115
|
-
if opts
|
|
116
|
+
if CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'callback'
|
|
116
117
|
ret = {}
|
|
117
118
|
ret['values'] = @p.map{ |e|
|
|
118
119
|
[e.name, e.class == Riddl::Parameter::Simple ? [:simple,e.value] : [:complex,e.mimetype,e.value.path] ]
|
|
@@ -129,7 +130,7 @@ module CPEE
|
|
|
129
130
|
ret,
|
|
130
131
|
opts[:redis]
|
|
131
132
|
)
|
|
132
|
-
elsif opts
|
|
133
|
+
elsif CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'vote'
|
|
133
134
|
if @p.length == 1 && @p[0].name == 'continue' && @p[0].class == Riddl::Parameter::Simple
|
|
134
135
|
CPEE::Message::send(
|
|
135
136
|
:'vote-response',
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
|
14
14
|
|
|
15
15
|
require 'json'
|
|
16
|
+
require_relative 'fail'
|
|
16
17
|
|
|
17
18
|
module CPEE
|
|
18
19
|
module Notifications
|
|
@@ -188,7 +189,7 @@ module CPEE
|
|
|
188
189
|
on.pmessage do |pat, what, message|
|
|
189
190
|
if pat == 'forward:*'
|
|
190
191
|
id, key = what.match(/forward:([^\/]+)\/(.+)/).captures
|
|
191
|
-
if sse = opts.dig(:sse_connections,id
|
|
192
|
+
if sse = opts.dig(:sse_connections,id,key)
|
|
192
193
|
sse.send message
|
|
193
194
|
else
|
|
194
195
|
DeleteSubscription::set(id,opts,key)
|
|
@@ -197,7 +198,7 @@ module CPEE
|
|
|
197
198
|
mess = JSON.parse(message[message.index(' ')+1..-1])
|
|
198
199
|
state = mess.dig('content','state')
|
|
199
200
|
if state == 'finished' || state == 'abandoned'
|
|
200
|
-
opts.dig(:sse_connections,mess.dig('instance').
|
|
201
|
+
opts.dig(:sse_connections,mess.dig('instance').to_s)&.each do |key,sse|
|
|
201
202
|
EM.add_timer(10) do # just to be sure that all messages arrived. 10 seconds should be enough ... we think ... therefore we are (not sure)
|
|
202
203
|
sse.close
|
|
203
204
|
end
|
|
@@ -218,7 +219,7 @@ module CPEE
|
|
|
218
219
|
class SSE < Riddl::SSEImplementation #{{{
|
|
219
220
|
def onopen
|
|
220
221
|
@opts = @a[1]
|
|
221
|
-
@id = @a[0]
|
|
222
|
+
@id = @a[0].to_s
|
|
222
223
|
@key = @r[-2]
|
|
223
224
|
if CPEE::Persistence::exists_handler?(@id,@opts,@key)
|
|
224
225
|
@opts[:sse_connections][@id] ||= {}
|
data/lib/cpee/message.rb
CHANGED
|
@@ -15,25 +15,27 @@
|
|
|
15
15
|
module CPEE
|
|
16
16
|
|
|
17
17
|
module Message
|
|
18
|
+
WHO = 'cpee'
|
|
19
|
+
TYPE = 'instance'
|
|
18
20
|
|
|
19
21
|
def self::send(type, event, cpee, instance, instance_uuid, instance_name, content={}, backend)
|
|
20
22
|
topic = ::File::dirname(event)
|
|
21
23
|
name = ::File::basename(event)
|
|
24
|
+
payload = {
|
|
25
|
+
WHO => cpee,
|
|
26
|
+
TYPE + '-url' => File.join(cpee,instance.to_s),
|
|
27
|
+
TYPE => instance,
|
|
28
|
+
'topic' => topic,
|
|
29
|
+
'type' => type,
|
|
30
|
+
'name' => name,
|
|
31
|
+
'timestamp' => Time.now.xmlschema(3),
|
|
32
|
+
'content' => content
|
|
33
|
+
}
|
|
34
|
+
payload[TYPE + '-uuid'] = instance_uuid if instance_uuid
|
|
35
|
+
payload[TYPE + '-name'] = instance_name if instance_name
|
|
22
36
|
backend.publish(type.to_s + ':' + event,
|
|
23
37
|
instance.to_s + ' ' +
|
|
24
|
-
JSON::generate(
|
|
25
|
-
{ 'cpee' => cpee,
|
|
26
|
-
'instance-url' => File.join(cpee,instance.to_s),
|
|
27
|
-
'instance-uuid' => instance_uuid,
|
|
28
|
-
'instance-name' => instance_name,
|
|
29
|
-
'instance' => instance,
|
|
30
|
-
'topic' => topic,
|
|
31
|
-
'type' => type,
|
|
32
|
-
'name' => name,
|
|
33
|
-
'timestamp' => Time.now.xmlschema(3),
|
|
34
|
-
'content' => content
|
|
35
|
-
}
|
|
36
|
-
)
|
|
38
|
+
JSON::generate(payload)
|
|
37
39
|
)
|
|
38
40
|
end
|
|
39
41
|
|
data/lib/cpee/persistence.rb
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
module CPEE
|
|
16
16
|
|
|
17
17
|
module Persistence
|
|
18
|
+
OBJ = 'instance'
|
|
19
|
+
|
|
18
20
|
def self::set_list(id,opts,item,values,deleted=[]) #{{{
|
|
19
21
|
ah = AttributesHelper.new
|
|
20
22
|
attributes = Persistence::extract_list(id,opts,'attributes').to_h
|
|
@@ -37,13 +39,13 @@ module CPEE
|
|
|
37
39
|
)
|
|
38
40
|
end #}}}
|
|
39
41
|
def self::extract_set(id,opts,item) #{{{
|
|
40
|
-
opts[:redis].smembers("
|
|
41
|
-
[e,opts[:redis].get("
|
|
42
|
+
opts[:redis].smembers(OBJ + ":#{id}/#{item}").map do |e|
|
|
43
|
+
[e,opts[:redis].get(OBJ + ":#{id}/#{item}/#{e}")]
|
|
42
44
|
end
|
|
43
45
|
end #}}}
|
|
44
46
|
def self::extract_list(id,opts,item) #{{{
|
|
45
|
-
opts[:redis].zrange("
|
|
46
|
-
[e,opts[:redis].get("
|
|
47
|
+
opts[:redis].zrange(OBJ + ":#{id}/#{item}",0,-1).map do |e|
|
|
48
|
+
[e,opts[:redis].get(OBJ + ":#{id}/#{item}/#{e}")]
|
|
47
49
|
end
|
|
48
50
|
end #}}}
|
|
49
51
|
|
|
@@ -60,15 +62,32 @@ module CPEE
|
|
|
60
62
|
)
|
|
61
63
|
end #}}}
|
|
62
64
|
def self::extract_item(id,opts,item) #{{{
|
|
63
|
-
opts[:redis].get("
|
|
65
|
+
opts[:redis].get(OBJ + ":#{id}/#{item}")
|
|
64
66
|
end #}}}
|
|
65
67
|
|
|
66
68
|
def self::exists?(id,opts) #{{{
|
|
67
|
-
opts[:redis].exists?("
|
|
69
|
+
opts[:redis].exists?(OBJ + ":#{id}/state")
|
|
68
70
|
end #}}}
|
|
71
|
+
def self::is_member?(id,opts,item,value) #{{{
|
|
72
|
+
opts[:redis].sismember(OBJ + ":#{id}/#{item}",value)
|
|
73
|
+
end #}}}
|
|
74
|
+
|
|
75
|
+
def self::each_object(opts)
|
|
76
|
+
opts[:redis].zrevrange(OBJ + 's',0,-1).each do |instance|
|
|
77
|
+
yield instance
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def self::new_object(opts)
|
|
82
|
+
opts[:redis].zrevrange(OBJ + 's', 0, 0).first.to_i + 1
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def self::keys(id,opts,item=nil)
|
|
86
|
+
opts[:redis].keys(File.join(OBJ + ":#{id}",item.to_s,'*'))
|
|
87
|
+
end
|
|
69
88
|
|
|
70
89
|
def self::set_handler(id,opts,key,url,values,update=false) #{{{
|
|
71
|
-
exis = opts[:redis].smembers("
|
|
90
|
+
exis = opts[:redis].smembers(OBJ + ":#{id}/handlers/#{key}")
|
|
72
91
|
|
|
73
92
|
if update == false && exis.length > 0
|
|
74
93
|
return 405
|
|
@@ -101,14 +120,14 @@ module CPEE
|
|
|
101
120
|
200
|
|
102
121
|
end #}}}
|
|
103
122
|
def self::extract_handler(id,opts,key) #{{{
|
|
104
|
-
opts[:redis].smembers("
|
|
123
|
+
opts[:redis].smembers(OBJ + ":#{id}/handlers/#{key}")
|
|
105
124
|
end #}}}
|
|
106
125
|
def self::exists_handler?(id,opts,key) #{{{
|
|
107
|
-
opts[:redis].exists?("
|
|
126
|
+
opts[:redis].exists?(OBJ + ":#{id}/handlers/#{key}")
|
|
108
127
|
end #}}}
|
|
109
128
|
def self::extract_handlers(id,opts) #{{{
|
|
110
|
-
opts[:redis].smembers("
|
|
111
|
-
[e, opts[:redis].get("
|
|
129
|
+
opts[:redis].smembers(OBJ + ":#{id}/handlers").map do |e|
|
|
130
|
+
[e, opts[:redis].get(OBJ + ":#{id}/handlers/#{e}/url")]
|
|
112
131
|
end
|
|
113
132
|
end #}}}
|
|
114
133
|
end
|
|
@@ -220,6 +220,8 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
|
220
220
|
elsif result[0].is_a? Riddl::Parameter::Complex
|
|
221
221
|
if result[0].mimetype == 'application/json'
|
|
222
222
|
result = JSON::parse(result[0].value.read) rescue nil
|
|
223
|
+
elsif result[0].mimetype == 'text/yaml'
|
|
224
|
+
result = YAML::load(result[0].value.read) rescue nil
|
|
223
225
|
elsif result[0].mimetype == 'application/xml' || result[0].mimetype == 'text/xml'
|
|
224
226
|
result = XML::Smart::string(result[0].value.read) rescue nil
|
|
225
227
|
elsif result[0].mimetype == 'text/plain'
|
|
@@ -21,6 +21,7 @@ require 'cpee/value_helper'
|
|
|
21
21
|
require 'cpee/attributes_helper'
|
|
22
22
|
require 'cpee/message'
|
|
23
23
|
require 'cpee/redis'
|
|
24
|
+
require 'cpee/persistence'
|
|
24
25
|
|
|
25
26
|
require 'ostruct'
|
|
26
27
|
class ParaStruct < OpenStruct
|
|
@@ -41,8 +42,8 @@ class Controller
|
|
|
41
42
|
@id = id
|
|
42
43
|
|
|
43
44
|
@attributes = {}
|
|
44
|
-
|
|
45
|
-
@attributes[
|
|
45
|
+
CPEE::Persistence::extract_list(id,opts,'attributes').each do |de|
|
|
46
|
+
@attributes[de[0]] = de[1]
|
|
46
47
|
end
|
|
47
48
|
|
|
48
49
|
@attributes_helper = AttributesHelper.new
|
|
@@ -152,7 +153,8 @@ class Controller
|
|
|
152
153
|
topic, name = what.split('/')
|
|
153
154
|
handler = File.join(topic,'vote',name)
|
|
154
155
|
votes = []
|
|
155
|
-
|
|
156
|
+
|
|
157
|
+
CPEE::Persistence::extract_handler(id,@opts,handler).each do |client|
|
|
156
158
|
voteid = Digest::MD5.hexdigest(Kernel::rand().to_s)
|
|
157
159
|
content[:key] = voteid
|
|
158
160
|
content[:attributes] = attributes_translated
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
<xsl:template match="/">
|
|
7
7
|
<xsl:text>control flow do</xsl:text>
|
|
8
8
|
<xsl:call-template name="print-newline"/>
|
|
9
|
-
<xsl:apply-templates select="
|
|
9
|
+
<xsl:apply-templates select="/d:description"/>
|
|
10
10
|
<xsl:text>end</xsl:text>
|
|
11
11
|
</xsl:template>
|
|
12
|
-
<xsl:template match="
|
|
12
|
+
<xsl:template match="/d:description">
|
|
13
13
|
<xsl:apply-templates>
|
|
14
14
|
<xsl:with-param name="myspace">
|
|
15
15
|
<xsl:value-of select="0*$myspacemultiplier"/>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1772897
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1772901
|
|
@@ -62,6 +62,12 @@ Daemonite.new do |opts|
|
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
end
|
|
65
|
+
unless opts[:redis].exists?("instance:#{instance}/state")
|
|
66
|
+
empt = opts[:redis].keys("instance:#{instance}/*").to_a
|
|
67
|
+
opts[:redis].multi do |multi|
|
|
68
|
+
multi.del empt
|
|
69
|
+
end
|
|
70
|
+
end
|
|
65
71
|
rescue => e
|
|
66
72
|
puts e.message
|
|
67
73
|
puts e.backtrace
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1772905
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1772911
|
data/server/routing/persist.rb
CHANGED
|
@@ -66,8 +66,10 @@ Daemonite.new do |opts|
|
|
|
66
66
|
end
|
|
67
67
|
when 'event:state/change'
|
|
68
68
|
opts[:redis].multi do |multi|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
unless mess.dig('content','state') == 'purged'
|
|
70
|
+
multi.set("instance:#{instance}/state",mess.dig('content','state'))
|
|
71
|
+
multi.set("instance:#{instance}/state/@changed",mess.dig('timestamp'))
|
|
72
|
+
end
|
|
71
73
|
end
|
|
72
74
|
when 'event:executionhandler/change'
|
|
73
75
|
opts[:redis].set("instance:#{instance}/executionhandler",mess.dig('content','executionhandler'))
|
data/server/server.conf
CHANGED
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.30
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juergen eTM Mangler
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: tools
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2022-01-12 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: riddl
|
|
@@ -221,30 +221,20 @@ files:
|
|
|
221
221
|
- cockpit/templates.legacy/testsets.xml
|
|
222
222
|
- cockpit/templates.legacy/transformations.xml
|
|
223
223
|
- cockpit/templates/Coopis 2010.xml
|
|
224
|
-
- cockpit/templates/Coopis 2010.xml.active
|
|
225
|
-
- cockpit/templates/Coopis 2010.xml.active-uuid
|
|
226
224
|
- cockpit/templates/IUPC arXiv:1104.3609 P34 1.xml
|
|
227
225
|
- cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml
|
|
228
226
|
- cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml
|
|
229
227
|
- cockpit/templates/Subprocess.xml
|
|
230
|
-
- cockpit/templates/Subprocess.xml.active
|
|
231
|
-
- cockpit/templates/Subprocess.xml.active-uuid
|
|
232
228
|
- cockpit/templates/Subprocess.xml.attrs
|
|
233
229
|
- cockpit/templates/Track Test Local.xml
|
|
234
230
|
- cockpit/templates/Track Test.xml
|
|
235
|
-
- cockpit/templates/Track Test.xml.active
|
|
236
|
-
- cockpit/templates/Track Test.xml.active-uuid
|
|
237
231
|
- cockpit/templates/Track Test.xml.attrs
|
|
238
232
|
- cockpit/templates/UR-VUE 2020 Manual Adjust.xml
|
|
239
233
|
- cockpit/templates/UR-VUE 2020 Solution Baseline.xml
|
|
240
|
-
- cockpit/templates/UR-VUE 2020 Solution Baseline.xml.active
|
|
241
|
-
- cockpit/templates/UR-VUE 2020 Solution Baseline.xml.active-uuid
|
|
242
234
|
- cockpit/templates/UR-VUE 2020 Solution NN.xml
|
|
243
235
|
- cockpit/templates/UR-VUE 2020 Solution View.xml
|
|
244
236
|
- cockpit/templates/UR-VUE 2020.xml
|
|
245
237
|
- cockpit/templates/Wait.xml
|
|
246
|
-
- cockpit/templates/Wait.xml.active
|
|
247
|
-
- cockpit/templates/Wait.xml.active-uuid
|
|
248
238
|
- cockpit/templates/Wait.xml.attrs
|
|
249
239
|
- cockpit/templates/Worklist.xml
|
|
250
240
|
- cockpit/templates/instantiate.local/Take_Sub.xml
|
|
@@ -616,6 +606,7 @@ files:
|
|
|
616
606
|
- lib/callbacks/callbacks.rng
|
|
617
607
|
- lib/cpee.xml
|
|
618
608
|
- lib/cpee/attributes_helper.rb
|
|
609
|
+
- lib/cpee/fail.rb
|
|
619
610
|
- lib/cpee/implementation.rb
|
|
620
611
|
- lib/cpee/implementation_callbacks.rb
|
|
621
612
|
- lib/cpee/implementation_notifications.rb
|
|
@@ -672,9 +663,13 @@ files:
|
|
|
672
663
|
- server/resources/states.xml
|
|
673
664
|
- server/resources/topics.xml
|
|
674
665
|
- server/resources/transformation.xml
|
|
666
|
+
- server/routing/end.pid
|
|
675
667
|
- server/routing/end.rb
|
|
668
|
+
- server/routing/forward-events.pid
|
|
676
669
|
- server/routing/forward-events.rb
|
|
670
|
+
- server/routing/forward-votes.pid
|
|
677
671
|
- server/routing/forward-votes.rb
|
|
672
|
+
- server/routing/persist.pid
|
|
678
673
|
- server/routing/persist.rb
|
|
679
674
|
- server/server.conf
|
|
680
675
|
- server/server.rb
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
https://cpee.org/flow/engine/542
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
692f7da6-a212-4876-9e72-dd8fc242651d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
https://cpee.org/flow/engine/215
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e109897c-8484-4d87-b7d3-8786731a2f0a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
https://cpee.org/flow/engine/194
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
92a04ef3-759d-451b-97ef-a5dab3c8809a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
https://cpee.org/flow/engine/613
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ffbc55c8-0759-42f8-955e-30ebf9c086a6
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
https://cpee.org/flow/engine/199
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bf96a05e-845c-4f6e-88a8-b0d0d0ea9b8f
|