cpee 2.1.71 → 2.1.73
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/css/wfadaptor.css +1 -1
- data/cockpit/js/instance.js +45 -27
- data/cockpit/js/modifiers.js +3 -0
- data/cockpit/templates/ML-pipe-multi.xml +635 -0
- data/cockpit/templates/Track Test Local.xml +19 -13
- data/cockpit/themes/base.js +14 -5
- data/cpee.gemspec +2 -2
- data/lib/cpee/implementation_callbacks.rb +15 -1
- data/lib/cpee/implementation_properties.rb +14 -1
- data/lib/cpee/message.rb +1 -1
- data/server/executionhandlers/eval/controller.rb +11 -1
- data/server/executionhandlers/ruby/controller.rb +1 -1
- data/server/executionhandlers/ruby/execution.rb +0 -1
- data/server/routing/end.pid +1 -1
- data/server/routing/forward-events-00.pid +1 -1
- data/server/routing/forward-votes.pid +1 -1
- data/server/routing/persist.pid +1 -1
- metadata +3 -7
- data/cockpit/templates/Coopis 2010 Eval.xml +0 -192
- data/server/executionhandlers/rust/backend/README.md +0 -17
- data/server/executionhandlers/rust/backend/compile.sh +0 -5
- data/server/executionhandlers/rust/backend/opts.yaml +0 -6
- data/server/executionhandlers/rust/execution.rb +0 -84
@@ -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>
|
@@ -5,8 +6,24 @@
|
|
5
6
|
</dataelements>
|
6
7
|
<endpoints>
|
7
8
|
<start_url>https://cpee.org/flow/start/url/</start_url>
|
9
|
+
<user>https-post://cpee.org/services/timeout-user.php</user>
|
10
|
+
<auto>https-post://cpee.org/services/timeout-auto.php</auto>
|
11
|
+
<subprocess>https-post://cpee.org/flow/start/url/</subprocess>
|
12
|
+
<timeout>https-post://cpee.org/services/timeout.php</timeout>
|
13
|
+
<send>https-post://cpee.org/ing/correlators/message/send/</send>
|
14
|
+
<receive>https-get://cpee.org/ing/correlators/message/receive/</receive>
|
8
15
|
</endpoints>
|
9
|
-
<
|
16
|
+
<attributes>
|
17
|
+
<info>Track Test Local</info>
|
18
|
+
<modeltype>CPEE</modeltype>
|
19
|
+
<theme>default</theme>
|
20
|
+
<customer>pilotfabrik</customer>
|
21
|
+
<status>development</status>
|
22
|
+
<creator>Christine Ashcreek</creator>
|
23
|
+
<author>Christine Ashcreek</author>
|
24
|
+
<design_stage>development</design_stage>
|
25
|
+
<design_dir>Templates.dir</design_dir>
|
26
|
+
</attributes>
|
10
27
|
<description>
|
11
28
|
<description xmlns="http://cpee.org/ns/description/1.0">
|
12
29
|
<loop mode="pre_test" condition="true">
|
@@ -73,15 +90,4 @@
|
|
73
90
|
<dataelements type="none"/>
|
74
91
|
<endpoints type="none"/>
|
75
92
|
</transformation>
|
76
|
-
|
77
|
-
<info>Track Test Local</info>
|
78
|
-
<modeltype>CPEE</modeltype>
|
79
|
-
<theme>default</theme>
|
80
|
-
<customer>pilotfabrik</customer>
|
81
|
-
<status>development</status>
|
82
|
-
<creator>Christine Ashcreek</creator>
|
83
|
-
<author>Christine Ashcreek</author>
|
84
|
-
<design_stage>development</design_stage>
|
85
|
-
<design_dir>Templates.dir</design_dir>
|
86
|
-
</attributes>
|
87
|
-
</testset>
|
93
|
+
</testset>
|
data/cockpit/themes/base.js
CHANGED
@@ -1248,14 +1248,22 @@ function WFAdaptorManifestationBase(adaptor) {
|
|
1248
1248
|
|
1249
1249
|
var regassi = /data\.([a-zA-Z_]+)\s*(=[^=]|\+\=|\-\=|\*\=|\/\=|<<|>>)/g; // we do not have to check for >/< version of stuff as only conditions are in attributes, and conditions can not contain assignments
|
1250
1250
|
var reg_not_assi = /data\.([a-zA-Z_]+)\s*/g;
|
1251
|
-
|
1252
|
-
|
1251
|
+
|
1252
|
+
$('call, loop[condition], alternative[condition]',node).each(function(i,n) {
|
1253
|
+
let item = '';
|
1253
1254
|
if (n.hasAttribute('condition')) {
|
1254
1255
|
item = n.getAttribute('condition');
|
1255
1256
|
} else {
|
1256
|
-
|
1257
|
+
$('call > code > prepare',n).each(function(j,m){
|
1258
|
+
item += m.textContent + '\n';
|
1259
|
+
});
|
1260
|
+
$('call > parameters > arguments > *, call > code > finalize, call > code > update, call > code > rescue',n).each(function(j,m){
|
1261
|
+
let x = m.textContent;
|
1262
|
+
if (m.parentNode.nodeName == 'arguments' && x.charAt(0) != '!' ) { return }
|
1263
|
+
item += x + '\n';
|
1264
|
+
});
|
1257
1265
|
}
|
1258
|
-
if (
|
1266
|
+
if (item == '') { return; }
|
1259
1267
|
|
1260
1268
|
let indices = [];
|
1261
1269
|
|
@@ -1263,11 +1271,12 @@ function WFAdaptorManifestationBase(adaptor) {
|
|
1263
1271
|
indices.push(match.index);
|
1264
1272
|
alist.push(match[1]);
|
1265
1273
|
}
|
1274
|
+
|
1266
1275
|
for (const match of item.matchAll(reg_not_assi)) {
|
1267
1276
|
const arg1 = match[1];
|
1268
1277
|
if (indices.includes(match.index)) { continue; }
|
1269
1278
|
if (!alist.includes(arg1)) {
|
1270
|
-
if (match.index >= indices[0]) {
|
1279
|
+
if (match.index >= indices[0] || indices.length == 0) {
|
1271
1280
|
plist.push(arg1);
|
1272
1281
|
}
|
1273
1282
|
}
|
data/cpee.gemspec
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cpee"
|
3
|
-
s.version = "2.1.
|
3
|
+
s.version = "2.1.73"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.license = "LGPL-3.0-or-later"
|
6
6
|
s.summary = "The cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
|
7
7
|
|
8
8
|
s.description = "see http://cpee.org"
|
9
9
|
|
10
|
-
s.files = Dir['{example/**/*,server/**/*,tools/**/*,tools/archive,lib/**/*,cockpit/**/*,cockpit/templates/.templates.xml,cockpit/templates/.transformations.xml,cockpit/templates/.Signavio.xml,cockpit/templates/.CPEE.xml,cockpit/*.html,cockpit/themes/*/*,cockpit/themes/*/*/*,contrib/logo*,contrib/Screen*}'] - Dir['{server/instances/**/*,cockpit/js_libs/**/*,server/redis*}'] + %w(COPYING FEATURES.md INSTALL.md Rakefile cpee.gemspec README.md AUTHORS)
|
10
|
+
s.files = Dir['{example/**/*,server/**/*,tools/**/*,tools/archive,lib/**/*,cockpit/**/*,cockpit/templates/.templates.xml,cockpit/templates/.transformations.xml,cockpit/templates/.Signavio.xml,cockpit/templates/.CPEE.xml,cockpit/*.html,cockpit/themes/*/*,cockpit/themes/*/*/*,contrib/logo*,contrib/Screen*}'] - Dir['{server/instances/**/*,server/executionhandlers/rust/**/*,cockpit/js_libs/**/*,server/redis*}'] + %w(COPYING FEATURES.md INSTALL.md Rakefile cpee.gemspec README.md AUTHORS)
|
11
11
|
s.require_path = 'lib'
|
12
12
|
s.extra_rdoc_files = ['README.md']
|
13
13
|
s.bindir = 'tools'
|
@@ -116,7 +116,21 @@ module CPEE
|
|
116
116
|
if CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'callback'
|
117
117
|
ret = {}
|
118
118
|
ret['values'] = @p.map{ |e|
|
119
|
-
|
119
|
+
# bei complex wenn kleiner 500KiB statt e.value.path e.value.read
|
120
|
+
# bei complex wenn groesser 500KiB das file ueber nginx in einem verzeichnis verfuegbar machen, mimetype auf cpee/externallink
|
121
|
+
# aendert, link auf den server in den content. Der eval macht das dann direkt.
|
122
|
+
# Alt: [e.name, e.class == Riddl::Parameter::Simple ? [:simple,e.value] : [:complex,e.mimetype,e.value.path] ]
|
123
|
+
[
|
124
|
+
e.name,
|
125
|
+
if e.class == Riddl::Parameter::Simple
|
126
|
+
[:simple,e.value]
|
127
|
+
elsif e.class == Riddl::Parameter::Complex && e.value.size <= 512000
|
128
|
+
[:complex,e.mimetype,e.value.read]
|
129
|
+
else
|
130
|
+
# [:complex,'cpee-external-' + e.mimetype,e.value.read]
|
131
|
+
[:complex, e.mimetype,e.value.read]
|
132
|
+
end
|
133
|
+
]
|
120
134
|
}
|
121
135
|
ret['headers'] = @h
|
122
136
|
|
@@ -332,6 +332,16 @@ module CPEE
|
|
332
332
|
class PutExecutionHandler < Riddl::Implementation #{{{
|
333
333
|
def self::set(id,opts,hw)
|
334
334
|
CPEE::Persistence::set_item(id,opts,'executionhandler',:executionhandler => hw)
|
335
|
+
desc = CPEE::Persistence::extract_item(id,opts,'description')
|
336
|
+
dslx = CPEE::Persistence::extract_item(id,opts,'dslx')
|
337
|
+
xml = XML::Smart::string(dslx)
|
338
|
+
xml.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
|
339
|
+
dsl = Object.const_get('CPEE::ExecutionHandler::' + hw.capitalize)::dslx_to_dsl(xml)
|
340
|
+
CPEE::Persistence::set_item(id,opts,'description',
|
341
|
+
:description => xml,
|
342
|
+
:dslx => dslx,
|
343
|
+
:dsl => dsl
|
344
|
+
)
|
335
345
|
end
|
336
346
|
def response
|
337
347
|
id = @a[0]
|
@@ -768,7 +778,10 @@ module CPEE
|
|
768
778
|
CPEE::Persistence::set_item(id,opts,'description',
|
769
779
|
:description => xml,
|
770
780
|
:dslx => dslx,
|
771
|
-
:dsl => dsl
|
781
|
+
:dsl => dsl,
|
782
|
+
:dataelements => CPEE::Persistence::extract_list(id,opts,'dataelements').to_h,
|
783
|
+
:endpoints => CPEE::Persistence::extract_list(id,opts,'endpoints').to_h,
|
784
|
+
:attributes => CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
772
785
|
)
|
773
786
|
PatchItems::set_hash('dataelements',id,opts,de) unless de.empty?
|
774
787
|
PatchItems::set_hash('dataelements',id,opts,ep) unless ep.empty?
|
data/lib/cpee/message.rb
CHANGED
@@ -70,7 +70,7 @@ class Controller
|
|
70
70
|
if e[1][0] == 'simple'
|
71
71
|
resp << Riddl::Parameter::Simple.new(e[0],e[1][1])
|
72
72
|
elsif e[1][0] == 'complex'
|
73
|
-
resp << Riddl::Parameter::Complex.new(e[0],e[1][1],
|
73
|
+
resp << Riddl::Parameter::Complex.new(e[0],e[1][1],e[1][2])
|
74
74
|
end
|
75
75
|
end
|
76
76
|
@callback_keys[identifier].send(:callback,resp,m['content']['headers'])
|
@@ -136,6 +136,16 @@ class Controller
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
+
def sim
|
140
|
+
if vote("state/change", :state => 'simulating')
|
141
|
+
@thread = @instance.sim
|
142
|
+
@thread.join
|
143
|
+
else
|
144
|
+
@thread = @instance.stop
|
145
|
+
@thread.join
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
139
149
|
def stop
|
140
150
|
### tell the instance to stop
|
141
151
|
@instance.stop
|
@@ -70,7 +70,7 @@ class Controller
|
|
70
70
|
if e[1][0] == 'simple'
|
71
71
|
resp << Riddl::Parameter::Simple.new(e[0],e[1][1])
|
72
72
|
elsif e[1][0] == 'complex'
|
73
|
-
resp << Riddl::Parameter::Complex.new(e[0],e[1][1],
|
73
|
+
resp << Riddl::Parameter::Complex.new(e[0],e[1][1],e[1][2])
|
74
74
|
end
|
75
75
|
end
|
76
76
|
@callback_keys[identifier].send(:callback,resp,m['content']['headers'])
|
@@ -40,7 +40,6 @@ module CPEE
|
|
40
40
|
[ k, v, CPEE::Persistence::extract_item(id,opts,File.join('positions',k,'@passthrough')) ]
|
41
41
|
end
|
42
42
|
iopts = YAML::load_file(ExecutionHandler::Ruby::BACKEND_OPTS)
|
43
|
-
pp iopts
|
44
43
|
iopts[:host] = opts[:host]
|
45
44
|
iopts[:url] = opts[:url]
|
46
45
|
iopts[:redis_url] = opts[:redis_url]
|
data/server/routing/end.pid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
1174970
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
1174988
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
1174982
|
data/server/routing/persist.pid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
1174976
|
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.73
|
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: 2024-
|
13
|
+
date: 2024-11-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: riddl
|
@@ -270,12 +270,12 @@ files:
|
|
270
270
|
- cockpit/templates.legacy/convert_preset.rb
|
271
271
|
- cockpit/templates.legacy/testsets.xml
|
272
272
|
- cockpit/templates.legacy/transformations.xml
|
273
|
-
- cockpit/templates/Coopis 2010 Eval.xml
|
274
273
|
- cockpit/templates/Coopis 2010.xml
|
275
274
|
- cockpit/templates/Frames.xml
|
276
275
|
- cockpit/templates/IUPC arXiv:1104.3609 P34 1.xml
|
277
276
|
- cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml
|
278
277
|
- cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml
|
278
|
+
- cockpit/templates/ML-pipe-multi.xml
|
279
279
|
- cockpit/templates/Subprocess.xml
|
280
280
|
- cockpit/templates/Subprocess.xml.attrs
|
281
281
|
- cockpit/templates/Track Test Local.xml
|
@@ -908,10 +908,6 @@ files:
|
|
908
908
|
- server/executionhandlers/ruby/controller.rb
|
909
909
|
- server/executionhandlers/ruby/dsl_to_dslx.xsl
|
910
910
|
- server/executionhandlers/ruby/execution.rb
|
911
|
-
- server/executionhandlers/rust/backend/README.md
|
912
|
-
- server/executionhandlers/rust/backend/compile.sh
|
913
|
-
- server/executionhandlers/rust/backend/opts.yaml
|
914
|
-
- server/executionhandlers/rust/execution.rb
|
915
911
|
- server/resources/empty_dslx.xml
|
916
912
|
- server/resources/notifications/logging/subscription.xml
|
917
913
|
- server/resources/properties.empty
|
@@ -1,192 +0,0 @@
|
|
1
|
-
<testset xmlns="http://cpee.org/ns/properties/2.0">
|
2
|
-
<executionhandler>eval</executionhandler>
|
3
|
-
<dataelements>
|
4
|
-
<persons>3</persons>
|
5
|
-
<card>Visa_12345</card>
|
6
|
-
<airline/>
|
7
|
-
<hotels>[]</hotels>
|
8
|
-
<from>Vienna</from>
|
9
|
-
<to>Prague</to>
|
10
|
-
<costs>0</costs>
|
11
|
-
</dataelements>
|
12
|
-
<endpoints>
|
13
|
-
<bookAir>http://gruppe.wst.univie.ac.at/~mangler/services/airline.php</bookAir>
|
14
|
-
<user>https-post://cpee.org/services/timeout-user.php</user>
|
15
|
-
<auto>https-post://cpee.org/services/timeout-auto.php</auto>
|
16
|
-
<timeout>https://cpee.org/services/timeout.php</timeout>
|
17
|
-
<bookHotel>http://gruppe.wst.univie.ac.at/~mangler/services/hotel.php</bookHotel>
|
18
|
-
<subprocess>https://cpee.org/flow/start/url/</subprocess>
|
19
|
-
<approve>http://gruppe.wst.univie.ac.at/~mangler/services/approval.php</approve>
|
20
|
-
<send>https-post://cpee.org/ing/correlators/message/send/</send>
|
21
|
-
<receive>https-get://cpee.org/ing/correlators/message/receive/</receive>
|
22
|
-
</endpoints>
|
23
|
-
<attributes>
|
24
|
-
<theme>extended</theme>
|
25
|
-
<info>Coopis 2010 Eval</info>
|
26
|
-
<creator>Christine Ashcreek</creator>
|
27
|
-
<author>Christine Ashcreek</author>
|
28
|
-
<modeltype>CPEE</modeltype>
|
29
|
-
<design_stage>development</design_stage>
|
30
|
-
<guarded>none</guarded>
|
31
|
-
<design_dir>Templates.dir/</design_dir>
|
32
|
-
<guarded_id/>
|
33
|
-
<model_uuid>1cdc1bc1-6cf9-4f52-a227-8c87a7b9120a</model_uuid>
|
34
|
-
</attributes>
|
35
|
-
<description>
|
36
|
-
<description xmlns="http://cpee.org/ns/description/1.0">
|
37
|
-
<call id="a1" endpoint="bookAir">
|
38
|
-
<parameters>
|
39
|
-
<label>Book Airline 1</label>
|
40
|
-
<method>:post</method>
|
41
|
-
<arguments>
|
42
|
-
<from>!data.from</from>
|
43
|
-
<to>!data.to</to>
|
44
|
-
<persons>!data.persons</persons>
|
45
|
-
</arguments>
|
46
|
-
</parameters>
|
47
|
-
<code>
|
48
|
-
<prepare/>
|
49
|
-
<finalize output="result">data.airline = result.value('id')
|
50
|
-
data.costs += result.value('costs').to_f
|
51
|
-
status.update 1, 'Hotel'</finalize>
|
52
|
-
<update output="result"/>
|
53
|
-
<rescue output="result"/>
|
54
|
-
</code>
|
55
|
-
<annotations>
|
56
|
-
<_timing>
|
57
|
-
<_timing_weight/>
|
58
|
-
<_timing_avg/>
|
59
|
-
<explanations/>
|
60
|
-
</_timing>
|
61
|
-
<_shifting>
|
62
|
-
<_shifting_type>Duration</_shifting_type>
|
63
|
-
</_shifting>
|
64
|
-
<_context_data_analysis>
|
65
|
-
<probes/>
|
66
|
-
<ips/>
|
67
|
-
</_context_data_analysis>
|
68
|
-
<report>
|
69
|
-
<url/>
|
70
|
-
</report>
|
71
|
-
<_notes>
|
72
|
-
<_notes_general/>
|
73
|
-
</_notes>
|
74
|
-
</annotations>
|
75
|
-
<documentation>
|
76
|
-
<input/>
|
77
|
-
<output/>
|
78
|
-
<implementation>
|
79
|
-
<description/>
|
80
|
-
</implementation>
|
81
|
-
<code>
|
82
|
-
<description/>
|
83
|
-
</code>
|
84
|
-
</documentation>
|
85
|
-
</call>
|
86
|
-
<parallel wait="-1" cancel="last">
|
87
|
-
<loop mode="pre_test" condition="data.persons > 0">
|
88
|
-
<parallel_branch>
|
89
|
-
<call id="a2" endpoint="bookHotel">
|
90
|
-
<parameters>
|
91
|
-
<label>Book Hotel</label>
|
92
|
-
<method>:post</method>
|
93
|
-
<arguments>
|
94
|
-
<to>!data.to</to>
|
95
|
-
</arguments>
|
96
|
-
</parameters>
|
97
|
-
<code>
|
98
|
-
<prepare/>
|
99
|
-
<finalize output="result">data.hotels << result.value('id')
|
100
|
-
data.costs += result.value('costs').to_f</finalize>
|
101
|
-
<update output="result"/>
|
102
|
-
<rescue output="result"/>
|
103
|
-
</code>
|
104
|
-
<annotations>
|
105
|
-
<_timing>
|
106
|
-
<_timing_weight/>
|
107
|
-
<_timing_avg/>
|
108
|
-
<explanations/>
|
109
|
-
</_timing>
|
110
|
-
<_shifting>
|
111
|
-
<_shifting_type>Duration</_shifting_type>
|
112
|
-
</_shifting>
|
113
|
-
<_context_data_analysis>
|
114
|
-
<probes/>
|
115
|
-
<ips/>
|
116
|
-
</_context_data_analysis>
|
117
|
-
<report>
|
118
|
-
<url/>
|
119
|
-
</report>
|
120
|
-
<_notes>
|
121
|
-
<_notes_general/>
|
122
|
-
</_notes>
|
123
|
-
</annotations>
|
124
|
-
<documentation>
|
125
|
-
<input/>
|
126
|
-
<output/>
|
127
|
-
<implementation>
|
128
|
-
<description/>
|
129
|
-
</implementation>
|
130
|
-
<code>
|
131
|
-
<description/>
|
132
|
-
</code>
|
133
|
-
</documentation>
|
134
|
-
</call>
|
135
|
-
</parallel_branch>
|
136
|
-
<manipulate id="a3">data.persons -= 1</manipulate>
|
137
|
-
</loop>
|
138
|
-
</parallel>
|
139
|
-
<choose mode="exclusive">
|
140
|
-
<alternative condition="data.costs > 700">
|
141
|
-
<_probability>
|
142
|
-
<_probability_min/>
|
143
|
-
<_probability_max/>
|
144
|
-
<_probability_avg/>
|
145
|
-
</_probability>
|
146
|
-
<call id="a4" endpoint="approve">
|
147
|
-
<parameters>
|
148
|
-
<label>Approve Hotel</label>
|
149
|
-
<method>:post</method>
|
150
|
-
<arguments>
|
151
|
-
<costs>!data.costs</costs>
|
152
|
-
</arguments>
|
153
|
-
</parameters>
|
154
|
-
<annotations>
|
155
|
-
<_timing>
|
156
|
-
<_timing_weight/>
|
157
|
-
<_timing_avg/>
|
158
|
-
<explanations/>
|
159
|
-
</_timing>
|
160
|
-
<_shifting>
|
161
|
-
<_shifting_type>Duration</_shifting_type>
|
162
|
-
</_shifting>
|
163
|
-
<_context_data_analysis>
|
164
|
-
<probes/>
|
165
|
-
<ips/>
|
166
|
-
</_context_data_analysis>
|
167
|
-
<report>
|
168
|
-
<url/>
|
169
|
-
</report>
|
170
|
-
<_notes>
|
171
|
-
<_notes_general/>
|
172
|
-
</_notes>
|
173
|
-
</annotations>
|
174
|
-
<documentation>
|
175
|
-
<input/>
|
176
|
-
<output/>
|
177
|
-
<implementation>
|
178
|
-
<description/>
|
179
|
-
</implementation>
|
180
|
-
</documentation>
|
181
|
-
</call>
|
182
|
-
</alternative>
|
183
|
-
<otherwise/>
|
184
|
-
</choose>
|
185
|
-
</description>
|
186
|
-
</description>
|
187
|
-
<transformation>
|
188
|
-
<description type="copy"/>
|
189
|
-
<dataelements type="none"/>
|
190
|
-
<endpoints type="none"/>
|
191
|
-
</transformation>
|
192
|
-
</testset>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
* run is copied into every instance.
|
2
|
-
* opts.yaml is written on each start.
|
3
|
-
* instance.rb is written on each start.
|
4
|
-
|
5
|
-
## What can you do to make it more robust?
|
6
|
-
|
7
|
-
Replace run with a program that actually compiles and runs instance.rb. Of
|
8
|
-
courses the transformation_* xslts would have to be adapted to create suitable
|
9
|
-
code. The compiled executable would just need to behave the same as the instance.rb,
|
10
|
-
dispersing all the same events through redis.
|
11
|
-
|
12
|
-
More suitable languages would be crystal and javascript, c++. Less suitable,
|
13
|
-
but doable, would be python, C. I.e., all languages that do not support multi-line
|
14
|
-
lambdas would produce much less readable code, thus the "Description" tab in
|
15
|
-
the cockpit would be garbage.
|
16
|
-
|
17
|
-
Definitely do tell me if you are interessted in doing something like this ;-)
|
@@ -1,84 +0,0 @@
|
|
1
|
-
# This file is part of CPEE.
|
2
|
-
#
|
3
|
-
# CPEE is free software: you can redistribute it and/or modify it under the terms
|
4
|
-
# of the GNU General Public License as published by the Free Software Foundation,
|
5
|
-
# either version 3 of the License, or (at your option) any later version.
|
6
|
-
#
|
7
|
-
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
8
|
-
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
9
|
-
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
10
|
-
#
|
11
|
-
# You should have received a copy of the GNU General Public License along with
|
12
|
-
# CPEE (file COPYING in the main directory). If not, see
|
13
|
-
# <http://www.gnu.org/licenses/>.
|
14
|
-
|
15
|
-
module CPEE
|
16
|
-
|
17
|
-
module ExecutionHandler
|
18
|
-
|
19
|
-
module Rust
|
20
|
-
BACKEND_INSTANCE = 'instance.rs'
|
21
|
-
BACKEND_OPTS = 'opts.yaml'
|
22
|
-
BACKEND_COMPILE = File.expand_path(File.join(__dir__,'backend','compile.sh'))
|
23
|
-
BACKEND_RUN = File.expand_path(File.join(__dir__,'backend','run'))
|
24
|
-
|
25
|
-
def self::dslx_to_dsl(dslx) # transpile
|
26
|
-
'hello world'
|
27
|
-
end
|
28
|
-
|
29
|
-
def self::prepare(id,opts) # write result to disk
|
30
|
-
Dir.mkdir(File.join(opts[:instances],id.to_s)) rescue nil
|
31
|
-
FileUtils.copy(ExecutionHandler::Rust::BACKEND_COMPILE,File.join(opts[:instances],id.to_s))
|
32
|
-
dsl = CPEE::Persistence::extract_item(id,opts,'dsl')
|
33
|
-
hw = CPEE::Persistence::extract_item(id,opts,'executionhandler')
|
34
|
-
endpoints = CPEE::Persistence::extract_list(id,opts,'endpoints').to_h
|
35
|
-
dataelements = CPEE::Persistence::extract_list(id,opts,'dataelements').to_h
|
36
|
-
attributes = CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
37
|
-
positions = CPEE::Persistence::extract_set(id,opts,'positions')
|
38
|
-
positions.map! do |k, v|
|
39
|
-
[ k, v, CPEE::Persistence::extract_item(id,opts,File.join('positions',k,'@passthrough')) ]
|
40
|
-
end
|
41
|
-
File.open(File.join(opts[:instances],id.to_s,ExecutionHandler::Rust::BACKEND_OPTS),'w') do |f|
|
42
|
-
YAML::dump({
|
43
|
-
:host => opts[:host],
|
44
|
-
:url => opts[:url],
|
45
|
-
:redis_url => opts[:redis_url],
|
46
|
-
:redis_path => File.join(opts[:basepath],opts[:redis_path]),
|
47
|
-
:redis_db => opts[:redis_db],
|
48
|
-
:workers => opts[:workers],
|
49
|
-
:global_executionhandlers => opts[:global_executionhandlers],
|
50
|
-
:executionhandlers => opts[:executionhandlers],
|
51
|
-
:executionhandler => hw,
|
52
|
-
:endpoints => endpoints,
|
53
|
-
:dataelements => dataelements,
|
54
|
-
:positions => positions,
|
55
|
-
:attributes => attributes
|
56
|
-
},f)
|
57
|
-
end
|
58
|
-
File.write(File.join(opts[:instances],id.to_s,ExecutionHandler::Rust::BACKEND_INSTANCE),dsl)
|
59
|
-
`#{File.join(opts[:instances],id.to_s,File.basename(ExecutionHandler::Rust::BACKEND_COMPILE))}`
|
60
|
-
end
|
61
|
-
|
62
|
-
def self::run(id,opts)
|
63
|
-
exe = File.join(opts[:instances],id.to_s,File.basename(ExecutionHandler::Rust::BACKEND_RUN))
|
64
|
-
pid = Kernel.spawn(exe , :pgroup => true, :in => '/dev/null', :out => exe + '.out', :err => exe + '.err')
|
65
|
-
Process.detach pid
|
66
|
-
File.write(exe + '.pid',pid)
|
67
|
-
end
|
68
|
-
|
69
|
-
def self::stop(id,opts) ### return: bool to tell if manually changing redis is necessary
|
70
|
-
exe = File.join(opts[:instances],id.to_s,File.basename(ExecutionHandler::Rust::BACKEND_RUN))
|
71
|
-
pid = File.read(exe + '.pid') rescue nil
|
72
|
-
if pid && (Process.kill(0, pid.to_i) rescue false)
|
73
|
-
Process.kill('HUP', pid.to_i) rescue nil
|
74
|
-
false
|
75
|
-
else # its not running, so clean up
|
76
|
-
File.unlink(exe + '.pid') rescue nil
|
77
|
-
true
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
83
|
-
|
84
|
-
end
|