cpee 1.3.226 → 1.3.227
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cockpit/js/instance.js +95 -79
- data/cpee.gemspec +1 -1
- data/lib/cpee/instantiation.rb +111 -0
- data/lib/instantiation.xml +25 -0
- data/server/handlerwrappers/default.rb +2 -2
- data/server/resources/transformation_dslx.xsl +19 -22
- data/tools/cpee +8 -0
- data/tools/instantiation/instantiation +23 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d8244701c2e34c3f78fb8cd2f3785aae9332957
|
4
|
+
data.tar.gz: 49f6fc29090d1e7fef195c181ace1f847266d296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df3e3abdf989bf14b822c2506207deda6f9f48768177f37038208ab2fea5c69240e79e259537430b3bb0c0e46f7aea7ec6c2251246efbf35e9ab55338d355b3a
|
7
|
+
data.tar.gz: 5e32adeeab2269493fce295f4c38c9b017551a4f756f5b2b7289276c5ceecd885ae4e77257269c362916c8f5f5af3f2c9a02b348546e9f1ecc8b80ff8fdfd2df
|
data/cockpit/js/instance.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
var ws;
|
2
|
+
var suspended_monitoring = false;
|
2
3
|
var myid = ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16));
|
3
|
-
var
|
4
|
+
var loading = false;
|
4
5
|
var subscription;
|
5
6
|
var subscription_state = 'less';
|
6
7
|
var save = {};
|
@@ -58,7 +59,7 @@ var sub_less = 'topic' + '=' + 'activity' + '&' +// {{{
|
|
58
59
|
'topic' + '=' + 'handlers' + '&' +
|
59
60
|
'events' + '=' + 'change';// }}}
|
60
61
|
|
61
|
-
function cockpit() {
|
62
|
+
function cockpit() { //{{{
|
62
63
|
$("button[name=base]").click(function(){ create_instance(null,false); });
|
63
64
|
$("button[name=instance]").click(function(){ ui_activate_tab("#tabinstance"); monitor_instance(false,false); });
|
64
65
|
$("button[name=loadtestset]").click(function(e){new CustomMenu(e).menu($('#predefinedtestsets'),function(){ load_testset(false) } ); });
|
@@ -123,9 +124,9 @@ function cockpit() {
|
|
123
124
|
});
|
124
125
|
}
|
125
126
|
});
|
126
|
-
}
|
127
|
+
} //}}}
|
127
128
|
|
128
|
-
function sanitize_url() {
|
129
|
+
function sanitize_url() { //{{{
|
129
130
|
var url = $("input[name=instance-url]").val();
|
130
131
|
var lastChar = url.substr(url.length - 1)
|
131
132
|
if (lastChar != '/') {
|
@@ -133,7 +134,7 @@ function sanitize_url() {
|
|
133
134
|
}
|
134
135
|
return $("input[name=instance-url]").val();
|
135
136
|
}
|
136
|
-
|
137
|
+
//}}}
|
137
138
|
function check_subscription() { // {{{
|
138
139
|
var url = $("#current-instance").text();
|
139
140
|
var num = 0;
|
@@ -189,6 +190,69 @@ function create_instance(ask,exec) {// {{{
|
|
189
190
|
}
|
190
191
|
}// }}}
|
191
192
|
|
193
|
+
function websocket() {
|
194
|
+
var url = $("#current-instance").text();
|
195
|
+
var Socket = "MozWebSocket" in window ? MozWebSocket : WebSocket;
|
196
|
+
if (ws) ws.close();
|
197
|
+
ws = new Socket(url.replace(/http/,'ws') + "/notifications/subscriptions/" + subscription + "/ws/");
|
198
|
+
ws.onopen = function() {
|
199
|
+
append_to_log("monitoring", "opened", "");
|
200
|
+
};
|
201
|
+
ws.onmessage = function(e) {
|
202
|
+
data = $.parseXML(e.data);
|
203
|
+
if ($('event > topic',data).length > 0) {
|
204
|
+
switch($('event > topic',data).text()) {
|
205
|
+
case 'dataelements':
|
206
|
+
monitor_instance_values("dataelements");
|
207
|
+
break;
|
208
|
+
case 'description':
|
209
|
+
monitor_instance_dsl();
|
210
|
+
break;
|
211
|
+
case 'endpoints':
|
212
|
+
monitor_instance_values("endpoints");
|
213
|
+
break;
|
214
|
+
case 'attributes':
|
215
|
+
monitor_instance_values("attributes");
|
216
|
+
monitor_instance_transformation();
|
217
|
+
if (suspended_monitoring) {
|
218
|
+
suspended_monitoring = false;
|
219
|
+
} else {
|
220
|
+
monitor_graph_change(true);
|
221
|
+
}
|
222
|
+
break;
|
223
|
+
case 'state':
|
224
|
+
monitor_instance_state_change(JSON.parse($('event > notification',data).text()).state);
|
225
|
+
break;
|
226
|
+
case 'position':
|
227
|
+
monitor_instance_pos_change($('event > notification',data).text());
|
228
|
+
break;
|
229
|
+
case 'transformation':
|
230
|
+
monitor_instance_transformation();
|
231
|
+
break;
|
232
|
+
case 'activity':
|
233
|
+
monitor_instance_running($('event > notification',data).text(),$('event > event',data).text());
|
234
|
+
break;
|
235
|
+
}
|
236
|
+
append_to_log("event", $('event > topic',data).text() + "/" + $('event > event',data).text(), $('event > notification',data).text());
|
237
|
+
}
|
238
|
+
if ($('vote > topic',data).length > 0) {
|
239
|
+
var notification = $('vote > notification',data).text();
|
240
|
+
append_to_log("vote", $('vote > topic',data).text() + "/" + $('vote > vote',data).text(), notification);
|
241
|
+
monitor_instance_vote_add(notification);
|
242
|
+
}
|
243
|
+
};
|
244
|
+
ws.onclose = function() {
|
245
|
+
append_to_log("monitoring", "closed", "server down i assume.");
|
246
|
+
};
|
247
|
+
|
248
|
+
monitor_instance_values("dataelements");
|
249
|
+
monitor_instance_values("endpoints");
|
250
|
+
monitor_instance_values("attributes");
|
251
|
+
monitor_instance_transformation();
|
252
|
+
monitor_instance_dsl();
|
253
|
+
monitor_instance_state();
|
254
|
+
}
|
255
|
+
|
192
256
|
function monitor_instance(load,exec) {// {{{
|
193
257
|
var url = sanitize_url();
|
194
258
|
|
@@ -231,64 +295,11 @@ function monitor_instance(load,exec) {// {{{
|
|
231
295
|
}
|
232
296
|
});
|
233
297
|
append_to_log("monitoring", "id", subscription);
|
234
|
-
|
235
|
-
if (
|
236
|
-
|
237
|
-
ws.onopen = function() {
|
238
|
-
append_to_log("monitoring", "opened", "");
|
239
|
-
};
|
240
|
-
ws.onmessage = function(e) {
|
241
|
-
data = $.parseXML(e.data);
|
242
|
-
if ($('event > topic',data).length > 0) {
|
243
|
-
switch($('event > topic',data).text()) {
|
244
|
-
case 'dataelements':
|
245
|
-
monitor_instance_values("dataelements");
|
246
|
-
break;
|
247
|
-
case 'description':
|
248
|
-
monitor_instance_dsl();
|
249
|
-
break;
|
250
|
-
case 'endpoints':
|
251
|
-
monitor_instance_values("endpoints");
|
252
|
-
break;
|
253
|
-
case 'attributes':
|
254
|
-
monitor_instance_values("attributes");
|
255
|
-
monitor_instance_transformation();
|
256
|
-
monitor_graph_change(true);
|
257
|
-
break;
|
258
|
-
case 'state':
|
259
|
-
monitor_instance_state_change(JSON.parse($('event > notification',data).text()).state);
|
260
|
-
break;
|
261
|
-
case 'position':
|
262
|
-
monitor_instance_pos_change($('event > notification',data).text());
|
263
|
-
break;
|
264
|
-
case 'transformation':
|
265
|
-
monitor_instance_transformation();
|
266
|
-
break;
|
267
|
-
case 'activity':
|
268
|
-
monitor_instance_running($('event > notification',data).text(),$('event > event',data).text());
|
269
|
-
break;
|
270
|
-
}
|
271
|
-
append_to_log("event", $('event > topic',data).text() + "/" + $('event > event',data).text(), $('event > notification',data).text());
|
272
|
-
}
|
273
|
-
if ($('vote > topic',data).length > 0) {
|
274
|
-
var notification = $('vote > notification',data).text();
|
275
|
-
append_to_log("vote", $('vote > topic',data).text() + "/" + $('vote > vote',data).text(), notification);
|
276
|
-
monitor_instance_vote_add(notification);
|
277
|
-
}
|
278
|
-
};
|
279
|
-
ws.onclose = function() {
|
280
|
-
append_to_log("monitoring", "closed", "server down i assume.");
|
281
|
-
};
|
282
|
-
if (load || exec) load_testset(exec);
|
298
|
+
websocket();
|
299
|
+
if (load || exec)
|
300
|
+
load_testset(exec);
|
283
301
|
}
|
284
302
|
});
|
285
|
-
|
286
|
-
monitor_instance_values("dataelements");
|
287
|
-
monitor_instance_values("endpoints");
|
288
|
-
monitor_instance_values("attributes");
|
289
|
-
monitor_instance_transformation();
|
290
|
-
monitor_instance_dsl();
|
291
|
-
monitor_instance_state();
|
292
303
|
},
|
293
304
|
error: function(a,b,c) {
|
294
305
|
alert("This ain't no CPEE instance");
|
@@ -629,6 +640,7 @@ function save_svg() {// {{{
|
|
629
640
|
}// }}}
|
630
641
|
function set_testset(testset,exec) {// {{{
|
631
642
|
var url = $("#current-instance").text();
|
643
|
+
suspended_monitoring = true;
|
632
644
|
|
633
645
|
$.ajax({
|
634
646
|
type: "GET",
|
@@ -689,8 +701,8 @@ function set_testset(testset,exec) {// {{{
|
|
689
701
|
}// }}}
|
690
702
|
|
691
703
|
function load_testsetfile_after() { //{{{
|
692
|
-
if (
|
693
|
-
|
704
|
+
if (loading) return;
|
705
|
+
loading = true;
|
694
706
|
if (typeof window.FileReader !== 'function') {
|
695
707
|
alert('FileReader not yet supportet');
|
696
708
|
return;
|
@@ -700,20 +712,20 @@ function load_testsetfile_after() { //{{{
|
|
700
712
|
reader.onload = function(){
|
701
713
|
set_testset($.parseXML(reader.result),false);
|
702
714
|
document.getElementById('fuckchrome').reset();
|
703
|
-
|
715
|
+
loading = false;
|
704
716
|
}
|
705
|
-
reader.onerror = function(){ console.log('error reading file');
|
706
|
-
reader.onabort = function(){ console.log('abort reading file');
|
717
|
+
reader.onerror = function(){ console.log('error reading file'); loading = false; }
|
718
|
+
reader.onabort = function(){ console.log('abort reading file'); loading = false; }
|
707
719
|
reader.readAsText(files[0]);
|
708
720
|
} //}}}
|
709
721
|
function load_testsetfile() {// {{{
|
710
|
-
if (
|
722
|
+
if (loading) return;
|
711
723
|
document.getElementById('testsetfile').click();
|
712
724
|
}// }}}
|
713
725
|
|
714
726
|
function load_modelfile_after() { //{{{
|
715
|
-
if (
|
716
|
-
|
727
|
+
if (loading) return;
|
728
|
+
loading = true;
|
717
729
|
if (typeof window.FileReader !== 'function') {
|
718
730
|
alert('FileReader not yet supportet');
|
719
731
|
return;
|
@@ -723,20 +735,20 @@ function load_modelfile_after() { //{{{
|
|
723
735
|
reader.onload = function(){
|
724
736
|
var url = $("#current-instance").text();
|
725
737
|
load_des(url,reader.result);
|
726
|
-
|
738
|
+
loading = false;
|
727
739
|
}
|
728
|
-
reader.onerror = function(){
|
729
|
-
reader.onabort = function(){
|
740
|
+
reader.onerror = function(){ loading = false; }
|
741
|
+
reader.onabort = function(){ loading = false; }
|
730
742
|
reader.readAsText(files[0]);
|
731
743
|
} //}}}
|
732
744
|
function load_modelfile() {// {{{
|
733
|
-
if (
|
745
|
+
if (loading) return;
|
734
746
|
document.getElementById('modelfile').click();
|
735
747
|
}// }}}
|
736
748
|
|
737
749
|
function load_testset(exec) {// {{{
|
738
|
-
if (
|
739
|
-
|
750
|
+
if (loading) return;
|
751
|
+
loading = true;
|
740
752
|
|
741
753
|
var name = $("#predefinedtestsets div.menuitem[data-selected=selected]").text();
|
742
754
|
$.ajax({
|
@@ -752,14 +764,14 @@ function load_testset(exec) {// {{{
|
|
752
764
|
set_testset(res,exec);
|
753
765
|
},
|
754
766
|
complete: function() {
|
755
|
-
|
767
|
+
loading = false;
|
756
768
|
}
|
757
769
|
});
|
758
770
|
}// }}}
|
759
771
|
function load_modeltype() {// {{{
|
760
|
-
if (
|
772
|
+
if (loading) return;
|
761
773
|
var url = $("#current-instance").text();
|
762
|
-
|
774
|
+
loading = true;
|
763
775
|
|
764
776
|
var name = $("#modeltypes div.menuitem[data-selected=selected]").text();
|
765
777
|
$.ajax({
|
@@ -778,7 +790,7 @@ function load_modeltype() {// {{{
|
|
778
790
|
});
|
779
791
|
},
|
780
792
|
complete: function() {
|
781
|
-
|
793
|
+
loading = false;
|
782
794
|
}
|
783
795
|
});
|
784
796
|
}// }}}
|
@@ -924,6 +936,10 @@ function format_visual_set(what) {//{{{
|
|
924
936
|
var actives = node_state[what]['active'];
|
925
937
|
var passives = node_state[what]['passive'];
|
926
938
|
|
939
|
+
// TODO scrollIntoView does not work in firefox
|
940
|
+
// $('g[element-id="' + what + '"]').each(function(a,b){ b.scrollIntoView(true); $('#graphcolumn')[0].scrollTop -= 15; });
|
941
|
+
$('g[element-id="' + what + '"]').each(function(a,b){ $('#graphcolumn')[0].scrollTop = b.getBBox().y - 10; });
|
942
|
+
|
927
943
|
if (actives > 0 && votes > 0)
|
928
944
|
$('g[element-id="' + what + '"] .super .colon').each(function(a,b){
|
929
945
|
b.setAttribute('class','colon necessary');
|
data/cpee.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cpee"
|
3
|
-
s.version = "1.3.
|
3
|
+
s.version = "1.3.227"
|
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). If you just need workflow execution, without a rest/xmpp service exposing it, then use WEEL"
|
@@ -0,0 +1,111 @@
|
|
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
|
+
require 'riddl/server'
|
16
|
+
require 'xml/smart'
|
17
|
+
require 'base64'
|
18
|
+
require 'uri'
|
19
|
+
|
20
|
+
module CPEE
|
21
|
+
module Instantiation
|
22
|
+
|
23
|
+
SERVER = File.expand_path(__dir__ + '/../instantiation.xml')
|
24
|
+
|
25
|
+
module Testset #{{{
|
26
|
+
|
27
|
+
def self::load(tdoc,cpee)
|
28
|
+
ins = -1
|
29
|
+
puts tdoc.to_s
|
30
|
+
XML::Smart.string(tdoc) do |doc|
|
31
|
+
doc.register_namespace 'desc', 'http://cpee.org/ns/description/1.0'
|
32
|
+
doc.register_namespace 'prop', 'http://riddl.org/ns/common-patterns/properties/1.0'
|
33
|
+
|
34
|
+
srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
|
35
|
+
res = srv.resource("/")
|
36
|
+
status, response = res.post Riddl::Parameter::Simple.new("info",doc.find("string(/testset/attributes/prop:info)"))
|
37
|
+
|
38
|
+
if status == 200
|
39
|
+
ins = response.first.value
|
40
|
+
params = []
|
41
|
+
|
42
|
+
res = srv.resource("/#{ins}/properties/values")
|
43
|
+
["handlerwrapper","positions","dataelements","endpoints","attributes","transformation"].each do |item|
|
44
|
+
if doc.find("/testset/#{item}").any?
|
45
|
+
params << Riddl::Parameter::Simple.new("name",item)
|
46
|
+
params << Riddl::Parameter::Simple.new("content",doc.find("/testset/#{item}").first.dump)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
["description"].each do |item|
|
50
|
+
if doc.find("/testset/#{item}").any?
|
51
|
+
params << Riddl::Parameter::Simple.new("name",item)
|
52
|
+
params << Riddl::Parameter::Simple.new("content","<content>" + doc.find("/testset/#{item}/desc:*").first.dump + "</content>")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
status, response = res.put params
|
56
|
+
["handlers"].each do |item|
|
57
|
+
doc.find("/testset/#{item}/handler").each do |han|
|
58
|
+
#pp han.children.first
|
59
|
+
url = han.attributes['url']
|
60
|
+
inp = "url=" + URI.encode_www_form_component(url)
|
61
|
+
inp = inp + "&topic=" + han.children.first.attributes['topic']
|
62
|
+
inp = inp + "&" + han.children.first.qname.to_s + "=" + han.children.first.to_s
|
63
|
+
pp cpee+ins+"/notifications/subscriptions/"
|
64
|
+
pp inp
|
65
|
+
status,body = Riddl::Client::new(cpee+ins+"/notifications/subscriptions/").post([Riddl::Parameter::Simple.new("url",han.attributes['url']),Riddl::Parameter::Simple.new("topic",han.children.first.attributes['topic']),Riddl::Parameter::Simple.new(han.children.first.qname.to_s,han.children.first.to_s)])
|
66
|
+
pp status
|
67
|
+
pp body
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
return ins
|
73
|
+
end
|
74
|
+
|
75
|
+
end #}}}
|
76
|
+
|
77
|
+
class Instantiate < Riddl::Implementation
|
78
|
+
def response
|
79
|
+
cpee = @a[0]
|
80
|
+
tdoc = @p[@p.length - 1].value.read
|
81
|
+
if @p[0].additional =~ /base64/
|
82
|
+
tdoc = Base64.decode64(tdoc)
|
83
|
+
end
|
84
|
+
|
85
|
+
if (ins = Testset::load(tdoc,cpee)) == -1
|
86
|
+
@status = 500
|
87
|
+
else
|
88
|
+
if @p.length > 1 && @p[0].value == "fork_running" && @p[0].value == "wait_running"
|
89
|
+
srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
|
90
|
+
res = srv.resource("/#{ins}/properties/values")
|
91
|
+
status, response = res.put [
|
92
|
+
params << Riddl::Parameter::Simple.new('name', 'state'),
|
93
|
+
params << Riddl::Parameter::Simple.new('value','running')
|
94
|
+
]
|
95
|
+
end
|
96
|
+
return Riddl::Parameter::Simple.new("url",cpee + ins)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def self::implementation(opts)
|
102
|
+
opts[:cpee] ||= 'http://localhost:9298/'
|
103
|
+
Proc.new do
|
104
|
+
on resource do
|
105
|
+
run Instantiate, opts[:cpee] if post 'instantiate'
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<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">
|
2
|
+
|
3
|
+
<message name="instantiate">
|
4
|
+
<optional>
|
5
|
+
<parameter name="behavior" type="string">
|
6
|
+
<choice>
|
7
|
+
<value>fork_ready</value>
|
8
|
+
<value>fork_running</value>
|
9
|
+
<value>wait_ready</value>
|
10
|
+
<value>wait_running</value>
|
11
|
+
</choice>
|
12
|
+
</parameter>
|
13
|
+
</optional>
|
14
|
+
<parameter name="xml" mimetype="*/xml"/>
|
15
|
+
</message>
|
16
|
+
|
17
|
+
<message name="instance">
|
18
|
+
<parameter name="url" type="anyURI"/>
|
19
|
+
</message>
|
20
|
+
|
21
|
+
<resource>
|
22
|
+
<post in="instantiate" out="instance"/>
|
23
|
+
</resource>
|
24
|
+
|
25
|
+
</description>
|
@@ -58,9 +58,9 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
58
58
|
params << Riddl::Header.new("CPEE-BASE",@controller.base_url)
|
59
59
|
params << Riddl::Header.new("CPEE-INSTANCE",@controller.instance_url)
|
60
60
|
params << Riddl::Header.new("CPEE-CALLBACK",@controller.instance_url + '/callbacks/' + callback)
|
61
|
-
params << Riddl::Header.new("CPEE-
|
61
|
+
params << Riddl::Header.new("CPEE-CALLBACK-ID",callback)
|
62
62
|
params << Riddl::Header.new("CPEE-ACTIVITY",@handler_position)
|
63
|
-
params << Riddl::Header.new("CPEE-LABEL",parameters[:label])
|
63
|
+
params << Riddl::Header.new("CPEE-LABEL",parameters[:label]||'')
|
64
64
|
@controller.attributes.each do |key,value|
|
65
65
|
params << Riddl::Header.new("CPEE-ATTR-#{key.gsub(/_/,'-')}",value)
|
66
66
|
end
|
@@ -377,9 +377,9 @@
|
|
377
377
|
<xsl:text>nil</xsl:text>
|
378
378
|
</xsl:when>
|
379
379
|
<xsl:when test="child::node()[not(self::text())]">
|
380
|
-
<xsl:text>"[</xsl:text>
|
380
|
+
<xsl:text>"[ </xsl:text>
|
381
381
|
<xsl:apply-templates select="*" mode="JSON"/>
|
382
|
-
<xsl:text>
|
382
|
+
<xsl:text>]"</xsl:text>
|
383
383
|
</xsl:when>
|
384
384
|
<xsl:otherwise>
|
385
385
|
<xsl:choose>
|
@@ -486,32 +486,33 @@
|
|
486
486
|
|
487
487
|
<!-- JSON Element -->
|
488
488
|
<xsl:template match="*" mode="JSON">
|
489
|
-
<xsl:
|
490
|
-
<xsl:value-of select="name()"/>
|
491
|
-
<xsl:text>\": </xsl:text>
|
492
|
-
<xsl:call-template name="JSONProperties">
|
493
|
-
<xsl:with-param name="parent" select="'Yes'"></xsl:with-param>
|
494
|
-
</xsl:call-template>
|
489
|
+
<xsl:call-template name="JSONProperties"/>
|
495
490
|
<xsl:choose>
|
496
|
-
<xsl:when test="following-sibling::*"
|
491
|
+
<xsl:when test="following-sibling::*">, </xsl:when>
|
492
|
+
<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
|
497
493
|
</xsl:choose>
|
498
|
-
<xsl:text>}</xsl:text>
|
499
|
-
<xsl:if test="following-sibling::*">,</xsl:if>
|
500
494
|
</xsl:template>
|
501
495
|
|
502
496
|
<xsl:template match="*" mode="JSONSUB">
|
503
|
-
<xsl:text
|
497
|
+
<xsl:text>\"</xsl:text>
|
504
498
|
<xsl:value-of select="name()"/>
|
505
499
|
<xsl:text>\": </xsl:text>
|
506
500
|
<xsl:call-template name="JSONProperties">
|
507
501
|
<xsl:with-param name="parent" select="'Yes'"></xsl:with-param>
|
508
502
|
</xsl:call-template>
|
509
|
-
<xsl:
|
503
|
+
<xsl:choose>
|
504
|
+
<xsl:when test="following-sibling::*">, </xsl:when>
|
505
|
+
<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
|
506
|
+
</xsl:choose>
|
510
507
|
</xsl:template>
|
511
508
|
|
512
509
|
<!-- JSON Array Element -->
|
513
510
|
<xsl:template match="*" mode="JSONArrayElement">
|
514
511
|
<xsl:call-template name="JSONProperties"/>
|
512
|
+
<xsl:choose>
|
513
|
+
<xsl:when test="following-sibling::*">, </xsl:when>
|
514
|
+
<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
|
515
|
+
</xsl:choose>
|
515
516
|
</xsl:template>
|
516
517
|
|
517
518
|
<!-- JSON Object Properties -->
|
@@ -555,13 +556,13 @@
|
|
555
556
|
<xsl:value-of select="$childName"/>
|
556
557
|
<xsl:text>\": [ </xsl:text>
|
557
558
|
<xsl:apply-templates select="*" mode="JSONArrayElement"/>
|
558
|
-
<xsl:text>
|
559
|
+
<xsl:text>] }</xsl:text>
|
559
560
|
</xsl:when>
|
560
561
|
<xsl:otherwise>
|
561
562
|
<xsl:if test="text()[normalize-space(.)]">
|
562
563
|
<xsl:text>[ </xsl:text>
|
563
564
|
</xsl:if>
|
564
|
-
<xsl:text>{</xsl:text>
|
565
|
+
<xsl:text>{ </xsl:text>
|
565
566
|
<xsl:apply-templates select="@*" mode="JSON"/>
|
566
567
|
<xsl:apply-templates select="*" mode="JSONSUB"/>
|
567
568
|
<xsl:text>}</xsl:text>
|
@@ -570,19 +571,15 @@
|
|
570
571
|
<xsl:text>\"</xsl:text>
|
571
572
|
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','\\\"')"/>
|
572
573
|
<xsl:text>\"</xsl:text>
|
573
|
-
<xsl:text>
|
574
|
+
<xsl:text>]</xsl:text>
|
574
575
|
</xsl:if>
|
575
|
-
<xsl:choose>
|
576
|
-
<xsl:when test="following-sibling::*"></xsl:when>
|
577
|
-
<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
|
578
|
-
</xsl:choose>
|
579
576
|
</xsl:otherwise>
|
580
577
|
</xsl:choose>
|
581
578
|
</xsl:template>
|
582
579
|
|
583
580
|
<!-- JSON Attribute Property -->
|
584
581
|
<xsl:template match="@*" mode="JSON">
|
585
|
-
<xsl:text
|
582
|
+
<xsl:text>\"@</xsl:text>
|
586
583
|
<xsl:value-of select="name()"/>
|
587
584
|
<xsl:text>\": </xsl:text>
|
588
585
|
<xsl:choose>
|
@@ -597,7 +594,7 @@
|
|
597
594
|
</xsl:choose>
|
598
595
|
<xsl:choose>
|
599
596
|
<xsl:when test="not(position() = last())">
|
600
|
-
<xsl:text
|
597
|
+
<xsl:text>, </xsl:text>
|
601
598
|
</xsl:when>
|
602
599
|
<xsl:otherwise>
|
603
600
|
<xsl:text> </xsl:text>
|
data/tools/cpee
CHANGED
@@ -28,6 +28,8 @@ ARGV.options { |opt|
|
|
28
28
|
opt.on("")
|
29
29
|
opt.on(wrap("[new DIR] scaffolds a sample execution engine. Everything except instances can be removed for default behaviour."))
|
30
30
|
opt.on("")
|
31
|
+
opt.on(wrap("[inst DIR] scaffolds a sample instantiation service. Post a testset to a model to keep going in one operation."))
|
32
|
+
opt.on("")
|
31
33
|
opt.on(wrap("[cpui DIR] scaffolds a sample html client. New versions might require manual merging if you changed something."))
|
32
34
|
opt.on("")
|
33
35
|
opt.on(wrap("[ui] starts a simple static web server with the ui on http://localhost:8080. Use [cpui DIR] if you want stuff in apache or nginx."))
|
@@ -50,6 +52,12 @@ elsif command == "cpui"
|
|
50
52
|
else
|
51
53
|
puts "Directory already exists."
|
52
54
|
end
|
55
|
+
elsif command == "inst"
|
56
|
+
if !File.exists?(dir)
|
57
|
+
FileUtils.cp_r("#{curpath}/instantiation/",dir)
|
58
|
+
else
|
59
|
+
puts "Directory already exists."
|
60
|
+
end
|
53
61
|
else
|
54
62
|
if !File.exists?(dir)
|
55
63
|
FileUtils.cp_r("#{curpath}/server/",dir)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require 'cpee/instantiation'
|
4
|
+
|
5
|
+
options = {
|
6
|
+
:host => 'localhost',
|
7
|
+
:port => 9296,
|
8
|
+
:secure => false
|
9
|
+
# :secure_options => {
|
10
|
+
# :private_key_file => '',
|
11
|
+
# :cert_chain_file => '',
|
12
|
+
# :verify_peer => false
|
13
|
+
# }
|
14
|
+
}
|
15
|
+
|
16
|
+
Riddl::Server.new(CPEE::Instantiation::SERVER, options) do
|
17
|
+
accessible_description true
|
18
|
+
cross_site_xhr true
|
19
|
+
|
20
|
+
@riddl_opts[:cpee] ||= 'http://localhost:9298/'
|
21
|
+
|
22
|
+
use CPEE::Instantiation::implementation(@riddl_opts)
|
23
|
+
end.loop!
|
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: 1.3.
|
4
|
+
version: 1.3.227
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: tools
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-
|
14
|
+
date: 2018-03-05 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: riddl
|
@@ -259,6 +259,7 @@ files:
|
|
259
259
|
- lib/cpee/handler_notifications.rb
|
260
260
|
- lib/cpee/handler_properties.rb
|
261
261
|
- lib/cpee/implementation.rb
|
262
|
+
- lib/cpee/instantiation.rb
|
262
263
|
- lib/cpee/processtransformation/bpel/Repository/booking.bpel
|
263
264
|
- lib/cpee/processtransformation/bpel/Repository/booking.wsdl
|
264
265
|
- lib/cpee/processtransformation/bpel/Repository/booking/airline.wsdl
|
@@ -276,6 +277,7 @@ files:
|
|
276
277
|
- lib/engine/callbacks.rng
|
277
278
|
- lib/engine/instance-info.rng
|
278
279
|
- lib/engine/instances.rng
|
280
|
+
- lib/instantiation.xml
|
279
281
|
- log/chain.xml
|
280
282
|
- log/log.xml
|
281
283
|
- log/logoverlay.xml
|
@@ -372,6 +374,7 @@ files:
|
|
372
374
|
- server/server.rb
|
373
375
|
- test/callback.rb
|
374
376
|
- tools/cpee
|
377
|
+
- tools/instantiation/instantiation
|
375
378
|
- tools/server/resources/notifications/logging/consumer-secret
|
376
379
|
- tools/server/resources/notifications/logging/producer-secret
|
377
380
|
- tools/server/resources/notifications/logging/subscription.xml
|