cpee 2.1.53 → 2.1.54

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,11 +63,7 @@ function WFAdaptorManifestation(adaptor) {
63
63
  //{{{ Render the details from rng (right hand side of graph tab)
64
64
  this.update_details = function(svgid){
65
65
  var tab = $('#dat_details');
66
- var focus_ele = $(':focus',tab);
67
- var focus_path = focus_ele.attr('data-relaxngui-path');
68
- var focus_pos = focus_ele.prop('selectionStart');
69
66
  var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
70
- tab.empty();
71
67
  if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
72
68
  save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
73
69
  var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
@@ -78,20 +74,16 @@ function WFAdaptorManifestation(adaptor) {
78
74
  if (save['endpoints_list'][$(node).attr('endpoint')] && (!save['endpoints_list'][$(node).attr('endpoint')].startsWith('http') || save['endpoints_list'][$(node).attr('endpoint')].match(/^https?-/))) {
79
75
  $(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
80
76
  }
81
- save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
82
77
  var nn = $X($(node).serializeXML());
83
78
  nn.removeAttr('svg-id');
84
79
  nn.removeAttr('svg-type');
85
80
  nn.removeAttr('svg-subtype');
86
81
  nn.removeAttr('svg-label');
82
+
83
+ tab.empty();
84
+ save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
87
85
  save['details'].content(nn);
88
- if (focus_ele.length > 0) {
89
- var ele = $('[data-relaxngui-path="' + focus_path + '"]',tab)[0];
90
- ele.focus();
91
- if (ele.setSelectionRange) {
92
- ele.setSelectionRange(focus_pos,focus_pos);
93
- }
94
- }
86
+
95
87
  format_visual_forms();
96
88
  }
97
89
  }; //}}}
@@ -211,8 +203,17 @@ function WFAdaptorManifestation(adaptor) {
211
203
  $(nodes).each(function(key,str) {
212
204
  nodes[key] = $X(str);
213
205
  });
206
+ let svgids = [];
214
207
  $(nodes).each(function(key,node){
215
- var target = self.adaptor.description.get_node_by_svg_id($(node).attr('svg-id'));
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);
216
217
  del_ui_pos(target)
217
218
  self.adaptor.description.remove(null,target);
218
219
  localStorage.removeItem('marked');
@@ -385,10 +386,18 @@ function WFAdaptorManifestation(adaptor) {
385
386
  },
386
387
  'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
387
388
  'resolve_symbol': function(node) {
388
- if($('> code', node).length > 0) {
389
- return 'callmanipulate';
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
+ }
390
395
  } else {
391
- return 'call';
396
+ if ($('> code', node).length > 0) {
397
+ return 'callmanipulate';
398
+ } else {
399
+ return 'call';
400
+ }
392
401
  }
393
402
  },
394
403
  'svg': self.adaptor.theme_dir + 'symbols/call.svg'
@@ -982,7 +991,7 @@ function WFAdaptorManifestation(adaptor) {
982
991
  ret.push({ column: 'Average', value: avg + '%' });
983
992
  }
984
993
  return ret;
985
- },
994
+ ,
986
995
  'svg': self.adaptor.theme_dir + 'symbols/closed_loop.svg'
987
996
  },//}}}
988
997
  'description': self.adaptor.theme_dir + 'rngs/closed_loop.rng',
@@ -1586,13 +1595,42 @@ function WFAdaptorManifestation(adaptor) {
1586
1595
  'expansion': function(node) {
1587
1596
  return 'vertical';
1588
1597
  },
1598
+ 'resolve_symbol': function(node) {
1599
+ let alist = []
1600
+ let plist = []
1601
+
1602
+ 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
1603
+ var reg_not_assi = /data\.([a-zA-Z_]+)\s*/g;
1604
+ $ ('call > parameters > arguments > *, call > code > *, loop[condition], alternative[condition]',node).each(function(i,n) {
1605
+ let item;
1606
+ if (n.hasAttribute('condition')) {
1607
+ item = n.getAttribute('condition');
1608
+ } else {
1609
+ item = n.textContent;
1610
+ }
1611
+ if (n.parentNode.nodeName == 'arguments' && item.charAt(0) != '!' ) { return }
1612
+
1613
+ let indices = [];
1614
+
1615
+ for (const match of item.matchAll(regassi)) {
1616
+ indices.push(match.index);
1617
+ alist.push(match[1]);
1618
+ }
1619
+ for (const match of item.matchAll(reg_not_assi)) {
1620
+ const arg1 = match[1];
1621
+ if (indices.includes(match.index)) { continue; }
1622
+ if (!alist.includes(arg1)) { plist.push(arg1); }
1623
+ }
1624
+ })
1625
+ if (plist.length > 0) { return 'start_event'; }
1626
+ },
1589
1627
  'closing_symbol': 'end',
1590
1628
  'col_shift': function(node) {
1591
1629
  return true;
1592
1630
  },
1593
1631
  'svg': self.adaptor.theme_dir + 'symbols/start.svg'
1594
1632
  },//}}}
1595
- 'description': null,
1633
+ 'description': self.adaptor.theme_dir + 'rngs/start.rng',
1596
1634
  'permissible_children': function(node,mode) { //{{{
1597
1635
  var func = null;
1598
1636
  if (mode == 'into') { func = self.adaptor.description.insert_first_into }
@@ -1664,13 +1702,31 @@ function WFAdaptorManifestation(adaptor) {
1664
1702
  // Abstract Elements
1665
1703
  // * they may only have an illustrator (or other parts)
1666
1704
  // * they HAVE TO have a parent
1705
+ this.elements.start_event = { /*{{{*/
1706
+ 'parent': 'start',
1707
+ 'illustrator': {//{{{
1708
+ 'svg': self.adaptor.theme_dir + 'symbols/start_event.svg'
1709
+ }//}}}
1710
+ }; /*}}}*/
1711
+ this.elements.call_sensor = { /*{{{*/
1712
+ 'parent': 'call',
1713
+ 'illustrator': {//{{{
1714
+ 'svg': self.adaptor.theme_dir + 'symbols/call_sensor.svg'
1715
+ }//}}}
1716
+ }; /*}}}*/
1667
1717
  this.elements.callmanipulate = { /*{{{*/
1668
1718
  'parent': 'call',
1669
1719
  'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
1670
1720
  'illustrator': {//{{{
1671
- 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
1672
1721
  'svg': self.adaptor.theme_dir + 'symbols/callmanipulate.svg'
1673
- },//}}}
1722
+ }//}}}
1723
+ }; /*}}}*/
1724
+ this.elements.callmanipulate_sensor = { /*{{{*/
1725
+ 'parent': 'call',
1726
+ 'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
1727
+ 'illustrator': {//{{{
1728
+ 'svg': self.adaptor.theme_dir + 'symbols/callmanipulate_sensor.svg'
1729
+ }//}}}
1674
1730
  }; /*}}}*/
1675
1731
  this.elements.loop_head = { /*{{{*/
1676
1732
  'parent': 'loop',
@@ -63,11 +63,7 @@ function WFAdaptorManifestation(adaptor) {
63
63
  //{{{ Render the details from rng (right hand side of graph tab)
64
64
  this.update_details = function(svgid){
65
65
  var tab = $('#dat_details');
66
- var focus_ele = $(':focus',tab);
67
- var focus_path = focus_ele.attr('data-relaxngui-path');
68
- var focus_pos = focus_ele.prop('selectionStart');
69
66
  var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
70
- tab.empty();
71
67
  if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
72
68
  save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
73
69
  var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
@@ -78,20 +74,16 @@ function WFAdaptorManifestation(adaptor) {
78
74
  if (save['endpoints_list'][$(node).attr('endpoint')] && (!save['endpoints_list'][$(node).attr('endpoint')].startsWith('http') || save['endpoints_list'][$(node).attr('endpoint')].match(/^https?-/))) {
79
75
  $(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
80
76
  }
81
- save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
82
77
  var nn = $X($(node).serializeXML());
83
78
  nn.removeAttr('svg-id');
84
79
  nn.removeAttr('svg-type');
85
80
  nn.removeAttr('svg-subtype');
86
81
  nn.removeAttr('svg-label');
82
+
83
+ tab.empty();
84
+ save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
87
85
  save['details'].content(nn);
88
- if (focus_ele.length > 0) {
89
- var ele = $('[data-relaxngui-path="' + focus_path + '"]',tab)[0];
90
- ele.focus();
91
- if (ele.setSelectionRange) {
92
- ele.setSelectionRange(focus_pos,focus_pos);
93
- }
94
- }
86
+
95
87
  format_visual_forms();
96
88
  }
97
89
  }; //}}}
@@ -211,8 +203,17 @@ function WFAdaptorManifestation(adaptor) {
211
203
  $(nodes).each(function(key,str) {
212
204
  nodes[key] = $X(str);
213
205
  });
206
+ let svgids = [];
214
207
  $(nodes).each(function(key,node){
215
- var target = self.adaptor.description.get_node_by_svg_id($(node).attr('svg-id'));
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);
216
217
  del_ui_pos(target)
217
218
  self.adaptor.description.remove(null,target);
218
219
  localStorage.removeItem('marked');
@@ -403,7 +404,7 @@ function WFAdaptorManifestation(adaptor) {
403
404
  let dict = {...dict1,...dict2};
404
405
  ret.push({ column: 'Dataflow', value: dict, type: 'resource' });
405
406
  if (lab != '') {
406
- ret.unshift( { column: 'Label', value: lab } );
407
+ ret.unshift( { type: 'label', column: 'Label', value: lab } );
407
408
  }
408
409
  if (wait != '') {
409
410
  ret.push({ column: 'Wait', value: 'ω = ' + wait });
@@ -463,7 +464,7 @@ function WFAdaptorManifestation(adaptor) {
463
464
  'label': function(node){
464
465
  var lab = $(node).attr('label');
465
466
  if (lab) {
466
- return [ { column: 'Label', value: lab.replace(/^['"]/,'').replace(/['"]$/,'') }, { column: 'ID', value: $(node).attr('id') } ];
467
+ return [ { type: 'label', column: 'Label', value: lab.replace(/^['"]/,'').replace(/['"]$/,'') }, { column: 'ID', value: $(node).attr('id') } ];
467
468
  } else {
468
469
  return [ { column: 'ID', value: $(node).attr('id') } ];
469
470
  }
@@ -597,7 +598,7 @@ function WFAdaptorManifestation(adaptor) {
597
598
  'closeblock': true,
598
599
  'label': function(node){
599
600
  var avg = $('> _probability_avg',$(node).children('_probability')).text();
600
- var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
601
+ var ret = [ { type: 'label', column: 'Label', value: $(node).attr('condition') } ];
601
602
  if (avg != '') {
602
603
  ret.push({ column: 'Average', value: avg + 'x' });
603
604
  }
@@ -649,7 +650,7 @@ function WFAdaptorManifestation(adaptor) {
649
650
  this.elements.choose = { /*{{{*/
650
651
  'type': 'complex',
651
652
  'illustrator': {//{{{
652
- 'label': function(node){ return [ { column: 'Label', value: $(node).attr('mode') == 'exclusive' ? 'exclusive' : 'inclusive' } ]; },
653
+ 'label': function(node){ return [ { type: 'label', column: 'Label', value: $(node).attr('mode') == 'exclusive' ? 'exclusive' : 'inclusive' } ]; },
653
654
  'endnodes': 'aggregate',
654
655
  'closeblock': false,
655
656
  'closing_symbol': 'choose_finish',
@@ -802,7 +803,7 @@ function WFAdaptorManifestation(adaptor) {
802
803
  'illustrator': {//{{{
803
804
  'label': function(node){
804
805
  var avg = $('> _probability_avg',$(node).children('_probability')).text();
805
- var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
806
+ var ret = [ { type: 'label', column: 'Label', value: $(node).attr('condition') } ];
806
807
  if (avg != '') {
807
808
  ret.push({ column: 'Average', value: avg + '%' });
808
809
  }
@@ -1298,35 +1299,40 @@ function WFAdaptorManifestation(adaptor) {
1298
1299
  'type': 'description',
1299
1300
  'illustrator': {//{{{
1300
1301
  'endnodes': 'passthrough',
1301
- 'label': function(node){ return [ { column: 'ID' }, { column: 'Dataflow'}, { column: 'Label'}, { column: 'RP' }, { column: 'R#' } ]; },
1302
+ 'label': function(node){ return [ { column: 'ID' }, { column: 'Dataflow', type: 'resource' }, { column: 'Label', type: 'label' }, { column: 'RP' }, { column: 'R#' } ]; },
1302
1303
  'closeblock': false,
1303
1304
  'balance': true,
1304
1305
  'expansion': function(node) {
1305
1306
  return 'vertical';
1306
1307
  },
1307
1308
  'resolve_symbol': function(node) {
1309
+ let alist = []
1308
1310
  let plist = []
1309
- let dirty = false
1310
- $('*:not(:has(*))',node).each(function(i,n) {
1311
- let lines = n.textContent.split(/(\r\n)|\n|;/)
1312
- for (const l of lines) {
1313
- if (l != null) {
1314
- let m0 = l.match(/^[^=]*data\.([a-z0-9A-Z_]+)[^=]*=/)
1315
- if (m0 != null) {
1316
- plist.push(m0[1])
1317
- }
1318
- let m1 = l.match(/=[^=].*data\.([a-z0-9A-Z_]+)/)
1319
- let m2 = l.match(/^[^=]*data\.([a-z0-9A-Z_]+)[^=]*$/)
1320
- if (m1 != null && !plist.includes(m1[1])) {
1321
- dirty = true
1322
- }
1323
- if (m2 != null && !plist.includes(m2[1])) {
1324
- dirty = true
1325
- }
1326
- }
1311
+
1312
+ 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
1313
+ var reg_not_assi = /data\.([a-zA-Z_]+)\s*/g;
1314
+ $ ('call > parameters > arguments > *, call > code > *, loop[condition], alternative[condition]',node).each(function(i,n) {
1315
+ let item;
1316
+ if (n.hasAttribute('condition')) {
1317
+ item = n.getAttribute('condition');
1318
+ } else {
1319
+ item = n.textContent;
1320
+ }
1321
+ if (n.parentNode.nodeName == 'arguments' && item.charAt(0) != '!' ) { return }
1322
+
1323
+ let indices = [];
1324
+
1325
+ for (const match of item.matchAll(regassi)) {
1326
+ indices.push(match.index);
1327
+ alist.push(match[1]);
1328
+ }
1329
+ for (const match of item.matchAll(reg_not_assi)) {
1330
+ const arg1 = match[1];
1331
+ if (indices.includes(match.index)) { continue; }
1332
+ if (!alist.includes(arg1)) { plist.push(arg1); }
1327
1333
  }
1328
1334
  })
1329
- if (dirty) { return 'start_event'; }
1335
+ if (plist.length > 0) { return 'start_event'; }
1330
1336
  },
1331
1337
  'closing_symbol': 'end',
1332
1338
  'col_shift': function(node) {
@@ -1434,7 +1440,7 @@ function WFAdaptorManifestation(adaptor) {
1434
1440
  'closeblock': true,
1435
1441
  'label': function(node){
1436
1442
  var avg = $('> _probability_avg',$(node).children('_probability')).text();
1437
- var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
1443
+ var ret = [ { type: 'label', column: 'Label', value: $(node).attr('condition') } ];
1438
1444
  if (avg != '') {
1439
1445
  ret.push({ column: 'Average', value: avg + 'x' });
1440
1446
  }
@@ -63,11 +63,7 @@ function WFAdaptorManifestation(adaptor) {
63
63
  //{{{ Render the details from rng (right hand side of graph tab)
64
64
  this.update_details = function(svgid){
65
65
  var tab = $('#dat_details');
66
- var focus_ele = $(':focus',tab);
67
- var focus_path = focus_ele.attr('data-relaxngui-path');
68
- var focus_pos = focus_ele.prop('selectionStart');
69
66
  var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
70
- tab.empty();
71
67
  if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
72
68
  save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
73
69
  var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
@@ -78,21 +74,16 @@ function WFAdaptorManifestation(adaptor) {
78
74
  if (save['endpoints_list'][$(node).attr('endpoint')] && (!save['endpoints_list'][$(node).attr('endpoint')].startsWith('http') || save['endpoints_list'][$(node).attr('endpoint')].match(/^https?-/))) {
79
75
  $(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
80
76
  }
81
- save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
82
77
  var nn = $X($(node).serializeXML());
83
78
  nn.removeAttr('svg-id');
84
79
  nn.removeAttr('svg-type');
85
80
  nn.removeAttr('svg-subtype');
86
81
  nn.removeAttr('svg-label');
82
+
83
+ tab.empty();
84
+ save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
87
85
  save['details'].content(nn);
88
- // only after setting content can we set the focus and position. It might loose some stuff nonetheless.
89
- if (focus_ele.length > 0) {
90
- var ele = $('[data-relaxngui-path="' + focus_path + '"]',tab)[0];
91
- ele.focus();
92
- if (ele.setSelectionRange) {
93
- ele.setSelectionRange(focus_pos,focus_pos);
94
- }
95
- }
86
+
96
87
  format_visual_forms();
97
88
  }
98
89
  }; //}}}
@@ -212,8 +203,17 @@ function WFAdaptorManifestation(adaptor) {
212
203
  $(nodes).each(function(key,str) {
213
204
  nodes[key] = $X(str);
214
205
  });
206
+ let svgids = [];
215
207
  $(nodes).each(function(key,node){
216
- var target = self.adaptor.description.get_node_by_svg_id($(node).attr('svg-id'));
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
217
  del_ui_pos(target)
218
218
  self.adaptor.description.remove(null,target);
219
219
  localStorage.removeItem('marked');
@@ -1235,28 +1235,33 @@ function WFAdaptorManifestation(adaptor) {
1235
1235
  return 'vertical';
1236
1236
  },
1237
1237
  'resolve_symbol': function(node) {
1238
+ let alist = []
1238
1239
  let plist = []
1239
- let dirty = false
1240
- $('*:not(:has(*))',node).each(function(i,n) {
1241
- let lines = n.textContent.split(/(\r\n)|\n|;/)
1242
- for (const l of lines) {
1243
- if (l != null) {
1244
- let m0 = l.match(/^[^=]*data\.([a-z0-9A-Z_]+)[^=]*=/)
1245
- if (m0 != null) {
1246
- plist.push(m0[1])
1247
- }
1248
- let m1 = l.match(/=[^=].*data\.([a-z0-9A-Z_]+)/)
1249
- let m2 = l.match(/^[^=]*data\.([a-z0-9A-Z_]+)[^=]*$/)
1250
- if (m1 != null && !plist.includes(m1[1])) {
1251
- dirty = true
1252
- }
1253
- if (m2 != null && !plist.includes(m2[1])) {
1254
- dirty = true
1255
- }
1256
- }
1240
+
1241
+ 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
1242
+ var reg_not_assi = /data\.([a-zA-Z_]+)\s*/g;
1243
+ $ ('call > parameters > arguments > *, call > code > *, loop[condition], alternative[condition]',node).each(function(i,n) {
1244
+ let item;
1245
+ if (n.hasAttribute('condition')) {
1246
+ item = n.getAttribute('condition');
1247
+ } else {
1248
+ item = n.textContent;
1249
+ }
1250
+ if (n.parentNode.nodeName == 'arguments' && item.charAt(0) != '!' ) { return }
1251
+
1252
+ let indices = [];
1253
+
1254
+ for (const match of item.matchAll(regassi)) {
1255
+ indices.push(match.index);
1256
+ alist.push(match[1]);
1257
+ }
1258
+ for (const match of item.matchAll(reg_not_assi)) {
1259
+ const arg1 = match[1];
1260
+ if (indices.includes(match.index)) { continue; }
1261
+ if (!alist.includes(arg1)) { plist.push(arg1); }
1257
1262
  }
1258
1263
  })
1259
- if (dirty) { return 'start_event'; }
1264
+ if (plist.length > 0) { return 'start_event'; }
1260
1265
  },
1261
1266
  'closing_symbol': 'end',
1262
1267
  'col_shift': function(node) {
@@ -63,11 +63,7 @@ function WFAdaptorManifestation(adaptor) {
63
63
  //{{{ Render the details from rng (right hand side of graph tab)
64
64
  this.update_details = function(svgid){
65
65
  var tab = $('#dat_details');
66
- var focus_ele = $(':focus',tab);
67
- var focus_path = focus_ele.attr('data-relaxngui-path');
68
- var focus_pos = focus_ele.prop('selectionStart');
69
66
  var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
70
- tab.empty();
71
67
  if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
72
68
  save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
73
69
  var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
@@ -78,21 +74,16 @@ function WFAdaptorManifestation(adaptor) {
78
74
  if (save['endpoints_list'][$(node).attr('endpoint')] && (!save['endpoints_list'][$(node).attr('endpoint')].startsWith('http') || save['endpoints_list'][$(node).attr('endpoint')].match(/^https?-/))) {
79
75
  $(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
80
76
  }
81
- save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
82
77
  var nn = $X($(node).serializeXML());
83
78
  nn.removeAttr('svg-id');
84
79
  nn.removeAttr('svg-type');
85
80
  nn.removeAttr('svg-subtype');
86
81
  nn.removeAttr('svg-label');
82
+
83
+ tab.empty();
84
+ save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
87
85
  save['details'].content(nn);
88
- // only after setting content can we set the focus and position. It might loose some stuff nonetheless.
89
- if (focus_ele.length > 0) {
90
- var ele = $('[data-relaxngui-path="' + focus_path + '"]',tab)[0];
91
- ele.focus();
92
- if (ele.setSelectionRange) {
93
- ele.setSelectionRange(focus_pos,focus_pos);
94
- }
95
- }
86
+
96
87
  format_visual_forms();
97
88
  }
98
89
  }; //}}}
@@ -212,8 +203,17 @@ function WFAdaptorManifestation(adaptor) {
212
203
  $(nodes).each(function(key,str) {
213
204
  nodes[key] = $X(str);
214
205
  });
206
+ let svgids = [];
215
207
  $(nodes).each(function(key,node){
216
- var target = self.adaptor.description.get_node_by_svg_id($(node).attr('svg-id'));
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
217
  del_ui_pos(target)
218
218
  self.adaptor.description.remove(null,target);
219
219
  localStorage.removeItem('marked');
@@ -1269,28 +1269,33 @@ function WFAdaptorManifestation(adaptor) {
1269
1269
  return 'vertical';
1270
1270
  },
1271
1271
  'resolve_symbol': function(node) {
1272
+ let alist = []
1272
1273
  let plist = []
1273
- let dirty = false
1274
- $('*:not(:has(*))',node).each(function(i,n) {
1275
- let lines = n.textContent.split(/(\r\n)|\n|;/)
1276
- for (const l of lines) {
1277
- if (l != null) {
1278
- let m0 = l.match(/^[^=]*data\.([a-z0-9A-Z_]+)[^=]*=/)
1279
- if (m0 != null) {
1280
- plist.push(m0[1])
1281
- }
1282
- let m1 = l.match(/=[^=].*data\.([a-z0-9A-Z_]+)/)
1283
- let m2 = l.match(/^[^=]*data\.([a-z0-9A-Z_]+)[^=]*$/)
1284
- if (m1 != null && !plist.includes(m1[1])) {
1285
- dirty = true
1286
- }
1287
- if (m2 != null && !plist.includes(m2[1])) {
1288
- dirty = true
1289
- }
1290
- }
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); }
1291
1296
  }
1292
1297
  })
1293
- if (dirty) { return 'start_event'; }
1298
+ if (plist.length > 0) { return 'start_event'; }
1294
1299
  },
1295
1300
  'closing_symbol': 'end',
1296
1301
  'col_shift': function(node) {