cpee 2.1.75 → 2.1.78
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/js/details.js +21 -9
- data/cockpit/templates/Subprocess.xml +16 -44
- data/cockpit/templates/Subprocess.xml.attrs +6 -6
- data/cockpit/templates/Wait.xml +16 -5
- data/cockpit/themes/compact/rngs/call.rng +1 -0
- data/cockpit/themes/compact/rngs/callmanipulate.rng +1 -0
- data/cockpit/themes/control/rngs/call.rng +1 -0
- data/cockpit/themes/control/rngs/callmanipulate.rng +1 -0
- data/cockpit/themes/dataflow/rngs/call.rng +1 -0
- data/cockpit/themes/dataflow/rngs/callmanipulate.rng +1 -0
- data/cockpit/themes/default/rngs/call.rng +1 -0
- data/cockpit/themes/default/rngs/callmanipulate.rng +1 -0
- data/cockpit/themes/extended/rngs/call.rng +1 -0
- data/cockpit/themes/extended/rngs/callmanipulate.rng +1 -0
- data/cockpit/themes/packed/rngs/call.rng +1 -0
- data/cockpit/themes/packed/rngs/callmanipulate.rng +1 -0
- data/cockpit/themes/preset/rngs/call.rng +1 -0
- data/cockpit/themes/preset/rngs/callmanipulate.rng +1 -0
- data/cockpit/themes/reduced/rngs/call.rng +1 -0
- data/cockpit/themes/reduced/rngs/callmanipulate.rng +1 -0
- data/cpee.gemspec +2 -1
- data/lib/cpee/implementation.rb +73 -10
- data/lib/cpee/implementation_properties.rb +81 -68
- data/lib/cpee/message.rb +17 -0
- data/lib/cpee/persistence.rb +4 -0
- data/lib/engine.xml +9 -2
- data/lib/properties/set-testset.rng +49 -0
- data/lib/properties/subscriptions.rng +43 -0
- data/server/executionhandlers/eval/execution.rb +1 -1
- data/server/executionhandlers/ruby/backend/{run → run.rb} +2 -2
- data/server/executionhandlers/ruby/connection.rb +15 -10
- data/server/executionhandlers/ruby/dsl_to_dslx.xsl +7 -7
- data/server/executionhandlers/ruby/execution.rb +4 -3
- 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
- data/server/routing/persist.rb +3 -0
- metadata +25 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9526070ed5def28c277c8581f28cac23c3a8f0ec1ac0e7d6e95fe66ed61ad639
|
4
|
+
data.tar.gz: 2a1f76601b0afe5c52d50f0d0c4805db1339f977b31f56d8e442d144b0344f30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3789d2bf18a604d52c89cdffa210f2294fb089993eeab142ddb5d6c17f613c1f2c13f3c327d525e78d1889ce84f840d6744d3a731dc5a979e76267d8e7963624
|
7
|
+
data.tar.gz: 666024df8c6e900bec39b07604a906a83929a1f1f4c04c4888a8ef7511d41ad878aa4271d6d91cf64ff636de8c7254008d85fa544436785e01c33c1f6b8bddd7
|
data/cockpit/js/details.js
CHANGED
@@ -29,22 +29,36 @@ $(document).ready(function() {
|
|
29
29
|
|
30
30
|
function do_main_save() { //{{{
|
31
31
|
if (save['details'].has_changed()) {
|
32
|
-
do_main_work();
|
32
|
+
do_main_work(save['details_target'].svgid);
|
33
33
|
}
|
34
34
|
} //}}}
|
35
35
|
|
36
|
-
function do_main_work() { //{{{
|
37
|
-
var svgid = save['details_target'].svgid;
|
36
|
+
function do_main_work(svgid) { //{{{
|
38
37
|
var desc = save['details_target'].model;
|
39
38
|
var node = desc.get_node_by_svg_id(svgid);
|
40
39
|
var orignode = save['graph_adaptor'].illustrator.get_node_by_svg_id(svgid).parents('g.element[element-id]');
|
41
40
|
var origtype = orignode.attr('element-type') + '_' + orignode.attr('element-endpoint');
|
42
41
|
|
43
42
|
var url = $('body').attr('current-instance');
|
44
|
-
save['details'].set_checkpoint();
|
45
43
|
|
46
|
-
var nnew
|
47
|
-
|
44
|
+
var nnew;
|
45
|
+
if (svgid != save['details_target'].svgid ) {
|
46
|
+
let tn = desc.get_node_by_svg_id(svgid).get(0);
|
47
|
+
let rng = desc.elements[$(tn).attr('svg-subtype')].clone();
|
48
|
+
if (save['endpoints_cache'][$(tn).attr('endpoint')] && save['endpoints_cache'][$(tn).attr('endpoint')].schema) {
|
49
|
+
let schema = save['endpoints_cache'][$(tn).attr('endpoint')].schema.documentElement;
|
50
|
+
$(rng).find(' > element[name="parameters"] > element[name="arguments"]').replaceWith($(schema).clone());
|
51
|
+
}
|
52
|
+
if (save['endpoints_list'][$(tn).attr('endpoint')] && (!save['endpoints_list'][$(tn).attr('endpoint')].startsWith('http') || save['endpoints_list'][$(tn).attr('endpoint')].match(/^https?-/))) {
|
53
|
+
$(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
|
54
|
+
}
|
55
|
+
let rngw = new RelaxNGui(rng,$('#relaxngworker'),desc.context_eval);
|
56
|
+
nnew = $(rngw.save().documentElement);
|
57
|
+
} else {
|
58
|
+
save['details'].set_checkpoint();
|
59
|
+
nnew = $(save['details'].save().documentElement);
|
60
|
+
}
|
61
|
+
nnew.attr('svg-id',svgid);
|
48
62
|
|
49
63
|
if ($('*[svg-id]',node).length > 0) {
|
50
64
|
nnew.append(node.children().filter(function(){ return this.attributes['svg-id'] != undefined; }));
|
@@ -54,8 +68,6 @@ function do_main_work() { //{{{
|
|
54
68
|
nnew[0].removeAttribute('xmlns');
|
55
69
|
}
|
56
70
|
|
57
|
-
parameters_changed
|
58
|
-
|
59
71
|
node.replaceWith(nnew);
|
60
72
|
|
61
73
|
var ttarget = manifestation.adaptor.illustrator.get_node_by_svg_id(svgid);
|
@@ -82,7 +94,7 @@ function do_main_work() { //{{{
|
|
82
94
|
|
83
95
|
if (newtype != origtype) {
|
84
96
|
manifestation.update_details(svgid);
|
85
|
-
do_main_work();
|
97
|
+
do_main_work(svgid);
|
86
98
|
} else {
|
87
99
|
$.ajax({
|
88
100
|
type: "PUT",
|
@@ -3,61 +3,29 @@
|
|
3
3
|
<executionhandler>ruby</executionhandler>
|
4
4
|
<dataelements/>
|
5
5
|
<endpoints>
|
6
|
-
<subprocess>https-post://
|
6
|
+
<subprocess>https-post://echo.bpm.in.tum.de/flow/start/url/</subprocess>
|
7
|
+
<user>https-post://cpee.org/services/timeout-user.php</user>
|
8
|
+
<auto>https-post://cpee.org/services/timeout-auto.php</auto>
|
7
9
|
<timeout>https://cpee.org/services/timeout.php</timeout>
|
10
|
+
<send>https-post://cpee.org/ing/correlators/message/send/</send>
|
11
|
+
<receive>https-get://cpee.org/ing/correlators/message/receive/</receive>
|
8
12
|
</endpoints>
|
9
13
|
<attributes>
|
14
|
+
<guarded>none</guarded>
|
10
15
|
<info>Subprocess</info>
|
11
|
-
<creator>Christine Ashcreek</creator>
|
12
|
-
<author>Christine Ashcreek</author>
|
13
16
|
<modeltype>CPEE</modeltype>
|
14
|
-
<
|
17
|
+
<theme>extended</theme>
|
18
|
+
<creator>Christine Ashcreek</creator>
|
15
19
|
<guarded_id/>
|
20
|
+
<author>Christine Ashcreek</author>
|
16
21
|
<model_uuid>1fc43528-3e4a-40ee-8503-c0ed7e5d883c</model_uuid>
|
17
22
|
<model_version/>
|
18
|
-
<theme>extended</theme>
|
19
|
-
<design_dir>Templates.dir</design_dir>
|
20
23
|
<design_stage>development</design_stage>
|
24
|
+
<design_dir>Templates.dir</design_dir>
|
21
25
|
</attributes>
|
22
26
|
<description>
|
23
27
|
<description xmlns="http://cpee.org/ns/description/1.0">
|
24
|
-
<
|
25
|
-
<parameters>
|
26
|
-
<label>Wait</label>
|
27
|
-
<method>:post</method>
|
28
|
-
<arguments>
|
29
|
-
<timeout>2</timeout>
|
30
|
-
</arguments>
|
31
|
-
</parameters>
|
32
|
-
<annotations>
|
33
|
-
<_generic/>
|
34
|
-
<_timing>
|
35
|
-
<_timing_weight/>
|
36
|
-
<_timing_avg/>
|
37
|
-
<explanations/>
|
38
|
-
</_timing>
|
39
|
-
<_shifting>
|
40
|
-
<_shifting_type>Duration</_shifting_type>
|
41
|
-
</_shifting>
|
42
|
-
<_context_data_analysis>
|
43
|
-
<probes/>
|
44
|
-
<ips/>
|
45
|
-
</_context_data_analysis>
|
46
|
-
<report>
|
47
|
-
<url/>
|
48
|
-
</report>
|
49
|
-
<_notes>
|
50
|
-
<_notes_general/>
|
51
|
-
</_notes>
|
52
|
-
</annotations>
|
53
|
-
<documentation>
|
54
|
-
<input/>
|
55
|
-
<output/>
|
56
|
-
<implementation>
|
57
|
-
<description/>
|
58
|
-
</implementation>
|
59
|
-
</documentation>
|
60
|
-
</call>
|
28
|
+
<manipulate id="a3" label="">data.start = Time.now.to_f</manipulate>
|
61
29
|
<call id="a1" endpoint="subprocess">
|
62
30
|
<parameters>
|
63
31
|
<label>Create Sub</label>
|
@@ -74,7 +42,10 @@
|
|
74
42
|
</parameters>
|
75
43
|
<code>
|
76
44
|
<prepare/>
|
77
|
-
<finalize output="result">data.res = result
|
45
|
+
<finalize output="result">data.res = result
|
46
|
+
data.substart = result['start'].to_f - data.start.to_f
|
47
|
+
data.subend = result['end'].to_f - data.start.to_f
|
48
|
+
data.duration = Time.now.to_f - data.start.to_f</finalize>
|
78
49
|
<update output="result"/>
|
79
50
|
<rescue output="result"/>
|
80
51
|
</code>
|
@@ -110,6 +81,7 @@
|
|
110
81
|
</code>
|
111
82
|
</documentation>
|
112
83
|
</call>
|
84
|
+
<stop id="a2"/>
|
113
85
|
</description>
|
114
86
|
</description>
|
115
87
|
<transformation>
|
@@ -1,13 +1,13 @@
|
|
1
1
|
{
|
2
|
+
"guarded": "none",
|
2
3
|
"info": "Subprocess",
|
3
|
-
"creator": "Christine Ashcreek",
|
4
|
-
"author": "Christine Ashcreek",
|
5
4
|
"modeltype": "CPEE",
|
6
|
-
"
|
5
|
+
"theme": "extended",
|
6
|
+
"creator": "Christine Ashcreek",
|
7
7
|
"guarded_id": "",
|
8
|
+
"author": "Christine Ashcreek",
|
8
9
|
"model_uuid": "1fc43528-3e4a-40ee-8503-c0ed7e5d883c",
|
9
10
|
"model_version": "",
|
10
|
-
"
|
11
|
-
"design_dir": "Templates.dir"
|
12
|
-
"design_stage": "development"
|
11
|
+
"design_stage": "development",
|
12
|
+
"design_dir": "Templates.dir"
|
13
13
|
}
|
data/cockpit/templates/Wait.xml
CHANGED
@@ -7,29 +7,37 @@
|
|
7
7
|
<subprocess>https://cpee.org/flow/start/url/</subprocess>
|
8
8
|
</endpoints>
|
9
9
|
<attributes>
|
10
|
+
<guarded>none</guarded>
|
10
11
|
<info>Wait</info>
|
11
|
-
<creator>Christine Ashcreek</creator>
|
12
|
-
<author>Christine Ashcreek</author>
|
13
12
|
<modeltype>CPEE</modeltype>
|
14
|
-
<
|
13
|
+
<theme>extended</theme>
|
14
|
+
<creator>Christine Ashcreek</creator>
|
15
15
|
<guarded_id/>
|
16
|
+
<author>Christine Ashcreek</author>
|
16
17
|
<model_uuid>c92d0c0b-8bbd-40dd-baad-01c5616dfceb</model_uuid>
|
17
18
|
<model_version/>
|
18
|
-
<theme>extended</theme>
|
19
19
|
<design_dir>Templates.dir</design_dir>
|
20
20
|
<design_stage>development</design_stage>
|
21
21
|
</attributes>
|
22
22
|
<description>
|
23
23
|
<description xmlns="http://cpee.org/ns/description/1.0">
|
24
|
+
<manipulate id="a2" label="Measure Start">data.start = Time.now.to_f</manipulate>
|
24
25
|
<call id="a1" endpoint="timeout">
|
25
26
|
<parameters>
|
26
27
|
<label>Wait</label>
|
27
28
|
<method>:post</method>
|
28
29
|
<arguments>
|
29
|
-
<timeout>
|
30
|
+
<timeout>1</timeout>
|
30
31
|
</arguments>
|
31
32
|
</parameters>
|
33
|
+
<code>
|
34
|
+
<prepare/>
|
35
|
+
<finalize output="result">data.end = Time.now.to_f</finalize>
|
36
|
+
<update output="result"/>
|
37
|
+
<rescue output="result"/>
|
38
|
+
</code>
|
32
39
|
<annotations>
|
40
|
+
<_generic/>
|
33
41
|
<_timing>
|
34
42
|
<_timing_weight/>
|
35
43
|
<_timing_avg/>
|
@@ -55,6 +63,9 @@
|
|
55
63
|
<implementation>
|
56
64
|
<description/>
|
57
65
|
</implementation>
|
66
|
+
<code>
|
67
|
+
<description/>
|
68
|
+
</code>
|
58
69
|
</documentation>
|
59
70
|
</call>
|
60
71
|
</description>
|
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.78"
|
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."
|
@@ -32,4 +32,5 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.add_runtime_dependency 'webrick', '~>1.7'
|
33
33
|
s.add_runtime_dependency 'rbtrace', '~>0.4'
|
34
34
|
s.add_runtime_dependency 'cpee-eval-ruby', '~> 1.0', '>= 1.0.4'
|
35
|
+
s.add_runtime_dependency 'by', '~> 1.1', '>= 1.1.0'
|
35
36
|
end
|
data/lib/cpee/implementation.rb
CHANGED
@@ -86,8 +86,19 @@ module CPEE
|
|
86
86
|
opts[:redis_pid] ||= 'redis.pid' # use e.g. /var/run/redis.pid if you do global. Look it up in your redis config
|
87
87
|
opts[:redis_db_name] ||= 'redis.rdb' # use e.g. /var/lib/redis.rdb for global stuff. Look it up in your redis config
|
88
88
|
|
89
|
+
opts[:libs_preload] ||= ['weel', 'json', 'redis', 'securerandom', 'riddl/client', 'cpee/value_helper', 'cpee/attributes_helper', 'cpee/message', 'cpee/redis', 'cpee/persistence', 'yaml', 'charlock_holmes', 'psych', 'xml/smart', 'ostruct', 'bigdecimal', 'mimemagic', 'cpee-eval-ruby/translation', 'get_process_mem']
|
90
|
+
opts[:libs_preloader] ||= '~/bin/by-server'
|
91
|
+
opts[:libs_preloaderrun] ||= '~/bin/by'
|
92
|
+
|
89
93
|
CPEE::redis_connect opts, 'Server Main'
|
90
94
|
|
95
|
+
### start by server
|
96
|
+
if opts[:libs_preload]&.is_a?(Array) && opts[:libs_preload].length > 0
|
97
|
+
puts '(re)starting by-server ...'
|
98
|
+
`pkill -f #{File.basename(opts[:libs_preloader])}`
|
99
|
+
`#{opts[:libs_preloader]} '#{opts[:libs_preload].join("' '")}'`
|
100
|
+
end
|
101
|
+
|
91
102
|
opts[:sse_keepalive_frequency] ||= 10
|
92
103
|
opts[:sse_connections] = {}
|
93
104
|
|
@@ -181,6 +192,7 @@ module CPEE
|
|
181
192
|
interface 'main' do
|
182
193
|
run CPEE::Instances, opts if get '*'
|
183
194
|
run CPEE::NewInstance, opts if post 'instance-new'
|
195
|
+
run CPEE::NewInstanceFull, opts if post 'instance-full-new'
|
184
196
|
on resource 'executionhandlers' do
|
185
197
|
run CPEE::ExecutionHandlers, opts if get
|
186
198
|
end
|
@@ -298,8 +310,53 @@ module CPEE
|
|
298
310
|
end
|
299
311
|
end #}}}
|
300
312
|
|
313
|
+
class NewInstanceFull < Riddl::Implementation #{{{
|
314
|
+
def response
|
315
|
+
opts = @a[0]
|
316
|
+
redis = opts[:redis]
|
317
|
+
|
318
|
+
doc = XML::Smart::string(@p[0].value.read)
|
319
|
+
doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
|
320
|
+
doc.register_namespace 'sub', 'http://riddl.org/ns/common-patterns/notifications-producer/2.0'
|
321
|
+
|
322
|
+
id, uuid = NewInstance::create(opts,redis,doc.find('string(/*/p:attributes/p:info)'))
|
323
|
+
|
324
|
+
subscriptions = []
|
325
|
+
doc.find('/*/sub:subscriptions/sub:subscription').each do |s|
|
326
|
+
sub = []
|
327
|
+
unless sub[0] = s.attributes['id']
|
328
|
+
sub[0] = Digest::MD5.hexdigest(Kernel::rand().to_s)
|
329
|
+
end
|
330
|
+
|
331
|
+
unless sub[1] = s.attributes['url']
|
332
|
+
raise "no url"
|
333
|
+
end
|
334
|
+
|
335
|
+
sub[2] = []
|
336
|
+
s.find('sub:topic').each do |t|
|
337
|
+
%w(event vote).each do |type|
|
338
|
+
t.find('sub:' + type).each do |e|
|
339
|
+
sub[2] << File.join(t.attributes['id'],type,e.text)
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
CPEE::Persistence::set_handler(id,opts,*sub)
|
345
|
+
end
|
346
|
+
|
347
|
+
CPEE::Properties::Put::change_first(id,opts,doc)
|
348
|
+
CPEE::Properties::PutState::run(id,opts,'running') if doc.find('string(/*/p:state)') == 'running'
|
349
|
+
|
350
|
+
@headers << Riddl::Header.new("CPEE-INSTANCE", id.to_s)
|
351
|
+
@headers << Riddl::Header.new("CPEE-INSTANCE-URL", File.join(opts[:url].to_s,id.to_s,'/'))
|
352
|
+
@headers << Riddl::Header.new("CPEE-INSTANCE-UUID", uuid)
|
353
|
+
|
354
|
+
Riddl::Parameter::Simple.new("id", id.to_s)
|
355
|
+
end
|
356
|
+
end #}}}
|
357
|
+
|
301
358
|
class NewInstance < Riddl::Implementation #{{{
|
302
|
-
def path(e)
|
359
|
+
def self::path(e)
|
303
360
|
ret = []
|
304
361
|
until e.qname.name == 'properties'
|
305
362
|
ret << (e.class == XML::Smart::Dom::Attribute ? '@' : '') + e.qname.name
|
@@ -308,12 +365,9 @@ module CPEE
|
|
308
365
|
File.join(*ret.reverse)
|
309
366
|
end
|
310
367
|
|
311
|
-
def
|
312
|
-
opts = @a[0]
|
313
|
-
redis = opts[:redis]
|
368
|
+
def self::create(opts,redis,name)
|
314
369
|
doc = XML::Smart::open_unprotected(opts[:properties_init])
|
315
370
|
doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
|
316
|
-
name = @p[0].value
|
317
371
|
id = CPEE::Persistence::new_object(opts)
|
318
372
|
uuid = SecureRandom.uuid
|
319
373
|
instance = CPEE::Persistence::obj + ':' + id.to_s
|
@@ -322,17 +376,17 @@ module CPEE
|
|
322
376
|
doc.root.find(PROPERTIES_PATHS_FULL.join(' | ')).each do |e|
|
323
377
|
if e.class == XML::Smart::Dom::Element && e.element_only?
|
324
378
|
val = e.find('*').map { |f| f.dump }.join
|
325
|
-
multi.set(File.join(instance, path(e)), val)
|
379
|
+
multi.set(File.join(instance, NewInstance::path(e)), val)
|
326
380
|
else
|
327
|
-
multi.set(File.join(instance, path(e)), e.text)
|
381
|
+
multi.set(File.join(instance, NewInstance::path(e)), e.text)
|
328
382
|
end
|
329
383
|
end
|
330
384
|
doc.root.find(PROPERTIES_PATHS_INDEX_UNORDERED.join(' | ')).each do |e|
|
331
|
-
p = path(e)
|
385
|
+
p = NewInstance::path(e)
|
332
386
|
multi.sadd(File.join(instance, File.dirname(p)), File.basename(p))
|
333
387
|
end
|
334
388
|
doc.root.find(PROPERTIES_PATHS_INDEX_ORDERED.join(' | ')).each_with_index do |e,i|
|
335
|
-
p = path(e)
|
389
|
+
p = NewInstance::path(e)
|
336
390
|
multi.zadd(File.join(instance, File.dirname(p)), i, File.basename(p))
|
337
391
|
end
|
338
392
|
Dir[File.join(opts[:notifications_init],'*','subscription.xml')].each do |f|
|
@@ -355,13 +409,22 @@ module CPEE
|
|
355
409
|
multi.zadd(File.join(instance, 'attributes'), -1, 'info')
|
356
410
|
multi.set(File.join(instance, 'state', '@changed'), Time.now.xmlschema(3))
|
357
411
|
end
|
358
|
-
|
359
412
|
content = {
|
360
413
|
:state => 'ready',
|
361
414
|
:attributes => CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
362
415
|
}
|
363
416
|
CPEE::Message::send(:event,'state/change',File.join(opts[:url],'/'),id,uuid,name,content,redis)
|
364
417
|
|
418
|
+
return id, uuid
|
419
|
+
end
|
420
|
+
|
421
|
+
def response
|
422
|
+
opts = @a[0]
|
423
|
+
redis = opts[:redis]
|
424
|
+
name = @p[0].value
|
425
|
+
|
426
|
+
id, uuid = NewInstance::create(opts,redis,name)
|
427
|
+
|
365
428
|
@headers << Riddl::Header.new("CPEE-INSTANCE", id.to_s)
|
366
429
|
@headers << Riddl::Header.new("CPEE-INSTANCE-URL", File.join(opts[:url].to_s,id.to_s,'/'))
|
367
430
|
@headers << Riddl::Header.new("CPEE-INSTANCE-UUID", uuid)
|
@@ -176,6 +176,7 @@ module CPEE
|
|
176
176
|
CPEE::Properties::PatchPositions::set id, opts, node.first.dump
|
177
177
|
end
|
178
178
|
end
|
179
|
+
CPEE::Persistence::wait(opts)
|
179
180
|
|
180
181
|
if (node = doc.find('/p:properties/p:state')).any?
|
181
182
|
CPEE::Properties::PutState::run id, opts, node.first.text
|
@@ -184,6 +185,41 @@ module CPEE
|
|
184
185
|
end
|
185
186
|
end #}}}
|
186
187
|
class Put < Riddl::Implementation #{{{
|
188
|
+
def self::change_first(id,opts,doc)
|
189
|
+
if (node = doc.find('/*/p:status')).any?
|
190
|
+
CPEE::Properties::PutStatus::set id, opts, node.first.dump
|
191
|
+
end
|
192
|
+
if (node = doc.find('/*/p:executionhandler')).any?
|
193
|
+
CPEE::Properties::PutExecutionHandler::set id, opts, node.first.text, false
|
194
|
+
end
|
195
|
+
|
196
|
+
%w{dataelements endpoints attributes}.each do |item|
|
197
|
+
if (node = doc.find('/*/p:' + item)).any?
|
198
|
+
CPEE::Properties::PutItems::set item, id, opts, node.first.dump
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
if (node = doc.find('/*/p:transformation')).any?
|
203
|
+
CPEE::Properties::PutTransformation::set id, opts, node.first.dump
|
204
|
+
end
|
205
|
+
if (node = doc.find('/*/p:description/*')).any?
|
206
|
+
CPEE::Properties::PutDescription::set id, opts, node.first.dump
|
207
|
+
end
|
208
|
+
|
209
|
+
if (node = doc.find('/*/p:positions')).any?
|
210
|
+
if node.first.find('p:*').any?
|
211
|
+
CPEE::Properties::PutPositions::set id, opts, node.first.dump
|
212
|
+
end
|
213
|
+
end
|
214
|
+
CPEE::Persistence::wait(opts)
|
215
|
+
end
|
216
|
+
|
217
|
+
def self::change_last(id,opts,doc)
|
218
|
+
if (node = doc.find('/*/p:state')).any?
|
219
|
+
CPEE::Properties::PutState::run id, opts, node.first.text
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
187
223
|
def response
|
188
224
|
id = @a[0]
|
189
225
|
opts = @a[1]
|
@@ -192,35 +228,8 @@ module CPEE
|
|
192
228
|
else
|
193
229
|
doc = XML::Smart::string(@p[0].value.read)
|
194
230
|
doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
|
195
|
-
|
196
|
-
|
197
|
-
end
|
198
|
-
if (node = doc.find('/p:properties/p:executionhandler')).any?
|
199
|
-
CPEE::Properties::PutExecutionHandler::set id, opts, node.first.text
|
200
|
-
end
|
201
|
-
|
202
|
-
%w{dataelements endpoints attributes}.each do |item|
|
203
|
-
if (node = doc.find('/p:properties/p:' + item)).any?
|
204
|
-
CPEE::Properties::PutItems::set item, id, opts, node.first.dump
|
205
|
-
end
|
206
|
-
end
|
207
|
-
|
208
|
-
if (node = doc.find('/p:properties/p:transformation')).any?
|
209
|
-
CPEE::Properties::PutTransformation::set id, opts, node.first.dump
|
210
|
-
end
|
211
|
-
if (node = doc.find('/p:properties/p:description/*')).any?
|
212
|
-
CPEE::Properties::PutDescription::set id, opts, node.first.dump
|
213
|
-
end
|
214
|
-
|
215
|
-
if (node = doc.find('/p:properties/p:positions')).any?
|
216
|
-
if node.first.find('p:*').any?
|
217
|
-
CPEE::Properties::PutPositions::set id, opts, node.first.dump
|
218
|
-
end
|
219
|
-
end
|
220
|
-
|
221
|
-
if (node = doc.find('/p:properties/p:state')).any?
|
222
|
-
CPEE::Properties::PutState::run id, opts, node.first.text
|
223
|
-
end
|
231
|
+
CPEE::Properties::Put::change_first(id,opts,doc)
|
232
|
+
CPEE::Properties::Put::change_last(id,opts,doc)
|
224
233
|
end
|
225
234
|
end
|
226
235
|
end #}}}
|
@@ -330,18 +339,21 @@ module CPEE
|
|
330
339
|
end
|
331
340
|
end #}}}
|
332
341
|
class PutExecutionHandler < Riddl::Implementation #{{{
|
333
|
-
def self::set(id,opts,hw)
|
342
|
+
def self::set(id,opts,hw,transform=true)
|
334
343
|
CPEE::Persistence::set_item(id,opts,'executionhandler',:executionhandler => hw)
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
344
|
+
if transform
|
345
|
+
desc = CPEE::Persistence::extract_item(id,opts,'description')
|
346
|
+
dslx = CPEE::Persistence::extract_item(id,opts,'dslx')
|
347
|
+
endpoints = CPEE::Persistence::extract_list(id,opts,'endpoints')
|
348
|
+
xml = XML::Smart::string(dslx)
|
349
|
+
xml.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
|
350
|
+
dsl = Object.const_get('CPEE::ExecutionHandler::' + hw.capitalize)::dslx_to_dsl(xml,endpoints)
|
351
|
+
CPEE::Persistence::set_item(id,opts,'description',
|
352
|
+
:description => xml,
|
353
|
+
:dslx => dslx,
|
354
|
+
:dsl => dsl
|
355
|
+
)
|
356
|
+
end
|
345
357
|
end
|
346
358
|
def response
|
347
359
|
id = @a[0]
|
@@ -663,7 +675,7 @@ module CPEE
|
|
663
675
|
end #}}}
|
664
676
|
|
665
677
|
class PutDescription < Riddl::Implementation #{{{
|
666
|
-
def self::transform(descxml,tdesc,tdesctype,tdata,tdatatype,tendp,tendptype,hw,opts) #{{{
|
678
|
+
def self::transform(descxml,tdesc,tdesctype,tdata,tdatatype,tendp,tendptype,hw,id,opts) #{{{
|
667
679
|
desc = XML::Smart::string(descxml) rescue nil
|
668
680
|
if desc.nil?
|
669
681
|
if descxml.empty?
|
@@ -681,6 +693,32 @@ module CPEE
|
|
681
693
|
de = {}
|
682
694
|
ep = {}
|
683
695
|
|
696
|
+
### endpoints extraction
|
697
|
+
addit = if tendptype == 'rest' && !tdata.empty?
|
698
|
+
srv = Riddl::Client.interface(tendp,opts[:transformation_service])
|
699
|
+
status, res = srv.post [
|
700
|
+
Riddl::Parameter::Complex.new("description","text/xml",descxml),
|
701
|
+
Riddl::Parameter::Simple.new("type","endpoints")
|
702
|
+
]
|
703
|
+
if status >= 200 && status < 300
|
704
|
+
res
|
705
|
+
else
|
706
|
+
raise 'Could not extract endpoints'
|
707
|
+
end
|
708
|
+
elsif tendptype == 'xslt' && !tdata.empty?
|
709
|
+
trans = XML::Smart::open_unprotected(tendp.text)
|
710
|
+
desc.transform_with(trans)
|
711
|
+
elsif tendptype == 'clean'
|
712
|
+
[]
|
713
|
+
else
|
714
|
+
nil
|
715
|
+
end
|
716
|
+
unless addit.nil?
|
717
|
+
addit.each_slice(2).each do |k,v|
|
718
|
+
ep[k.value.to_sym] = v.value
|
719
|
+
end
|
720
|
+
end
|
721
|
+
|
684
722
|
### description transformation, including dslx to dsl
|
685
723
|
addit = if tdesctype == 'copy' || tdesc.empty?
|
686
724
|
desc || ''
|
@@ -705,7 +743,7 @@ module CPEE
|
|
705
743
|
end
|
706
744
|
unless addit.nil?
|
707
745
|
dslx = addit.to_s
|
708
|
-
dsl = Object.const_get('CPEE::ExecutionHandler::' + hw.capitalize)::dslx_to_dsl(addit)
|
746
|
+
dsl = Object.const_get('CPEE::ExecutionHandler::' + hw.capitalize)::dslx_to_dsl(addit,CPEE::Persistence::extract_list(id,opts,'endpoints').to_h.merge(ep))
|
709
747
|
end
|
710
748
|
|
711
749
|
### dataelements extraction
|
@@ -734,32 +772,6 @@ module CPEE
|
|
734
772
|
end
|
735
773
|
end
|
736
774
|
|
737
|
-
### endpoints extraction
|
738
|
-
addit = if tendptype == 'rest' && !tdata.empty?
|
739
|
-
srv = Riddl::Client.interface(tendp,opts[:transformation_service])
|
740
|
-
status, res = srv.post [
|
741
|
-
Riddl::Parameter::Complex.new("description","text/xml",descxml),
|
742
|
-
Riddl::Parameter::Simple.new("type","endpoints")
|
743
|
-
]
|
744
|
-
if status >= 200 && status < 300
|
745
|
-
res
|
746
|
-
else
|
747
|
-
raise 'Could not extract endpoints'
|
748
|
-
end
|
749
|
-
elsif tendptype == 'xslt' && !tdata.empty?
|
750
|
-
trans = XML::Smart::open_unprotected(tendp.text)
|
751
|
-
desc.transform_with(trans)
|
752
|
-
elsif tendptype == 'clean'
|
753
|
-
[]
|
754
|
-
else
|
755
|
-
nil
|
756
|
-
end
|
757
|
-
unless addit.nil?
|
758
|
-
addit.each_slice(2).each do |k,v|
|
759
|
-
ep[k.value.to_sym] = v.value
|
760
|
-
end
|
761
|
-
end
|
762
|
-
|
763
775
|
[dslx, dsl, de, ep]
|
764
776
|
end #}}}
|
765
777
|
|
@@ -773,6 +785,7 @@ module CPEE
|
|
773
785
|
CPEE::Persistence::extract_item(id,opts,'transformation/endpoints'),
|
774
786
|
CPEE::Persistence::extract_item(id,opts,'transformation/endpoints/@type'),
|
775
787
|
CPEE::Persistence::extract_item(id,opts,'executionhandler'),
|
788
|
+
id,
|
776
789
|
opts
|
777
790
|
)
|
778
791
|
CPEE::Persistence::set_item(id,opts,'description',
|
data/lib/cpee/message.rb
CHANGED
@@ -39,6 +39,23 @@ module CPEE
|
|
39
39
|
@@last < @@tworkers-1 ? @@last += 1 : @@last = 0
|
40
40
|
end
|
41
41
|
|
42
|
+
def self::wait(backend,sub,tt=nil)
|
43
|
+
target = '%02i' % (tt || CPEE::Message::target)
|
44
|
+
wid = Digest::MD5.hexdigest(Kernel::rand().to_s)
|
45
|
+
begin
|
46
|
+
sub.subscribe_with_timeout(2,'event:' + target + ':transaction/finished') do |on|
|
47
|
+
on.message do |what,message|
|
48
|
+
mess = message[0...message.index(' ')]
|
49
|
+
sub.unsubscribe('event:' + target + ':transaction/finished') if mess == wid
|
50
|
+
end
|
51
|
+
backend.publish('event:' + target + ':transaction/start',wid + ' {}')
|
52
|
+
end
|
53
|
+
rescue => e
|
54
|
+
puts "timeout error"
|
55
|
+
end
|
56
|
+
sub.disconnect!
|
57
|
+
end
|
58
|
+
|
42
59
|
def self::send(type, event, cpee, instance, instance_uuid, instance_name, content={}, backend=nil, tt=nil)
|
43
60
|
target = '%02i' % (tt || CPEE::Message::target)
|
44
61
|
topic = ::File::dirname(event)
|
data/lib/cpee/persistence.rb
CHANGED
@@ -23,6 +23,10 @@ module CPEE
|
|
23
23
|
@@obj = it
|
24
24
|
end #}}}
|
25
25
|
|
26
|
+
def self::wait(opts)
|
27
|
+
CPEE::Message::wait(opts[:redis],opts[:redis_dyn].call('Temporary Storage Transaction Subscriber'))
|
28
|
+
end
|
29
|
+
|
26
30
|
def self::set_list(id,opts,item,values,deleted=[]) #{{{
|
27
31
|
ah = AttributesHelper.new
|
28
32
|
attributes = Persistence::extract_list(id,opts,'attributes').to_h
|
data/lib/engine.xml
CHANGED
@@ -16,6 +16,10 @@
|
|
16
16
|
|
17
17
|
<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">
|
18
18
|
|
19
|
+
<message name="instance-new">
|
20
|
+
<parameter name="info" type="string"/>
|
21
|
+
</message>
|
22
|
+
|
19
23
|
<message name="list-of-workflow-instances">
|
20
24
|
<parameter name="wis" mimetype="text/xml" handler="http://riddl.org/ns/handlers/relaxng">
|
21
25
|
<doc:documentation>d</doc:documentation>
|
@@ -27,8 +31,10 @@
|
|
27
31
|
<parameter name="id" type="nonNegativeInteger"/>
|
28
32
|
</message>
|
29
33
|
|
30
|
-
<message name="instance-new">
|
31
|
-
<parameter name="
|
34
|
+
<message name="instance-full-new">
|
35
|
+
<parameter name="testset" mimetype="*/xml" handler="http://riddl.org/ns/handlers/relaxng">
|
36
|
+
<xi:include href="properties/set-testset.rng"/>
|
37
|
+
</parameter>
|
32
38
|
</message>
|
33
39
|
|
34
40
|
<message name="instance-info">
|
@@ -48,6 +54,7 @@
|
|
48
54
|
<doc:documentation>a</doc:documentation>
|
49
55
|
</get>
|
50
56
|
<post in="instance-new" out="instance-id"/>
|
57
|
+
<post in="instance-full-new" out="instance-id"/>
|
51
58
|
<resource relative="executionhandlers">
|
52
59
|
<get out="executionhandlerlist"/>
|
53
60
|
</resource>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
2
|
+
<include href="state.rng"/>
|
3
|
+
<include href="status.rng"/>
|
4
|
+
<include href="executionhandler.rng"/>
|
5
|
+
<include href="positions.rng"/>
|
6
|
+
<include href="dataelements.rng"/>
|
7
|
+
<include href="endpoints.rng"/>
|
8
|
+
<include href="attributes.rng"/>
|
9
|
+
<include href="description.rng"/>
|
10
|
+
<include href="transformation.rng"/>
|
11
|
+
<include href="subscriptions.rng"/>
|
12
|
+
|
13
|
+
<start>
|
14
|
+
<element name="testset" ns="http://cpee.org/ns/properties/2.0">
|
15
|
+
<interleave>
|
16
|
+
<optional>
|
17
|
+
<ref name="subscriptions"/>
|
18
|
+
</optional>
|
19
|
+
<optional>
|
20
|
+
<ref name="set-state"/>
|
21
|
+
</optional>
|
22
|
+
<optional>
|
23
|
+
<ref name="status"/>
|
24
|
+
</optional>
|
25
|
+
<optional>
|
26
|
+
<ref name="executionhandler"/>
|
27
|
+
</optional>
|
28
|
+
<optional>
|
29
|
+
<ref name="positions"/>
|
30
|
+
</optional>
|
31
|
+
<optional>
|
32
|
+
<ref name="dataelements"/>
|
33
|
+
</optional>
|
34
|
+
<optional>
|
35
|
+
<ref name="endpoints"/>
|
36
|
+
</optional>
|
37
|
+
<optional>
|
38
|
+
<ref name="attributes"/>
|
39
|
+
</optional>
|
40
|
+
<optional>
|
41
|
+
<ref name="description"/>
|
42
|
+
</optional>
|
43
|
+
<optional>
|
44
|
+
<ref name="transformation"/>
|
45
|
+
</optional>
|
46
|
+
</interleave>
|
47
|
+
</element>
|
48
|
+
</start>
|
49
|
+
</grammar>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
2
|
+
<define name="subscriptions">
|
3
|
+
<element name="subscriptions" ns="http://riddl.org/ns/common-patterns/notifications-producer/2.0">
|
4
|
+
<zeroOrMore>
|
5
|
+
<ref name="subscription"/>
|
6
|
+
</zeroOrMore>
|
7
|
+
</element>
|
8
|
+
</define>
|
9
|
+
|
10
|
+
<define name="subscription">
|
11
|
+
<element name="subscription" ns="http://riddl.org/ns/common-patterns/notifications-producer/2.0">
|
12
|
+
<attribute name="id">
|
13
|
+
<data type="string">
|
14
|
+
<param name="pattern">[a-zA-Z0-9_]+</param>
|
15
|
+
</data>
|
16
|
+
</attribute>
|
17
|
+
<optional>
|
18
|
+
<attribute name="url">
|
19
|
+
<data type="string"/>
|
20
|
+
</attribute>
|
21
|
+
</optional>
|
22
|
+
<oneOrMore>
|
23
|
+
<element name="topic">
|
24
|
+
<attribute name="id">
|
25
|
+
<data type="string"/>
|
26
|
+
</attribute>
|
27
|
+
<oneOrMore>
|
28
|
+
<element>
|
29
|
+
<choice>
|
30
|
+
<name>event</name>
|
31
|
+
<name>vote</name>
|
32
|
+
</choice>
|
33
|
+
<data type="string">
|
34
|
+
<param name="pattern">[\w_]+</param>
|
35
|
+
</data>
|
36
|
+
</element>
|
37
|
+
</oneOrMore>
|
38
|
+
</element>
|
39
|
+
</oneOrMore>
|
40
|
+
</element>
|
41
|
+
</define>
|
42
|
+
|
43
|
+
</grammar>
|
@@ -23,7 +23,7 @@ module CPEE
|
|
23
23
|
BACKEND_RUN = File.expand_path(File.join(__dir__,'backend','run'))
|
24
24
|
BACKEND_TEMPLATE = File.expand_path(File.join(__dir__,'backend','instance.template'))
|
25
25
|
|
26
|
-
def self::dslx_to_dsl(dslx) # transpile
|
26
|
+
def self::dslx_to_dsl(dslx,ep) # transpile
|
27
27
|
trans = XML::Smart::open_unprotected(ExecutionHandler::Eval::DSL_TO_DSLX_XSL)
|
28
28
|
dslx.transform_with(trans).to_s
|
29
29
|
end
|
@@ -158,20 +158,25 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
158
158
|
a[k_ht] = headers[hname] if headers[hname]
|
159
159
|
end
|
160
160
|
end
|
161
|
-
params.
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
161
|
+
p = params.find{|p| p.name == k }
|
162
|
+
if p.nil?
|
163
|
+
p = Riddl::Parameter::Simple.new(k,'{}')
|
164
|
+
params << p
|
165
|
+
end
|
166
|
+
|
167
|
+
if a.is_a? String
|
168
|
+
p.value = a
|
169
|
+
elsif a.is_a? Hash
|
170
|
+
ohash = JSON::parse(p.value) rescue {}
|
171
|
+
ohash.merge!(a)
|
172
|
+
p.value = JSON.generate(ohash)
|
171
173
|
end
|
172
174
|
end
|
173
175
|
end
|
174
176
|
end
|
177
|
+
|
178
|
+
order = { 'behavior' => 1, 'url' => 2, 'init' => 3, 'endpoints' => 4, 'attributes' => 5, 'customization' => 6 }
|
179
|
+
params.sort!{|a,b| order[a.name].to_i <=> order[b.name].to_i }
|
175
180
|
end
|
176
181
|
else
|
177
182
|
@handler_endpoint = @handler_endpoint_orig
|
@@ -810,7 +810,7 @@
|
|
810
810
|
</xsl:when>
|
811
811
|
<xsl:otherwise>
|
812
812
|
<xsl:text>"</xsl:text>
|
813
|
-
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','
|
813
|
+
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','\"')"/>
|
814
814
|
<xsl:text>"</xsl:text>
|
815
815
|
</xsl:otherwise>
|
816
816
|
</xsl:choose>
|
@@ -830,11 +830,11 @@
|
|
830
830
|
<xsl:choose>
|
831
831
|
<xsl:when test="substring(.,1,1) = '!'">
|
832
832
|
<xsl:text>>🠊("</xsl:text>
|
833
|
-
<xsl:value-of select="str:replace(str:replace(substring(.,2),'\','\\'),'"','
|
833
|
+
<xsl:value-of select="str:replace(str:replace(substring(.,2),'\','\\'),'"','\"')"/>
|
834
834
|
<xsl:text>")</xsl:text>
|
835
835
|
</xsl:when>
|
836
836
|
<xsl:otherwise>
|
837
|
-
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','
|
837
|
+
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','\"')"/>
|
838
838
|
</xsl:otherwise>
|
839
839
|
</xsl:choose>
|
840
840
|
<xsl:text>"</xsl:text>
|
@@ -864,11 +864,11 @@
|
|
864
864
|
<xsl:choose>
|
865
865
|
<xsl:when test="substring(.,1,1) = '!'">
|
866
866
|
<xsl:text>>🠊("</xsl:text>
|
867
|
-
<xsl:value-of select="str:replace(str:replace(substring(.,2),'\','\\'),'"','
|
867
|
+
<xsl:value-of select="str:replace(str:replace(substring(.,2),'\','\\'),'"','\"')"/>
|
868
868
|
<xsl:text>")</xsl:text>
|
869
869
|
</xsl:when>
|
870
870
|
<xsl:otherwise>
|
871
|
-
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','
|
871
|
+
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','\"')"/>
|
872
872
|
</xsl:otherwise>
|
873
873
|
</xsl:choose>
|
874
874
|
<xsl:text>"</xsl:text>
|
@@ -892,11 +892,11 @@
|
|
892
892
|
<xsl:choose>
|
893
893
|
<xsl:when test="substring(.,1,1) = '!'">
|
894
894
|
<xsl:text>>🠊("</xsl:text>
|
895
|
-
<xsl:value-of select="str:replace(str:replace(substring(.,2),'\','\\'),'"','
|
895
|
+
<xsl:value-of select="str:replace(str:replace(substring(.,2),'\','\\'),'"','\"')"/>
|
896
896
|
<xsl:text>")</xsl:text>
|
897
897
|
</xsl:when>
|
898
898
|
<xsl:otherwise>
|
899
|
-
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','
|
899
|
+
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','\"')"/>
|
900
900
|
</xsl:otherwise>
|
901
901
|
</xsl:choose>
|
902
902
|
<xsl:text>"</xsl:text>
|
@@ -19,11 +19,11 @@ module CPEE
|
|
19
19
|
module Ruby
|
20
20
|
BACKEND_INSTANCE = 'instance.rb'
|
21
21
|
DSL_TO_DSLX_XSL = File.expand_path(File.join(__dir__,'dsl_to_dslx.xsl'))
|
22
|
-
BACKEND_RUN = File.expand_path(File.join(__dir__,'backend','run'))
|
22
|
+
BACKEND_RUN = File.expand_path(File.join(__dir__,'backend','run.rb'))
|
23
23
|
BACKEND_OPTS = File.expand_path(File.join(__dir__,'backend','opts.yaml'))
|
24
24
|
BACKEND_TEMPLATE = File.expand_path(File.join(__dir__,'backend','instance.template'))
|
25
25
|
|
26
|
-
def self::dslx_to_dsl(dslx) # transpile
|
26
|
+
def self::dslx_to_dsl(dslx,ep) # transpile
|
27
27
|
trans = XML::Smart::open_unprotected(ExecutionHandler::Ruby::DSL_TO_DSLX_XSL)
|
28
28
|
dslx.transform_with(trans).to_s
|
29
29
|
end
|
@@ -55,12 +55,13 @@ module CPEE
|
|
55
55
|
end
|
56
56
|
template = ERB.new(File.read(ExecutionHandler::Ruby::BACKEND_TEMPLATE), trim_mode: '-')
|
57
57
|
res = template.result_with_hash(dsl: dsl, dataelements: dataelements, endpoints: endpoints, positions: positions)
|
58
|
+
pp dataelements
|
58
59
|
File.write(File.join(opts[:instances],id.to_s,ExecutionHandler::Ruby::BACKEND_INSTANCE),res)
|
59
60
|
end
|
60
61
|
|
61
62
|
def self::run(id,opts)
|
62
63
|
exe = File.join(opts[:instances],id.to_s,File.basename(ExecutionHandler::Ruby::BACKEND_RUN))
|
63
|
-
pid = Kernel.spawn(exe , :pgroup => true, :in => '/dev/null', :out => exe + '.out', :err => exe + '.err')
|
64
|
+
pid = Kernel.spawn(opts[:libs_preloaderrun] + ' ' + exe , :pgroup => true, :in => '/dev/null', :out => exe + '.out', :err => exe + '.err')
|
64
65
|
Process.detach pid
|
65
66
|
File.write(exe + '.pid',pid)
|
66
67
|
end
|
data/server/routing/end.pid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
55683
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
55702
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
55696
|
data/server/routing/persist.pid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
55689
|
data/server/routing/persist.rb
CHANGED
@@ -36,6 +36,7 @@ Daemonite.new do |opts|
|
|
36
36
|
opts[:events] = []
|
37
37
|
0.upto(opts[:workers]-1) do |w|
|
38
38
|
opts[:events] += [
|
39
|
+
'event:' + ('%02i' % w) + ':transaction/start',
|
39
40
|
'event:' + ('%02i' % w) + ':state/change',
|
40
41
|
'event:' + ('%02i' % w) + ':executionhandler/change',
|
41
42
|
'event:' + ('%02i' % w) + ':description/change',
|
@@ -107,6 +108,8 @@ Daemonite.new do |opts|
|
|
107
108
|
end
|
108
109
|
end
|
109
110
|
end
|
111
|
+
when /event:(\d+):transaction\/start/
|
112
|
+
opts[:redis].publish('event:' + $1 + ':transaction/finished',message)
|
110
113
|
when /event:\d+:transformation\/change/
|
111
114
|
opts[:redis].multi do |multi|
|
112
115
|
multi.set("instance:#{instance}/transformation/description",mess.dig('content','description'))
|
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.78
|
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: 2025-
|
13
|
+
date: 2025-02-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: riddl
|
@@ -178,6 +178,26 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: 1.0.4
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: by
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '1.1'
|
188
|
+
- - ">="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: 1.1.0
|
191
|
+
type: :runtime
|
192
|
+
prerelease: false
|
193
|
+
version_requirements: !ruby/object:Gem::Requirement
|
194
|
+
requirements:
|
195
|
+
- - "~>"
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '1.1'
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: 1.1.0
|
181
201
|
description: see http://cpee.org
|
182
202
|
email: juergen.mangler@gmail.com
|
183
203
|
executables:
|
@@ -880,9 +900,11 @@ files:
|
|
880
900
|
- lib/properties/properties.rng
|
881
901
|
- lib/properties/set-properties.rng
|
882
902
|
- lib/properties/set-some-properties.rng
|
903
|
+
- lib/properties/set-testset.rng
|
883
904
|
- lib/properties/simple.rng
|
884
905
|
- lib/properties/state.rng
|
885
906
|
- lib/properties/status.rng
|
907
|
+
- lib/properties/subscriptions.rng
|
886
908
|
- lib/properties/t_attributes.rng
|
887
909
|
- lib/properties/t_dataelements.rng
|
888
910
|
- lib/properties/t_endpoints.rng
|
@@ -904,7 +926,7 @@ files:
|
|
904
926
|
- server/executionhandlers/ruby/backend/README.md
|
905
927
|
- server/executionhandlers/ruby/backend/instance.template
|
906
928
|
- server/executionhandlers/ruby/backend/opts.yaml
|
907
|
-
- server/executionhandlers/ruby/backend/run
|
929
|
+
- server/executionhandlers/ruby/backend/run.rb
|
908
930
|
- server/executionhandlers/ruby/connection.rb
|
909
931
|
- server/executionhandlers/ruby/controller.rb
|
910
932
|
- server/executionhandlers/ruby/dsl_to_dslx.xsl
|