cpee 1.4.30 → 1.4.31

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.
@@ -0,0 +1,40 @@
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ <title>CPEE Cockpit</title>
7
+ <style>
8
+ :root {
9
+ --xx1: bold;
10
+ --xx2: normal;
11
+ }
12
+ #a, #c {
13
+ font-weight: var(--xx1);
14
+ }
15
+ #b, #d {
16
+ font-weight: var(--xx2);
17
+ }
18
+ #a:hover, #c:hover {
19
+ @nest & {
20
+ --xx1: bold;
21
+ }
22
+ }
23
+ #b:hover, #d:hover {
24
+ @nest & {
25
+ --xx2: bold;
26
+ }
27
+ }
28
+ </style>
29
+ </head>
30
+ <body>
31
+ <div id='graphgrid'>
32
+ <div>
33
+ <div id='a' class='a'>aaa</div>
34
+ <div id='b' class='b'>bbb</div>
35
+ </div>
36
+ <div id='c' class='a'>aaa</div>
37
+ <div id='d' class='b'>bbb</div>
38
+ </div>
39
+ </body>
40
+ </html>
@@ -8,8 +8,6 @@ function WFAdaptorManifestation(adaptor) {
8
8
  this.compact = true;
9
9
  this.endpoints = {};
10
10
 
11
- this.noarrow = ['alternative', 'otherwise'];
12
-
13
11
  //{{{ transform the details data to description parts based on rng
14
12
  this.source = function(base,opts) {
15
13
  if (base[0].namespaceURI == "http://relaxng.org/ns/structure/1.0") {
@@ -189,6 +187,9 @@ function WFAdaptorManifestation(adaptor) {
189
187
  }
190
188
  return false;
191
189
  } // }}}
190
+ this.events.suppress = function(svgid, e, child, sibling) { // {{{
191
+ return false;
192
+ } // }}}
192
193
  this.events.click = function(svgid, e) { // {{{
193
194
  if (self.adaptor.description.get_node_by_svg_id(svgid).length == 0) {
194
195
  return;
@@ -237,7 +238,20 @@ function WFAdaptorManifestation(adaptor) {
237
238
  'illustrator': {//{{{
238
239
  'endnodes': 'this',
239
240
  'label': function(node){
240
- return $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'');
241
+ var ep = self.endpoints[$(node).attr('endpoint')];
242
+ var eplen = 1;
243
+ if (ep != undefined && ep[0] == '[') {
244
+ try {
245
+ eplen = JSON.parse(ep).length;
246
+ } catch(e) {
247
+ eplen = 1;
248
+ }
249
+ } else {
250
+ eplen = 1;
251
+ }
252
+ var avg = $('> _timing_avg',$(node).children('_timing')).text();
253
+ var lnd = $(node).attr('endpoint');
254
+ return $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'') + (lnd == '' ? '' : ' (Resource ' + lnd + (eplen > 1 ? ' - ' + (eplen) + ' Alternatives': ' - 1 Alternative') + ')') + (avg == '' ? '' : ' (Avg. Duration ' + avg + ' Min)');
241
255
  },
242
256
  'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
243
257
  'resolve_symbol': function(node) {
@@ -332,8 +346,81 @@ function WFAdaptorManifestation(adaptor) {
332
346
  return [];
333
347
  }, //}}}
334
348
  'adaptor': {//{{{
335
- 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
349
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,false); },
350
+ }//}}}
351
+ }; /*}}}*/
352
+ this.elements.end = { /*{{{*/
353
+ 'type': 'primitive',
354
+ 'illustrator': {//{{{
355
+ 'endnodes': 'this',
356
+ 'svg': self.adaptor.theme_dir + 'symbols/end.svg'
357
+ }, //}}}
358
+ 'adaptor': {//{{{
359
+ 'mousedown': function (node,e) {
360
+ self.events.suppress();
361
+ }
362
+ }//}}}
363
+ }; /*}}}*/
364
+ this.elements.event_end = { /*{{{*/
365
+ 'type': 'primitive',
366
+ 'illustrator': {//{{{
367
+ 'endnodes': 'this',
368
+ 'svg': self.adaptor.theme_dir + 'symbols/event_end.svg'
369
+ }, //}}}
370
+ 'adaptor': {//{{{
371
+ 'mousedown': function (node,e) {
372
+ self.events.suppress();
373
+ },
336
374
  'click': self.events.click,
375
+ 'dblclick': self.events.dblclick,
376
+ 'mouseover': self.events.mouseover,
377
+ 'mouseout': self.events.mouseout
378
+ }//}}}
379
+ }; /*}}}*/
380
+ this.elements.choose_finish = { /*{{{*/
381
+ 'type': 'primitive',
382
+ 'illustrator': {//{{{
383
+ 'endnodes': 'this',
384
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg',
385
+ 'resolve_symbol': function(node) {
386
+ if($(node).attr('mode') == 'exclusive') {
387
+ return 'choose_exclusive_finish';
388
+ } else {
389
+ return 'choose_inclusive_finish';
390
+ }
391
+ },
392
+ }, //}}}
393
+ 'adaptor': {//{{{
394
+ 'mousedown': function (node,e) {
395
+ self.events.mousedown(node,e,true,true);
396
+ },
397
+ 'click': self.events.click,
398
+ 'dblclick': self.events.dblclick,
399
+ 'mouseover': self.events.mouseover,
400
+ 'mouseout': self.events.mouseout
401
+ }//}}}
402
+ }; /*}}}*/
403
+ this.elements.parallel_finish = { /*{{{*/
404
+ 'type': 'primitive',
405
+ 'illustrator': {//{{{
406
+ 'endnodes': 'this',
407
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg',
408
+ 'resolve_symbol': function(node) {
409
+ if($(node).attr('wait') == '-1') {
410
+ return 'parallel_simple';
411
+ } else {
412
+ return 'parallel_complex';
413
+ }
414
+ },
415
+ }, //}}}
416
+ 'adaptor': {//{{{
417
+ 'mousedown': function (node,e) {
418
+ self.events.mousedown(node,e,true,true);
419
+ },
420
+ 'click': self.events.click,
421
+ 'dblclick': self.events.dblclick,
422
+ 'mouseover': self.events.mouseover,
423
+ 'mouseout': self.events.mouseout
337
424
  }//}}}
338
425
  }; /*}}}*/
339
426
 
@@ -344,6 +431,7 @@ function WFAdaptorManifestation(adaptor) {
344
431
  'label': function(node){return $(node).attr('mode') == 'exclusive' ? 'exclusive' : 'inclusive' },
345
432
  'endnodes': 'aggregate',
346
433
  'closeblock': false,
434
+ 'closing_symbol': 'choose_finish',
347
435
  'expansion': function(node) {
348
436
  return 'horizontal';
349
437
  },
@@ -403,8 +491,13 @@ function WFAdaptorManifestation(adaptor) {
403
491
  this.elements.otherwise = { /*{{{*/
404
492
  'type': 'complex',
405
493
  'illustrator': {//{{{
494
+ 'label': function(node){
495
+ var avg = $('> _probability_avg',$(node).children('_probability')).text();
496
+ return (avg == '' ? '' : ' (Avg. Probability ' + avg + '%)');
497
+ },
406
498
  'endnodes': 'passthrough',
407
499
  'closeblock': false,
500
+ 'noarrow': true,
408
501
  'expansion': function(node) {
409
502
  return 'vertical';
410
503
  },
@@ -481,8 +574,12 @@ function WFAdaptorManifestation(adaptor) {
481
574
  this.elements.alternative = { /*{{{*/
482
575
  'type': 'complex',
483
576
  'illustrator': {//{{{
484
- 'label': function(node){return $(node).attr('condition')},
577
+ 'label': function(node){
578
+ var avg = $('> _probability_avg',$(node).children('_probability')).text();
579
+ return $(node).attr('condition') + (avg == '' ? '' : ' (Avg. Probability ' + avg + '%)');
580
+ },
485
581
  'endnodes': 'passthrough',
582
+ 'noarrow': true,
486
583
  'closeblock':false,
487
584
  'expansion': function(node) {
488
585
  return 'vertical';
@@ -564,7 +661,10 @@ function WFAdaptorManifestation(adaptor) {
564
661
  this.elements.loop = { /*{{{*/
565
662
  'type': 'complex',
566
663
  'illustrator': {//{{{
567
- 'label': function(node){return $(node).attr('condition') + ($(node).attr('mode') == 'pre_test' ? ' (⭱)' : ' (⭳)') },
664
+ 'label': function(node){
665
+ var avg = $('> _probability_avg',$(node).children('_probability')).text();
666
+ return $(node).attr('condition') + ($(node).attr('mode') == 'pre_test' ? ' (⭱)' : ' (⭳)') + (avg == '' ? '' : ' (Avg. ' + avg + ' Times)');
667
+ },
568
668
  'endnodes': 'this',
569
669
  'closeblock': true,
570
670
  'expansion': function(node) {
@@ -652,9 +752,9 @@ function WFAdaptorManifestation(adaptor) {
652
752
  this.elements.parallel = { /*{{{*/
653
753
  'type': 'complex',
654
754
  'illustrator': {//{{{
655
- 'endnodes': 'this',
755
+ 'endnodes': 'aggregate',
656
756
  'closeblock': false,
657
- 'border': true,
757
+ 'closing_symbol': 'parallel_finish',
658
758
  'expansion': function(node) {
659
759
  // check if any sibling other than 'parallel_branch' is present
660
760
  if($(node).children(':not(parallel_branch)').length > 0) return 'vertical';
@@ -667,49 +767,37 @@ function WFAdaptorManifestation(adaptor) {
667
767
  },//}}}
668
768
  'description': self.adaptor.theme_dir + 'rngs/parallel.rng',
669
769
  'permissible_children': function(node,mode) { //{{{
770
+ var func = null;
771
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
772
+ else { func = self.adaptor.description.insert_after }
670
773
  var childs = [
671
774
  {'label': 'Service Call with Scripts',
672
- 'function_call': self.adaptor.description.insert_last_into,
775
+ 'function_call': func,
673
776
  'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
674
777
  'type': 'callmanipulate',
675
778
  'params': [self.adaptor.description.elements.callmanipulate, node]},
676
779
  {'label': 'Service Call',
677
- 'function_call': self.adaptor.description.insert_last_into,
780
+ 'function_call': func,
678
781
  'menu_icon': self.elements.call.illustrator.svg.clone(),
679
782
  'type': 'call',
680
783
  'params': [self.adaptor.description.elements.call, node]},
681
784
  {'label': 'Manipulate',
682
- 'function_call': self.adaptor.description.insert_last_into,
785
+ 'function_call': func,
683
786
  'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
684
787
  'type': 'manipulate',
685
788
  'params': [self.adaptor.description.elements.manipulate, node]},
686
789
  {'label': 'Decision',
687
- 'function_call': self.adaptor.description.insert_last_into,
790
+ 'function_call': func,
688
791
  'menu_icon': self.elements.choose.illustrator.svg.clone(),
689
792
  'type': 'choose',
690
793
  'params': [self.adaptor.description.elements.choose, node]},
691
794
  {'label': 'Loop',
692
- 'function_call': self.adaptor.description.insert_last_into,
795
+ 'function_call': func,
693
796
  'menu_icon': self.elements.loop.illustrator.svg.clone(),
694
797
  'type': 'loop',
695
798
  'params': [self.adaptor.description.elements.loop, node]},
696
- {'label': 'Terminate',
697
- 'function_call': self.adaptor.description.insert_last_into,
698
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
699
- 'type': 'terminate',
700
- 'params': [self.adaptor.description.elements.terminate, node]},
701
- {'label': 'Stop',
702
- 'function_call': self.adaptor.description.insert_last_into,
703
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
704
- 'type': 'stop',
705
- 'params': [self.adaptor.description.elements.stop, node]},
706
- {'label': 'Critical',
707
- 'function_call': self.adaptor.description.insert_last_into,
708
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
709
- 'type': 'critical',
710
- 'params': [self.adaptor.description.elements.critical, node]},
711
799
  {'label': 'Parallel Branch',
712
- 'function_call': self.adaptor.description.insert_last_into,
800
+ 'function_call': func,
713
801
  'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
714
802
  'type': 'parallel_branch',
715
803
  'params': [self.adaptor.description.elements.parallel_branch, node]}
@@ -735,11 +823,19 @@ function WFAdaptorManifestation(adaptor) {
735
823
  this.elements.parallel_branch = { /*{{{*/
736
824
  'type': 'complex',
737
825
  'illustrator': {//{{{
738
- 'endnodes': 'this',
826
+ 'endnodes': 'passthrough',
739
827
  'closeblock': false,
828
+ 'noarrow': true,
740
829
  'expansion': function(node) {
741
830
  return 'vertical';
742
831
  },
832
+ 'resolve_symbol': function(node,shift) {
833
+ if(shift == true) {
834
+ return 'parallel_branch_event';
835
+ } else {
836
+ return 'parallel_branch_normal';
837
+ }
838
+ },
743
839
  'col_shift': function(node) {
744
840
  if(node.parentNode.tagName == 'choose') return false;
745
841
  if($(node).parents('parallel').first().children(':not(parallel_branch)').length > 0) return true;
@@ -811,7 +907,12 @@ function WFAdaptorManifestation(adaptor) {
811
907
  }, //}}}
812
908
  'adaptor': {//{{{
813
909
  'mousedown': function (node,e) {
814
- self.events.mousedown(node,e,true,false);
910
+ var xml_node = self.adaptor.description.get_node_by_svg_id(node);
911
+ if(xml_node.get(0).parentNode.tagName == 'parallel') {
912
+ self.events.mousedown(node,e,true,false);
913
+ } else {
914
+ self.events.mousedown(node,e,true,true);
915
+ }
815
916
  },
816
917
  'click': self.events.click,
817
918
  'dblclick': self.events.dblclick,
@@ -933,9 +1034,11 @@ function WFAdaptorManifestation(adaptor) {
933
1034
  'illustrator': {//{{{
934
1035
  'endnodes': 'passthrough',
935
1036
  'closeblock': false,
1037
+ 'balance': true,
936
1038
  'expansion': function(node) {
937
1039
  return 'vertical';
938
1040
  },
1041
+ 'closing_symbol': 'end',
939
1042
  'col_shift': function(node) {
940
1043
  return true;
941
1044
  },
@@ -1009,7 +1112,6 @@ function WFAdaptorManifestation(adaptor) {
1009
1112
  // * they may only have an illustrator (or other parts)
1010
1113
  // * they HAVE TO have a parent
1011
1114
  this.elements.callmanipulate = { /*{{{*/
1012
- 'type': 'abstract',
1013
1115
  'parent': 'call',
1014
1116
  'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
1015
1117
  'illustrator': {//{{{
@@ -1019,21 +1121,59 @@ function WFAdaptorManifestation(adaptor) {
1019
1121
  },//}}}
1020
1122
  }; /*}}}*/
1021
1123
  this.elements.choose_inclusive = { /*{{{*/
1022
- 'type': 'abstract',
1023
1124
  'parent': 'choose',
1024
1125
  'illustrator': {//{{{
1025
1126
  'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1026
- },//}}}
1127
+ }//}}}
1027
1128
  }; /*}}}*/
1028
1129
  this.elements.choose_exclusive = { /*{{{*/
1029
- 'type': 'abstract',
1030
1130
  'parent': 'choose',
1031
1131
  'illustrator': {//{{{
1032
1132
  'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1033
1133
  },//}}}
1034
1134
  }; /*}}}*/
1135
+ this.elements.choose_inclusive_finish = { /*{{{*/
1136
+ 'parent': 'choose_finish',
1137
+ 'illustrator': {//{{{
1138
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1139
+ }//}}}
1140
+ }; /*}}}*/
1141
+ this.elements.choose_exclusive_finish = { /*{{{*/
1142
+ 'parent': 'choose_finish',
1143
+ 'illustrator': {//{{{
1144
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1145
+ },//}}}
1146
+ }; /*}}}*/
1147
+ this.elements.parallel_simple = { /*{{{*/
1148
+ 'parent': 'parallel_finish',
1149
+ 'illustrator': {//{{{
1150
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
1151
+ }//}}}
1152
+ }; /*}}}*/
1153
+ this.elements.parallel_complex = { /*{{{*/
1154
+ 'parent': 'parallel_finish',
1155
+ 'illustrator': {//{{{
1156
+ 'svg': self.adaptor.theme_dir + 'symbols/complex.svg'
1157
+ },//}}}
1158
+ }; /*}}}*/
1159
+ this.elements.parallel_branch_normal = { /*{{{*/
1160
+ 'parent': 'parallel_branch',
1161
+ 'illustrator': {//{{{
1162
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_normal.svg'
1163
+ }//}}}
1164
+ }; /*}}}*/
1165
+ this.elements.parallel_branch_event = { /*{{{*/
1166
+ 'parent': 'parallel_branch',
1167
+ 'illustrator': {//{{{
1168
+ 'endnodes': 'this',
1169
+ 'noarrow': false,
1170
+ 'border': true,
1171
+ 'wide': true,
1172
+ 'closing_symbol': 'event_end',
1173
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_event.svg'
1174
+ }//}}}
1175
+ }; /*}}}*/
1035
1176
  this.elements.scripts = { /*{{{*/
1036
- 'type': 'abstract',
1037
1177
  'description': [self.adaptor.theme_dir + 'rngs/update.rng',self.adaptor.theme_dir + 'rngs/finalize.rng']
1038
1178
  }; /*}}}*/
1039
1179
  }
@@ -2,4 +2,24 @@
2
2
  <attribute name="condition" rngui:label="Condition">
3
3
  <data type="string" rngui:label="Condition"/>
4
4
  </attribute>
5
+ <element name="_probability" rngui:mark="true" rngui:header="Execution Probability">
6
+ <element name="_probability_min" rngui:label='Min in %'>
7
+ <data type='integer' rngui:label='Percent 0-100'>
8
+ <param name="minInclusive">1</param>
9
+ <param name="maxInclusive">100</param>
10
+ </data>
11
+ </element>
12
+ <element name="_probability_max" rngui:label='Max in %'>
13
+ <data type='integer' rngui:label='Percent 0-100'>
14
+ <param name="minInclusive">1</param>
15
+ <param name="maxInclusive">100</param>
16
+ </data>
17
+ </element>
18
+ <element name="_probability_avg" rngui:label='Avg in %'>
19
+ <data type='integer' rngui:label='Percent 0-100'>
20
+ <param name="minInclusive">1</param>
21
+ <param name="maxInclusive">100</param>
22
+ </data>
23
+ </element>
24
+ </element>
5
25
  </element>
@@ -56,13 +56,13 @@
56
56
  </element>
57
57
  </element>
58
58
  <element name="_timing" rngui:header="Timing">
59
- <element name="_timing_min" rngui:label='Min in m'>
59
+ <element name="_timing_min" rngui:label='Min in min'>
60
60
  <data type='float' rngui:label='Minutes'/>
61
61
  </element>
62
- <element name="_timing_max" rngui:label='Max in m'>
62
+ <element name="_timing_max" rngui:label='Max in min'>
63
63
  <data type='float' rngui:label='Minutes'/>
64
64
  </element>
65
- <element name="_timing_avg" rngui:label='Avg in m'>
65
+ <element name="_timing_avg" rngui:label='Avg in min'>
66
66
  <data type='float' rngui:label='Minutes'/>
67
67
  </element>
68
68
  </element>
@@ -68,13 +68,13 @@
68
68
  <text rngui:label='Script that is executed, when a service sends intermediate data'/>
69
69
  </element>
70
70
  <element name="_timing" rngui:header="Timing">
71
- <element name="_timing_min" rngui:label='Min in m'>
71
+ <element name="_timing_min" rngui:label='Min in min'>
72
72
  <data type='float' rngui:label='Minutes'/>
73
73
  </element>
74
- <element name="_timing_max" rngui:label='Max in m'>
74
+ <element name="_timing_max" rngui:label='Max in min'>
75
75
  <data type='float' rngui:label='Minutes'/>
76
76
  </element>
77
- <element name="_timing_avg" rngui:label='Avg in m'>
77
+ <element name="_timing_avg" rngui:label='Avg in min'>
78
78
  <data type='float' rngui:label='Minutes'/>
79
79
  </element>
80
80
  </element>