cpee 2.1.56 → 2.1.57

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