cpee 2.1.51 → 2.1.52

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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/css/resources.css +42 -0
  3. data/cockpit/css/ui.css +4 -0
  4. data/cockpit/index.html +3 -0
  5. data/cockpit/js/details.js +5 -0
  6. data/cockpit/js/instance.js +253 -62
  7. data/cockpit/js/modifiers.js +8 -1
  8. data/cockpit/js/resources.js +16 -0
  9. data/cockpit/js/wfadaptor.js +3 -3
  10. data/cockpit/templates/Coopis 2010.xml +7 -1
  11. data/cockpit/themes/compact/rngs/call.rng +3 -1
  12. data/cockpit/themes/compact/rngs/callmanipulate.rng +3 -1
  13. data/cockpit/themes/compact/theme.js +1 -1
  14. data/cockpit/themes/control/rngs/call.rng +3 -1
  15. data/cockpit/themes/control/rngs/callmanipulate.rng +3 -1
  16. data/cockpit/themes/control/theme.js +1 -1
  17. data/cockpit/themes/dataflow/rngs/alternative.rng +25 -0
  18. data/cockpit/themes/dataflow/rngs/call.rng +228 -0
  19. data/cockpit/themes/dataflow/rngs/callmanipulate.rng +257 -0
  20. data/cockpit/themes/dataflow/rngs/choose.rng +14 -0
  21. data/cockpit/themes/dataflow/rngs/closed_loop.rng +62 -0
  22. data/cockpit/themes/dataflow/rngs/closed_loop_cancel.rng +5 -0
  23. data/cockpit/themes/dataflow/rngs/closed_loop_control.rng +31 -0
  24. data/cockpit/themes/dataflow/rngs/closed_loop_measuring.rng +12 -0
  25. data/cockpit/themes/dataflow/rngs/critical.rng +5 -0
  26. data/cockpit/themes/dataflow/rngs/escape.rng +1 -0
  27. data/cockpit/themes/dataflow/rngs/group.rng +3 -0
  28. data/cockpit/themes/dataflow/rngs/loop.rng +22 -0
  29. data/cockpit/themes/dataflow/rngs/manipulate.rng +9 -0
  30. data/cockpit/themes/dataflow/rngs/otherwise.rng +22 -0
  31. data/cockpit/themes/dataflow/rngs/parallel.rng +27 -0
  32. data/cockpit/themes/dataflow/rngs/parallel_branch.rng +2 -0
  33. data/cockpit/themes/dataflow/rngs/scripts.rng +23 -0
  34. data/cockpit/themes/dataflow/rngs/start.rng +121 -0
  35. data/cockpit/themes/dataflow/rngs/stop.rng +5 -0
  36. data/cockpit/themes/dataflow/rngs/terminate.rng +1 -0
  37. data/cockpit/themes/dataflow/symbols/alternative.svg +5 -0
  38. data/cockpit/themes/dataflow/symbols/arrow.svg +3 -0
  39. data/cockpit/themes/dataflow/symbols/call.svg +6 -0
  40. data/cockpit/themes/dataflow/symbols/call_sensor.svg +9 -0
  41. data/cockpit/themes/dataflow/symbols/callmanipulate.svg +8 -0
  42. data/cockpit/themes/dataflow/symbols/callmanipulate_sensor.svg +11 -0
  43. data/cockpit/themes/dataflow/symbols/choose.svg +5 -0
  44. data/cockpit/themes/dataflow/symbols/choose_exclusive.svg +5 -0
  45. data/cockpit/themes/dataflow/symbols/choose_inclusive.svg +4 -0
  46. data/cockpit/themes/dataflow/symbols/closed_loop.svg +5 -0
  47. data/cockpit/themes/dataflow/symbols/closed_loop_cancel.svg +5 -0
  48. data/cockpit/themes/dataflow/symbols/closed_loop_control.svg +5 -0
  49. data/cockpit/themes/dataflow/symbols/closed_loop_measuring.svg +6 -0
  50. data/cockpit/themes/dataflow/symbols/complex.svg +8 -0
  51. data/cockpit/themes/dataflow/symbols/critical.svg +4 -0
  52. data/cockpit/themes/dataflow/symbols/delete.svg +4 -0
  53. data/cockpit/themes/dataflow/symbols/end.svg +3 -0
  54. data/cockpit/themes/dataflow/symbols/escape.svg +5 -0
  55. data/cockpit/themes/dataflow/symbols/event_end.svg +3 -0
  56. data/cockpit/themes/dataflow/symbols/loop.svg +5 -0
  57. data/cockpit/themes/dataflow/symbols/manipulate.svg +4 -0
  58. data/cockpit/themes/dataflow/symbols/otherwise.svg +5 -0
  59. data/cockpit/themes/dataflow/symbols/parallel.svg +5 -0
  60. data/cockpit/themes/dataflow/symbols/parallel_branch.svg +5 -0
  61. data/cockpit/themes/dataflow/symbols/parallel_branch_compact.svg +4 -0
  62. data/cockpit/themes/dataflow/symbols/parallel_branch_event.svg +14 -0
  63. data/cockpit/themes/dataflow/symbols/parallel_branch_normal.svg +5 -0
  64. data/cockpit/themes/dataflow/symbols/parallel_eventbased_exclusive.svg +9 -0
  65. data/cockpit/themes/dataflow/symbols/parallel_eventbased_parallel.svg +8 -0
  66. data/cockpit/themes/dataflow/symbols/scripts.svg +4 -0
  67. data/cockpit/themes/dataflow/symbols/start.svg +3 -0
  68. data/cockpit/themes/dataflow/symbols/start_event.svg +5 -0
  69. data/cockpit/themes/dataflow/symbols/stop.svg +5 -0
  70. data/cockpit/themes/dataflow/symbols/terminate.svg +4 -0
  71. data/cockpit/themes/dataflow/symbols/test.svg +74 -0
  72. data/cockpit/themes/dataflow/theme.js +1556 -0
  73. data/cockpit/themes/default/rngs/call.rng +3 -1
  74. data/cockpit/themes/default/rngs/callmanipulate.rng +3 -1
  75. data/cockpit/themes/default/theme.js +1 -1
  76. data/cockpit/themes/extended/rngs/call.rng +3 -1
  77. data/cockpit/themes/extended/rngs/callmanipulate.rng +3 -1
  78. data/cockpit/themes/extended/theme.js +1 -1
  79. data/cockpit/themes/model/theme.js +1 -1
  80. data/cockpit/themes/packed/rngs/call.rng +3 -1
  81. data/cockpit/themes/packed/rngs/callmanipulate.rng +3 -1
  82. data/cockpit/themes/packed/theme.js +1 -1
  83. data/cockpit/themes/preset/rngs/call.rng +3 -1
  84. data/cockpit/themes/preset/rngs/callmanipulate.rng +3 -1
  85. data/cockpit/themes/preset/theme.js +1 -1
  86. data/cpee.gemspec +2 -2
  87. data/lib/cpee/message.rb +20 -8
  88. data/lib/cpee/persistence.rb +12 -0
  89. data/lib/properties.xml +1 -1
  90. data/server/executionhandlers/ruby/connection.rb +31 -4
  91. data/tools/cpee +32 -1
  92. metadata +62 -8
  93. data/server/routing/end.pid +0 -1
  94. data/server/routing/forward-events-00.pid +0 -1
  95. data/server/routing/forward-votes.pid +0 -1
  96. data/server/routing/persist.pid +0 -1
