cpee 2.0.6 → 2.0.13

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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/config.json +3 -0
  3. data/cockpit/css/track.css +17 -6
  4. data/cockpit/css/ui.css +6 -2
  5. data/cockpit/css/wfadaptor.css +1 -1
  6. data/cockpit/edit.html +1 -0
  7. data/cockpit/index.html +2 -2
  8. data/cockpit/js/instance.js +75 -55
  9. data/cockpit/js/track.js +10 -0
  10. data/cockpit/js/ui.js +47 -16
  11. data/cockpit/templates/Track Test Local.xml +82 -0
  12. data/cockpit/templates/Track Test.xml +82 -0
  13. data/cockpit/templates/instantiate.local/Take_Sub.xml +59 -0
  14. data/cockpit/templates/instantiate/Take_Perf.xml +46 -0
  15. data/cockpit/templates/instantiate/Take_Sub.xml +58 -0
  16. data/cockpit/templates/instantiate/Take_X.xml +48 -0
  17. data/cockpit/themes/compact/rngs/call.rng +5 -0
  18. data/cockpit/themes/compact/rngs/callmanipulate.rng +6 -1
  19. data/cockpit/themes/compact/rngs/loop.rng +1 -1
  20. data/cockpit/themes/compact/rngs/parallel.rng +1 -1
  21. data/cockpit/themes/default/rngs/call.rng +5 -0
  22. data/cockpit/themes/default/rngs/callmanipulate.rng +6 -1
  23. data/cockpit/themes/default/rngs/loop.rng +1 -1
  24. data/cockpit/themes/default/rngs/parallel.rng +1 -1
  25. data/cockpit/themes/extended/rngs/call.rng +5 -0
  26. data/cockpit/themes/extended/rngs/callmanipulate.rng +6 -1
  27. data/cockpit/themes/extended/rngs/loop.rng +1 -1
  28. data/cockpit/themes/extended/rngs/parallel.rng +1 -1
  29. data/cockpit/themes/extended/theme.js +4 -0
  30. data/cockpit/themes/model/theme.js +1 -1
  31. data/cockpit/themes/packed/rngs/call.rng +5 -0
  32. data/cockpit/themes/packed/rngs/callmanipulate.rng +6 -1
  33. data/cockpit/themes/packed/rngs/loop.rng +1 -1
  34. data/cockpit/themes/packed/rngs/parallel.rng +1 -1
  35. data/cockpit/themes/preset/rngs/call.rng +5 -0
  36. data/cockpit/themes/preset/rngs/callmanipulate.rng +6 -1
  37. data/cockpit/themes/preset/rngs/loop.rng +1 -1
  38. data/cockpit/themes/preset/rngs/parallel.rng +1 -1
  39. data/cockpit/track.html +37 -8
  40. data/cpee.gemspec +3 -3
  41. data/lib/cpee/implementation.rb +15 -6
  42. data/lib/cpee/implementation_notifications.rb +80 -51
  43. data/lib/cpee/implementation_properties.rb +5 -2
  44. data/lib/cpee/persistence.rb +3 -0
  45. data/server/handlerwrappers/default.rb +3 -0
  46. data/server/routing/forward-events.rb +2 -1
  47. data/server/routing/forward-votes.rb +1 -1
  48. data/server/server.conf +4 -0
  49. data/tools/cpee +17 -9
  50. metadata +17 -10
  51. data/cockpit/templates/convert_cpee2.rb +0 -15
  52. data/cockpit/themes/convert_cpee2.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ceb3ebb10b51f80ab5279f9738c67e1b916c06f10b7f30352ba8c2152172fbbd
4
- data.tar.gz: 48b7e67c715b8ed0a9e5e4fa4cd90786f5cf2096fc1362c0d679c729e0576816
3
+ metadata.gz: 8626501eb6fa91fc0c21782e57a5448f070fc717aa38d0cfb68bf783b5608794
4
+ data.tar.gz: a76f7036d8777a7b0d58eb1ba31b4a8c2cf6fe8b0ed45d34fe54001094224be8
5
5
  SHA512:
6
- metadata.gz: 9b1340826747baad2c00ed578b84a87d20d3d6ffb31d7a6cf6f856ba8366686d6c8044faebd819168d36488dc690956ed2c44e38b999f81f6edf83fac86a5c4e
7
- data.tar.gz: b5744e76d4fa37304555a1fb1678a6181e1bda425e4a5007419214c514af3c78f4bee52adb5623f76a2a84509c7c28ebd2a8ca299b1b1b1c175dec45f047a3d9
6
+ metadata.gz: 4e7cc5e856f65f51c2bf89fdf1870cfede3e191c08b944f48a6eb03def8dea5bd5f9eb1e994863615068e6ff31f6ed33438cac119848b0626000f427125bcd80
7
+ data.tar.gz: 7d630f9034480e0ae433c9c983d30210cf24eaafcca8e89ef8afbacc7bb55e734a69505a91f807cb52c714cd2d1900f7140214519d40b3486f074e099f00ac1a
@@ -0,0 +1,3 @@
1
+ {
2
+ "res-url": "https://cpee.org/flow/resources/"
3
+ }
@@ -5,11 +5,16 @@
5
5
  height: 100vh;
6
6
  }
7
7
  #graphcolumn {
8
- flex: 0 0 auto;
9
- overflow: auto;
10
- min-width: 35em;
8
+ flex: 0 1 auto;
9
+ width: 35em;
10
+ min-width: 15em;
11
11
  border-right: 0 none;
12
+ overflow: auto;
13
+ }
14
+ #graphcolumn.resize {
15
+ resize: horizontal;
12
16
  }
17
+
13
18
  #trackcolumn {
14
19
  flex: 1 1 auto;
15
20
  display: flex;
@@ -24,19 +29,25 @@
24
29
  margin: 0;
25
30
  border-left: 0.1em solid var(--x-ui-border-color);
26
31
  border-bottom: 0.1em solid var(--x-ui-border-color);
32
+ overflow: scroll;
27
33
  }
28
34
 
29
- #usage {
35
+ #trackusage {
30
36
  line-height: 2em;
31
37
  margin-top: 0.5em;
32
38
  margin-left: 2em;
33
39
  margin-right: 1em;
34
40
  }
35
- #usage button{
41
+ #trackusage button {
36
42
  width: 2em;
37
43
  height: 2em;
38
- vertical-align: center;
44
+ vertical-align: middle;
39
45
  }
40
46
  #current-instance[href]:after {
41
47
  content: "";
42
48
  }
49
+
50
+ #tracktitle {
51
+ white-space: nowrap;
52
+ margin-bottom: 0.1em;
53
+ }
@@ -66,8 +66,6 @@ body {
66
66
  font: normal normal normal 14px/1 FontAwesome;
67
67
  font-size: 0.8em;
68
68
  text-rendering: auto;
69
- -webkit-font-smoothing: antialiased;
70
- -moz-osx-font-smoothing: grayscale;
71
69
  content: ' ';
72
70
  }
73
71
  #graphgrid .graphlabel.selected a::after, graphgrid .graphlabel.hover a::after {
@@ -104,6 +102,12 @@ ui-tabbed ui-tabbar ui-behind button {
104
102
  #current-instance-subscriptions[href]:after {
105
103
  content: "|";
106
104
  }
105
+ #current-graph[href]:before {
106
+ content: "|";
107
+ }
108
+ #current-log[href]:before {
109
+ content: "|";
110
+ }
107
111
 
108
112
  #parameters ui-content { height: 8.5em; min-height: 1.7em; }
109
113
 
