cpee 2.1.93 → 2.1.95

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/css/{resources-label.css → extended_columns-label.css} +4 -0
  3. data/cockpit/css/ui.css +2 -1
  4. data/cockpit/css/wfadaptor.css +8 -11
  5. data/cockpit/david.html +292 -0
  6. data/cockpit/edit.html +16 -7
  7. data/cockpit/graph.html +3 -3
  8. data/cockpit/index.html +15 -7
  9. data/cockpit/js/extended_columns.js +233 -0
  10. data/cockpit/js/instance.js +33 -161
  11. data/cockpit/js/wfadaptor.js +25 -14
  12. data/cockpit/llm.html +3 -3
  13. data/cockpit/llm_alternative.html +3 -3
  14. data/cockpit/model.html +2 -2
  15. data/cockpit/only_llm.html +16 -7
  16. data/cockpit/templates/Coopis 2010.xml +11 -4
  17. data/cockpit/templates/Frames.xml +78 -10
  18. data/cockpit/templates/Track Test.xml +1 -1
  19. data/cockpit/themes/base.js +11 -7
  20. data/cockpit/themes/control/rngs/call.rng +8 -0
  21. data/cockpit/themes/control/rngs/callmanipulate.rng +9 -1
  22. data/cockpit/themes/control/rngs/loop.rng +7 -0
  23. data/cockpit/themes/control/rngs/manipulate.rng +7 -0
  24. data/cockpit/themes/dataflow/rngs/call.rng +8 -0
  25. data/cockpit/themes/dataflow/rngs/callmanipulate.rng +9 -1
  26. data/cockpit/themes/dataflow/rngs/loop.rng +7 -0
  27. data/cockpit/themes/dataflow/rngs/manipulate.rng +7 -0
  28. data/cockpit/themes/dataflow/theme.js +4 -4
  29. data/cockpit/themes/default/rngs/call.rng +8 -0
  30. data/cockpit/themes/default/rngs/callmanipulate.rng +9 -1
  31. data/cockpit/themes/default/rngs/loop.rng +7 -0
  32. data/cockpit/themes/default/rngs/manipulate.rng +7 -0
  33. data/cockpit/themes/extended/rngs/call.rng +8 -0
  34. data/cockpit/themes/extended/rngs/callmanipulate.rng +9 -1
  35. data/cockpit/themes/extended/rngs/loop.rng +7 -0
  36. data/cockpit/themes/extended/rngs/manipulate.rng +7 -0
  37. data/cockpit/themes/packed/rngs/call.rng +8 -0
  38. data/cockpit/themes/packed/rngs/callmanipulate.rng +9 -1
  39. data/cockpit/themes/packed/rngs/loop.rng +7 -0
  40. data/cockpit/themes/packed/rngs/manipulate.rng +7 -0
  41. data/cockpit/themes/preset/rngs/call.rng +8 -0
  42. data/cockpit/themes/preset/rngs/callmanipulate.rng +9 -1
  43. data/cockpit/themes/preset/rngs/loop.rng +7 -0
  44. data/cockpit/themes/preset/rngs/manipulate.rng +7 -0
  45. data/cockpit/themes/presetaltid/rngs/call.rng +8 -0
  46. data/cockpit/themes/presetaltid/rngs/callmanipulate.rng +9 -1
  47. data/cockpit/themes/presetaltid/rngs/loop.rng +7 -0
  48. data/cockpit/themes/presetaltid/rngs/manipulate.rng +7 -0
  49. data/cockpit/themes/presetaltid/theme.js +3 -3
  50. data/cockpit/themes/presetid/rngs/call.rng +8 -0
  51. data/cockpit/themes/presetid/rngs/callmanipulate.rng +9 -1
  52. data/cockpit/themes/presetid/rngs/loop.rng +7 -0
  53. data/cockpit/themes/presetid/rngs/manipulate.rng +7 -0
  54. data/cockpit/themes/reduced/rngs/call.rng +8 -0
  55. data/cockpit/themes/reduced/rngs/callmanipulate.rng +9 -1
  56. data/cockpit/themes/reduced/rngs/loop.rng +7 -0
  57. data/cockpit/themes/reduced/rngs/manipulate.rng +7 -0
  58. data/cockpit/track.html +3 -3
  59. data/cpee.gemspec +1 -1
  60. data/lib/cpee/implementation.rb +25 -38
  61. data/server/executionhandlers/ruby/connection.rb +6 -2
  62. data/server/routing/end.pid +1 -1
  63. data/server/routing/forward-events-00.pid +1 -1
  64. data/server/routing/forward-events-01.pid +1 -0
  65. data/server/routing/forward-events-02.pid +1 -0
  66. data/server/routing/forward-events-03.pid +1 -0
  67. data/server/routing/forward-events-04.pid +1 -0
  68. data/server/routing/forward-events-05.pid +1 -0
  69. data/server/routing/forward-events-06.pid +1 -0
  70. data/server/routing/forward-votes.pid +1 -1
  71. data/server/routing/persist.pid +1 -1
  72. metadata +11 -4
  73. data/cockpit/js/resources.js +0 -64
  74. /data/cockpit/css/{resources-svg.css → extended_columns-svg.css} +0 -0