@@ -0,0 +1,1556 @@
1
+ function WFAdaptorManifestation(adaptor) {
2
+ var self = this;
3
+
4
+ this.adaptor = adaptor;
5
+ this.resources = {};
6
+ this.elements = {};
7
+ this.events = {};
8
+ this.compact = false;
9
+ this.striped = true;
10
+ this.endpoints = {};
11
+ this.presstimer;
12
+
13
+ //{{{ transform the details data to description parts based on rng
14
+ this.source = function(base,opts) {
15
+ if (base[0].namespaceURI == "http://relaxng.org/ns/structure/1.0") {
16
+ $('#relaxngworker').empty();
17
+ var rngw = new RelaxNGui(base,$('#relaxngworker'),self.adaptor.description.context_eval);
18
+ var nnew = $(rngw.save().documentElement);
19
+ return(nnew);
20
+ } else {
21
+ if (opts && opts == 'clone') {
22
+ base = base.clone();
23
+ if (base.attr('id')) {
24
+ base.attr('id',self.adaptor.description.get_free_id());
25
+ }
26
+ base.find('*[id]').each(function(k,v){
27
+ $(v).attr('id',self.adaptor.description.get_free_id(base));
28
+ });
29
+ }
30
+ return base;
31
+ }
32
+ }; //}}}
33
+ //{{{ Return the svgid for the selected task
34
+ this.selected = function(){
35
+ var svgid = 'unknown';
36
+ _.each(self.adaptor.illustrator.get_elements(),function(value,key) {
37
+ if ($(value).hasClass('selected')) {
38
+ svgid = $(value).attr('element-id');
39
+ }
40
+ });
41
+ return svgid;
42
+ }; //}}}
43
+ //{{{ Return the svgids for all marked tasks
44
+ this.marked = function(){
45
+ var svgid = [];
46
+ _.each(self.adaptor.illustrator.get_elements(),function(value,key) {
47
+ if ($(value).hasClass('marked')) {
48
+ svgid.push($(value).attr('element-id'));
49
+ }
50
+ });
51
+ return svgid;
52
+ }; //}}}
53
+ //{{{ Return the json for all marked tasks
54
+ this.marked_text = function(){
55
+ var nodes = [];
56
+ var markymark = _.uniq(self.marked());
57
+ $(markymark).each(function(key,svgid){
58
+ var node = self.adaptor.description.get_node_by_svg_id(svgid);
59
+ nodes.push($(node).serializePrettyXML());
60
+ });
61
+ return JSON.stringify(nodes);
62
+ }; //}}}
63
+ //{{{ Render the details from rng (right hand side of graph tab)
64
+ this.update_details = function(svgid){
65
+ var tab = $('#dat_details');
66
+ var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
67
+ tab.empty();
68
+ if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
69
+ save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
70
+ var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
71
+ if (save['endpoints_cache'][$(node).attr('endpoint')] && save['endpoints_cache'][$(node).attr('endpoint')].schema) {
72
+ var schema = save['endpoints_cache'][$(node).attr('endpoint')].schema.documentElement;
73
+ $(rng).find(' > element[name="parameters"] > element[name="arguments"]').replaceWith($(schema).clone());
74
+ }
75
+ if (save['endpoints_list'][$(node).attr('endpoint')] && (!save['endpoints_list'][$(node).attr('endpoint')].startsWith('http') || save['endpoints_list'][$(node).attr('endpoint')].match(/^https?-/))) {
76
+ $(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
77
+ }
78
+ save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
79
+ var nn = $X($(node).serializeXML());
80
+ nn.removeAttr('svg-id');
81
+ nn.removeAttr('svg-type');
82
+ nn.removeAttr('svg-subtype');
83
+ nn.removeAttr('svg-label');
84
+ save['details'].content(nn);
85
+ format_visual_forms();
86
+ }
87
+ }; //}}}
88
+
89
+ function copyOrMove(menu,group,xml_node,mode) { //{{{
90
+ var nodes = localStorage.getItem('marked');
91
+
92
+ if (typeof(nodes) != "string") { return; }
93
+
94
+ nodes = JSON.parse(nodes);
95
+ $(nodes).each(function(key,str) {
96
+ nodes[key] = $X(str);
97
+ });
98
+
99
+ var check1 = [];
100
+ var check2 = [];
101
+ $(nodes).each(function(key,node){
102
+ check1.push($(node).attr('svg-type'));
103
+ });
104
+ $(group).each(function(key,value){
105
+ check2.push(value.type);
106
+ });
107
+
108
+ if (nodes.length > 0 && _.uniq(check1).length == _.intersection(check1,check2).length) {
109
+ if (myid == localStorage.getItem('marked_from')) {
110
+ $(nodes).each(function(key,node){
111
+ nodes[key] = self.adaptor.description.get_node_by_svg_id($(node).attr('svg-id'));
112
+ });
113
+ }
114
+ nodes.reverse();
115
+ var iconm = self.resources['arrow'].clone();
116
+ var iconc = self.resources['arrow'].clone();
117
+ iconm.children('.rfill').addClass('menu');
118
+ if (myid == localStorage.getItem('marked_from')) {
119
+ menu.push(
120
+ {
121
+ 'label': '<em>Move Marked Elements</em>',
122
+ 'function_call': mode,
123
+ 'menu_icon': iconm,
124
+ 'type': undefined,
125
+ 'params': [nodes, xml_node]
126
+ }
127
+ );
128
+ }
129
+ menu.push(
130
+ {
131
+ 'label': '<em>Copy Marked Elements</em>',
132
+ 'function_call': mode,
133
+ 'menu_icon': iconc,
134
+ 'type': undefined,
135
+ 'params': [nodes, xml_node, 'clone']
136
+ }
137
+ );
138
+ }
139
+ } //}}}
140
+
141
+ function contextMenuHandling(svgid,e,child,sibling) { //{{{
142
+ if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
143
+
144
+ var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
145
+ var group = null;
146
+ var menu = {};
147
+
148
+ if (child) {
149
+ group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node,'into');
150
+ if(group.length > 0) {
151
+ menu['Insert into'] = group;
152
+ copyOrMove(menu['Insert into'],group,xml_node,self.adaptor.description.insert_first_into);
153
+ }
154
+ if (self.elements[xml_node.get(0).tagName].permissible_children_expert) {
155
+ group = self.elements[xml_node.get(0).tagName].permissible_children_expert(xml_node,'into');
156
+ if(group.length > 0) {
157
+ menu['Insert into (Experts Only!)'] = group;
158
+ copyOrMove(menu['Insert into (Experts Only!)'],group,xml_node,self.adaptor.description.insert_first_into);
159
+ }
160
+ }
161
+ }
162
+ if (sibling) {
163
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node,'after');
164
+ if(group.length > 0) {
165
+ menu['Insert after'] = group;
166
+ copyOrMove(menu['Insert after'],group,xml_node,self.adaptor.description.insert_after);
167
+ }
168
+ if (self.elements[xml_node.parent().get(0).tagName].permissible_children_expert) {
169
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children_expert(xml_node,'after');
170
+ if(group.length > 0) {
171
+ menu['Insert after (Experts Only!)'] = group;
172
+ copyOrMove(menu['Insert after (Experts Only!)'],group,xml_node,self.adaptor.description.insert_after);
173
+ }
174
+ }
175
+ }
176
+
177
+ if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
178
+ var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
179
+ icon.find('.rfill').addClass('menu');
180
+ icon.find('.hfill').addClass('menu');
181
+ menu['Delete'] = [{
182
+ 'label': 'Remove Element',
183
+ 'function_call': function(selector,target,selected){
184
+ del_ui_pos(target)
185
+ self.adaptor.description.remove(selector,target);
186
+ localStorage.removeItem('marked');
187
+ localStorage.removeItem('marked_from');
188
+ },
189
+ 'menu_icon': icon,
190
+ 'type': undefined,
191
+ 'params': [null, xml_node, self.selected()]
192
+ }];
193
+ var nodes = localStorage.getItem('marked');
194
+ nodes = JSON.parse(nodes);
195
+ if (nodes && nodes.length > 0) {
196
+ var icond = self.resources['delete'].clone();
197
+ icond.children('.standfat').addClass('menu');
198
+ menu['Delete'].push({
199
+ 'label': 'Remove Marked Elements',
200
+ 'function_call': function(){
201
+ $(nodes).each(function(key,str) {
202
+ nodes[key] = $X(str);
203
+ });
204
+ $(nodes).each(function(key,node){
205
+ var target = self.adaptor.description.get_node_by_svg_id($(node).attr('svg-id'));
206
+ del_ui_pos(target)
207
+ self.adaptor.description.remove(null,target);
208
+ localStorage.removeItem('marked');
209
+ localStorage.removeItem('marked_from');
210
+ });
211
+ },
212
+ 'menu_icon': icond,
213
+ 'type': undefined,
214
+ 'params': []
215
+ })
216
+ }
217
+ }
218
+ if($('> code', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
219
+ var icon = self.elements.callmanipulate.illustrator.svg.clone();
220
+ icon.children('.rfill:last').addClass('menu');
221
+ menu['Delete'].push({
222
+ 'label': 'Remove Scripts',
223
+ 'function_call': self.adaptor.description.remove,
224
+ 'menu_icon': icon,
225
+ 'type': undefined,
226
+ 'params': ['> code', xml_node]
227
+ });
228
+ }
229
+ if (xml_node.get(0).tagName == "call" || xml_node.get(0).tagName == "manipulate" || xml_node.get(0).tagName == "stop") {
230
+ var icon = self.elements.call.illustrator.svg.clone();
231
+ icon.children('g.replace').addClass('passive');
232
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
233
+ if (vtarget.length > 0) {
234
+ if (vtarget.parents('g.activities.passive, g.activities.active').length > 0) {
235
+ menu['Position'] = [{
236
+ 'label': 'No Execution from here',
237
+ 'function_call': del_ui_pos,
238
+ 'menu_icon': icon,
239
+ 'type': undefined,
240
+ 'params': xml_node
241
+ }];
242
+ } else {
243
+ menu['Position'] = [{
244
+ 'label': 'Execute from here',
245
+ 'function_call': add_ui_pos,
246
+ 'menu_icon': icon,
247
+ 'type': undefined,
248
+ 'params': xml_node
249
+ }];
250
+ }
251
+ }
252
+ }
253
+ new CustomMenu(e).contextmenu(menu);
254
+ } //}}}
255
+
256
+ function positionHandling(svgid) {
257
+ var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
258
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
259
+ if (vtarget.length > 0) {
260
+ if (vtarget.parents('g.activities.passive, g.activities.active').length > 0) {
261
+ del_ui_pos(xml_node);
262
+ } else {
263
+ add_ui_pos(xml_node);
264
+ }
265
+ }
266
+ }
267
+
268
+ // Events
269
+ this.events.touchend = function(svgid, e) { // {{{
270
+ clearTimeout(self.presstimer);
271
+ } // }}}
272
+ this.events.touchstart = function(svgid, e, child, sibling) { // {{{
273
+ self.presstimer = window.setTimeout(function() { contextMenuHandling(svgid,e,child,sibling); },1000);
274
+ return false;
275
+ } // }}}
276
+ this.events.mousedown = function(svgid, e, child, sibling) { // {{{
277
+ if(e.button == 0) { // left-click
278
+ } else if(e.button == 1) { // middle-click
279
+ positionHandling(svgid);
280
+ } else if(e.button == 2) { // right-click
281
+ contextMenuHandling(svgid,e,child,sibling);
282
+ }
283
+ return false;
284
+ } // }}}
285
+ this.events.suppress = function(svgid, e, child, sibling) { // {{{
286
+ return false;
287
+ } // }}}
288
+ this.events.click = function(svgid, e) { // {{{
289
+ if (self.adaptor.description.get_node_by_svg_id(svgid).length == 0) {
290
+ return;
291
+ }
292
+
293
+ self.adaptor.illustrator.get_elements().removeClass('selected');
294
+ self.adaptor.illustrator.get_labels().removeClass('selected');
295
+
296
+ if (e && (e.ctrlKey || e.metaKey)) {
297
+ if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
298
+ var tab = $('#dat_details');
299
+ tab.empty();
300
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
301
+ if (vtarget.length > 0) {
302
+ var vt = vtarget.parents('g.element[element-id]');
303
+ vt.toggleClass('marked');
304
+ if (vt.hasClass('marked')) {
305
+ localStorage.setItem('marked',self.marked_text());
306
+ localStorage.setItem('marked_from',myid);
307
+ } else {
308
+ localStorage.removeItem('marked');
309
+ localStorage.removeItem('marked_from');
310
+ }
311
+ }
312
+ } else if (e && (e.shiftKey)) {
313
+ positionHandling(svgid);
314
+ } else {
315
+ self.adaptor.illustrator.get_elements().removeClass('marked');
316
+ localStorage.removeItem('marked');
317
+ localStorage.removeItem('marked_from');
318
+
319
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
320
+ if (vtarget.length > 0) {
321
+ vtarget.parents('g.element[element-id]').addClass('selected');
322
+ }
323
+ self.adaptor.illustrator.get_label_by_svg_id(svgid).addClass('selected');
324
+
325
+ self.update_details(svgid);
326
+ }
327
+ } // }}}
328
+ this.events.dblclick = function(svgid, e) { // {{{
329
+ } // }}}
330
+ this.events.mouseover = function(svgid, e) { // {{{
331
+ self.adaptor.illustrator.svg.container.find('.tile[element-id = "' + svgid + '"]').css('display','block');
332
+ self.adaptor.illustrator.svg.container.find('[element-id = "' + svgid + '"]').addClass('hover');
333
+ self.adaptor.illustrator.svg.label_container.find('[element-id = "' + svgid + '"]').addClass('hover');
334
+ return false;
335
+ } // }}}
336
+ this.events.mouseout = function(svgid, e) { // {{{
337
+ self.adaptor.illustrator.svg.container.find('.tile[element-id = "' + svgid + '"]').css('display','none');
338
+ self.adaptor.illustrator.svg.container.find('[element-id = "' + svgid + '"]').removeClass('hover');
339
+ self.adaptor.illustrator.svg.label_container.find('[element-id = "' + svgid + '"]').removeClass('hover');
340
+ return false;
341
+ } // }}}
342
+ this.events.dragstart = function (svgid, e) { //{{{
343
+ } //}}}
344
+
345
+ function dataflow_extract(subject,mixed,extract) {
346
+ let dict = {};
347
+ var regassi = /data.([a-zA-Z_]+)\s*(=[^=]|\+\=|\-\=|\*\=|\/\=|<<|>>)/g; // we do not have to check for &gt;/&lt; version of stuff as only conditions are in attributes, and conditions can not contain assignments
348
+ var reg_not_assi = /data.([a-zA-Z_]+)\s*/g;
349
+
350
+ $(subject).each(function(_,ele){
351
+ let item = extract(ele);
352
+ if (mixed && item.length > 0 && item[0].charAt(0) != '!') { return }
353
+
354
+ let indices = [];
355
+ for (const match of item.matchAll(regassi)) {
356
+ indices.push(match.index);
357
+ dict[match[1]] = "Assign";
358
+ }
359
+ for (const match of item.matchAll(reg_not_assi)) {
360
+ const arg1 = match[1];
361
+ if (indices.includes(match.index)) { continue; }
362
+ if (dict[arg1] == "Assign" || dict[arg1] == "AssignRead") {
363
+ dict[arg1] = "AssignRead";
364
+ } else {
365
+ dict[arg1] = "Read";
366
+ }
367
+ }
368
+ });
369
+ return dict;
370
+ }
371
+
372
+ // other resources
373
+ this.resources.arrow = self.adaptor.theme_dir + 'symbols/arrow.svg';
374
+ this.resources.delete = self.adaptor.theme_dir + 'symbols/delete.svg';
375
+
376
+ // Primitive Elements
377
+ this.elements.call = { /*{{{*/
378
+ 'type': 'primitive',
379
+ 'illustrator': {//{{{
380
+ 'endnodes': 'this',
381
+ 'label': function(node){
382
+ var rep = $('body').attr('current-resources');
383
+ var ep = self.endpoints[$(node).attr('endpoint')];
384
+ var wait = $('_timing_wait',$(node).children('annotations')).text();
385
+ var threshold = $('_timing_threshold',$(node).children('annotations')).text();
386
+ var adur = $('_timing_avg',$(node).children('annotations')).text();
387
+ var lab = $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'');
388
+ var ret = [ { column: 'ID', value: $(node).attr('id') } ];
389
+
390
+ // For Blue Points
391
+ let dict1 = dataflow_extract($('arguments > *',$(node).children('parameters')),true,function(target){ return $(target).text(); });
392
+ let dict2 = dataflow_extract($(node).children('code').children(),false,function(target){ return $(target).text(); });
393
+ let dict = {...dict1,...dict2};
394
+ ret.push({ column: 'Dataflow', value: dict, type: 'resource' });
395
+ if (lab != '') {
396
+ ret.unshift( { column: 'Label', value: lab } );
397
+ }
398
+ if (wait != '') {
399
+ ret.push({ column: 'Wait', value: 'ω = ' + wait });
400
+ }
401
+ if (threshold != '') {
402
+ ret.push({ column: 'Threshold', value: 'κ = ' + threshold });
403
+ }
404
+ if (adur != '') {
405
+ ret.push({ column: 'Duration', value: '~T = ' + adur + 'm' });
406
+ }
407
+ return ret;
408
+ },
409
+ 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
410
+ 'resolve_symbol': function(node) {
411
+ if ($('> annotations > _context_data_analysis > probes > probe', node).length > 0) {
412
+ if ($('> code', node).length > 0) {
413
+ return 'callmanipulate_sensor';
414
+ } else {
415
+ return 'call_sensor';
416
+ }
417
+ } else {
418
+ if ($('> code', node).length > 0) {
419
+ return 'callmanipulate';
420
+ } else {
421
+ return 'call';
422
+ }
423
+ }
424
+ },
425
+ 'svg': self.adaptor.theme_dir + 'symbols/call.svg'
426
+ },//}}}
427
+ 'description': self.adaptor.theme_dir + 'rngs/call.rng',
428
+ 'permissible_children': function(node,mode) { //{{{
429
+ if(node.children('code').length < 1)
430
+ return [
431
+ {'label': 'Scripts',
432
+ 'function_call': self.adaptor.description.insert_last_into,
433
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
434
+ 'type': undefined,
435
+ 'params': [self.adaptor.description.elements.scripts, node]}
436
+ ];
437
+ return [];
438
+ }, //}}}
439
+ 'adaptor': {//{{{
440
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
441
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
442
+ 'touchend': self.events.touchend,
443
+ 'click': self.events.click,
444
+ 'dragstart': self.events.dragstart,
445
+ 'mouseover': self.events.mouseover,
446
+ 'mouseout': self.events.mouseout
447
+ }//}}}
448
+ }; /*}}}*/
449
+ this.elements.manipulate = { /*{{{*/
450
+ 'type': 'primitive',
451
+ 'illustrator': {//{{{
452
+ 'endnodes': 'this',
453
+ 'label': function(node){
454
+ var lab = $(node).attr('label');
455
+ if (lab) {
456
+ return [ { column: 'Label', value: lab.replace(/^['"]/,'').replace(/['"]$/,'') }, { column: 'ID', value: $(node).attr('id') } ];
457
+ } else {
458
+ return [ { column: 'ID', value: $(node).attr('id') } ];
459
+ }
460
+ },
461
+ 'svg': self.adaptor.theme_dir + 'symbols/manipulate.svg'
462
+ },//}}}
463
+ 'description': self.adaptor.theme_dir + 'rngs/manipulate.rng',
464
+ 'permissible_children': function(node,mode) { //{{{
465
+ return [];
466
+ }, //}}}
467
+ 'adaptor': {//{{{
468
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
469
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,false,true); },
470
+ 'touchend': self.events.touchend,
471
+ 'click': self.events.click,
472
+ 'mouseover': self.events.mouseover,
473
+ 'mouseout': self.events.mouseout
474
+ }//}}}
475
+ }; /*}}}*/
476
+ this.elements.escape = { /*{{{*/
477
+ 'type': 'primitive',
478
+ 'illustrator': {//{{{
479
+ 'endnodes': 'this',
480
+ 'svg': self.adaptor.theme_dir + 'symbols/escape.svg'
481
+ },//}}}
482
+ 'description': self.adaptor.theme_dir + 'rngs/escape.rng',
483
+ 'permissible_children': function(node,mode) { //{{{
484
+ return [];
485
+ }, //}}}
486
+ 'adaptor': {//{{{
487
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
488
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,false,true); },
489
+ 'touchend': self.events.touchend,
490
+ 'click': self.events.click,
491
+ 'mouseover': self.events.mouseover,
492
+ 'mouseout': self.events.mouseout
493
+ }//}}}
494
+ }; /*}}}*/
495
+ this.elements.stop = { /*{{{*/
496
+ 'type': 'primitive',
497
+ 'illustrator': {//{{{
498
+ 'endnodes': 'this',
499
+ 'label': function(node){
500
+ return [ { column: 'ID', value: $(node).attr('id') } ];
501
+ },
502
+ 'svg': self.adaptor.theme_dir + 'symbols/stop.svg'
503
+ },//}}}
504
+ 'description': self.adaptor.theme_dir + 'rngs/stop.rng',
505
+ 'permissible_children': function(node,mode) { //{{{
506
+ return [];
507
+ }, //}}}
508
+ 'adaptor': {//{{{
509
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
510
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,false,true); },
511
+ 'touchend': self.events.touchend,
512
+ 'click': self.events.click,
513
+ 'mouseover': self.events.mouseover,
514
+ 'mouseout': self.events.mouseout
515
+ }//}}}
516
+ }; /*}}}*/
517
+ this.elements.terminate = { /*{{{*/
518
+ 'type': 'primitive',
519
+ 'illustrator': {//{{{
520
+ 'endnodes': 'this',
521
+ 'final': true,
522
+ 'svg': self.adaptor.theme_dir + 'symbols/terminate.svg'
523
+ },//}}}
524
+ 'description': self.adaptor.theme_dir + 'rngs/terminate.rng',
525
+ 'permissible_children': function(node,mode) { //{{{
526
+ return [];
527
+ }, //}}}
528
+ 'adaptor': {//{{{
529
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,false); },
530
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,false,false); },
531
+ 'touchend': self.events.touchend,
532
+ 'mouseover': self.events.mouseover,
533
+ 'mouseout': self.events.mouseout
534
+ }//}}}
535
+ }; /*}}}*/
536
+ this.elements.end = { /*{{{*/
537
+ 'type': 'primitive',
538
+ 'illustrator': {//{{{
539
+ 'endnodes': 'this',
540
+ 'svg': self.adaptor.theme_dir + 'symbols/end.svg'
541
+ }, //}}}
542
+ 'adaptor': {//{{{
543
+ 'mousedown': function (node,e) { self.events.suppress(); }
544
+ }//}}}
545
+ }; /*}}}*/
546
+ this.elements.event_end = { /*{{{*/
547
+ 'type': 'primitive',
548
+ 'illustrator': {//{{{
549
+ 'endnodes': 'this',
550
+ 'svg': self.adaptor.theme_dir + 'symbols/event_end.svg'
551
+ }, //}}}
552
+ 'adaptor': {//{{{
553
+ 'mousedown': function (node,e) { self.events.suppress(); },
554
+ 'click': self.events.click,
555
+ 'dblclick': self.events.dblclick,
556
+ 'mouseover': self.events.mouseover,
557
+ 'mouseout': self.events.mouseout
558
+ }//}}}
559
+ }; /*}}}*/
560
+ this.elements.choose_finish = { /*{{{*/
561
+ 'type': 'primitive',
562
+ 'illustrator': {//{{{
563
+ 'endnodes': 'this',
564
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg',
565
+ 'resolve_symbol': function(node) {
566
+ if($(node).attr('mode') == 'exclusive') {
567
+ return 'choose_exclusive_finish';
568
+ } else {
569
+ return 'choose_inclusive_finish';
570
+ }
571
+ },
572
+ }, //}}}
573
+ 'adaptor': {//{{{
574
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
575
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
576
+ 'touchend': self.events.touchend,
577
+ 'click': self.events.click,
578
+ 'dblclick': self.events.dblclick,
579
+ 'mouseover': self.events.mouseover,
580
+ 'mouseout': self.events.mouseout
581
+ }//}}}
582
+ }; /*}}}*/
583
+ this.elements.loop_finish = { /*{{{*/
584
+ 'type': 'primitive',
585
+ 'illustrator': {//{{{
586
+ 'endnodes': 'this',
587
+ 'closeblock': true,
588
+ 'label': function(node){
589
+ var avg = $('> _probability_avg',$(node).children('_probability')).text();
590
+ var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
591
+ if (avg != '') {
592
+ ret.push({ column: 'Average', value: avg + 'x' });
593
+ }
594
+ return ret;
595
+ },
596
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg',
597
+ }, //}}}
598
+ 'adaptor': {//{{{
599
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
600
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
601
+ 'touchend': self.events.touchend,
602
+ 'click': self.events.click,
603
+ 'dblclick': self.events.dblclick,
604
+ 'mouseover': self.events.mouseover,
605
+ 'mouseout': self.events.mouseout
606
+ }//}}}
607
+ }; /*}}}*/
608
+ this.elements.parallel_finish = { /*{{{*/
609
+ 'type': 'primitive',
610
+ 'illustrator': {//{{{
611
+ 'endnodes': 'this',
612
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg',
613
+ 'resolve_symbol': function(node) {
614
+ if($(node).children(':not(parallel_branch)').length > 0) {
615
+ return 'parallel_complex';
616
+ } else if($(node).attr('cancel') == 'last' && $(node).attr('wait') == '-1') {
617
+ return 'parallel_simple';
618
+ } else if($(node).attr('cancel') == 'first' && $(node).attr('wait') == '-1') {
619
+ return 'parallel_event_all';
620
+ } else if($(node).attr('cancel') == 'first' && $(node).attr('wait') == '1') {
621
+ return 'parallel_event_one';
622
+ } else {
623
+ return 'parallel_complex';
624
+ }
625
+ },
626
+ }, //}}}
627
+ 'adaptor': {//{{{
628
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
629
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
630
+ 'touchend': self.events.touchend,
631
+ 'click': self.events.click,
632
+ 'dblclick': self.events.dblclick,
633
+ 'mouseover': self.events.mouseover,
634
+ 'mouseout': self.events.mouseout
635
+ }//}}}
636
+ }; /*}}}*/
637
+
638
+ // Complex Elements
639
+ this.elements.choose = { /*{{{*/
640
+ 'type': 'complex',
641
+ 'illustrator': {//{{{
642
+ 'label': function(node){ return [ { column: 'Label', value: $(node).attr('mode') == 'exclusive' ? 'exclusive' : 'inclusive' } ]; },
643
+ 'endnodes': 'aggregate',
644
+ 'closeblock': false,
645
+ 'closing_symbol': 'choose_finish',
646
+ 'expansion': function(node) {
647
+ return 'horizontal';
648
+ },
649
+ 'resolve_symbol': function(node) {
650
+ if($(node).attr('mode') == 'exclusive') {
651
+ return 'choose_exclusive';
652
+ } else {
653
+ return 'choose_inclusive';
654
+ }
655
+ },
656
+ 'col_shift': function(node) {
657
+ return false;
658
+ },
659
+ 'svg': self.adaptor.theme_dir + 'symbols/choose.svg'
660
+ },//}}}
661
+ 'description': self.adaptor.theme_dir + 'rngs/choose.rng',
662
+ 'permissible_children': function(node,mode) { //{{{
663
+ var func = null;
664
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
665
+ else { func = self.adaptor.description.insert_after }
666
+ if(node.children('parallel_branch').length > 0) {
667
+ return [{'label': 'Parallel Branch',
668
+ 'function_call': func,
669
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
670
+ 'type': 'parallel_branch',
671
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}];
672
+ }
673
+ var childs = [{'label': 'Alternative',
674
+ 'function_call': func,
675
+ 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
676
+ 'type': 'alternative',
677
+ 'params': [self.adaptor.description.elements.alternative, node]}];
678
+ if((node.children('otherwise').length == 0) && node.parents('parallel').length == node.parents('parallel_branch').length && node.parent('choose').length == 0)
679
+ childs.push({'label': 'Otherwise',
680
+ 'function_call': self.adaptor.description.insert_last_into,
681
+ 'menu_icon': self.elements.otherwise.illustrator.svg.clone(),
682
+ 'type': 'otherwise',
683
+ 'params': [self.adaptor.description.elements.otherwise, node]});
684
+ if(node.parents('parallel').length > node.parents('parallel_branch').length)
685
+ childs.push({'label': 'Parallel Branch',
686
+ 'function_call': func,
687
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
688
+ 'type': 'parallel_branch',
689
+ 'params': [self.adaptor.description.elements.parallel_branch, node]});
690
+ return childs;
691
+ }, //}}}
692
+ 'adaptor': {//{{{
693
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
694
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
695
+ 'touchend': self.events.touchend,
696
+ 'click': self.events.click,
697
+ 'dblclick': self.events.dblclick,
698
+ 'mouseover': self.events.mouseover,
699
+ 'mouseout': self.events.mouseout
700
+ }//}}}
701
+ }; /*}}}*/
702
+ this.elements.otherwise = { /*{{{*/
703
+ 'type': 'complex',
704
+ 'illustrator': {//{{{
705
+ 'label': function(node){
706
+ var avg = $('> _probability_avg',$(node).children('_probability')).text();
707
+ return (avg == '' ? [] : [ { column: 'Average', value: avg + '%' } ]);
708
+ },
709
+ 'endnodes': 'passthrough',
710
+ 'closeblock': false,
711
+ 'noarrow': true,
712
+ 'expansion': function(node) {
713
+ return 'vertical';
714
+ },
715
+ 'col_shift': function(node) {
716
+ return false;
717
+ },
718
+ 'svg': self.adaptor.theme_dir + 'symbols/otherwise.svg'
719
+ },//}}}
720
+ 'description': self.adaptor.theme_dir + 'rngs/otherwise.rng',
721
+ 'neverdelete': true,
722
+ 'permissible_children': function(node,mode) { //{{{
723
+ var func = null;
724
+ var childs = null;
725
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
726
+ else { func = self.adaptor.description.insert_after }
727
+ var childs = [
728
+ {'label': 'Service Call with Scripts',
729
+ 'function_call': func,
730
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
731
+ 'type': 'callmanipulate',
732
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
733
+ {'label': 'Service Call',
734
+ 'function_call': func,
735
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
736
+ 'type': 'call',
737
+ 'params': [self.adaptor.description.elements.call, node]},
738
+ {'label': 'Script',
739
+ 'function_call': func,
740
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
741
+ 'type': 'manipulate',
742
+ 'params': [self.adaptor.description.elements.manipulate, node]},
743
+ {'label': 'Parallel',
744
+ 'function_call': func,
745
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
746
+ 'type': 'parallel',
747
+ 'params': [self.adaptor.description.elements.parallel, node]},
748
+ {'label': 'Decision',
749
+ 'function_call': func,
750
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
751
+ 'type': 'choose',
752
+ 'params': [self.adaptor.description.elements.choose, node]},
753
+ {'label': 'Loop',
754
+ 'function_call': func,
755
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
756
+ 'type': 'loop',
757
+ 'params': [self.adaptor.description.elements.loop, node]},
758
+ {'label': 'Terminate',
759
+ 'function_call': func,
760
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
761
+ 'type': 'terminate',
762
+ 'params': [self.adaptor.description.elements.terminate, node]},
763
+ {'label': 'Stop',
764
+ 'function_call': func,
765
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
766
+ 'type': 'stop',
767
+ 'params': [self.adaptor.description.elements.stop, node]}
768
+ ];
769
+ if(node.parent('parallel_branch').length > 0) {
770
+ childs.push({
771
+ 'label': 'Critical',
772
+ 'function_call': func,
773
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
774
+ 'type': 'critical',
775
+ 'params': [self.adaptor.description.elements.critical, node]
776
+ });
777
+ }
778
+ return childs;
779
+ }, //}}}
780
+ 'adaptor': {//{{{
781
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },
782
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,false); },
783
+ 'touchend': self.events.touchend,
784
+ 'click': self.events.click,
785
+ 'dblclick': self.events.dblclick,
786
+ 'mouseover': self.events.mouseover,
787
+ 'mouseout': self.events.mouseout,
788
+ }//}}}
789
+ }; /*}}}*/
790
+ this.elements.alternative = { /*{{{*/
791
+ 'type': 'complex',
792
+ 'illustrator': {//{{{
793
+ 'label': function(node){
794
+ var avg = $('> _probability_avg',$(node).children('_probability')).text();
795
+ var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
796
+ if (avg != '') {
797
+ ret.push({ column: 'Average', value: avg + '%' });
798
+ }
799
+
800
+ let dict = dataflow_extract($(node),false,function(target){ return $(target).attr('condition'); });
801
+ ret.push({ column: 'Dataflow', value: dict, type: 'resource' });
802
+
803
+ return ret;
804
+ },
805
+ 'endnodes': 'passthrough',
806
+ 'noarrow': true,
807
+ 'closeblock':false,
808
+ 'expansion': function(node) {
809
+ return 'vertical';
810
+ },
811
+ 'col_shift': function(node) {
812
+ return false;
813
+ },
814
+ 'svg': self.adaptor.theme_dir + 'symbols/alternative.svg'
815
+ },//}}}
816
+ 'description': self.adaptor.theme_dir + 'rngs/alternative.rng',
817
+ 'permissible_children': function(node,mode) { //{{{
818
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
819
+ else { func = self.adaptor.description.insert_after }
820
+ if(node.parents('parallel').length > node.parents('parallel_branch').length && node.get(0).tagName == 'alternative') {
821
+ return [{'label': 'Parallel Branch',
822
+ 'function_call': func,
823
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
824
+ 'type': 'parallel_branch',
825
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}];
826
+ }
827
+ var childs = [
828
+ {'label': 'Service Call with Scripts',
829
+ 'function_call': func,
830
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
831
+ 'type': 'callmanipulate',
832
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
833
+ {'label': 'Service Call',
834
+ 'function_call': func,
835
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
836
+ 'type': 'call',
837
+ 'params': [self.adaptor.description.elements.call, node]},
838
+ {'label': 'Script',
839
+ 'function_call': func,
840
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
841
+ 'type': 'manipulate',
842
+ 'params': [self.adaptor.description.elements.manipulate, node]},
843
+ {'label': 'Parallel',
844
+ 'function_call': func,
845
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
846
+ 'type': 'parallel',
847
+ 'params': [self.adaptor.description.elements.parallel, node]},
848
+ {'label': 'Decision',
849
+ 'function_call': func,
850
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
851
+ 'type': 'choose',
852
+ 'params': [self.adaptor.description.elements.choose, node]},
853
+ {'label': 'Loop',
854
+ 'function_call': func,
855
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
856
+ 'type': 'loop',
857
+ 'params': [self.adaptor.description.elements.loop, node]},
858
+ {'label': 'Terminate',
859
+ 'function_call': func,
860
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
861
+ 'type': 'terminate',
862
+ 'params': [self.adaptor.description.elements.terminate, node]},
863
+ {'label': 'Stop',
864
+ 'function_call': func,
865
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
866
+ 'type': 'stop',
867
+ 'params': [self.adaptor.description.elements.stop, node]}
868
+ ];
869
+ if(node.parent('parallel_branch').length > 0) {
870
+ childs.push({
871
+ 'label': 'Critical',
872
+ 'function_call': func,
873
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
874
+ 'type': 'critical',
875
+ 'params': [self.adaptor.description.elements.critical, node]
876
+ });
877
+ }
878
+ return childs;
879
+ }, //}}}
880
+ 'adaptor': {//{{{
881
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
882
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
883
+ 'touchend': self.events.touchend,
884
+ 'click': self.events.click,
885
+ 'dblclick': self.events.dblclick,
886
+ 'mouseover': self.events.mouseover,
887
+ 'mouseout': self.events.mouseout,
888
+ }//}}}
889
+ }; /*}}}*/
890
+ this.elements.loop = { /*{{{*/
891
+ 'type': 'complex',
892
+ 'illustrator': {//{{{
893
+ 'resolve_symbol': function(node) {
894
+ if($(node).attr('mode') == 'pre_test') {
895
+ return 'loop_head';
896
+ } else {
897
+ return 'loop_tail';
898
+ }
899
+ },
900
+ 'expansion': function(node) {
901
+ return 'vertical';
902
+ },
903
+ 'col_shift': function(node) {
904
+ return true;
905
+ },
906
+ 'svg': self.adaptor.theme_dir + 'symbols/loop.svg'
907
+ },// }}}
908
+ 'description': self.adaptor.theme_dir + 'rngs/loop.rng',
909
+ 'permissible_children': function(node,mode) { //{{{
910
+ var func = null;
911
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
912
+ else { func = self.adaptor.description.insert_after }
913
+ var childs = [
914
+ {'label': 'Service Call with Scripts',
915
+ 'function_call': func,
916
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
917
+ 'type': 'callmanipulate',
918
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
919
+ {'label': 'Service Call',
920
+ 'function_call': func,
921
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
922
+ 'type': 'call',
923
+ 'params': [self.adaptor.description.elements.call, node]},
924
+ {'label': 'Script',
925
+ 'function_call': func,
926
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
927
+ 'type': 'manipulate',
928
+ 'params': [self.adaptor.description.elements.manipulate, node]},
929
+ {'label': 'Decision',
930
+ 'function_call': func,
931
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
932
+ 'type': 'choose',
933
+ 'params': [self.adaptor.description.elements.choose, node]},
934
+ {'label': 'Loop',
935
+ 'function_call': func,
936
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
937
+ 'type': 'loop',
938
+ 'params': [self.adaptor.description.elements.loop, node]},
939
+ {'label': 'Terminate',
940
+ 'function_call': func,
941
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
942
+ 'type': 'terminate',
943
+ 'params': [self.adaptor.description.elements.terminate, node]},
944
+ {'label': 'Stop',
945
+ 'function_call': func,
946
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
947
+ 'type': 'stop',
948
+ 'params': [self.adaptor.description.elements.stop, node]}
949
+ ];
950
+ if(node.parent('parallel_branch').length > 0) {
951
+ childs.push({
952
+ 'label': 'Critical',
953
+ 'function_call': func,
954
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
955
+ 'type': 'critical',
956
+ 'params': [self.adaptor.description.elements.critical, node]
957
+ });
958
+ }
959
+ if(node.parent('parallel').length > node.parent('parallel_branch').length) {
960
+ childs.push({'label': 'Parallel Branch',
961
+ 'function_call': func,
962
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
963
+ 'type': 'parallel_branch',
964
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}
965
+ );
966
+ } else {
967
+ childs.push({'label': 'Parallel',
968
+ 'function_call': func,
969
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
970
+ 'type': 'parallel',
971
+ 'params': [self.adaptor.description.elements.parallel, node]}
972
+ );
973
+ }
974
+ return childs;
975
+ }, //}}}
976
+ 'adaptor': {//{{{
977
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
978
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
979
+ 'touchend': self.events.touchend,
980
+ 'click': self.events.click,
981
+ 'dblclick': self.events.dblclick,
982
+ 'mouseover': self.events.mouseover,
983
+ 'mouseout': self.events.mouseout,
984
+ }//}}}
985
+ }; /*}}}*/
986
+ this.elements.parallel = { /*{{{*/
987
+ 'type': 'complex',
988
+ 'illustrator': {//{{{
989
+ 'endnodes': 'aggregate',
990
+ 'closeblock': false,
991
+ 'closing_symbol': 'parallel_finish',
992
+ 'expansion': function(node) {
993
+ // check if any sibling other than 'parallel_branch' is present
994
+ if($(node).children(':not(parallel_branch)').length > 0) return 'vertical';
995
+ return 'horizontal';
996
+ },
997
+ 'col_shift': function(node) {
998
+ return true;
999
+ },
1000
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg',
1001
+ 'resolve_symbol': function(node) {
1002
+ if($(node).attr('cancel') == 'last') {
1003
+ return 'parallel_start';
1004
+ } else if($(node).attr('cancel') == 'first' && $(node).attr('wait') == 1) {
1005
+ return 'parallel_eventbased_exclusive';
1006
+ } else {
1007
+ return 'parallel_eventbased_parallel';
1008
+ }
1009
+ },
1010
+ },//}}}
1011
+ 'description': self.adaptor.theme_dir + 'rngs/parallel.rng',
1012
+ 'permissible_children': function(node,mode) { //{{{
1013
+ var func = null;
1014
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1015
+ else { func = self.adaptor.description.insert_after }
1016
+ var childs = [
1017
+ {'label': 'Parallel Branch',
1018
+ 'function_call': func,
1019
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
1020
+ 'type': 'parallel_branch',
1021
+ 'params': [self.adaptor.description.elements.parallel_branch, node]},
1022
+ ];
1023
+ return childs;
1024
+ }, //}}}
1025
+ 'permissible_children_expert': function(node,mode) { //{{{
1026
+ var func = null;
1027
+ if (mode.match(/into/)) { func = self.adaptor.description.insert_first_into }
1028
+ else { func = self.adaptor.description.insert_after }
1029
+ var childs = [
1030
+ {'label': 'Service Call with Scripts',
1031
+ 'function_call': func,
1032
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1033
+ 'type': 'callmanipulate',
1034
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
1035
+ {'label': 'Service Call',
1036
+ 'function_call': func,
1037
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
1038
+ 'type': 'call',
1039
+ 'params': [self.adaptor.description.elements.call, node]},
1040
+ {'label': 'Script',
1041
+ 'function_call': func,
1042
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1043
+ 'type': 'manipulate',
1044
+ 'params': [self.adaptor.description.elements.manipulate, node]},
1045
+ {'label': 'Decision',
1046
+ 'function_call': func,
1047
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1048
+ 'type': 'choose',
1049
+ 'params': [self.adaptor.description.elements.choose, node]},
1050
+ {'label': 'Loop',
1051
+ 'function_call': func,
1052
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1053
+ 'type': 'loop',
1054
+ 'params': [self.adaptor.description.elements.loop, node]},
1055
+ {'label': 'Stop',
1056
+ 'function_call': func,
1057
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1058
+ 'type': 'stop',
1059
+ 'params': [self.adaptor.description.elements.stop, node]}
1060
+ ];
1061
+ if(node.get(0).tagName != 'parallel')
1062
+ childs.push({'label': 'Parallel',
1063
+ 'function_call': self.adaptor.description.insert_last_into,
1064
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1065
+ 'type': 'parallel',
1066
+ 'params': [self.adaptor.description.elements.parallel, node]});
1067
+ return childs;
1068
+ }, //}}}
1069
+ 'adaptor': {//{{{
1070
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1071
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1072
+ 'touchend': self.events.touchend,
1073
+ 'click': self.events.click,
1074
+ 'dblclick': self.events.dblclick,
1075
+ 'mouseover': self.events.mouseover,
1076
+ 'mouseout': self.events.mouseout,
1077
+ }//}}}
1078
+ }; /*}}}*/
1079
+ this.elements.parallel_branch = { /*{{{*/
1080
+ 'type': 'complex',
1081
+ 'illustrator': {//{{{
1082
+ 'endnodes': 'passthrough',
1083
+ 'closeblock': false,
1084
+ 'noarrow': true,
1085
+ 'expansion': function(node) {
1086
+ return 'vertical';
1087
+ },
1088
+ 'resolve_symbol': function(node,shift) {
1089
+ if(shift == true) {
1090
+ return 'parallel_branch_event';
1091
+ } else {
1092
+ return 'parallel_branch_normal';
1093
+ }
1094
+ },
1095
+ 'col_shift': function(node) {
1096
+ if(node.parentNode.tagName == 'choose') return false;
1097
+ if($(node).parents('parallel').first().children(':not(parallel_branch)').length > 0) return true;
1098
+ return false;
1099
+ },
1100
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch.svg'
1101
+ },//}}}
1102
+ 'description': self.adaptor.theme_dir + 'rngs/parallel_branch.rng',
1103
+ 'permissible_children': function(node,mode) { //{{{
1104
+ var func = null;
1105
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1106
+ else { func = self.adaptor.description.insert_after }
1107
+ var childs = [
1108
+ {'label': 'Service Call with Scripts',
1109
+ 'function_call': func,
1110
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1111
+ 'type': 'callmanipulate',
1112
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
1113
+ {'label': 'Service Call',
1114
+ 'function_call': func,
1115
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
1116
+ 'type': 'call',
1117
+ 'params': [self.adaptor.description.elements.call, node]},
1118
+ {'label': 'Script',
1119
+ 'function_call': func,
1120
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1121
+ 'type': 'manipulate',
1122
+ 'params': [self.adaptor.description.elements.manipulate, node]},
1123
+ {'label': 'Parallel',
1124
+ 'function_call': func,
1125
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1126
+ 'type': 'parallel',
1127
+ 'params': [self.adaptor.description.elements.parallel, node]},
1128
+ {'label': 'Decision',
1129
+ 'function_call': func,
1130
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1131
+ 'type': 'choose',
1132
+ 'params': [self.adaptor.description.elements.choose, node]},
1133
+ {'label': 'Loop',
1134
+ 'function_call': func,
1135
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1136
+ 'type': 'loop',
1137
+ 'params': [self.adaptor.description.elements.loop, node]},
1138
+ {'label': 'Terminate',
1139
+ 'function_call': func,
1140
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
1141
+ 'type': 'terminate',
1142
+ 'params': [self.adaptor.description.elements.terminate, node]},
1143
+ {'label': 'Stop',
1144
+ 'function_call': func,
1145
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1146
+ 'type': 'stop',
1147
+ 'params': [self.adaptor.description.elements.stop, node]},
1148
+ {'label': 'Critical',
1149
+ 'function_call': func,
1150
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1151
+ 'type': 'critical',
1152
+ 'params': [self.adaptor.description.elements.critical, node]}
1153
+ ];
1154
+ if(node.parents('choose').length > node.parents('alternative, otherwise').length && node.get(0).tagName == 'parallel_branch') {
1155
+ return [{'label': 'Alternative',
1156
+ 'function_call': func,
1157
+ 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
1158
+ 'type': 'alternative',
1159
+ 'params': [self.adaptor.description.elements.alternative, node]}];
1160
+ }
1161
+ return childs;
1162
+ }, //}}}
1163
+ 'adaptor': {//{{{
1164
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1165
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1166
+ 'touchend': self.events.touchend,
1167
+ 'click': self.events.click,
1168
+ 'dblclick': self.events.dblclick,
1169
+ 'mouseover': self.events.mouseover,
1170
+ 'mouseout': self.events.mouseout,
1171
+ }//}}}
1172
+ }; /*}}}*/
1173
+ this.elements.critical = { /*{{{*/
1174
+ 'type': 'complex',
1175
+ 'illustrator': {//{{{
1176
+ 'endnodes': 'aggregate',
1177
+ 'closeblock': false,
1178
+ 'border': true,
1179
+ 'expansion': function(node) {
1180
+ return 'vertical';
1181
+ },
1182
+ 'col_shift': function(node) {
1183
+ return true;
1184
+ },
1185
+ 'svg': self.adaptor.theme_dir + 'symbols/critical.svg'
1186
+ },//}}}
1187
+ 'description': self.adaptor.theme_dir + 'rngs/critical.rng',
1188
+ 'permissible_children': function(node,mode) { //{{{
1189
+ var func = null;
1190
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1191
+ else { func = self.adaptor.description.insert_after }
1192
+ var childs = [
1193
+ {'label': 'Service Call with Scripts',
1194
+ 'function_call': func,
1195
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1196
+ 'type': 'callmanipulate',
1197
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
1198
+ {'label': 'Service Call',
1199
+ 'function_call': func,
1200
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
1201
+ 'type': 'call',
1202
+ 'params': [self.adaptor.description.elements.call, node]},
1203
+ {'label': 'Script',
1204
+ 'function_call': func,
1205
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1206
+ 'type': 'manipulate',
1207
+ 'params': [self.adaptor.description.elements.manipulate, node]},
1208
+ {'label': 'Parallel',
1209
+ 'function_call': func,
1210
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1211
+ 'type': 'parallel',
1212
+ 'params': [self.adaptor.description.elements.parallel, node]},
1213
+ {'label': 'Decision',
1214
+ 'function_call': func,
1215
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1216
+ 'type': 'choose',
1217
+ 'params': [self.adaptor.description.elements.choose, node]},
1218
+ {'label': 'Loop',
1219
+ 'function_call': func,
1220
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1221
+ 'type': 'loop',
1222
+ 'params': [self.adaptor.description.elements.loop, node]},
1223
+ {'label': 'Terminate',
1224
+ 'function_call': func,
1225
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
1226
+ 'type': 'terminate',
1227
+ 'params': [self.adaptor.description.elements.terminate, node]},
1228
+ {'label': 'Stop',
1229
+ 'function_call': func,
1230
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1231
+ 'type': 'stop',
1232
+ 'params': [self.adaptor.description.elements.stop, node]}
1233
+ ];
1234
+ if(node.parent('parallel_branch').length > 0) {
1235
+ childs.push({
1236
+ 'label': 'Critical',
1237
+ 'function_call': func,
1238
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1239
+ 'type': 'critical',
1240
+ 'params': [self.adaptor.description.elements.critical, node]
1241
+ });
1242
+ }
1243
+ return childs;
1244
+ }, //}}}
1245
+ 'adaptor': {//{{{
1246
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1247
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1248
+ 'touchend': self.events.touchend,
1249
+ 'click': self.events.click,
1250
+ 'dblclick': self.events.dblclick,
1251
+ 'mouseover': self.events.mouseover,
1252
+ 'mouseout': self.events.mouseout,
1253
+ }//}}}
1254
+ }; /*}}}*/
1255
+ this.elements.group = { /*{{{*/
1256
+ 'type': 'complex',
1257
+ 'illustrator': {//{{{
1258
+ 'endnodes': 'aggregate',
1259
+ 'closeblock': false,
1260
+ 'border': 'injectiongroup', // other value than true,false inidcates the used class for the svg-object
1261
+ 'expansion': function(node) {
1262
+ return 'vertical';
1263
+ },
1264
+ 'col_shift': function(node) {
1265
+ return true;
1266
+ },
1267
+ 'svg': null
1268
+ },//}}}
1269
+ 'description': self.adaptor.theme_dir + 'rngs/group.rng',
1270
+ 'permissible_children': function(node,mode) { //{{{
1271
+ var func = null;
1272
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1273
+ else { func = self.adaptor.description.insert_after }
1274
+ return [
1275
+ ];
1276
+ }, //}}}
1277
+ 'adaptor': {//{{{
1278
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1279
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1280
+ 'touchend': self.events.touchend,
1281
+ 'click': self.events.click,
1282
+ 'dblclick': self.events.dblclick,
1283
+ 'mouseover': self.events.mouseover,
1284
+ 'mouseout': self.events.mouseout,
1285
+ }//}}}
1286
+ }; /*}}}*/
1287
+ this.elements.start = this.elements.description = { /*{{{*/
1288
+ 'type': 'description',
1289
+ 'illustrator': {//{{{
1290
+ 'endnodes': 'passthrough',
1291
+ 'label': function(node){ return [ { column: 'ID' }, { column: 'Dataflow'}, { column: 'Label'}, { column: 'RP' }, { column: 'R#' } ]; },
1292
+ 'closeblock': false,
1293
+ 'balance': true,
1294
+ 'expansion': function(node) {
1295
+ return 'vertical';
1296
+ },
1297
+ 'resolve_symbol': function(node) {
1298
+ let plist = []
1299
+ let dirty = false
1300
+ $('*:not(:has(*))',node).each(function(i,n) {
1301
+ let lines = n.textContent.split(/(\r\n)|\n|;/)
1302
+ for (const l of lines) {
1303
+ if (l != null) {
1304
+ let m0 = l.match(/^[^=]*data\.([a-z0-9A-Z_]+)[^=]*=/)
1305
+ if (m0 != null) {
1306
+ plist.push(m0[1])
1307
+ }
1308
+ let m1 = l.match(/=[^=].*data\.([a-z0-9A-Z_]+)/)
1309
+ let m2 = l.match(/^[^=]*data\.([a-z0-9A-Z_]+)[^=]*$/)
1310
+ if (m1 != null && !plist.includes(m1[1])) {
1311
+ dirty = true
1312
+ }
1313
+ if (m2 != null && !plist.includes(m2[1])) {
1314
+ dirty = true
1315
+ }
1316
+ }
1317
+ }
1318
+ })
1319
+ if (dirty) { return 'start_event'; }
1320
+ },
1321
+ 'closing_symbol': 'end',
1322
+ 'col_shift': function(node) {
1323
+ return true;
1324
+ },
1325
+ 'svg': self.adaptor.theme_dir + 'symbols/start.svg'
1326
+ },//}}}
1327
+ 'description': self.adaptor.theme_dir + 'rngs/start.rng',
1328
+ 'permissible_children': function(node,mode) { //{{{
1329
+ var func = null;
1330
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1331
+ else { func = self.adaptor.description.insert_after }
1332
+ var childs = [
1333
+ {'label': 'Service Call with Scripts',
1334
+ 'function_call': func,
1335
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1336
+ 'type': 'callmanipulate',
1337
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
1338
+ {'label': 'Service Call',
1339
+ 'function_call': func,
1340
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
1341
+ 'type': 'call',
1342
+ 'params': [self.adaptor.description.elements.call, node]},
1343
+ {'label': 'Script',
1344
+ 'function_call': func,
1345
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1346
+ 'type': 'manipulate',
1347
+ 'params': [self.adaptor.description.elements.manipulate, node]},
1348
+ {'label': 'Parallel',
1349
+ 'function_call': func,
1350
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1351
+ 'type': 'parallel',
1352
+ 'params': [self.adaptor.description.elements.parallel, node]},
1353
+ {'label': 'Decision',
1354
+ 'function_call': func,
1355
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1356
+ 'type': 'choose',
1357
+ 'params': [self.adaptor.description.elements.choose, node]},
1358
+ {'label': 'Loop',
1359
+ 'function_call': func,
1360
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1361
+ 'type': 'loop',
1362
+ 'params': [self.adaptor.description.elements.loop, node]},
1363
+ {'label': 'Stop',
1364
+ 'function_call': func,
1365
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1366
+ 'type': 'stop',
1367
+ 'params': [self.adaptor.description.elements.stop, node]}
1368
+ ];
1369
+ if(node.parent('parallel_branch').length > 0) {
1370
+ childs.push({
1371
+ 'label': 'Critical',
1372
+ 'function_call': func,
1373
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1374
+ 'type': 'critical',
1375
+ 'params': [self.adaptor.description.elements.critical, node]
1376
+ });
1377
+ }
1378
+ return childs;
1379
+ }, //}}}
1380
+ 'adaptor': {//{{{
1381
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },
1382
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,false); },
1383
+ 'touchend': self.events.touchend,
1384
+ 'click': self.events.click,
1385
+ 'dblclick': self.events.dblclick,
1386
+ 'mouseover': self.events.mouseover,
1387
+ 'mouseout': self.events.mouseout,
1388
+ }//}}}
1389
+ }; /*}}}*/
1390
+
1391
+ // Abstract Elements
1392
+ // * they may only have an illustrator (or other parts)
1393
+ // * they HAVE TO have a parent
1394
+ this.elements.start_event = { /*{{{*/
1395
+ 'parent': 'start',
1396
+ 'illustrator': {//{{{
1397
+ 'svg': self.adaptor.theme_dir + 'symbols/start_event.svg'
1398
+ }//}}}
1399
+ }; /*}}}*/
1400
+ this.elements.call_sensor = { /*{{{*/
1401
+ 'parent': 'call',
1402
+ 'illustrator': {//{{{
1403
+ 'svg': self.adaptor.theme_dir + 'symbols/call_sensor.svg'
1404
+ }//}}}
1405
+ }; /*}}}*/
1406
+ this.elements.callmanipulate = { /*{{{*/
1407
+ 'parent': 'call',
1408
+ 'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
1409
+ 'illustrator': {//{{{
1410
+ 'svg': self.adaptor.theme_dir + 'symbols/callmanipulate.svg'
1411
+ }//}}}
1412
+ }; /*}}}*/
1413
+ this.elements.callmanipulate_sensor = { /*{{{*/
1414
+ 'parent': 'call',
1415
+ 'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
1416
+ 'illustrator': {//{{{
1417
+ 'svg': self.adaptor.theme_dir + 'symbols/callmanipulate_sensor.svg'
1418
+ }//}}}
1419
+ }; /*}}}*/
1420
+ this.elements.loop_head = { /*{{{*/
1421
+ 'parent': 'loop',
1422
+ 'illustrator': {//{{{
1423
+ 'endnodes': 'this',
1424
+ 'closeblock': true,
1425
+ 'label': function(node){
1426
+ var avg = $('> _probability_avg',$(node).children('_probability')).text();
1427
+ var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
1428
+ if (avg != '') {
1429
+ ret.push({ column: 'Average', value: avg + 'x' });
1430
+ }
1431
+
1432
+ let dict = dataflow_extract($(node),false,function(target){ return $(target).attr('condition'); });
1433
+ ret.push({ column: 'Dataflow', value: dict, type: 'resource' });
1434
+
1435
+ return ret;
1436
+ },
1437
+ }//}}}
1438
+ }; /*}}}*/
1439
+ this.elements.loop_tail = { /*{{{*/
1440
+ 'parent': 'loop',
1441
+ 'illustrator': {//{{{
1442
+ 'endnodes': 'aggregate',
1443
+ 'closeblock': false,
1444
+ 'closing_symbol': 'loop_finish'
1445
+ },//}}}
1446
+ }; /*}}}*/
1447
+ this.elements.choose_inclusive = { /*{{{*/
1448
+ 'parent': 'choose',
1449
+ 'illustrator': {//{{{
1450
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1451
+ }//}}}
1452
+ }; /*}}}*/
1453
+ this.elements.choose_exclusive = { /*{{{*/
1454
+ 'parent': 'choose',
1455
+ 'illustrator': {//{{{
1456
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1457
+ },//}}}
1458
+ }; /*}}}*/
1459
+ this.elements.choose_inclusive_finish = { /*{{{*/
1460
+ 'parent': 'choose_finish',
1461
+ 'illustrator': {//{{{
1462
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1463
+ }//}}}
1464
+ }; /*}}}*/
1465
+ this.elements.choose_exclusive_finish = { /*{{{*/
1466
+ 'parent': 'choose_finish',
1467
+ 'illustrator': {//{{{
1468
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1469
+ },//}}}
1470
+ }; /*}}}*/
1471
+ this.elements.loop_head_finish = { /*{{{*/
1472
+ 'parent': 'loop_finish',
1473
+ 'illustrator': {//{{{
1474
+ 'endnodes': 'this',
1475
+ 'closeblock': true,
1476
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1477
+ }//}}}
1478
+ }; /*}}}*/
1479
+ this.elements.loop_tail_finish = { /*{{{*/
1480
+ 'parent': 'loop_finish',
1481
+ 'illustrator': {//{{{
1482
+ 'endnodes': 'this',
1483
+ 'closeblock': false,
1484
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1485
+ },//}}}
1486
+ }; /*}}}*/
1487
+ this.elements.parallel_start = { /*{{{*/
1488
+ 'parent': 'parallel',
1489
+ 'illustrator': {//{{{
1490
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
1491
+ }//}}}
1492
+ }; /*}}}*/
1493
+ this.elements.parallel_eventbased_exclusive = { /*{{{*/
1494
+ 'parent': 'parallel',
1495
+ 'illustrator': {//{{{
1496
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_eventbased_exclusive.svg'
1497
+ }//}}}
1498
+ }; /*}}}*/
1499
+ this.elements.parallel_eventbased_parallel = { /*{{{*/
1500
+ 'parent': 'parallel',
1501
+ 'illustrator': {//{{{
1502
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_eventbased_parallel.svg'
1503
+ }//}}}
1504
+ }; /*}}}*/
1505
+ this.elements.parallel_simple = { /*{{{*/
1506
+ 'parent': 'parallel_finish',
1507
+ 'illustrator': {//{{{
1508
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
1509
+ }//}}}
1510
+ }; /*}}}*/
1511
+ this.elements.parallel_complex = { /*{{{*/
1512
+ 'parent': 'parallel_finish',
1513
+ 'illustrator': {//{{{
1514
+ 'svg': self.adaptor.theme_dir + 'symbols/complex.svg'
1515
+ },//}}}
1516
+ }; /*}}}*/
1517
+ this.elements.parallel_event_all = { /*{{{*/
1518
+ 'parent': 'parallel_finish',
1519
+ 'illustrator': {//{{{
1520
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_eventbased_parallel.svg'
1521
+ }//}}}
1522
+ }; /*}}}*/
1523
+ this.elements.parallel_event_one = { /*{{{*/
1524
+ 'parent': 'parallel_finish',
1525
+ 'illustrator': {//{{{
1526
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1527
+ }//}}}
1528
+ }; /*}}}*/
1529
+ this.elements.parallel_branch_normal = { /*{{{*/
1530
+ 'parent': 'parallel_branch',
1531
+ 'illustrator': {//{{{
1532
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_normal.svg'
1533
+ }//}}}
1534
+ }; /*}}}*/
1535
+ this.elements.parallel_branch_event = { /*{{{*/
1536
+ 'parent': 'parallel_branch',
1537
+ 'illustrator': {//{{{
1538
+ 'endnodes': 'this',
1539
+ 'noarrow': false,
1540
+ 'border': true,
1541
+ 'wide': true,
1542
+ 'closing_symbol': 'event_end',
1543
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_event.svg'
1544
+ }//}}}
1545
+ }; /*}}}*/
1546
+ this.elements.parallel_branch_compact = { /*{{{*/
1547
+ 'parent': 'parallel_branch',
1548
+ 'illustrator': {//{{{
1549
+ 'endnodes': 'this',
1550
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_compact.svg'
1551
+ }//}}}
1552
+ }; /*}}}*/
1553
+ this.elements.scripts = { /*{{{*/
1554
+ 'description': [self.adaptor.theme_dir + 'rngs/scripts.rng']
1555
+ }; /*}}}*/
1556
+ }