@@ -338,7 +338,7 @@ svg text.label {
338
338
  text-align:center;
339
339
  line-height:125%;
340
340
  writing-mode:horizontal-tb;
341
- text-anchor:left;
341
+ text-anchor:start;
342
342
  color: var(--wfadaptor-base);
343
343
  fill: var(--wfadaptor-base);
344
344
  fill-opacity:1;
@@ -0,0 +1 @@
1
+ cockpit/index.html
@@ -121,7 +121,7 @@
121
121
  <ui-tab class="" data-tab="new" id="tabnew" >New</ui-tab>
122
122
  <ui-tab class="inactive hidden" data-tab="instance" id="tabinstance" >Instance</ui-tab>
123
123
  <ui-tab class="inactive hidden" data-tab="execution" id="tabexecution">Execution</ui-tab>
124
- <ui-behind ><a id='current-instance'></a><a id='current-instance-properties'></a><a id='current-instance-subscriptions'></a><a id='current-instance-callbacks'></a></ui-behind>
124
+ <ui-behind ><a style='display:none' target='_blank' id='current-instance'></a><a style='display:none' target='_blank' id='current-instance-properties'>P</a><a style='display:none' target='_blank' id='current-instance-subscriptions'>S</a><a style='display:none' target='_blank' id='current-instance-callbacks'>C</a></ui-behind>
125
125
  </ui-tabbar>
126
126
  <ui-content>
127
127
  <ui-area data-belongs-to-tab="new" id="areanew"> <!--{{{-->
@@ -234,7 +234,7 @@
234
234
  <ui-tab class="" data-tab="details" id="tabdetails">Graph</ui-tab>
235
235
  <ui-tab class="inactive" data-tab="dsl" id="tabdsl" >Description</ui-tab>
236
236
  <ui-tab class="inactive" data-tab="log" id="tablog" >Log</ui-tab>
237
- <ui-behind ></ui-behind>
237
+ <ui-behind ><a style='display:none' target='_blank' id='current-track'>T</a><a style='display:none' target='_blank' id='current-graph'>G</a><a style='display:none' target='_blank' id='current-log'>L</a></ui-behind>
238
238
  </ui-tabbar>
239
239
  <ui-content>
240
240
  <ui-area data-belongs-to-tab="details" id='graphcolumn'>
@@ -251,56 +251,60 @@ function create_instance(base,name,load,exec) {// {{{
251
251
 
252
252
  function sse() { //{{{
253
253
  var url = $('body').attr('current-instance');
254
- es = new EventSource(url + "/notifications/subscriptions/" + subscription + "/sse/");
255
- es.onopen = function() {
256
- append_to_log("monitoring", "opened", "");
257
- };
258
- es.onmessage = function(e) {
259
- data = JSON.parse(e.data);
260
- if (data['type'] == 'event') {
261
- switch(data['topic']) {
262
- case 'dataelements':
263
- monitor_instance_values("dataelements");
264
- break;
265
- case 'description':
266
- monitor_instance_dsl();
267
- break;
268
- case 'endpoints':
269
- monitor_instance_values("endpoints");
270
- break;
271
- case 'attributes':
272
- monitor_instance_values("attributes");
273
- monitor_instance_transformation();
274
- if (!suspended_monitoring) { // or else it would load twice, because dsl changes also trigger
275
- monitor_graph_change(true);
276
- }
277
- break;
278
- case 'task':
279
- if ($('#trackcolumn').length > 0) {
280
- $('#trackcolumn').append($('<iframe src="track.html?monitor=' + data.content.received['CPEE-INSTANCE-URL'].replace(/\/*$/,'/') + '"></iframe>'));
281
- }
282
- break;
283
- case 'state':
284
- monitor_instance_state_change(data['content']['state']);
285
- break;
286
- case 'position':
287
- monitor_instance_pos_change(data['content']);
288
- break;
289
- case 'activity':
290
- monitor_instance_running(data['content'],data['name']);
291
- break;
254
+ if (subscription) {
255
+ es = new EventSource(url + "/notifications/subscriptions/" + subscription + "/sse/");
256
+ es.onopen = function() {
257
+ append_to_log("monitoring", "opened", "nice.");
258
+ };
259
+ es.onmessage = function(e) {
260
+ data = JSON.parse(e.data);
261
+ if (data['type'] == 'event') {
262
+ switch(data['topic']) {
263
+ case 'dataelements':
264
+ monitor_instance_values("dataelements");
265
+ break;
266
+ case 'description':
267
+ monitor_instance_dsl();
268
+ break;
269
+ case 'endpoints':
270
+ monitor_instance_values("endpoints");
271
+ break;
272
+ case 'attributes':
273
+ monitor_instance_values("attributes");
274
+ monitor_instance_transformation();
275
+ if (!suspended_monitoring) { // or else it would load twice, because dsl changes also trigger
276
+ if (save['graph_theme'] != data.content.values.theme) {
277
+ monitor_graph_change(true);
278
+ }
279
+ }
280
+ break;
281
+ case 'task':
282
+ if ($('#trackcolumn').length > 0) {
283
+ $('#trackcolumn').append($('<iframe src="track.html?monitor=' + data.content.received['CPEE-INSTANCE-URL'].replace(/\/*$/,'/') + '"></iframe>'));
284
+ $('#graphcolumn').addClass('resize');
285
+ }
286
+ break;
287
+ case 'state':
288
+ monitor_instance_state_change(data['content']['state']);
289
+ break;
290
+ case 'position':
291
+ monitor_instance_pos_change(data['content']);
292
+ break;
293
+ case 'activity':
294
+ monitor_instance_running(data['content'],data['name']);
295
+ break;
296
+ }
292
297
  }
293
- }
294
- if (data['type'] == 'vote') {
295
- monitor_instance_vote_add(data['content']);
296
- }
297
- append_to_log(data['type'], data['topic'] + '/' + data['name'], JSON.stringify(data['content']));
298
- };
299
- es.onerror = function() {
300
- append_to_log("monitoring", "closed", "server down i assume.");
301
- // setTimeout(sse,10000);
302
- };
303
-
298
+ if (data['type'] == 'vote') {
299
+ monitor_instance_vote_add(data['content']);
300
+ }
301
+ append_to_log(data['type'], data['topic'] + '/' + data['name'], JSON.stringify(data['content']));
302
+ };
303
+ es.onerror = function() {
304
+ append_to_log("monitoring", "closed", "finished or abandoned or not existing or server down. one of these, i assume.");
305
+ // setTimeout(sse,10000);
306
+ };
307
+ }
304
308
  monitor_instance_values("dataelements");
305
309
  monitor_instance_values("endpoints");
306
310
  monitor_instance_values("attributes");
@@ -334,14 +338,25 @@ function monitor_instance(cin,rep,load,exec) {// {{{
334
338
  $("ui-tabbed ui-tab.hidden, ui-rest ui-tab.hidden").removeClass("hidden");
335
339
 
336
340
  // Change url to return to current instance when reloading
337
- $("#current-instance").text(url);
341
+ $("#current-instance").show();
342
+ $("#current-instance").text(url.match(/(\d+)\/?$/)[1]);
338
343
  $("#current-instance").attr('href',url);
344
+ $("#current-instance-properties").show();
339
345
  $("#current-instance-properties").attr('href',url + 'properties/');
340
- $("#current-instance-properties").text('P');
346
+ $("#current-instance-subscriptions").show();
341
347
  $("#current-instance-subscriptions").attr('href',url + 'notifications/subscriptions/');
342
- $("#current-instance-subscriptions").text('S');
348
+ $("#current-instance-callbacks").show();
343
349
  $("#current-instance-callbacks").attr('href',url + 'callbacks/');
344
- $("#current-instance-callbacks").text('C');
350
+ $("#current-monitor").show();
351
+ $("#current-monitor").attr('href','edit.html?monitor=' + url);
352
+ $("#current-graph").show();
353
+ $("#current-graph").attr('href','graph.html?monitor=' + url);
354
+ $("#current-track").show();
355
+ $("#current-track").attr('href','track.html?monitor=' + url);
356
+ if ($('body').attr('current-logs')) {
357
+ $("#current-log").show();
358
+ $("#current-log").attr('href','edit.html?monitor=' + url);
359
+ }
345
360
  var q = $.parseQuerySimple();
346
361
  history.replaceState({}, '', '?' + (q.min || q.min=="" ? "min&" : "") + 'monitor='+url);
347
362
 
@@ -359,6 +374,11 @@ function monitor_instance(cin,rep,load,exec) {// {{{
359
374
  if (load || exec) {
360
375
  load_testset(exec);
361
376
  }
377
+ },
378
+ error: function() {
379
+ subscription = undefined;
380
+ append_to_log("monitoring", "closed", "For Good.");
381
+ sse();
362
382
  }
363
383
  });
364
384
  },
@@ -541,6 +561,7 @@ function adaptor_init(url,theme,dslx) { //{{{
541
561
  format_instance_pos();
542
562
  });
543
563
  }
564
+ suspended_monitoring = false;
544
565
  } //}}}
545
566
 
546
567
  function monitor_graph_change(force) { //{{{
@@ -644,7 +665,7 @@ function monitor_instance_running(content,event) {// {{{
644
665
  } // }}}
645
666
  function monitor_instance_state_change(notification) { //{{{
646
667
  if ($('#trackcolumn').length > 0) {
647
- if (notification == "finished") {
668
+ if (notification == "finished" || notification == "abandoned") {
648
669
  parent.closeIFrame(window.location.search);
649
670
  }
650
671
  }
@@ -915,7 +936,6 @@ async function set_testset(testset,exec) {// {{{
915
936
  );
916
937
 
917
938
  await Promise.all(promises);
918
- suspended_monitoring = false;
919
939
 
920
940
  $.ajax({
921
941
  type: "GET",
@@ -1,8 +1,18 @@
1
1
  function closeIFrame(srch) {
2
+ var count = 0;
2
3
  $('iframe').each(function(i,val){
3
4
  if ($(val).attr('src') == 'track.html' + srch) {
4
5
  $(val).remove();
5
6
  }
7
+ count += 1;
6
8
  });
9
+ if (count == 1) {
10
+ $('#graphcolumn').removeClass('resize');
11
+ }
7
12
  }
8
13
 
14
+ $(document).ready(function() {
15
+ $("a[name=glob_unshow]").click(e => {
16
+ parent.closeIFrame(window.location.search);
17
+ });
18
+ });
@@ -1,3 +1,19 @@
1
+ function config_defaults(){
2
+ var default_values = {};
3
+ // logs is missing, so that the button is not shown, when there is no info
4
+ if (location.protocol.match(/^file/)) {
5
+ default_values['res-url'] = 'http://localhost:' + $('body').data('res-port');
6
+ default_values['base-url'] = 'http://localhost:' + $('body').data('base-port');
7
+ default_values['save-url'] = 'http://localhost:' + $('body').data('base-port') + '/design';
8
+ } else {
9
+ default_values['res-url'] = location.protocol + "//" + location.hostname + ":" + $('body').data('res-port');
10
+ default_values['base-url'] = location.protocol + "//" + location.hostname + ":" + $('body').data('base-port');
11
+ default_values['save-url'] = location.protocol + "//" + location.hostname + ":" + $('body').data('base-port') + '/design';
12
+ }
13
+ default_values['templates-url'] = 'templates/';
14
+ return default_values;
15
+ }
16
+
1
17
  $(document).ready(function() {
2
18
  if (!($.cookie('cpee_iagree')) && $("body > div[id='disclaimer']").length > 0) {
3
19
  $("body > :not([id='disclaimer'])").remove();
@@ -18,25 +34,40 @@ $(document).ready(function() {
18
34
  $.ajax({
19
35
  url: "config.json",
20
36
  success: function(res){
21
- $("input[name=res-url]").val(res['res-url']);
22
- $("input[name=base-url]").val(res['base-url']);
23
- $("body").attr('current-resources',res['res-url']);
24
- $("body").attr('current-base',res['base-url']);
25
- $("body").attr('current-save',res['save-url']);
26
- $("body").attr('current-templates',res['testsets-url']);
37
+ var res_def = config_defaults();
38
+ if (res['log-url']) { // just leave it out when it is not configured
39
+ $("body").attr('current-logs',res['log-url']);
40
+ }
41
+ if (res['res-url']) {
42
+ $("body").attr('current-resources',res['res-url']);
43
+ } else {
44
+ $("body").attr('current-resources',res_def['res-url']);
45
+ }
46
+ if (res['base-url']) {
47
+ $("body").attr('current-base',res['base-url']);
48
+ } else {
49
+ $("body").attr('current-base',res_def['base-url']);
50
+ }
51
+ if (res['save-url']) {
52
+ $("body").attr('current-save',res['save-url']);
53
+ } else {
54
+ $("body").attr('current-save',res_def['save-url']);
55
+ }
56
+ if (res['templates-url']) {
57
+ $("body").attr('current-templates',res['templates-url']);
58
+ } else {
59
+ $("body").attr('current-templates',res_def['templates-url']);
60
+ }
61
+ $("input[name=res-url]").val($("body").attr('current-resources'));
62
+ $("input[name=base-url]").val($("body").attr('current-base'));
27
63
  cockpit();
28
64
  },
29
65
  error: function(){
30
- $("body").attr('current-templates','templates/');
31
- if (location.protocol.match(/^file/)) {
32
- $("body").attr('current-resources',"http://localhost:" + $('body').data('res-port'));
33
- $("body").attr('current-base',"http://localhost:" + $('body').data('base-port'));
34
- $("body").attr('current-save',"http://localhost:" + $('body').data('base-port') + '/design');
35
- } else {
36
- $("body").attr('current-resources',location.protocol + "//" + location.hostname + ":" + $('body').data('res-port'));
37
- $("body").attr('current-base',location.protocol + "//" + location.hostname + ":" + $('body').data('base-port'));
38
- $("body").attr('current-save',location.protocol + "//" + location.hostname + ":" + $('body').data('base-port') + '/design');
39
- }
66
+ var res = config_defaults();
67
+ $("body").attr('current-resources',res['res-url']);
68
+ $("body").attr('current-base',res['base-url']);
69
+ $("body").attr('current-save',res['save-url']);
70
+ $("body").attr('current-templates',res['templates-url']);
40
71
  $("input[name=res-url]").val($("body").attr('current-resources'));
41
72
  $("input[name=base-url]").val($("body").attr('current-base'));
42
73
  cockpit();
@@ -0,0 +1,82 @@
1
+ <testset xmlns="http://cpee.org/ns/properties/2.0">
2
+ <dataelements>
3
+ <i>0</i>
4
+ </dataelements>
5
+ <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
6
+ <endpoints>
7
+ <start_url>http://localhost:9296/url/</start_url>
8
+ </endpoints>
9
+ <positions/>
10
+ <description>
11
+ <description xmlns="http://cpee.org/ns/description/1.0">
12
+ <loop mode="pre_test" condition="true">
13
+ <parallel wait="-1">
14
+ <loop mode="pre_test" condition="data.i &lt; 4">
15
+ <_probability>
16
+ <_probability_min/>
17
+ <_probability_max/>
18
+ <_probability_avg/>
19
+ </_probability>
20
+ <parallel_branch pass="" local="">
21
+ <call id="a1" endpoint="start_url">
22
+ <parameters>
23
+ <label>Start</label>
24
+ <method>:post</method>
25
+ <arguments>
26
+ <behavior>wait_running</behavior>
27
+ <url>http://localhost/flow/templates/instantiate.local/Take_Sub.xml</url>
28
+ <init>
29
+ <time>4</time>
30
+ </init>
31
+ <endpoints/>
32
+ <stream/>
33
+ </arguments>
34
+ <stream>
35
+ <sensors/>
36
+ <aggregators/>
37
+ <costs/>
38
+ </stream>
39
+ <report>
40
+ <url/>
41
+ </report>
42
+ </parameters>
43
+ <annotations>
44
+ <_timing>
45
+ <_timing_wait/>
46
+ <_timing_threshold/>
47
+ <_timing_min/>
48
+ <_timing_max/>
49
+ <_timing_avg/>
50
+ </_timing>
51
+ <_notes>
52
+ <_notes_general/>
53
+ </_notes>
54
+ </annotations>
55
+ </call>
56
+ </parallel_branch>
57
+ <manipulate id="a4" label="">data.i += 1</manipulate>
58
+ </loop>
59
+ </parallel>
60
+ <manipulate id="a3" label="">data.i = 0</manipulate>
61
+ <_probability>
62
+ <_probability_min/>
63
+ <_probability_max/>
64
+ <_probability_avg/>
65
+ </_probability>
66
+ <stop id="a2"/>
67
+ </loop>
68
+ </description>
69
+ </description>
70
+ <transformation>
71
+ <description type="copy"/>
72
+ <dataelements type="none"/>
73
+ <endpoints type="none"/>
74
+ </transformation>
75
+ <attributes>
76
+ <info>Track Test</info>
77
+ <modeltype>CPEE</modeltype>
78
+ <theme>default</theme>
79
+ <customer>pilotfabrik</customer>
80
+ <status>development</status>
81
+ </attributes>
82
+ </testset>