@@ -0,0 +1,233 @@
1
+ function show_dataflow_label(x,y,deg,text) {
2
+ const degrees_to_radians = deg => (deg * Math.PI) / 180.0;
3
+
4
+ let clone = $('svg',document.querySelector('#label').content.cloneNode(true));
5
+ $('text',clone).text(text);
6
+ let n = $('body').append(clone);
7
+ let dim = $('text',clone)[0].getBBox();
8
+ let height = $('rect',clone).attr('height');
9
+ let width = dim.width + dim.x;
10
+ let shift = (width + 10) * Math.sin(degrees_to_radians(deg));
11
+ let shift_plus = height * Math.sin(degrees_to_radians(90-deg));
12
+ let neigh = (width + 10) * Math.cos(degrees_to_radians(deg)) + height * Math.cos(degrees_to_radians(90-deg));
13
+
14
+ let top_y = 23 * Math.cos(degrees_to_radians(deg));
15
+ let top_x = 23 * Math.sin(degrees_to_radians(deg));
16
+
17
+ let top = y-shift-top_y;
18
+ if (top < 0) top = 0;
19
+ $(clone).css('left',x-top_x);
20
+ $(clone).css('top',top);
21
+
22
+ $(clone).attr('height',shift + shift_plus + 2);
23
+ $(clone).attr('width',neigh + 2);
24
+ $('g',clone).attr('transform',$('g',clone).attr('transform').replace(/%%1/, shift + 1).replace(/%%2/, deg));
25
+ $('rect',clone).attr('width',width);
26
+ }
27
+
28
+ function show_dataflow_row_label(data) {
29
+ let pos = data.getBoundingClientRect();
30
+ let pos_top = $('#graphgrid').parent()[0].getBoundingClientRect();
31
+ let pos_y;
32
+ let text = $('text',data).text();
33
+ if (pos.y < (pos_top.y + 10)) {
34
+ pos_y = pos_top.y + 10;
35
+ } else {
36
+ pos_y = pos.y;
37
+ }
38
+ show_dataflow_label(pos.x + 12, pos_y, 60, text);
39
+ }
40
+
41
+ function draw_extended_columns(graphrealization,max,labels,dimensions,striped) {
42
+ // labels
43
+ graphrealization.illustrator.svg.container.css('grid-row', '1/span ' + (max.row + 2));
44
+ if (striped == true) {
45
+ if (!graphrealization.illustrator.svg.label_container.hasClass('striped')) {
46
+ graphrealization.illustrator.svg.label_container.addClass('striped');
47
+ }
48
+ } else {
49
+ graphrealization.illustrator.svg.label_container.removeClass('striped');
50
+ }
51
+
52
+ $('.labelsrow, .graphlast').remove();
53
+ let tcolumns = [];
54
+ let tcolumntype = {};
55
+ let tcolumncount = {}
56
+
57
+ const mapPoints = new Map();
58
+ const tcolumnsvgs = {};
59
+ const iconsize = 10;
60
+ const space = 5;
61
+
62
+ for (val of labels) {
63
+ if (val.label != "") {
64
+ for (col of val.label) {
65
+ if (!tcolumns.includes(col.column)) {
66
+ tcolumns.push(col.column);
67
+ tcolumncount[col.column] = 0;
68
+ tcolumnsvgs[col.column] = {};
69
+ }
70
+ if (tcolumntype[col.column] == undefined && col.type != undefined) {
71
+ tcolumntype[col.column] = col.type;
72
+ }
73
+ if (col.value != undefined) {
74
+ let pos = dimensions.height_shift/2 + dimensions.height * (val.row - 1) + (dimensions.height / 2);
75
+ let firstpos = dimensions.height_shift/2 + (dimensions.height / 2);
76
+
77
+ if (col.type == "resource") {
78
+ for (const [k, v] of Object.entries(col.value)) {
79
+ var p = { AR: v };
80
+ if (!mapPoints.has(k)) {
81
+ p.y0 = p.y0 == undefined ? pos : p.y0;
82
+ p.ymax = (p.ymax == undefined) ? p.y0 : p.ymax;
83
+ } else {
84
+ p.y0 = mapPoints.get(k).y0;
85
+ p.ymax = mapPoints.get(k).ymax;
86
+ }
87
+ mapPoints.set(k, p);
88
+ }
89
+
90
+ let tsvg = $X('<g xmlns="http://www.w3.org/2000/svg" class="resource-row" element-row="' + (val.row-1) + '"></g>');
91
+
92
+ var cx = space;
93
+ var count = 0;
94
+ for (const [k, p] of mapPoints) {
95
+ let firstAssignFlag = false;
96
+ p.x = cx;
97
+
98
+ // Including Triangle
99
+ if (k in col.value) { // Define points for a triangle pointing to the right
100
+ let inner;
101
+
102
+ if (p.AR == "Read") {
103
+ inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" points="' + (p.x) + ',' + pos + ' ' + (p.x + iconsize) + ',' + (pos + iconsize/2) + ' ' + (p.x + iconsize) + ',' + (pos - iconsize/2) + '" class="resource-point read"></polygon>');
104
+ if (pos == p.y0) { firstAssignFlag = true; }
105
+ } else if (p.AR == "Assign") { // Define points for a triangle pointing to the left
106
+ inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" points="' + (p.x + iconsize) + ',' + pos + ' ' + (p.x) + ',' + (pos + iconsize/2) + ' ' + (p.x) + ',' + (pos - iconsize/2) + '" class="resource-point write"></polygon>');
107
+ } else if (p.AR == "AssignRead") {
108
+ inner = $X('<circle xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" cx="' + (p.x + iconsize/2) + '" cy="' + pos + '" r="' + (iconsize / 2) + '" class="resource-point both"></circle>');
109
+ } else if (p.AR == "ReadAssign") {
110
+ inner = $X('<circle xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" cx="' + (p.x + iconsize/2) + '" cy="' + pos + '" r="' + (iconsize / 2) + '" class="resource-point both"></circle>');
111
+ if (pos == p.y0) { firstAssignFlag = true; }
112
+ }
113
+
114
+ // extend the bars
115
+ if (pos > p.ymax) {
116
+ p.ymax = pos;
117
+ }
118
+
119
+ inner.append($X('<text xmlns="http://www.w3.org/2000/svg"></text>').text(k));
120
+ tsvg.append(inner);
121
+ }
122
+
123
+ if (firstAssignFlag) {
124
+ // Additional logic and construction of another polygon for orange triangle pointing left in row 0
125
+ p.y0 -= (val.row-1) * dimensions.height;
126
+ if (tcolumnsvgs[col.column][1] == undefined) {
127
+ tcolumnsvgs[col.column][1] = $X('<g xmlns="http://www.w3.org/2000/svg" class="resource-row" element-row="' + 0 + '"></g>');
128
+ }
129
+ tcolumnsvgs[col.column][1].append($X('<polygon xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" points="' + (p.x + iconsize) + ',' + firstpos + ' ' + (p.x) + ',' + (firstpos + iconsize/2) + ' ' + (p.x) + ',' + (firstpos - iconsize/2) + '" class="resource-point write"></polygon>').append($X('<text xmlns="http://www.w3.org/2000/svg"></text>').text(k)));
130
+ }
131
+ cx += iconsize + space;
132
+ count += 1;
133
+ }
134
+
135
+ if (tsvg.children().length > 0) {
136
+ tcolumnsvgs[col.column][val.row] = tsvg;
137
+ }
138
+ } else {
139
+ tsvg = $X('<text class="label" element-id="' + val.element_id + '" x="' + space + '" y="' + (dimensions.height * val.row - dimensions.height_shift) + '" xmlns="http://www.w3.org/2000/svg"></text>')
140
+ tsvg.text(col.value);
141
+ tsvg.mouseover(function(ev){ manifestation.events.mouseover($(ev.currentTarget).attr('element-id')); });
142
+ tsvg.mouseout(function(ev){ manifestation.events.mouseout($(ev.currentTarget).attr('element-id')); });
143
+ tsvg.click(function(ev){ manifestation.events.click($(ev.currentTarget).attr('element-id'),ev); });
144
+ tcolumnsvgs[col.column][val.row] = tsvg;
145
+ }
146
+
147
+ tcolumncount[col.column] += 1;
148
+ }
149
+ };
150
+ }
151
+ };
152
+
153
+ graphrealization.illustrator.svg.label_container.css({
154
+ 'grid-template-rows': (dimensions.height_shift/2) + 'px repeat(' + max.row + ', 1fr) ' + (dimensions.height_shift/2) + 'px',
155
+ 'grid-template-columns': 'max-content' + (tcolumns.length > 0 ? ' repeat(' + tcolumns.length.toString() + ',max-content)' : '') + ' auto'
156
+ });
157
+
158
+ tcolumns.forEach(h => {
159
+ if (Object.keys(tcolumnsvgs[h]).length > 0) {
160
+ const svgcolumn = $X('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" class="labelsrow"></svg>');
161
+ const svgback = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
162
+ const svgfront = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
163
+ let xwidth = 0;
164
+ svgcolumn.append(svgback);
165
+ svgcolumn.append(svgfront);
166
+ svgcolumn.css('grid-row', '1/span ' + (max.row + 2))
167
+ svgcolumn.css('grid-column', tcolumns.indexOf(tcolumns.first) + 2);
168
+ svgcolumn.attr('height', graphrealization.illustrator.svg.container.attr('height'));
169
+ graphrealization.illustrator.svg.label_container.append(svgcolumn);
170
+
171
+ for (var i = 0; i < max.row; i++) {
172
+ let node = svgfront.append($(tcolumnsvgs[h][i+1]));
173
+ if (xwidth < node[0].getBBox().width) { xwidth = node[0].getBBox().width; }
174
+ }
175
+ xwidth = xwidth + 2 * space;
176
+ if (striped == true) {
177
+ for (var i = 0; i < max.row; i++) {
178
+ svgback.append($X('<rect xmlns="http://www.w3.org/2000/svg" element-row="' + i + '" class="stripe ' + (i % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + (dimensions.height * i + dimensions.height_shift/2) + '" width="' + (xwidth + 1) + '" height="' + dimensions.height + '"></rect>'));
179
+ svgback.append($X('<rect xmlns="http://www.w3.org/2000/svg" element-row="' + i + '" class="border" x="0" y="' + (dimensions.height * i + dimensions.height_shift/2) + '" height="' + dimensions.height + '" width="1"></rect>'));
180
+ }
181
+ }
182
+ if (tcolumntype[h] == 'resource' || tcolumntype[h] == 'bodsod') {
183
+ let count = 0;
184
+ for (const [k, p] of mapPoints) {
185
+ svgback.append($X('<line xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" x1="' + (p.x + iconsize/2) + '" y1="' + p.y0 + '" x2="' + (p.x + iconsize/2) + '" y2="' + (p.ymax + 0.01) + '" class="' + tcolumntype[h] + '-column" stroke-width="' + iconsize + '"><text>' + k + '</text></line>'));
186
+ count += 1;
187
+ }
188
+ }
189
+
190
+ $('.resource-label').hide(); // Speech Bubble hide by default
191
+
192
+ svgcolumn.attr('width', xwidth);
193
+ }
194
+ });
195
+
196
+ return tcolumns.length;
197
+ }
198
+
199
+ $(document).ready(function() {
200
+ var current_label;
201
+ var clicked_label;
202
+ $('#graphgrid').on('mouseout','svg .resource-column, svg .resource-point',(data)=>{
203
+ if (clicked_label != current_label) {
204
+ $('.displaylabel').remove();
205
+ clicked_label = undefined;
206
+ current_label = undefined;
207
+ }
208
+ });
209
+ $('#graphcolumn').scroll((data)=>{
210
+ if (current_label != undefined) {
211
+ $('.displaylabel').remove();
212
+ show_dataflow_row_label(current_label);
213
+ }
214
+ });
215
+ $('#graphgrid').on('click','svg .resource-column',(data)=>{
216
+ show_dataflow_row_label(data.target);
217
+ current_label = data.target;
218
+ clicked_label = data.target;
219
+ });
220
+ $('#graphgrid').on('mouseover','svg .resource-column',(data)=>{
221
+ show_dataflow_row_label(data.target);
222
+ current_label = data.target;
223
+ });
224
+ $('#graphgrid').on('mouseover','svg .resource-point',(ev)=>{
225
+ let rc = $(ev.target).attr('resource-column');
226
+ let data = $('.resource-column[resource-column=' + rc + ']')[0];
227
+ show_dataflow_row_label(data);
228
+ current_label = data;
229
+ // let pos = data.target.getBoundingClientRect();
230
+ // let text = $('text',data.target).text();
231
+ // show_dataflow_label(pos.x + 12, pos.y + 5, 60, text);
232
+ });
233
+ });
@@ -19,6 +19,7 @@ var save = {};
19
19
  save['attributes'] = undefined;
20
20
  save['attributes_raw'] = {};
21
21
  var node_state = {};
22
+ var debug = false;
22
23
 
23
24
  function global_init() {
24
25
  suspended_redrawing = false;
@@ -102,6 +103,7 @@ function cockpit() { //{{{
102
103
  $("button[name=loadmodelfile]").click(load_modelfile);
103
104
  $("button[name=loadmodeltype]").click(function(e){new CustomMenu(e).menu($('#modeltypes'),load_modeltype, $("button[name=loadmodeltype]")); });
104
105
  $("button[name=savetestsetfile]").click(function(){ save_testsetfile(); });
106
+ $("button[name=savebpmnfile]").click(function(){ save_bpmnfile(); });
105
107
  $("button[name=savesvgfile]").click(function(){ save_svgfile(); });
106
108
  $("button[name=state_start]").click(function(){ $(this).parent().find('button').attr("disabled","disabled");start_instance(); });
107
109
  $("button[name=state_stop]").click(function(){ $(this).parent().find('button').attr("disabled","disabled");stop_instance(); });
@@ -149,6 +151,7 @@ function cockpit() { //{{{
149
151
  graph_highlight = graph_highlight[0];
150
152
  }
151
153
  }
154
+ if ('debug' in q) { debug = true; }
152
155
  if (q.monitor && q.load) {
153
156
  if (q.load.match(/https?:\/\//)) {
154
157
  $('body').attr('load-testset',q.load);
@@ -398,8 +401,9 @@ function monitor_instance(cin,rep,load,exec) {// {{{
398
401
  $("#current-track").attr('href','track.html?monitor=' + url);
399
402
  $("#current-index").show();
400
403
  $("#current-index").attr('href','index.html?monitor=' + url);
404
+
401
405
  var q = $.parseQuerySimple();
402
- history.replaceState({}, '', '?' + (graph_position ? "position=" + graph_position + "&" : "") + (graph_highlight ? "highlight=" + graph_highlight + "&" : "") + (graph_theme ? "theme=" + graph_theme + "&" : "") + (q.min || q.min=="" ? "min&" : "") + 'monitor='+url);
406
+ history.replaceState({}, '', '?' + ('debug' in q ? "debug&" : "") + (graph_position ? "position=" + graph_position + "&" : "") + (graph_highlight ? "highlight=" + graph_highlight + "&" : "") + (graph_theme ? "theme=" + graph_theme + "&" : "") + (q.min || q.min=="" ? "min&" : "") + 'monitor='+url);
403
407
 
404
408
  // Change url to return to current instance when reloading (because new subscription is made)
405
409
  $("input[name=votecontinue]").prop( "checked", false );
@@ -611,165 +615,12 @@ function adaptor_init(url,theme,dslx) { //{{{
611
615
  })
612
616
  }
613
617
 
614
- // labels
615
- $('#graphcanvas').css('grid-row', '1/span ' + (max.row + 2));
616
- if (striped == true) {
617
- if (!$('#graphgrid').hasClass('striped')) {
618
- $('#graphgrid').addClass('striped');
619
- }
620
- } else {
621
- $('#graphgrid').removeClass('striped');
622
- }
623
-
624
- $('.labelsrow, #graphgrid .graphlast').remove();
625
- let tcolumns = [];
626
- let tcolumntype = {};
627
- let tcolumncount = {}
628
-
629
- const mapPoints = new Map();
630
- const tcolumnsvgs = {};
631
- const iconsize = 10;
632
- const space = 5;
633
-
634
- _.each(labels,function(val){
635
- if (val.label != "") {
636
- _.each(val.label,function(col) {
637
- if (!tcolumns.includes(col.column)) {
638
- tcolumns.push(col.column);
639
- tcolumncount[col.column] = 0;
640
- tcolumnsvgs[col.column] = {};
641
- }
642
- if (tcolumntype[col.column] == undefined && col.type != undefined) {
643
- tcolumntype[col.column] = col.type;
644
- }
645
- if (col.value != undefined) {
646
- let pos = dimensions.height_shift/2 + dimensions.height * (val.row - 1) + (dimensions.height / 2);
647
- let firstpos = dimensions.height_shift/2 + (dimensions.height / 2);
648
-
649
- if (col.type == "resource") {
650
- for (const [k, v] of Object.entries(col.value)) {
651
- var p = { AR: v };
652
- if (!mapPoints.has(k)) {
653
- p.y0 = p.y0 == undefined ? pos : p.y0;
654
- p.ymax = (p.ymax == undefined) ? p.y0 : p.ymax;
655
- } else {
656
- p.y0 = mapPoints.get(k).y0;
657
- p.ymax = mapPoints.get(k).ymax;
658
- }
659
- mapPoints.set(k, p);
660
- }
661
-
662
- let tsvg = $X('<g xmlns="http://www.w3.org/2000/svg" class="resource-row" element-row="' + (val.row-1) + '"></g>');
663
-
664
- var cx = space;
665
- var count = 0;
666
- for (const [k, p] of mapPoints) {
667
- let firstAssignFlag = false;
668
- p.x = cx;
669
-
670
- // Including Triangle
671
- if (k in col.value) { // Define points for a triangle pointing to the right
672
- let inner;
673
-
674
- if (p.AR == "Read") {
675
- inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" points="' + (p.x) + ',' + pos + ' ' + (p.x + iconsize) + ',' + (pos + iconsize/2) + ' ' + (p.x + iconsize) + ',' + (pos - iconsize/2) + '" class="resource-point read"></polygon>');
676
- if (pos == p.y0) { firstAssignFlag = true; }
677
- } else if (p.AR == "Assign") { // Define points for a triangle pointing to the left
678
- inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" points="' + (p.x + iconsize) + ',' + pos + ' ' + (p.x) + ',' + (pos + iconsize/2) + ' ' + (p.x) + ',' + (pos - iconsize/2) + '" class="resource-point write"></polygon>');
679
- } else if (p.AR == "AssignRead") {
680
- inner = $X('<circle xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" cx="' + (p.x + iconsize/2) + '" cy="' + pos + '" r="' + (iconsize / 2) + '" class="resource-point both"></circle>');
681
- } else if (p.AR == "ReadAssign") {
682
- inner = $X('<circle xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" cx="' + (p.x + iconsize/2) + '" cy="' + pos + '" r="' + (iconsize / 2) + '" class="resource-point both"></circle>');
683
- if (pos == p.y0) { firstAssignFlag = true; }
684
- }
685
-
686
- // extend the bars
687
- if (pos > p.ymax) {
688
- p.ymax = pos;
689
- }
690
-
691
- inner.append($X('<text xmlns="http://www.w3.org/2000/svg"></text>').text(k));
692
- tsvg.append(inner);
693
- }
694
-
695
- if (firstAssignFlag) {
696
- // Additional logic and construction of another polygon for orange triangle pointing left in row 0
697
- p.y0 -= (val.row-1) * dimensions.height;
698
- if (tcolumnsvgs[col.column][1] == undefined) {
699
- tcolumnsvgs[col.column][1] = $X('<g xmlns="http://www.w3.org/2000/svg" class="resource-row" element-row="' + 0 + '"></g>');
700
- }
701
- tcolumnsvgs[col.column][1].append($X('<polygon xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" points="' + (p.x + iconsize) + ',' + firstpos + ' ' + (p.x) + ',' + (firstpos + iconsize/2) + ' ' + (p.x) + ',' + (firstpos - iconsize/2) + '" class="resource-point write"></polygon>').append($X('<text xmlns="http://www.w3.org/2000/svg"></text>').text(k)));
702
- }
703
- cx += iconsize + space;
704
- count += 1;
705
- }
706
-
707
- if (tsvg.children().length > 0) {
708
- tcolumnsvgs[col.column][val.row] = tsvg;
709
- }
710
- } else {
711
- tsvg = $X('<text class="label" element-id="' + val.element_id + '" x="' + space + '" y="' + (dimensions.height * val.row - dimensions.height_shift) + '" xmlns="http://www.w3.org/2000/svg"></text>')
712
- tsvg.text(col.value);
713
- tsvg.mouseover(function(ev){ manifestation.events.mouseover($(ev.currentTarget).attr('element-id')); });
714
- tsvg.mouseout(function(ev){ manifestation.events.mouseout($(ev.currentTarget).attr('element-id')); });
715
- tsvg.click(function(ev){ manifestation.events.click($(ev.currentTarget).attr('element-id'),ev); });
716
- tcolumnsvgs[col.column][val.row] = tsvg;
717
- }
718
-
719
- tcolumncount[col.column] += 1;
720
- }
721
- });
722
- }
723
- });
724
-
725
- $('#graphgrid').css({
726
- 'grid-template-rows': (dimensions.height_shift/2) + 'px repeat(' + max.row + ', 1fr) ' + (dimensions.height_shift/2) + 'px',
727
- 'grid-template-columns': 'max-content' + (tcolumns.length > 0 ? ' repeat(' + tcolumns.length.toString() + ',max-content)' : '') + ' auto'
728
- });
729
-
730
- tcolumns.forEach(h => {
731
- if (Object.keys(tcolumnsvgs[h]).length > 0) {
732
- const svgcolumn = $X('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" class="labelsrow"></svg>');
733
- const svgback = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
734
- const svgfront = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
735
- let xwidth = 0;
736
- svgcolumn.append(svgback);
737
- svgcolumn.append(svgfront);
738
- svgcolumn.css('grid-row', '1/span ' + (max.row + 2))
739
- svgcolumn.css('grid-column', tcolumns.indexOf(tcolumns.first) + 2);
740
- svgcolumn.attr('height', $('#graphcanvas').attr('height'));
741
- $('#graphgrid').append(svgcolumn);
742
-
743
- for (var i = 0; i < max.row; i++) {
744
- let node = svgfront.append($(tcolumnsvgs[h][i+1]));
745
- if (xwidth < node[0].getBBox().width) { xwidth = node[0].getBBox().width; }
746
- }
747
- xwidth = xwidth + 2 * space;
748
- if (striped == true) {
749
- for (var i = 0; i < max.row; i++) {
750
- svgback.append($X('<rect xmlns="http://www.w3.org/2000/svg" element-row="' + i + '" class="stripe ' + (i % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + (dimensions.height * i + dimensions.height_shift/2) + '" width="' + (xwidth + 1) + '" height="' + dimensions.height + '"></rect>'));
751
- svgback.append($X('<rect xmlns="http://www.w3.org/2000/svg" element-row="' + i + '" class="border" x="0" y="' + (dimensions.height * i + dimensions.height_shift/2) + '" height="' + dimensions.height + '" width="1"></rect>'));
752
- }
753
- }
754
- if (tcolumntype[h] == 'resource' || tcolumntype[h] == 'bodsod') {
755
- let count = 0;
756
- for (const [k, p] of mapPoints) {
757
- svgback.append($X('<line xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" x1="' + (p.x + iconsize/2) + '" y1="' + p.y0 + '" x2="' + (p.x + iconsize/2) + '" y2="' + (p.ymax + 0.01) + '" class="' + tcolumntype[h] + '-column" stroke-width="' + iconsize + '"><text>' + k + '</text></line>'));
758
- count += 1;
759
- }
760
- }
761
-
762
- $('.resource-label').hide(); // Speech Bubble hide by default
763
-
764
- svgcolumn.attr('width', xwidth);
765
- }
766
- });
618
+ columns = draw_extended_columns(graphrealization,max,labels,dimensions,striped);
767
619
 
768
620
  // Add the last stripe
769
- var j = tcolumns.length;
770
621
  for (var i = 0; i < max.row; i++) {
771
- var ele = $('<div element-row="' + i + '" class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; height: ' + dimensions.stripe_height + 'px">&#032;</div>');
772
- $('#graphgrid').append(ele);
622
+ var ele = $('<div element-row="' + i + '" class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (columns+2) + '; grid-row: ' + (i+2) + '; height: ' + dimensions.stripe_height + 'px">&#032;</div>');
623
+ graphrealization.illustrator.svg.label_container.append(ele);
773
624
  }
774
625
  }; //}}}
775
626
  graphrealization.set_svg_container($('#graphcanvas'));
@@ -968,7 +819,6 @@ function monitor_instance_pos_change(content) {// {{{
968
819
  }
969
820
  } // }}}
970
821
 
971
-
972
822
  function monitor_instance_state_change(notification) { //{{{
973
823
  // sometimes, out of sheer network routingness, stopping comes after stopped, which fucks the UI hard
974
824
  // thus, we are having none of it
@@ -1208,11 +1058,30 @@ function save_svgfile() {// {{{
1208
1058
  },
1209
1059
  error: report_failure
1210
1060
  });
1061
+ } // }}}
1062
+
1063
+ function save_bpmnfile() {// {{{
1064
+ var url = $('body').attr('current-instance');
1065
+
1066
+ let dpm = JSON.parse($('svg[data-pos-matrix]').attr('data-pos-matrix'));
1067
+ let dcl = JSON.parse($('svg[data-con-list]').attr('data-con-list'));
1068
+
1069
+ let david = david_bpmn_convert(dpm,dcl);
1070
+
1071
+ $.ajax({
1072
+ type: "GET",
1073
+ url: url + "/properties/attributes/info/",
1074
+ success: function(res){
1075
+ $('#savebpmnfile').attr('download',res + '.bpmn');
1076
+ $('#savebpmnfile').attr('href','data:application/xml;charset=utf-8;base64,' + $B64(david.serializePrettyXML()));
1077
+ document.getElementById('savebpmnfile').click();
1078
+ },
1079
+ error: report_failure
1080
+ });
1211
1081
  }// }}}
1212
1082
  async function set_testset(testset,exec) {// {{{
1213
1083
  var url = $('body').attr('current-instance');
1214
-
1215
- var promises = [];
1084
+ var promises;
1216
1085
 
1217
1086
  var tset = $X('<properties xmlns="http://cpee.org/ns/properties/2.0"/>');
1218
1087
  tset.append($("testset > executionhandler",testset));
@@ -1227,6 +1096,7 @@ async function set_testset(testset,exec) {// {{{
1227
1096
  $('properties > attributes > design_dir',tset).remove();
1228
1097
  }
1229
1098
 
1099
+ promises = [];
1230
1100
  promises.push(
1231
1101
  $.ajax({
1232
1102
  type: "GET",
@@ -1241,6 +1111,9 @@ async function set_testset(testset,exec) {// {{{
1241
1111
  await load_testset_handlers(url,testset,vals);
1242
1112
  })
1243
1113
  );
1114
+ await Promise.all(promises);
1115
+
1116
+ promises = [];
1244
1117
  promises.push(
1245
1118
  $.ajax({
1246
1119
  type: 'PATCH',
@@ -1254,7 +1127,6 @@ async function set_testset(testset,exec) {// {{{
1254
1127
  error: report_failure
1255
1128
  })
1256
1129
  );
1257
-
1258
1130
  await Promise.all(promises);
1259
1131
 
1260
1132
  document.dispatchEvent(model_loaded);
@@ -239,6 +239,11 @@ function WfIllustrator(wf_adaptor) { // View {{{
239
239
  ' <clipPath id="endclip">' +
240
240
  ' <rect x="20" y="-1" width="' + self.endclipshift + '" height="35"/>' +
241
241
  ' </clipPath>' +
242
+ ' <linearGradient id="custom-gradient" x2="0.35" y2="1">' +
243
+ ' <stop offset="0%" stop-color="var(--wfadaptor-background)"/>' +
244
+ ' <stop offset="50%" stop-color="var(--custom-color)"/>' +
245
+ ' <stop offset="100%" stop-color="var(--custom-color)"/>' +
246
+ ' </linearGradient>' +
242
247
  '</defs>'));
243
248
  self.svg.defs = {};
244
249
  self.svg.defs['unknown'] = $X('<g xmlns="http://www.w3.org/2000/svg" class="unknown">' +
@@ -292,10 +297,11 @@ function WfIllustrator(wf_adaptor) { // View {{{
292
297
  $('> :not(defs)', self.svg.container).each(function() {$(this).remove()});
293
298
  $('> defs > [belongs-to=element]', self.svg.container).each(function() {$(this).remove()});
294
299
  self.dim.symbols = [];
300
+ self.dim.connections = [];
295
301
  } // }}}
296
302
  var get_symbol = this.get_symbol = function() { // {{{
297
303
  } // }}}
298
- var get_properties = this.get_symbol = function() { // {{{
304
+ var get_properties = this.get_properties = function() { // {{{
299
305
  } // }}}
300
306
 
301
307
  // Helper Functions {{{
@@ -360,7 +366,7 @@ function WfIllustrator(wf_adaptor) { // View {{{
360
366
  self.dim.symbols[row][col].type = sname;
361
367
  // console.log('set_x ',row,col,debug_dim());
362
368
  } //}}}
363
- var set_x_cond = this.dim.set_x_cond = function(row,col,tx,twidth,sname,label,subtype) { //{{{
369
+ var set_x_cond = this.dim.set_x_cond = function(row,col,tx,twidth,sname,label,subtype,sty,eid) { //{{{
364
370
  if (!self.dim.symbols[row]) { self.dim.symbols[row] = []; }
365
371
  if (!self.dim.symbols[row][col] || self.dim.symbols[row][col].width < twidth) {
366
372
  self.dim.symbols[row][col] = {};
@@ -370,6 +376,10 @@ function WfIllustrator(wf_adaptor) { // View {{{
370
376
  self.dim.symbols[row][col].type = sname;
371
377
  self.dim.symbols[row][col].label = label;
372
378
  self.dim.symbols[row][col].subtype = subtype;
379
+ self.dim.symbols[row][col].eid = eid;
380
+ for (const s in sty) {
381
+ self.dim.symbols[row][col][s] = sty[s];
382
+ }
373
383
  // console.log('set_x_cond',row,col,debug_dim());
374
384
  } //}}}
375
385
 
@@ -595,6 +605,14 @@ function WfIllustrator(wf_adaptor) { // View {{{
595
605
  }
596
606
  }
597
607
 
608
+ sym.attr('class','activities');
609
+ let sty = { ...self.global_style, ...style };
610
+ for (const s in sty) {
611
+ $('.colorstyle', sym).each((_,ele) => {
612
+ $(ele).css(s,sty[s]);
613
+ });
614
+ }
615
+
598
616
  var tit = $X('<title xmlns="http://www.w3.org/2000/svg"></title>');
599
617
  tit.text(title);
600
618
  sym.prepend(tit);
@@ -662,7 +680,7 @@ function WfIllustrator(wf_adaptor) { // View {{{
662
680
  if (xtr.length > 0) {
663
681
  xtr.attr('transform','translate(' + (pos.x + width - self.endclipshift - 4) + ',0)');
664
682
  }
665
- set_x_cond(row,col,dstart,pos.x + width - self.endclipshift - 4 + this.get_width(end) + 2 * self.width_shift_label,sname,title,subtype);
683
+ set_x_cond(row,col,dstart,pos.x + width - self.endclipshift - 4 + this.get_width(end) + 2 * self.width_shift_label,sname,title,subtype,sty,id);
666
684
  } else {
667
685
  let tdim = 0;
668
686
  if (self.rotated_labels && self.elements[sname].rotatelabels != false) {
@@ -671,14 +689,14 @@ function WfIllustrator(wf_adaptor) { // View {{{
671
689
  } else {
672
690
  tdim = self.width + width + self.width_shift_label;
673
691
  }
674
- set_x_cond(row,col,dstart,tdim,sname,title,subtype);
692
+ set_x_cond(row,col,dstart,tdim,sname,title,subtype,sty,id);
675
693
  }
676
694
  } else {
677
- set_x_cond(row,col,dstart,self.width,sname,title,subtype);
695
+ set_x_cond(row,col,dstart,self.width,sname,title,subtype,sty,id);
678
696
  }
679
697
  if (nor.length > 0) { nor.remove(); }
680
698
  } else {
681
- set_x_cond(row,col,dstart,self.width,sname,title,subtype);
699
+ set_x_cond(row,col,dstart,self.width,sname,title,subtype,sty,id);
682
700
  if (sta.length > 0) { sta.remove(); }
683
701
  if (mid.length > 0) { mid.remove(); }
684
702
  if (end.length > 0) { end.remove(); }
@@ -687,16 +705,9 @@ function WfIllustrator(wf_adaptor) { // View {{{
687
705
  $('.part-start',sym).remove();
688
706
  $('.part-middle',sym).remove();
689
707
  $('.part-end',sym).remove();
690
- set_x_cond(row,col,dstart,self.width,sname,title,subtype);
708
+ set_x_cond(row,col,dstart,self.width,sname,title,subtype,sty,id);
691
709
  }
692
710
 
693
- sym.attr('class','activities');
694
- let sty = { ...self.global_style, ...style };
695
- for (const s in sty) {
696
- $('.colorstyle', sym).each((_,ele) => {
697
- $(ele).css(s,sty[s]);
698
- });
699
- }
700
711
 
701
712
  $(g[0].childNodes[0]).append(sym);
702
713
  if (!addition) {
data/cockpit/llm.html CHANGED
@@ -54,7 +54,7 @@
54
54
  <script type="text/javascript" src="js/instance.js"></script>
55
55
  <script type="text/javascript" src="js/details.js"></script>
56
56
  <script type="text/javascript" src="js/parameters.js"></script>
57
- <script type="text/javascript" src="js/resources.js"></script>
57
+ <script type="text/javascript" src="js/extended_columns.js"></script>
58
58
  <script type="text/javascript" src="js/modifiers.js"></script>
59
59
  <script type="text/javascript" src="themes/base.js"></script>
60
60
 
@@ -62,8 +62,8 @@
62
62
  <link rel="stylesheet" href="css/llm.css" type="text/css"/>
63
63
 
64
64
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
65
- <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
66
- <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
65
+ <link rel="stylesheet" href="css/extended_columns-label.css" type="text/css"/>
66
+ <link rel="stylesheet" href="css/extended_columns-svg.css" type="text/css" data-include-export="true"/>
67
67
  <link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
68
68
  <style>
69
69
  /* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
@@ -58,14 +58,14 @@
58
58
  <script type="text/javascript" src="js/instance.js"></script>
59
59
  <script type="text/javascript" src="js/details.js"></script>
60
60
  <script type="text/javascript" src="js/parameters.js"></script>
61
- <script type="text/javascript" src="js/resources.js"></script>
61
+ <script type="text/javascript" src="js/extended_columns.js"></script>
62
62
  <script type="text/javascript" src="js/modifiers.js"></script>
63
63
  <script type="text/javascript" src="themes/base.js"></script>
64
64
 
65
65
 
66
66
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
67
- <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
68
- <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
67
+ <link rel="stylesheet" href="css/extended_columns-label.css" type="text/css"/>
68
+ <link rel="stylesheet" href="css/extended_columns-svg.css" type="text/css" data-include-export="true"/>
69
69
  <link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
70
70
  <style>
71
71
  /* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */