cpee 2.0.21 → 2.0.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/CPEE.xml +8 -0
  3. data/cockpit/Signavio.xml +8 -0
  4. data/cockpit/css/model.css +2 -0
  5. data/cockpit/css/replay.css +55 -0
  6. data/cockpit/css/ui.css +29 -5
  7. data/cockpit/edit.html +263 -0
  8. data/cockpit/graph.html +3 -3
  9. data/cockpit/index.html +11 -8
  10. data/cockpit/js/details.js +0 -1
  11. data/cockpit/js/edit.js +32 -0
  12. data/cockpit/js/instance.js +52 -52
  13. data/cockpit/js/model.js +6 -36
  14. data/cockpit/js/parameters.js +9 -4
  15. data/cockpit/js/replay.js +40 -0
  16. data/cockpit/js/ui.js +7 -0
  17. data/cockpit/model.html +8 -4
  18. data/cockpit/replay.html +53 -0
  19. data/cockpit/templates/Coopis 2010.xml +1 -1
  20. data/cockpit/templates/IUPC arXiv:1104.3609 P34 1.xml +1 -1
  21. data/cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml +1 -1
  22. data/cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml +1 -1
  23. data/cockpit/templates/Track Test Local.xml +6 -2
  24. data/cockpit/templates/Track Test.xml +5 -1
  25. data/cockpit/templates/UR-VUE 2020 Manual Adjust.xml +5 -1
  26. data/cockpit/templates/UR-VUE 2020 Solution Baseline.xml +8 -4
  27. data/cockpit/templates/UR-VUE 2020 Solution NN.xml +8 -4
  28. data/cockpit/templates/UR-VUE 2020 Solution View.xml +8 -4
  29. data/cockpit/templates/UR-VUE 2020.xml +8 -4
  30. data/cockpit/templates/instantiate.local/Take_Sub.xml +1 -1
  31. data/cockpit/themes/compact/rngs/call.rng +93 -41
  32. data/cockpit/themes/compact/rngs/callmanipulate.rng +113 -40
  33. data/cockpit/themes/compact/theme.js +57 -25
  34. data/cockpit/themes/{diana → control}/rngs/alternative.rng +0 -0
  35. data/cockpit/themes/control/rngs/call.rng +174 -0
  36. data/cockpit/themes/control/rngs/callmanipulate.rng +218 -0
  37. data/cockpit/themes/{diana → control}/rngs/choose.rng +0 -0
  38. data/cockpit/themes/{diana → control}/rngs/closed_loop.rng +0 -0
  39. data/cockpit/themes/{diana → control}/rngs/closed_loop_cancel.rng +0 -0
  40. data/cockpit/themes/{diana → control}/rngs/closed_loop_control.rng +0 -0
  41. data/cockpit/themes/{diana → control}/rngs/closed_loop_measuring.rng +0 -0
  42. data/cockpit/themes/{diana → control}/rngs/critical.rng +0 -0
  43. data/cockpit/themes/{diana → control}/rngs/escape.rng +0 -0
  44. data/cockpit/themes/{diana → control}/rngs/group.rng +0 -0
  45. data/cockpit/themes/{diana → control}/rngs/loop.rng +0 -0
  46. data/cockpit/themes/{diana → control}/rngs/manipulate.rng +0 -0
  47. data/cockpit/themes/{diana → control}/rngs/otherwise.rng +0 -0
  48. data/cockpit/themes/{diana → control}/rngs/parallel.rng +0 -0
  49. data/cockpit/themes/{diana → control}/rngs/parallel_branch.rng +0 -0
  50. data/cockpit/themes/{diana → control}/rngs/scripts.rng +0 -0
  51. data/cockpit/themes/{diana → control}/rngs/stop.rng +0 -0
  52. data/cockpit/themes/{diana → control}/rngs/terminate.rng +0 -0
  53. data/cockpit/themes/{diana → control}/symbols/alternative.svg +0 -0
  54. data/cockpit/themes/{diana → control}/symbols/arrow.svg +0 -0
  55. data/cockpit/themes/{diana → control}/symbols/call.svg +0 -0
  56. data/cockpit/themes/{diana → control}/symbols/callmanipulate.svg +0 -0
  57. data/cockpit/themes/{diana → control}/symbols/choose.svg +0 -0
  58. data/cockpit/themes/{diana → control}/symbols/choose_exclusive.svg +0 -0
  59. data/cockpit/themes/{diana → control}/symbols/choose_inclusive.svg +0 -0
  60. data/cockpit/themes/{diana → control}/symbols/closed_loop.svg +0 -0
  61. data/cockpit/themes/{diana → control}/symbols/closed_loop_cancel.svg +0 -0
  62. data/cockpit/themes/{diana → control}/symbols/closed_loop_control.svg +0 -0
  63. data/cockpit/themes/{diana → control}/symbols/closed_loop_measuring.svg +0 -0
  64. data/cockpit/themes/{diana → control}/symbols/complex.svg +0 -0
  65. data/cockpit/themes/{diana → control}/symbols/critical.svg +0 -0
  66. data/cockpit/themes/{diana → control}/symbols/end.svg +0 -0
  67. data/cockpit/themes/{diana → control}/symbols/escape.svg +0 -0
  68. data/cockpit/themes/{diana → control}/symbols/event_end.svg +0 -0
  69. data/cockpit/themes/{diana → control}/symbols/loop.svg +0 -0
  70. data/cockpit/themes/{diana → control}/symbols/manipulate.svg +0 -0
  71. data/cockpit/themes/{diana → control}/symbols/otherwise.svg +0 -0
  72. data/cockpit/themes/{diana → control}/symbols/parallel.svg +0 -0
  73. data/cockpit/themes/{diana → control}/symbols/parallel_branch.svg +0 -0
  74. data/cockpit/themes/{diana → control}/symbols/parallel_branch_compact.svg +0 -0
  75. data/cockpit/themes/{diana → control}/symbols/parallel_branch_event.svg +0 -0
  76. data/cockpit/themes/{diana → control}/symbols/parallel_branch_normal.svg +0 -0
  77. data/cockpit/themes/{diana → control}/symbols/scripts.svg +0 -0
  78. data/cockpit/themes/{diana → control}/symbols/start.svg +0 -0
  79. data/cockpit/themes/{diana → control}/symbols/stop.svg +0 -0
  80. data/cockpit/themes/{diana → control}/symbols/terminate.svg +0 -0
  81. data/cockpit/themes/{diana → control}/theme.js +74 -28
  82. data/cockpit/themes/default/rngs/call.rng +93 -41
  83. data/cockpit/themes/default/rngs/callmanipulate.rng +113 -40
  84. data/cockpit/themes/default/theme.js +1318 -0
  85. data/cockpit/themes/extended/rngs/call.rng +93 -41
  86. data/cockpit/themes/extended/rngs/callmanipulate.rng +113 -40
  87. data/cockpit/themes/extended/theme.js +50 -19
  88. data/cockpit/themes/model/rngs/call.rng +21 -20
  89. data/cockpit/themes/model/rngs/callmanipulate.rng +23 -22
  90. data/cockpit/themes/model/theme.js +51 -20
  91. data/cockpit/themes/packed/rngs/call.rng +93 -41
  92. data/cockpit/themes/packed/rngs/callmanipulate.rng +113 -40
  93. data/cockpit/themes/packed/theme.js +50 -19
  94. data/cockpit/themes/preset/rngs/call.rng +93 -41
  95. data/cockpit/themes/preset/rngs/callmanipulate.rng +113 -40
  96. data/cockpit/themes/preset/theme.js +49 -18
  97. data/cockpit/track.html +3 -10
  98. data/cockpit/transformations.xml +4 -0
  99. data/cpee.gemspec +2 -2
  100. data/lib/callbacks.xml +5 -0
  101. data/lib/cpee/controller.rb +30 -28
  102. data/lib/cpee/implementation_callbacks.rb +60 -0
  103. data/lib/cpee/implementation_notifications.rb +6 -2
  104. data/server/handlerwrappers/default.rb +17 -5
  105. data/server/resources/notifications/logging/subscription.xml +6 -0
  106. data/server/resources/transformation_dslx.xsl +1 -1
  107. data/server/routing/end.pid +1 -0
  108. data/server/routing/end.rb +1 -0
  109. data/server/routing/forward-events.pid +1 -0
  110. data/server/routing/forward-votes.pid +1 -0
  111. data/server/routing/forward-votes.rb +6 -5
  112. data/server/routing/persist.pid +1 -0
  113. data/server/routing/persist.rb +4 -4
  114. data/server/server.pid +1 -0
  115. metadata +63 -50
  116. data/cockpit/edit.html +0 -1
  117. data/cockpit/themes/diana/rngs/call.rng +0 -122
  118. data/cockpit/themes/diana/rngs/callmanipulate.rng +0 -145
@@ -26,7 +26,8 @@
26
26
  </zeroOrMore>
27
27
  </element>
28
28
  <element name="stream" rngui:header="Data Stream Handling" rngui:fold="closed">
29
- <element name="sensors" rngui:header="Sensors" rngui:fold="closed">
29
+
30
+ <element name="sensors" rngui:header="Sensor Data Streams" rngui:fold="closed">
30
31
  <zeroOrMore rngui:label="Add Sensor">
31
32
  <element name="sensor">
32
33
  <element name="name" rngui:label="Label">
@@ -35,13 +36,18 @@
35
36
  <element name="extractor_url" rngui:label="Extractor Url">
36
37
  <data type="string" rngui:label="Service Url"/>
37
38
  </element>
38
- <element name="extractor_arg" rngui:label="Extractor Argument">
39
- <data type="string" rngui:label="Value / Json"/>
39
+ <element name="extractor_params" rngui:label="Extractor Arguments:">
40
+ <zeroOrMore rngui:label="Create Extractor Argument Pairs">
41
+ <element rngui:label="Name">
42
+ <anyName/>
43
+ <data type="string" rngui:label="Value / Json"/>
44
+ </element>
45
+ </zeroOrMore>
40
46
  </element>
41
47
  <element name="visualizer_url" rngui:label="Visualizer Url">
42
48
  <data type="string" rngui:label="Service Url"/>
43
49
  </element>
44
- <element name="visualizer_params" rngui:header="Visualizer Arguments">
50
+ <element name="visualizer_params" rngui:label="Visualizer Arguments">
45
51
  <zeroOrMore rngui:label="Create Visualizer Argument Pairs">
46
52
  <element rngui:label="Name">
47
53
  <anyName/>
@@ -52,44 +58,46 @@
52
58
  </element>
53
59
  </zeroOrMore>
54
60
  </element>
55
- <element name="aggregators" rngui:header="Aggregators" rngui:fold="closed">
56
- <zeroOrMore rngui:label="Add Aggregator">
57
- <element name="aggregator">
58
- <element name="name" rngui:label="Label">
59
- <data type="string" rngui:label="Label"/>
60
- </element>
61
- <element name="aggregator_url" rngui:label="Aggregator Url">
62
- <data type="string" rngui:label="Service Url"/>
63
- </element>
64
- <element name="aggregator_arg" rngui:label="Aggregator Argument">
65
- <data type="string" rngui:label="Value / Json"/>
66
- </element>
67
- </element>
68
- </zeroOrMore>
69
- </element>
70
- <element name="costs" rngui:header="Costs" rngui:fold="closed">
71
- <zeroOrMore rngui:label="Create Cost Factor">
72
- <element name="cost_factor">
61
+
62
+ <element name="ips" rngui:header="Impact Profiles" rngui:fold="closed">
63
+ <zeroOrMore rngui:label="Add Impact Profile">
64
+ <element name="ip">
73
65
  <element name="name" rngui:label="Label">
74
66
  <data type="string" rngui:label="Label"/>
75
67
  </element>
76
68
  <element name="target" rngui:label="Target Value">
77
69
  <data type="string" rngui:label="Value"/>
78
70
  </element>
79
- <element name="vfunc_url" rngui:label="Violation Function Url">
80
- <data type="string" rngui:label="Service Url"/>
81
- </element>
82
- <element name="vfunc_arg" rngui:label="Violation Function Argument">
83
- <data type="string" rngui:label="Service Url"/>
71
+ <element name="ifs" rngui:header="Impact Factors">
72
+ <zeroOrMore rngui:label="Add Impact Factor">
73
+ <element name="if">
74
+ <element name="ivs" rngui:header="Impact Values">
75
+ <zeroOrMore rngui:label="Add Impact Value ">
76
+ <element name="iv">
77
+ <element name="extractor_url" rngui:label="Extractor Url">
78
+ <data type="string" rngui:label="Service Url + Parameters"/>
79
+ </element>
80
+ <element name="aggregator_url" rngui:label="Aggregator Url">
81
+ <data type="string" rngui:label="Service Url + Parameters"/>
82
+ </element>
83
+ </element>
84
+ </zeroOrMore>
85
+ </element>
86
+ <element name="aggregator_url" rngui:label="Impact Function Url">
87
+ <data type="string" rngui:label="Service Url + Parameters"/>
88
+ </element>
89
+ </element>
90
+ </zeroOrMore>
84
91
  </element>
85
- <element name="vcost" rngui:label="Violation Cost">
86
- <data type="string" rngui:label="Value"/>
92
+ <element name="vfunc_url" rngui:label="Violation Function Url">
93
+ <data type="string" rngui:label="Service Url + Parameters"/>
87
94
  </element>
88
95
  </element>
89
96
  </zeroOrMore>
90
97
  </element>
98
+
91
99
  </element>
92
- <element name="report" rngui:header="Reporting Annotation" rngui:fold="closed">
100
+ <element name="report" rngui:header="Reporting" rngui:fold="closed">
93
101
  <element name="url" rngui:label='HTML Snippet'>
94
102
  <data type="string" rngui:label="url to report snippet"/>
95
103
  </element>
@@ -97,21 +105,40 @@
97
105
  </element>
98
106
  <element name="annotations" rngui:header="Annotations">
99
107
  <element name="_timing" rngui:header="Timing" rngui:fold="closed">
100
- <element name="_timing_wait" rngui:label="&#x3C9; - Wait">
101
- <data type="float" rngui:label="[0,1]" rngui:default="0.5"/>
102
- </element>
103
- <element name="_timing_threshold" rngui:label="&#x3BA; - Threshold">
104
- <data type="float" rngui:label="[0,3,n]" rngui:default="3"/>
105
- </element>
106
- <element name="_timing_min" rngui:label="Min in min">
107
- <data type="float" rngui:label="Minutes"/>
108
- </element>
109
- <element name="_timing_max" rngui:label="Max in min">
110
- <data type="float" rngui:label="Minutes"/>
108
+ <element name="_timing_weight" rngui:label="&#x3C9; - Weight">
109
+ <data type="float" rngui:label="[0,1]"/>
111
110
  </element>
112
111
  <element name="_timing_avg" rngui:label="Avg in min">
113
112
  <data type="float" rngui:label="Minutes"/>
114
113
  </element>
114
+ <element name="explanations" rngui:header="Explanations">
115
+ <zeroOrMore rngui:label="Add Explanation">
116
+ <element name="explanation">
117
+ <element name="type" rngui:label="Type">
118
+ <choice>
119
+ <value>&gt;</value>
120
+ <value>&lt;</value>
121
+ </choice>
122
+ </element>
123
+ <element name="deviation" rngui:label="Deviation">
124
+ <data type="float" rngui:label="Minutes"/>
125
+ </element>
126
+ <element name="behaviour" rngui:label="Behaviour">
127
+ <choice>
128
+ <value>Immediately</value>
129
+ <value>Wait until next</value>
130
+ <value>Use grace period value</value>
131
+ </choice>
132
+ </element>
133
+ <element name="grace" rngui:label="Grace Period" rngui:default="0.0">
134
+ <data type="float" rngui:label="Minutes"/>
135
+ </element>
136
+ <element name="text" rngui:label="Explanation">
137
+ <data type="string" rngui:label="Patterns"/>
138
+ </element>
139
+ </element>
140
+ </zeroOrMore>
141
+ </element>
115
142
  </element>
116
143
  <element name="_notes" rngui:header="Notes" rngui:fold="closed">
117
144
  <element name="_notes_general" rngui:label="General">
@@ -119,4 +146,29 @@
119
146
  </element>
120
147
  </element>
121
148
  </element>
149
+ <element name="input" rngui:header="Input Arguments Documentation" rngui:fold="closed">
150
+ <zeroOrMore rngui:label="Create Argument">
151
+ <element name="item" rngui:label="Description">
152
+ <attribute name="label" rngui:label="Name">
153
+ <data type="string"/>
154
+ </attribute>
155
+ <text rngui:wrap="true" rngui:label="What does it do?"/>
156
+ </element>
157
+ </zeroOrMore>
158
+ </element>
159
+ <element name="output" rngui:header="Output Elements Documentation" rngui:fold="closed">
160
+ <zeroOrMore rngui:label="Create Element">
161
+ <element name="item" rngui:label="Description">
162
+ <attribute name="label" rngui:label="Name">
163
+ <data type="string"/>
164
+ </attribute>
165
+ <text rngui:wrap="true" rngui:label="What does it do?"/>
166
+ </element>
167
+ </zeroOrMore>
168
+ </element>
169
+ <element name="implementation" rngui:header="Implementation Documentation" rngui:fold="closed">
170
+ <element name="description" rngui:label="Description">
171
+ <text rngui:wrap="true" rngui:label="What is supposed to happen?"/>
172
+ </element>
173
+ </element>
122
174
  </element>
@@ -26,7 +26,8 @@
26
26
  </zeroOrMore>
27
27
  </element>
28
28
  <element name="stream" rngui:header="Data Stream Handling" rngui:fold="closed">
29
- <element name="sensors" rngui:header="Sensors" rngui:fold="closed">
29
+
30
+ <element name="sensors" rngui:header="Sensor Data Streams" rngui:fold="closed">
30
31
  <zeroOrMore rngui:label="Add Sensor">
31
32
  <element name="sensor">
32
33
  <element name="name" rngui:label="Label">
@@ -35,8 +36,13 @@
35
36
  <element name="extractor_url" rngui:label="Extractor Url">
36
37
  <data type="string" rngui:label="Service Url"/>
37
38
  </element>
38
- <element name="extractor_arg" rngui:label="Extractor Argument">
39
- <data type="string" rngui:label="Value / Json"/>
39
+ <element name="extractor_params" rngui:label="Extractor Arguments:">
40
+ <zeroOrMore rngui:label="Create Extractor Argument Pairs">
41
+ <element rngui:label="Name">
42
+ <anyName/>
43
+ <data type="string" rngui:label="Value / Json"/>
44
+ </element>
45
+ </zeroOrMore>
40
46
  </element>
41
47
  <element name="visualizer_url" rngui:label="Visualizer Url">
42
48
  <data type="string" rngui:label="Service Url"/>
@@ -52,50 +58,68 @@
52
58
  </element>
53
59
  </zeroOrMore>
54
60
  </element>
55
- <element name="aggregators" rngui:header="Aggregators" rngui:fold="closed">
56
- <zeroOrMore rngui:label="Add Aggregator">
57
- <element name="aggregator">
58
- <element name="name" rngui:label="Label">
59
- <data type="string" rngui:label="Label"/>
60
- </element>
61
- <element name="aggregator_url" rngui:label="Aggregator Url">
62
- <data type="string" rngui:label="Service Url"/>
63
- </element>
64
- <element name="aggregator_arg" rngui:label="Aggregator Argument">
65
- <data type="string" rngui:label="Value / Json"/>
66
- </element>
67
- </element>
68
- </zeroOrMore>
69
- </element>
70
- <element name="costs" rngui:header="Costs" rngui:fold="closed">
71
- <zeroOrMore rngui:label="Create Cost Factor">
72
- <element name="cost_factor">
61
+
62
+ <element name="ips" rngui:header="Impact Profiles" rngui:fold="closed">
63
+ <zeroOrMore rngui:label="Add Impact Profile">
64
+ <element name="ip">
73
65
  <element name="name" rngui:label="Label">
74
66
  <data type="string" rngui:label="Label"/>
75
67
  </element>
76
68
  <element name="target" rngui:label="Target Value">
77
69
  <data type="string" rngui:label="Value"/>
78
70
  </element>
79
- <element name="vfunc_url" rngui:label="Violation Function Url">
80
- <data type="string" rngui:label="Service Url"/>
81
- </element>
82
- <element name="vfunc_arg" rngui:label="Violation Function Argument">
83
- <data type="string" rngui:label="Service Url"/>
71
+ <element name="ifs" rngui:header="Impact Factors">
72
+ <zeroOrMore rngui:label="Add Impact Factor">
73
+ <element name="if">
74
+ <element name="ivs" rngui:header="Impact Values">
75
+ <zeroOrMore rngui:label="Add Impact Value ">
76
+ <element name="iv">
77
+ <element name="extractor_url" rngui:label="Extractor Url">
78
+ <data type="string" rngui:label="Service Url + Parameters"/>
79
+ </element>
80
+ <element name="extractor_params" rngui:header="Extractor Arguments">
81
+ <zeroOrMore rngui:label="Create Extractor Argument Pairs">
82
+ <element rngui:label="Name">
83
+ <anyName/>
84
+ <data type="string" rngui:label="Value / Json"/>
85
+ </element>
86
+ </zeroOrMore>
87
+ </element>
88
+ <element name="aggregator_url" rngui:label="Aggregator Url">
89
+ <data type="string" rngui:label="Service Url + Parameters"/>
90
+ </element>
91
+ <element name="aggregator_params" rngui:header="Extractor Arguments">
92
+ <zeroOrMore rngui:label="Create Aggregator Argument Pairs">
93
+ <element rngui:label="Name">
94
+ <anyName/>
95
+ <data type="string" rngui:label="Value / Json"/>
96
+ </element>
97
+ </zeroOrMore>
98
+ </element>
99
+ </element>
100
+ </zeroOrMore>
101
+ </element>
102
+ <element name="aggregator_url" rngui:label="Impact Function Url">
103
+ <data type="string" rngui:label="Service Url + Parameters"/>
104
+ </element>
105
+ </element>
106
+ </zeroOrMore>
84
107
  </element>
85
- <element name="vcost" rngui:label="Violation Cost">
86
- <data type="string" rngui:label="Value"/>
108
+ <element name="vfunc_url" rngui:label="Violation Function Url">
109
+ <data type="string" rngui:label="Service Url + Parameters"/>
87
110
  </element>
88
111
  </element>
89
112
  </zeroOrMore>
90
113
  </element>
114
+
91
115
  </element>
92
- <element name="report" rngui:header="Reporting Annotation" rngui:fold="closed">
116
+ <element name="report" rngui:header="Reporting" rngui:fold="closed">
93
117
  <element name="url" rngui:label='HTML Snippet'>
94
118
  <data type="string" rngui:label="url to report snippet"/>
95
119
  </element>
96
120
  </element>
97
121
  </element>
98
- <element name="code" rngui:header="Implementation">
122
+ <element name="code" rngui:header="Output Handling">
99
123
  <element name="prepare" rngui:header="Prepare" rngui:label="Code" rngui:fold="closed_conditional">
100
124
  <text rngui:label="Script that is executed, before a service call"/>
101
125
  </element>
@@ -120,21 +144,40 @@
120
144
  </element>
121
145
  <element name="annotations" rngui:header="Annotations">
122
146
  <element name="_timing" rngui:header="Timing" rngui:fold="closed">
123
- <element name="_timing_wait" rngui:label="&#x3C9; - Wait">
147
+ <element name="_timing_weight" rngui:label="&#x3C9; - Weight">
124
148
  <data type="float" rngui:label="[0,1]"/>
125
149
  </element>
126
- <element name="_timing_threshold" rngui:label="&#x3BA; - Threshold">
127
- <data type="float" rngui:label="[0,3,n]"/>
128
- </element>
129
- <element name="_timing_min" rngui:label="Min in min">
130
- <data type="float" rngui:label="Minutes"/>
131
- </element>
132
- <element name="_timing_max" rngui:label="Max in min">
133
- <data type="float" rngui:label="Minutes"/>
134
- </element>
135
150
  <element name="_timing_avg" rngui:label="Avg in min">
136
151
  <data type="float" rngui:label="Minutes"/>
137
152
  </element>
153
+ <element name="explanations" rngui:header="Explanations">
154
+ <zeroOrMore rngui:label="Add Explanation">
155
+ <element name="explanation">
156
+ <element name="type" rngui:label="Type">
157
+ <choice>
158
+ <value>&gt;</value>
159
+ <value>&lt;</value>
160
+ </choice>
161
+ </element>
162
+ <element name="deviation" rngui:label="Deviation">
163
+ <data type="float" rngui:label="Minutes"/>
164
+ </element>
165
+ <element name="behaviour" rngui:label="Behaviour">
166
+ <choice>
167
+ <value>Immediately</value>
168
+ <value>Wait until next</value>
169
+ <value>Use grace period value</value>
170
+ </choice>
171
+ </element>
172
+ <element name="grace" rngui:label="Grace Period" rngui:default="0.0">
173
+ <data type="float" rngui:label="Minutes"/>
174
+ </element>
175
+ <element name="text" rngui:label="Explanation">
176
+ <data type="string" rngui:label="Patterns"/>
177
+ </element>
178
+ </element>
179
+ </zeroOrMore>
180
+ </element>
138
181
  </element>
139
182
  <element name="_notes" rngui:header="Notes" rngui:fold="closed">
140
183
  <element name="_notes_general" rngui:label="General">
@@ -142,4 +185,34 @@
142
185
  </element>
143
186
  </element>
144
187
  </element>
188
+ <element name="input" rngui:header="Input Arguments Documentation" rngui:fold="closed">
189
+ <zeroOrMore rngui:label="Create Argument">
190
+ <element name="item" rngui:label="Description">
191
+ <attribute name="label" rngui:label="Name">
192
+ <data type="string"/>
193
+ </attribute>
194
+ <text rngui:wrap="true" rngui:label="What does it do?"/>
195
+ </element>
196
+ </zeroOrMore>
197
+ </element>
198
+ <element name="output" rngui:header="Output Elements Documentation" rngui:fold="closed">
199
+ <zeroOrMore rngui:label="Create Element">
200
+ <element name="item" rngui:label="Description">
201
+ <attribute name="label" rngui:label="Name">
202
+ <data type="string"/>
203
+ </attribute>
204
+ <text rngui:wrap="true" rngui:label="What does it do?"/>
205
+ </element>
206
+ </zeroOrMore>
207
+ </element>
208
+ <element name="implementation" rngui:header="Implementation Documentation" rngui:fold="closed">
209
+ <element name="description" rngui:label="Description">
210
+ <text rngui:wrap="true" rngui:label="What is supposed to happen?"/>
211
+ </element>
212
+ </element>
213
+ <element name="code" rngui:header="Output Handling Documentation" rngui:fold="closed">
214
+ <element name="description" rngui:label="Description">
215
+ <text rngui:wrap="true" rngui:label="Which output elements are important? How to transform and save them?"/>
216
+ </element>
217
+ </element>
145
218
  </element>
@@ -0,0 +1,1318 @@
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 = false;
10
+ this.endpoints = {};
11
+
12
+ //{{{ transform the details data to description parts based on rng
13
+ this.source = function(base,opts) {
14
+ if (base[0].namespaceURI == "http://relaxng.org/ns/structure/1.0") {
15
+ $('#relaxngworker').empty();
16
+ var rngw = new RelaxNGui(base,$('#relaxngworker'),self.adaptor.description.context_eval);
17
+ var nnew = $(rngw.save().documentElement);
18
+ return(nnew);
19
+ } else {
20
+ if (opts && opts == 'clone') {
21
+ base = base.clone();
22
+ if (base.attr('id')) {
23
+ base.attr('id',self.adaptor.description.get_free_id());
24
+ }
25
+ base.find('*[id]').each(function(k,v){
26
+ $(v).attr('id',self.adaptor.description.get_free_id(base));
27
+ });
28
+ }
29
+ return base;
30
+ }
31
+ }; //}}}
32
+ //{{{ Return the svgid for the selected task
33
+ this.selected = function(){
34
+ var svgid = 'unknown';
35
+ _.each(self.adaptor.illustrator.get_elements(),function(value,key) {
36
+ if ($(value).hasClass('selected')) {
37
+ svgid = $(value).attr('element-id');
38
+ }
39
+ });
40
+ return svgid;
41
+ }; //}}}
42
+ //{{{ Return the svgids for all marked tasks
43
+ this.marked = function(){
44
+ var svgid = [];
45
+ _.each(self.adaptor.illustrator.get_elements(),function(value,key) {
46
+ if ($(value).hasClass('marked')) {
47
+ svgid.push($(value).attr('element-id'));
48
+ }
49
+ });
50
+ return svgid;
51
+ }; //}}}
52
+ //{{{ Return the json for all marked tasks
53
+ this.marked_text = function(){
54
+ var nodes = [];
55
+ var markymark = _.uniq(self.marked());
56
+ $(markymark).each(function(key,svgid){
57
+ var node = self.adaptor.description.get_node_by_svg_id(svgid);
58
+ nodes.push($(node).serializePrettyXML());
59
+ });
60
+ return JSON.stringify(nodes);
61
+ }; //}}}
62
+ //{{{ Render the details from rng (right hand side of graph tab)
63
+ this.update_details = function(svgid){
64
+ var tab = $('#dat_details');
65
+ var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
66
+ tab.empty();
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
+ save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
78
+ var nn = $X($(node).serializeXML());
79
+ nn.removeAttr('svg-id');
80
+ nn.removeAttr('svg-type');
81
+ nn.removeAttr('svg-subtype');
82
+ nn.removeAttr('svg-label');
83
+ save['details'].content(nn);
84
+ format_visual_forms();
85
+ }
86
+ }; //}}}
87
+
88
+ function copyOrMove(menu,group,xml_node,mode) { //{{{
89
+ var nodes = localStorage.getItem('marked');
90
+
91
+ if (typeof(nodes) != "string") { return; }
92
+
93
+ nodes = JSON.parse(nodes);
94
+ $(nodes).each(function(key,str) {
95
+ nodes[key] = $X(str);;
96
+ });
97
+
98
+ var check1 = [];
99
+ var check2 = [];
100
+ $(nodes).each(function(key,node){
101
+ check1.push($(node).attr('svg-type'));
102
+ });
103
+ $(group).each(function(key,value){
104
+ check2.push(value.type);
105
+ });
106
+
107
+ if (nodes.length > 0 && _.uniq(check1).length == _.intersection(check1,check2).length) {
108
+ if (myid == localStorage.getItem('marked_from')) {
109
+ $(nodes).each(function(key,node){
110
+ nodes[key] = self.adaptor.description.get_node_by_svg_id($(node).attr('svg-id'));
111
+ });
112
+ }
113
+ nodes.reverse();
114
+ var iconm = self.resources['arrow'].clone();
115
+ var iconc = self.resources['arrow'].clone();
116
+ iconm.children('.rfill').addClass('menu');
117
+ if (myid == localStorage.getItem('marked_from')) {
118
+ menu.push(
119
+ {
120
+ 'label': '<em>Move Marked Elements</em>',
121
+ 'function_call': mode,
122
+ 'menu_icon': iconm,
123
+ 'type': undefined,
124
+ 'params': [nodes, xml_node]
125
+ }
126
+ );
127
+ }
128
+ menu.push(
129
+ {
130
+ 'label': '<em>Copy Marked Elements</em>',
131
+ 'function_call': mode,
132
+ 'menu_icon': iconc,
133
+ 'type': undefined,
134
+ 'params': [nodes, xml_node, 'clone']
135
+ }
136
+ );
137
+ }
138
+ } //}}}
139
+
140
+ // Events
141
+ this.events.mousedown = function(svgid, e, child, sibling) { // {{{
142
+ if(e.button == 0) { // left-click
143
+ } else if(e.button == 1) { // middle-click
144
+ } else if(e.button == 2) { // right-click
145
+ if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
146
+
147
+ var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
148
+ var group = null;
149
+ var menu = {};
150
+
151
+ if (child) {
152
+ group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node,'into');
153
+ if(group.length > 0) {
154
+ menu['Insert into'] = group;
155
+ copyOrMove(menu['Insert into'],group,xml_node,self.adaptor.description.insert_first_into);
156
+ }
157
+ if (self.elements[xml_node.get(0).tagName].permissible_children_expert) {
158
+ group = self.elements[xml_node.get(0).tagName].permissible_children_expert(xml_node,'into');
159
+ if(group.length > 0) {
160
+ menu['Insert into (Experts Only!)'] = group;
161
+ copyOrMove(menu['Insert into (Experts Only!)'],group,xml_node,self.adaptor.description.insert_first_into);
162
+ }
163
+ }
164
+ }
165
+ if (sibling) {
166
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node,'after');
167
+ if(group.length > 0) {
168
+ menu['Insert after'] = group;
169
+ copyOrMove(menu['Insert after'],group,xml_node,self.adaptor.description.insert_after);
170
+ }
171
+ if (self.elements[xml_node.parent().get(0).tagName].permissible_children_expert) {
172
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children_expert(xml_node,'after');
173
+ if(group.length > 0) {
174
+ menu['Insert after (Experts Only!)'] = group;
175
+ copyOrMove(menu['Insert after (Experts Only!)'],group,xml_node,self.adaptor.description.insert_after);
176
+ }
177
+ }
178
+ }
179
+
180
+ if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
181
+ var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
182
+ icon.children('.rfill').addClass('menu');
183
+ menu['Delete'] = [{
184
+ 'label': 'Remove Element',
185
+ 'function_call': function(selector,target,selected){ self.adaptor.description.remove(selector,target); self.adaptor.illustrator.get_label_by_svg_id(selected).addClass('selected'); },
186
+ 'menu_icon': icon,
187
+ 'type': undefined,
188
+ 'params': [null, xml_node, self.selected()]
189
+ }];
190
+ }
191
+ if($('> code', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
192
+ var icon = self.elements.callmanipulate.illustrator.svg.clone();
193
+ icon.children('.rfill:last').addClass('menu');
194
+ menu['Delete'].push({
195
+ 'label': 'Remove Scripts',
196
+ 'function_call': self.adaptor.description.remove,
197
+ 'menu_icon': icon,
198
+ 'type': undefined,
199
+ 'params': ['> code', xml_node]
200
+ });
201
+ }
202
+ if (xml_node.get(0).tagName == "call" || xml_node.get(0).tagName == "manipulate" || xml_node.get(0).tagName == "stop") {
203
+ var icon = self.elements.call.illustrator.svg.clone();
204
+ icon.children('g.replace').addClass('active');
205
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
206
+ if (vtarget.length > 0) {
207
+ if (vtarget.parents('g.activities.passive, g.activities.active').length > 0) {
208
+ menu['Position'] = [{
209
+ 'label': 'No Execution from here',
210
+ 'function_call': del_ui_pos,
211
+ 'menu_icon': icon,
212
+ 'type': undefined,
213
+ 'params': xml_node
214
+ }];
215
+ } else {
216
+ menu['Position'] = [{
217
+ 'label': 'Execute from here',
218
+ 'function_call': add_ui_pos,
219
+ 'menu_icon': icon,
220
+ 'type': undefined,
221
+ 'params': xml_node
222
+ }];
223
+ }
224
+ }
225
+ }
226
+ new CustomMenu(e).contextmenu(menu);
227
+ }
228
+ return false;
229
+ } // }}}
230
+ this.events.suppress = function(svgid, e, child, sibling) { // {{{
231
+ return false;
232
+ } // }}}
233
+ this.events.click = function(svgid, e) { // {{{
234
+ if (self.adaptor.description.get_node_by_svg_id(svgid).length == 0) {
235
+ return;
236
+ }
237
+
238
+ self.adaptor.illustrator.get_elements().removeClass('selected');
239
+ self.adaptor.illustrator.get_labels().removeClass('selected');
240
+
241
+ if (e && (e.ctrlKey || e.metaKey)) {
242
+ if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
243
+ var tab = $('#dat_details');
244
+ tab.empty();
245
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
246
+ if (vtarget.length > 0) {
247
+ var vt = vtarget.parents('g.element[element-id]');
248
+ vt.toggleClass('marked');
249
+ if (vt.hasClass('marked')) {
250
+ localStorage.setItem('marked',self.marked_text());
251
+ localStorage.setItem('marked_from',myid);
252
+ } else {
253
+ localStorage.removeItem('marked');
254
+ localStorage.removeItem('marked_from');
255
+ }
256
+ }
257
+ } else {
258
+ self.adaptor.illustrator.get_elements().removeClass('marked');
259
+ localStorage.removeItem('marked');
260
+ localStorage.removeItem('marked_from');
261
+
262
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
263
+ if (vtarget.length > 0) {
264
+ vtarget.parents('g.element[element-id]').addClass('selected');
265
+ }
266
+ self.adaptor.illustrator.get_label_by_svg_id(svgid).addClass('selected');
267
+
268
+ self.update_details(svgid);
269
+ }
270
+ } // }}}
271
+ this.events.dblclick = function(svgid, e) { // {{{
272
+ } // }}}
273
+ this.events.mouseover = function(svgid, e) { // {{{
274
+ self.adaptor.illustrator.svg.container.find('.tile[element-id = "' + svgid + '"]').css('display','block');
275
+ self.adaptor.illustrator.svg.container.find('[element-id = "' + svgid + '"]').addClass('hover');
276
+ self.adaptor.illustrator.svg.label_container.find('[element-id = "' + svgid + '"]').addClass('hover');
277
+ return false;
278
+ } // }}}
279
+ this.events.mouseout = function(svgid, e) { // {{{
280
+ self.adaptor.illustrator.svg.container.find('.tile[element-id = "' + svgid + '"]').css('display','none');
281
+ self.adaptor.illustrator.svg.container.find('[element-id = "' + svgid + '"]').removeClass('hover');
282
+ self.adaptor.illustrator.svg.label_container.find('[element-id = "' + svgid + '"]').removeClass('hover');
283
+ return false;
284
+ } // }}}
285
+ this.events.dragstart = function (svgid, e) { //{{{
286
+ } //}}}
287
+
288
+ // other resources
289
+ this.resources.arrow = self.adaptor.theme_dir + 'symbols/arrow.svg';
290
+
291
+ // Primitive Elements
292
+ this.elements.call = { /*{{{*/
293
+ 'type': 'primitive',
294
+ 'illustrator': {//{{{
295
+ 'endnodes': 'this',
296
+ 'label': function(node){
297
+ var ret = [ { column: 'Label', value: $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'') } ];
298
+ return ret;
299
+ },
300
+ 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
301
+ 'resolve_symbol': function(node) {
302
+ if($('code', node).length > 0) {
303
+ return 'callmanipulate';
304
+ } else {
305
+ return 'call';
306
+ }
307
+ },
308
+ 'svg': self.adaptor.theme_dir + 'symbols/call.svg'
309
+ },//}}}
310
+ 'description': self.adaptor.theme_dir + 'rngs/call.rng',
311
+ 'permissible_children': function(node,mode) { //{{{
312
+ if(node.children('code').length < 1)
313
+ return [
314
+ {'label': 'Scripts',
315
+ 'function_call': self.adaptor.description.insert_last_into,
316
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
317
+ 'type': undefined,
318
+ 'params': [self.adaptor.description.elements.scripts, node]}
319
+ ];
320
+ return [];
321
+ }, //}}}
322
+ 'adaptor': {//{{{
323
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
324
+ 'click': self.events.click,
325
+ 'dragstart': self.events.dragstart,
326
+ 'mouseover': self.events.mouseover,
327
+ 'mouseout': self.events.mouseout
328
+ }//}}}
329
+ }; /*}}}*/
330
+ this.elements.manipulate = { /*{{{*/
331
+ 'type': 'primitive',
332
+ 'illustrator': {//{{{
333
+ 'endnodes': 'this',
334
+ 'label': function(node){
335
+ var lab = $(node).attr('label');
336
+ if (lab) {
337
+ return [ { column: 'Label', value: lab.replace(/^['"]/,'').replace(/['"]$/,'') } ];
338
+ } else {
339
+ return [];
340
+ }
341
+ },
342
+ 'svg': self.adaptor.theme_dir + 'symbols/manipulate.svg'
343
+ },//}}}
344
+ 'description': self.adaptor.theme_dir + 'rngs/manipulate.rng',
345
+ 'permissible_children': function(node,mode) { //{{{
346
+ return [];
347
+ }, //}}}
348
+ 'adaptor': {//{{{
349
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
350
+ 'click': self.events.click,
351
+ 'mouseover': self.events.mouseover,
352
+ 'mouseout': self.events.mouseout
353
+ }//}}}
354
+ }; /*}}}*/
355
+ this.elements.escape = { /*{{{*/
356
+ 'type': 'primitive',
357
+ 'illustrator': {//{{{
358
+ 'endnodes': 'this',
359
+ 'svg': self.adaptor.theme_dir + 'symbols/escape.svg'
360
+ },//}}}
361
+ 'description': self.adaptor.theme_dir + 'rngs/escape.rng',
362
+ 'permissible_children': function(node,mode) { //{{{
363
+ return [];
364
+ }, //}}}
365
+ 'adaptor': {//{{{
366
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
367
+ 'click': self.events.click,
368
+ 'mouseover': self.events.mouseover,
369
+ 'mouseout': self.events.mouseout
370
+ }//}}}
371
+ }; /*}}}*/
372
+ this.elements.stop = { /*{{{*/
373
+ 'type': 'primitive',
374
+ 'illustrator': {//{{{
375
+ 'endnodes': 'this',
376
+ 'svg': self.adaptor.theme_dir + 'symbols/stop.svg'
377
+ },//}}}
378
+ 'description': self.adaptor.theme_dir + 'rngs/stop.rng',
379
+ 'permissible_children': function(node,mode) { //{{{
380
+ return [];
381
+ }, //}}}
382
+ 'adaptor': {//{{{
383
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
384
+ 'click': self.events.click,
385
+ 'mouseover': self.events.mouseover,
386
+ 'mouseout': self.events.mouseout
387
+ }//}}}
388
+ }; /*}}}*/
389
+ this.elements.terminate = { /*{{{*/
390
+ 'type': 'primitive',
391
+ 'illustrator': {//{{{
392
+ 'endnodes': 'this',
393
+ 'final': true,
394
+ 'svg': self.adaptor.theme_dir + 'symbols/terminate.svg'
395
+ },//}}}
396
+ 'description': self.adaptor.theme_dir + 'rngs/terminate.rng',
397
+ 'permissible_children': function(node,mode) { //{{{
398
+ return [];
399
+ }, //}}}
400
+ 'adaptor': {//{{{
401
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,false); },
402
+ 'mouseover': self.events.mouseover,
403
+ 'mouseout': self.events.mouseout
404
+ }//}}}
405
+ }; /*}}}*/
406
+ this.elements.end = { /*{{{*/
407
+ 'type': 'primitive',
408
+ 'illustrator': {//{{{
409
+ 'endnodes': 'this',
410
+ 'svg': self.adaptor.theme_dir + 'symbols/end.svg'
411
+ }, //}}}
412
+ 'adaptor': {//{{{
413
+ 'mousedown': function (node,e) {
414
+ self.events.suppress();
415
+ }
416
+ }//}}}
417
+ }; /*}}}*/
418
+ this.elements.event_end = { /*{{{*/
419
+ 'type': 'primitive',
420
+ 'illustrator': {//{{{
421
+ 'endnodes': 'this',
422
+ 'svg': self.adaptor.theme_dir + 'symbols/event_end.svg'
423
+ }, //}}}
424
+ 'adaptor': {//{{{
425
+ 'mousedown': function (node,e) {
426
+ self.events.suppress();
427
+ },
428
+ 'click': self.events.click,
429
+ 'dblclick': self.events.dblclick,
430
+ 'mouseover': self.events.mouseover,
431
+ 'mouseout': self.events.mouseout
432
+ }//}}}
433
+ }; /*}}}*/
434
+ this.elements.choose_finish = { /*{{{*/
435
+ 'type': 'primitive',
436
+ 'illustrator': {//{{{
437
+ 'endnodes': 'this',
438
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg',
439
+ 'resolve_symbol': function(node) {
440
+ if($(node).attr('mode') == 'exclusive') {
441
+ return 'choose_exclusive_finish';
442
+ } else {
443
+ return 'choose_inclusive_finish';
444
+ }
445
+ },
446
+ }, //}}}
447
+ 'adaptor': {//{{{
448
+ 'mousedown': function (node,e) {
449
+ self.events.mousedown(node,e,true,true);
450
+ },
451
+ 'click': self.events.click,
452
+ 'dblclick': self.events.dblclick,
453
+ 'mouseover': self.events.mouseover,
454
+ 'mouseout': self.events.mouseout
455
+ }//}}}
456
+ }; /*}}}*/
457
+ this.elements.loop_finish = { /*{{{*/
458
+ 'type': 'primitive',
459
+ 'illustrator': {//{{{
460
+ 'endnodes': 'this',
461
+ 'closeblock': true,
462
+ 'label': function(node){
463
+ var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
464
+ return ret;
465
+ },
466
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg',
467
+ }, //}}}
468
+ 'adaptor': {//{{{
469
+ 'mousedown': function (node,e) {
470
+ self.events.mousedown(node,e,true,true);
471
+ },
472
+ 'click': self.events.click,
473
+ 'dblclick': self.events.dblclick,
474
+ 'mouseover': self.events.mouseover,
475
+ 'mouseout': self.events.mouseout
476
+ }//}}}
477
+ }; /*}}}*/
478
+ this.elements.parallel_finish = { /*{{{*/
479
+ 'type': 'primitive',
480
+ 'illustrator': {//{{{
481
+ 'endnodes': 'this',
482
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg',
483
+ 'resolve_symbol': function(node) {
484
+ if($(node).attr('wait') == '-1') {
485
+ return 'parallel_simple';
486
+ } else {
487
+ return 'parallel_complex';
488
+ }
489
+ },
490
+ }, //}}}
491
+ 'adaptor': {//{{{
492
+ 'mousedown': function (node,e) {
493
+ self.events.mousedown(node,e,true,true);
494
+ },
495
+ 'click': self.events.click,
496
+ 'dblclick': self.events.dblclick,
497
+ 'mouseover': self.events.mouseover,
498
+ 'mouseout': self.events.mouseout
499
+ }//}}}
500
+ }; /*}}}*/
501
+
502
+ // Complex Elements
503
+ this.elements.choose = { /*{{{*/
504
+ 'type': 'complex',
505
+ 'illustrator': {//{{{
506
+ 'label': function(node){ return [ { column: 'Label', value: $(node).attr('mode') == 'exclusive' ? 'exclusive' : 'inclusive' } ]; },
507
+ 'endnodes': 'aggregate',
508
+ 'closeblock': false,
509
+ 'closing_symbol': 'choose_finish',
510
+ 'expansion': function(node) {
511
+ return 'horizontal';
512
+ },
513
+ 'resolve_symbol': function(node) {
514
+ if($(node).attr('mode') == 'exclusive') {
515
+ return 'choose_exclusive';
516
+ } else {
517
+ return 'choose_inclusive';
518
+ }
519
+ },
520
+ 'col_shift': function(node) {
521
+ return false;
522
+ },
523
+ 'svg': self.adaptor.theme_dir + 'symbols/choose.svg'
524
+ },//}}}
525
+ 'description': self.adaptor.theme_dir + 'rngs/choose.rng',
526
+ 'permissible_children': function(node,mode) { //{{{
527
+ var func = null;
528
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
529
+ else { func = self.adaptor.description.insert_after }
530
+ if(node.children('parallel_branch').length > 0) {
531
+ return [{'label': 'Parallel Branch',
532
+ 'function_call': func,
533
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
534
+ 'type': 'parallel_branch',
535
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}];
536
+ }
537
+ var childs = [{'label': 'Alternative',
538
+ 'function_call': func,
539
+ 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
540
+ 'type': 'alternative',
541
+ 'params': [self.adaptor.description.elements.alternative, node]}];
542
+ if((node.children('otherwise').length == 0) && node.parents('parallel').length == node.parents('parallel_branch').length && node.parent('choose').length == 0)
543
+ childs.push({'label': 'Otherwise',
544
+ 'function_call': self.adaptor.description.insert_last_into,
545
+ 'menu_icon': self.elements.otherwise.illustrator.svg.clone(),
546
+ 'type': 'otherwise',
547
+ 'params': [self.adaptor.description.elements.otherwise, node]});
548
+ if(node.parents('parallel').length > node.parents('parallel_branch').length)
549
+ childs.push({'label': 'Parallel Branch',
550
+ 'function_call': func,
551
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
552
+ 'type': 'parallel_branch',
553
+ 'params': [self.adaptor.description.elements.parallel_branch, node]});
554
+ return childs;
555
+ }, //}}}
556
+ 'adaptor': {//{{{
557
+ 'mousedown': function (node,e) {
558
+ self.events.mousedown(node,e,true,true);
559
+ },
560
+ 'click': self.events.click,
561
+ 'dblclick': self.events.dblclick,
562
+ 'mouseover': self.events.mouseover,
563
+ 'mouseout': self.events.mouseout
564
+ }//}}}
565
+ }; /*}}}*/
566
+ this.elements.otherwise = { /*{{{*/
567
+ 'type': 'complex',
568
+ 'illustrator': {//{{{
569
+ 'endnodes': 'passthrough',
570
+ 'closeblock': false,
571
+ 'noarrow': true,
572
+ 'expansion': function(node) {
573
+ return 'vertical';
574
+ },
575
+ 'col_shift': function(node) {
576
+ return false;
577
+ },
578
+ 'svg': self.adaptor.theme_dir + 'symbols/otherwise.svg'
579
+ },//}}}
580
+ 'description': self.adaptor.theme_dir + 'rngs/otherwise.rng',
581
+ 'neverdelete': true,
582
+ 'permissible_children': function(node,mode) { //{{{
583
+ var func = null;
584
+ var childs = null;
585
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
586
+ else { func = self.adaptor.description.insert_after }
587
+ var childs = [
588
+ {'label': 'Service Call with Scripts',
589
+ 'function_call': func,
590
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
591
+ 'type': 'callmanipulate',
592
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
593
+ {'label': 'Service Call',
594
+ 'function_call': func,
595
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
596
+ 'type': 'call',
597
+ 'params': [self.adaptor.description.elements.call, node]},
598
+ {'label': 'Script',
599
+ 'function_call': func,
600
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
601
+ 'type': 'manipulate',
602
+ 'params': [self.adaptor.description.elements.manipulate, node]},
603
+ {'label': 'Parallel',
604
+ 'function_call': func,
605
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
606
+ 'type': 'parallel',
607
+ 'params': [self.adaptor.description.elements.parallel, node]},
608
+ {'label': 'Decision',
609
+ 'function_call': func,
610
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
611
+ 'type': 'choose',
612
+ 'params': [self.adaptor.description.elements.choose, node]},
613
+ {'label': 'Loop',
614
+ 'function_call': func,
615
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
616
+ 'type': 'loop',
617
+ 'params': [self.adaptor.description.elements.loop, node]},
618
+ {'label': 'Terminate',
619
+ 'function_call': func,
620
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
621
+ 'type': 'terminate',
622
+ 'params': [self.adaptor.description.elements.terminate, node]},
623
+ {'label': 'Stop',
624
+ 'function_call': func,
625
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
626
+ 'type': 'stop',
627
+ 'params': [self.adaptor.description.elements.stop, node]}
628
+ ];
629
+ if(node.parent('parallel_branch').length > 0) {
630
+ childs.push({
631
+ 'label': 'Critical',
632
+ 'function_call': func,
633
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
634
+ 'type': 'critical',
635
+ 'params': [self.adaptor.description.elements.critical, node]
636
+ });
637
+ }
638
+ return childs;
639
+ }, //}}}
640
+ 'adaptor': {//{{{
641
+ 'mousedown': function (node,e) {
642
+ self.events.mousedown(node,e,true,false);
643
+ },
644
+ 'click': self.events.click,
645
+ 'dblclick': self.events.dblclick,
646
+ 'mouseover': self.events.mouseover,
647
+ 'mouseout': self.events.mouseout,
648
+ }//}}}
649
+ }; /*}}}*/
650
+ this.elements.alternative = { /*{{{*/
651
+ 'type': 'complex',
652
+ 'illustrator': {//{{{
653
+ 'label': function(node){
654
+ var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
655
+ return ret;
656
+ },
657
+ 'endnodes': 'passthrough',
658
+ 'noarrow': true,
659
+ 'closeblock':false,
660
+ 'expansion': function(node) {
661
+ return 'vertical';
662
+ },
663
+ 'col_shift': function(node) {
664
+ return false;
665
+ },
666
+ 'svg': self.adaptor.theme_dir + 'symbols/alternative.svg'
667
+ },//}}}
668
+ 'description': self.adaptor.theme_dir + 'rngs/alternative.rng',
669
+ 'permissible_children': function(node,mode) { //{{{
670
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
671
+ else { func = self.adaptor.description.insert_after }
672
+ if(node.parents('parallel').length > node.parents('parallel_branch').length && node.get(0).tagName == 'alternative') {
673
+ return [{'label': 'Parallel Branch',
674
+ 'function_call': func,
675
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
676
+ 'type': 'parallel_branch',
677
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}];
678
+ }
679
+ var childs = [
680
+ {'label': 'Service Call with Scripts',
681
+ 'function_call': func,
682
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
683
+ 'type': 'callmanipulate',
684
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
685
+ {'label': 'Service Call',
686
+ 'function_call': func,
687
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
688
+ 'type': 'call',
689
+ 'params': [self.adaptor.description.elements.call, node]},
690
+ {'label': 'Script',
691
+ 'function_call': func,
692
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
693
+ 'type': 'manipulate',
694
+ 'params': [self.adaptor.description.elements.manipulate, node]},
695
+ {'label': 'Parallel',
696
+ 'function_call': func,
697
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
698
+ 'type': 'parallel',
699
+ 'params': [self.adaptor.description.elements.parallel, node]},
700
+ {'label': 'Decision',
701
+ 'function_call': func,
702
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
703
+ 'type': 'choose',
704
+ 'params': [self.adaptor.description.elements.choose, node]},
705
+ {'label': 'Loop',
706
+ 'function_call': func,
707
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
708
+ 'type': 'loop',
709
+ 'params': [self.adaptor.description.elements.loop, node]},
710
+ {'label': 'Terminate',
711
+ 'function_call': func,
712
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
713
+ 'type': 'terminate',
714
+ 'params': [self.adaptor.description.elements.terminate, node]},
715
+ {'label': 'Stop',
716
+ 'function_call': func,
717
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
718
+ 'type': 'stop',
719
+ 'params': [self.adaptor.description.elements.stop, node]}
720
+ ];
721
+ if(node.parent('parallel_branch').length > 0) {
722
+ childs.push({
723
+ 'label': 'Critical',
724
+ 'function_call': func,
725
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
726
+ 'type': 'critical',
727
+ 'params': [self.adaptor.description.elements.critical, node]
728
+ });
729
+ }
730
+ return childs;
731
+ }, //}}}
732
+ 'adaptor': {//{{{
733
+ 'mousedown': function (node,e) {
734
+ self.events.mousedown(node,e,true,true);
735
+ },
736
+ 'click': self.events.click,
737
+ 'dblclick': self.events.dblclick,
738
+ 'mouseover': self.events.mouseover,
739
+ 'mouseout': self.events.mouseout,
740
+ }//}}}
741
+ }; /*}}}*/
742
+ this.elements.loop = { /*{{{*/
743
+ 'type': 'complex',
744
+ 'illustrator': {//{{{
745
+ 'resolve_symbol': function(node) {
746
+ if($(node).attr('mode') == 'pre_test') {
747
+ return 'loop_head';
748
+ } else {
749
+ return 'loop_tail';
750
+ }
751
+ },
752
+ 'expansion': function(node) {
753
+ return 'vertical';
754
+ },
755
+ 'col_shift': function(node) {
756
+ return true;
757
+ },
758
+ 'svg': self.adaptor.theme_dir + 'symbols/loop.svg'
759
+ },// }}}
760
+ 'description': self.adaptor.theme_dir + 'rngs/loop.rng',
761
+ 'permissible_children': function(node,mode) { //{{{
762
+ var func = null;
763
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
764
+ else { func = self.adaptor.description.insert_after }
765
+ var childs = [
766
+ {'label': 'Service Call with Scripts',
767
+ 'function_call': func,
768
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
769
+ 'type': 'callmanipulate',
770
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
771
+ {'label': 'Service Call',
772
+ 'function_call': func,
773
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
774
+ 'type': 'call',
775
+ 'params': [self.adaptor.description.elements.call, node]},
776
+ {'label': 'Script',
777
+ 'function_call': func,
778
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
779
+ 'type': 'manipulate',
780
+ 'params': [self.adaptor.description.elements.manipulate, node]},
781
+ {'label': 'Decision',
782
+ 'function_call': func,
783
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
784
+ 'type': 'choose',
785
+ 'params': [self.adaptor.description.elements.choose, node]},
786
+ {'label': 'Loop',
787
+ 'function_call': func,
788
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
789
+ 'type': 'loop',
790
+ 'params': [self.adaptor.description.elements.loop, node]},
791
+ {'label': 'Terminate',
792
+ 'function_call': func,
793
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
794
+ 'type': 'terminate',
795
+ 'params': [self.adaptor.description.elements.terminate, node]},
796
+ {'label': 'Stop',
797
+ 'function_call': func,
798
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
799
+ 'type': 'stop',
800
+ 'params': [self.adaptor.description.elements.stop, node]}
801
+ ];
802
+ if(node.parent('parallel_branch').length > 0) {
803
+ childs.push({
804
+ 'label': 'Critical',
805
+ 'function_call': func,
806
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
807
+ 'type': 'critical',
808
+ 'params': [self.adaptor.description.elements.critical, node]
809
+ });
810
+ }
811
+ if(node.parent('parallel').length > node.parent('parallel_branch').length) {
812
+ childs.push({'label': 'Parallel Branch',
813
+ 'function_call': func,
814
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
815
+ 'type': 'parallel_branch',
816
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}
817
+ );
818
+ } else {
819
+ childs.push({'label': 'Parallel',
820
+ 'function_call': func,
821
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
822
+ 'type': 'parallel',
823
+ 'params': [self.adaptor.description.elements.parallel, node]}
824
+ );
825
+ }
826
+ return childs;
827
+ }, //}}}
828
+ 'adaptor': {//{{{
829
+ 'mousedown': function (node,e) {
830
+ self.events.mousedown(node,e,true,true);
831
+ },
832
+ 'click': self.events.click,
833
+ 'dblclick': self.events.dblclick,
834
+ 'mouseover': self.events.mouseover,
835
+ 'mouseout': self.events.mouseout,
836
+ }//}}}
837
+ }; /*}}}*/
838
+ this.elements.parallel = { /*{{{*/
839
+ 'type': 'complex',
840
+ 'illustrator': {//{{{
841
+ 'endnodes': 'aggregate',
842
+ 'closeblock': false,
843
+ 'closing_symbol': 'parallel_finish',
844
+ 'expansion': function(node) {
845
+ // check if any sibling other than 'parallel_branch' is present
846
+ if($(node).children(':not(parallel_branch)').length > 0) return 'vertical';
847
+ return 'horizontal';
848
+ },
849
+ 'col_shift': function(node) {
850
+ return true;
851
+ },
852
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
853
+ },//}}}
854
+ 'description': self.adaptor.theme_dir + 'rngs/parallel.rng',
855
+ 'permissible_children': function(node,mode) { //{{{
856
+ var func = null;
857
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
858
+ else { func = self.adaptor.description.insert_after }
859
+ var childs = [
860
+ {'label': 'Parallel Branch',
861
+ 'function_call': func,
862
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
863
+ 'type': 'parallel_branch',
864
+ 'params': [self.adaptor.description.elements.parallel_branch, node]},
865
+ ];
866
+ return childs;
867
+ }, //}}}
868
+ 'permissible_children_expert': function(node,mode) { //{{{
869
+ var func = null;
870
+ if (mode.match(/into/)) { func = self.adaptor.description.insert_first_into }
871
+ else { func = self.adaptor.description.insert_after }
872
+ var childs = [
873
+ {'label': 'Service Call with Scripts',
874
+ 'function_call': func,
875
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
876
+ 'type': 'callmanipulate',
877
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
878
+ {'label': 'Service Call',
879
+ 'function_call': func,
880
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
881
+ 'type': 'call',
882
+ 'params': [self.adaptor.description.elements.call, node]},
883
+ {'label': 'Script',
884
+ 'function_call': func,
885
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
886
+ 'type': 'manipulate',
887
+ 'params': [self.adaptor.description.elements.manipulate, node]},
888
+ {'label': 'Decision',
889
+ 'function_call': func,
890
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
891
+ 'type': 'choose',
892
+ 'params': [self.adaptor.description.elements.choose, node]},
893
+ {'label': 'Loop',
894
+ 'function_call': func,
895
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
896
+ 'type': 'loop',
897
+ 'params': [self.adaptor.description.elements.loop, node]},
898
+ {'label': 'Stop',
899
+ 'function_call': func,
900
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
901
+ 'type': 'stop',
902
+ 'params': [self.adaptor.description.elements.stop, node]}
903
+ ];
904
+ if(node.get(0).tagName != 'parallel')
905
+ childs.push({'label': 'Parallel',
906
+ 'function_call': self.adaptor.description.insert_last_into,
907
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
908
+ 'type': 'parallel',
909
+ 'params': [self.adaptor.description.elements.parallel, node]});
910
+ return childs;
911
+ }, //}}}
912
+ 'adaptor': {//{{{
913
+ 'mousedown': function (node,e) {
914
+ self.events.mousedown(node,e,true,true);
915
+ },
916
+ 'click': self.events.click,
917
+ 'dblclick': self.events.dblclick,
918
+ 'mouseover': self.events.mouseover,
919
+ 'mouseout': self.events.mouseout,
920
+ }//}}}
921
+ }; /*}}}*/
922
+ this.elements.parallel_branch = { /*{{{*/
923
+ 'type': 'complex',
924
+ 'illustrator': {//{{{
925
+ 'endnodes': 'passthrough',
926
+ 'closeblock': false,
927
+ 'noarrow': true,
928
+ 'expansion': function(node) {
929
+ return 'vertical';
930
+ },
931
+ 'resolve_symbol': function(node,shift) {
932
+ if(shift == true) {
933
+ return 'parallel_branch_event';
934
+ } else {
935
+ return 'parallel_branch_normal';
936
+ }
937
+ },
938
+ 'col_shift': function(node) {
939
+ if(node.parentNode.tagName == 'choose') return false;
940
+ if($(node).parents('parallel').first().children(':not(parallel_branch)').length > 0) return true;
941
+ return false;
942
+ },
943
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch.svg'
944
+ },//}}}
945
+ 'description': self.adaptor.theme_dir + 'rngs/parallel_branch.rng',
946
+ 'permissible_children': function(node,mode) { //{{{
947
+ var func = null;
948
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
949
+ else { func = self.adaptor.description.insert_after }
950
+ var childs = [
951
+ {'label': 'Service Call with Scripts',
952
+ 'function_call': func,
953
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
954
+ 'type': 'callmanipulate',
955
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
956
+ {'label': 'Service Call',
957
+ 'function_call': func,
958
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
959
+ 'type': 'call',
960
+ 'params': [self.adaptor.description.elements.call, node]},
961
+ {'label': 'Script',
962
+ 'function_call': func,
963
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
964
+ 'type': 'manipulate',
965
+ 'params': [self.adaptor.description.elements.manipulate, node]},
966
+ {'label': 'Parallel',
967
+ 'function_call': func,
968
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
969
+ 'type': 'parallel',
970
+ 'params': [self.adaptor.description.elements.parallel, node]},
971
+ {'label': 'Decision',
972
+ 'function_call': func,
973
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
974
+ 'type': 'choose',
975
+ 'params': [self.adaptor.description.elements.choose, node]},
976
+ {'label': 'Loop',
977
+ 'function_call': func,
978
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
979
+ 'type': 'loop',
980
+ 'params': [self.adaptor.description.elements.loop, node]},
981
+ {'label': 'Terminate',
982
+ 'function_call': func,
983
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
984
+ 'type': 'terminate',
985
+ 'params': [self.adaptor.description.elements.terminate, node]},
986
+ {'label': 'Stop',
987
+ 'function_call': func,
988
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
989
+ 'type': 'stop',
990
+ 'params': [self.adaptor.description.elements.stop, node]},
991
+ {'label': 'Critical',
992
+ 'function_call': func,
993
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
994
+ 'type': 'critical',
995
+ 'params': [self.adaptor.description.elements.critical, node]}
996
+ ];
997
+ if(node.parents('choose').length > node.parents('alternative, otherwise').length && node.get(0).tagName == 'parallel_branch') {
998
+ return [{'label': 'Alternative',
999
+ 'function_call': func,
1000
+ 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
1001
+ 'type': 'alternative',
1002
+ 'params': [self.adaptor.description.elements.alternative, node]}];
1003
+ }
1004
+ return childs;
1005
+ }, //}}}
1006
+ 'adaptor': {//{{{
1007
+ 'mousedown': function (node,e) {
1008
+ self.events.mousedown(node,e,true,true);
1009
+ },
1010
+ 'click': self.events.click,
1011
+ 'dblclick': self.events.dblclick,
1012
+ 'mouseover': self.events.mouseover,
1013
+ 'mouseout': self.events.mouseout,
1014
+ }//}}}
1015
+ }; /*}}}*/
1016
+ this.elements.critical = { /*{{{*/
1017
+ 'type': 'complex',
1018
+ 'illustrator': {//{{{
1019
+ 'endnodes': 'aggregate',
1020
+ 'closeblock': false,
1021
+ 'border': true,
1022
+ 'expansion': function(node) {
1023
+ return 'vertical';
1024
+ },
1025
+ 'col_shift': function(node) {
1026
+ return true;
1027
+ },
1028
+ 'svg': self.adaptor.theme_dir + 'symbols/critical.svg'
1029
+ },//}}}
1030
+ 'description': self.adaptor.theme_dir + 'rngs/critical.rng',
1031
+ 'permissible_children': function(node,mode) { //{{{
1032
+ var func = null;
1033
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1034
+ else { func = self.adaptor.description.insert_after }
1035
+ var childs = [
1036
+ {'label': 'Service Call with Scripts',
1037
+ 'function_call': func,
1038
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1039
+ 'type': 'callmanipulate',
1040
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
1041
+ {'label': 'Service Call',
1042
+ 'function_call': func,
1043
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
1044
+ 'type': 'call',
1045
+ 'params': [self.adaptor.description.elements.call, node]},
1046
+ {'label': 'Script',
1047
+ 'function_call': func,
1048
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1049
+ 'type': 'manipulate',
1050
+ 'params': [self.adaptor.description.elements.manipulate, node]},
1051
+ {'label': 'Parallel',
1052
+ 'function_call': func,
1053
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1054
+ 'type': 'parallel',
1055
+ 'params': [self.adaptor.description.elements.parallel, node]},
1056
+ {'label': 'Decision',
1057
+ 'function_call': func,
1058
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1059
+ 'type': 'choose',
1060
+ 'params': [self.adaptor.description.elements.choose, node]},
1061
+ {'label': 'Loop',
1062
+ 'function_call': func,
1063
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1064
+ 'type': 'loop',
1065
+ 'params': [self.adaptor.description.elements.loop, node]},
1066
+ {'label': 'Terminate',
1067
+ 'function_call': func,
1068
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
1069
+ 'type': 'terminate',
1070
+ 'params': [self.adaptor.description.elements.terminate, node]},
1071
+ {'label': 'Stop',
1072
+ 'function_call': func,
1073
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1074
+ 'type': 'stop',
1075
+ 'params': [self.adaptor.description.elements.stop, node]}
1076
+ ];
1077
+ if(node.parent('parallel_branch').length > 0) {
1078
+ childs.push({
1079
+ 'label': 'Critical',
1080
+ 'function_call': func,
1081
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1082
+ 'type': 'critical',
1083
+ 'params': [self.adaptor.description.elements.critical, node]
1084
+ });
1085
+ }
1086
+ return childs;
1087
+ }, //}}}
1088
+ 'adaptor': {//{{{
1089
+ 'mousedown': function (node,e) {
1090
+ self.events.mousedown(node,e,true,true);
1091
+ },
1092
+ 'click': self.events.click,
1093
+ 'dblclick': self.events.dblclick,
1094
+ 'mouseover': self.events.mouseover,
1095
+ 'mouseout': self.events.mouseout,
1096
+ }//}}}
1097
+ }; /*}}}*/
1098
+ this.elements.group = { /*{{{*/
1099
+ 'type': 'complex',
1100
+ 'illustrator': {//{{{
1101
+ 'endnodes': 'aggregate',
1102
+ 'closeblock': false,
1103
+ 'border': 'injectiongroup', // other value than true,false inidcates the used class for the svg-object
1104
+ 'expansion': function(node) {
1105
+ return 'vertical';
1106
+ },
1107
+ 'col_shift': function(node) {
1108
+ return true;
1109
+ },
1110
+ 'svg': null
1111
+ },//}}}
1112
+ 'description': self.adaptor.theme_dir + 'rngs/group.rng',
1113
+ 'permissible_children': function(node,mode) { //{{{
1114
+ var func = null;
1115
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1116
+ else { func = self.adaptor.description.insert_after }
1117
+ return [
1118
+ ];
1119
+ }, //}}}
1120
+ 'adaptor': {//{{{
1121
+ 'mousedown': function (node,e) {
1122
+ self.events.mousedown(node,e,true,true);
1123
+ },
1124
+ 'click': self.events.click,
1125
+ 'dblclick': self.events.dblclick,
1126
+ 'mouseover': self.events.mouseover,
1127
+ 'mouseout': self.events.mouseout,
1128
+ }//}}}
1129
+ }; /*}}}*/
1130
+ this.elements.start = this.elements.description = { /*{{{*/
1131
+ 'type': 'description',
1132
+ 'illustrator': {//{{{
1133
+ 'endnodes': 'passthrough',
1134
+ 'closeblock': false,
1135
+ 'balance': true,
1136
+ 'expansion': function(node) {
1137
+ return 'vertical';
1138
+ },
1139
+ 'closing_symbol': 'end',
1140
+ 'col_shift': function(node) {
1141
+ return true;
1142
+ },
1143
+ 'svg': self.adaptor.theme_dir + 'symbols/start.svg'
1144
+ },//}}}
1145
+ 'description': null,
1146
+ 'permissible_children': function(node,mode) { //{{{
1147
+ var func = null;
1148
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1149
+ else { func = self.adaptor.description.insert_after }
1150
+ var childs = [
1151
+ {'label': 'Service Call with Scripts',
1152
+ 'function_call': func,
1153
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1154
+ 'type': 'callmanipulate',
1155
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
1156
+ {'label': 'Service Call',
1157
+ 'function_call': func,
1158
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
1159
+ 'type': 'call',
1160
+ 'params': [self.adaptor.description.elements.call, node]},
1161
+ {'label': 'Script',
1162
+ 'function_call': func,
1163
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1164
+ 'type': 'manipulate',
1165
+ 'params': [self.adaptor.description.elements.manipulate, node]},
1166
+ {'label': 'Parallel',
1167
+ 'function_call': func,
1168
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1169
+ 'type': 'parallel',
1170
+ 'params': [self.adaptor.description.elements.parallel, node]},
1171
+ {'label': 'Decision',
1172
+ 'function_call': func,
1173
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1174
+ 'type': 'choose',
1175
+ 'params': [self.adaptor.description.elements.choose, node]},
1176
+ {'label': 'Loop',
1177
+ 'function_call': func,
1178
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1179
+ 'type': 'loop',
1180
+ 'params': [self.adaptor.description.elements.loop, node]},
1181
+ {'label': 'Stop',
1182
+ 'function_call': func,
1183
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1184
+ 'type': 'stop',
1185
+ 'params': [self.adaptor.description.elements.stop, node]}
1186
+ ];
1187
+ if(node.parent('parallel_branch').length > 0) {
1188
+ childs.push({
1189
+ 'label': 'Critical',
1190
+ 'function_call': func,
1191
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1192
+ 'type': 'critical',
1193
+ 'params': [self.adaptor.description.elements.critical, node]
1194
+ });
1195
+ }
1196
+ return childs;
1197
+ }, //}}}
1198
+ 'adaptor': {//{{{
1199
+ 'mousedown': function (node,e) {
1200
+ self.events.mousedown(node,e,true,false);
1201
+ },
1202
+ 'click': self.events.click,
1203
+ 'dblclick': self.events.dblclick,
1204
+ 'mouseover': self.events.mouseover,
1205
+ 'mouseout': self.events.mouseout,
1206
+ }//}}}
1207
+ }; /*}}}*/
1208
+
1209
+ // Abstract Elements
1210
+ // * they may only have an illustrator (or other parts)
1211
+ // * they HAVE TO have a parent
1212
+ this.elements.callmanipulate = { /*{{{*/
1213
+ 'parent': 'call',
1214
+ 'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
1215
+ 'illustrator': {//{{{
1216
+ 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
1217
+ 'svg': self.adaptor.theme_dir + 'symbols/callmanipulate.svg'
1218
+ },//}}}
1219
+ }; /*}}}*/
1220
+ this.elements.loop_head = { /*{{{*/
1221
+ 'parent': 'loop',
1222
+ 'illustrator': {//{{{
1223
+ 'endnodes': 'this',
1224
+ 'closeblock': true,
1225
+ 'label': function(node){
1226
+ var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
1227
+ return ret;
1228
+ },
1229
+ }//}}}
1230
+ }; /*}}}*/
1231
+ this.elements.loop_tail = { /*{{{*/
1232
+ 'parent': 'loop',
1233
+ 'illustrator': {//{{{
1234
+ 'endnodes': 'aggregate',
1235
+ 'closeblock': false,
1236
+ 'closing_symbol': 'loop_finish'
1237
+ },//}}}
1238
+ }; /*}}}*/
1239
+ this.elements.choose_inclusive = { /*{{{*/
1240
+ 'parent': 'choose',
1241
+ 'illustrator': {//{{{
1242
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1243
+ }//}}}
1244
+ }; /*}}}*/
1245
+ this.elements.choose_exclusive = { /*{{{*/
1246
+ 'parent': 'choose',
1247
+ 'illustrator': {//{{{
1248
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1249
+ },//}}}
1250
+ }; /*}}}*/
1251
+ this.elements.choose_inclusive_finish = { /*{{{*/
1252
+ 'parent': 'choose_finish',
1253
+ 'illustrator': {//{{{
1254
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1255
+ }//}}}
1256
+ }; /*}}}*/
1257
+ this.elements.choose_exclusive_finish = { /*{{{*/
1258
+ 'parent': 'choose_finish',
1259
+ 'illustrator': {//{{{
1260
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1261
+ },//}}}
1262
+ }; /*}}}*/
1263
+ this.elements.loop_head_finish = { /*{{{*/
1264
+ 'parent': 'loop_finish',
1265
+ 'illustrator': {//{{{
1266
+ 'endnodes': 'this',
1267
+ 'closeblock': true,
1268
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1269
+ }//}}}
1270
+ }; /*}}}*/
1271
+ this.elements.loop_tail_finish = { /*{{{*/
1272
+ 'parent': 'loop_finish',
1273
+ 'illustrator': {//{{{
1274
+ 'endnodes': 'this',
1275
+ 'closeblock': false,
1276
+ 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1277
+ },//}}}
1278
+ }; /*}}}*/
1279
+ this.elements.parallel_simple = { /*{{{*/
1280
+ 'parent': 'parallel_finish',
1281
+ 'illustrator': {//{{{
1282
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
1283
+ }//}}}
1284
+ }; /*}}}*/
1285
+ this.elements.parallel_complex = { /*{{{*/
1286
+ 'parent': 'parallel_finish',
1287
+ 'illustrator': {//{{{
1288
+ 'svg': self.adaptor.theme_dir + 'symbols/complex.svg'
1289
+ },//}}}
1290
+ }; /*}}}*/
1291
+ this.elements.parallel_branch_normal = { /*{{{*/
1292
+ 'parent': 'parallel_branch',
1293
+ 'illustrator': {//{{{
1294
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_normal.svg'
1295
+ }//}}}
1296
+ }; /*}}}*/
1297
+ this.elements.parallel_branch_event = { /*{{{*/
1298
+ 'parent': 'parallel_branch',
1299
+ 'illustrator': {//{{{
1300
+ 'endnodes': 'this',
1301
+ 'noarrow': false,
1302
+ 'border': true,
1303
+ 'wide': true,
1304
+ 'closing_symbol': 'event_end',
1305
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_event.svg'
1306
+ }//}}}
1307
+ }; /*}}}*/
1308
+ this.elements.parallel_branch_compact = { /*{{{*/
1309
+ 'parent': 'parallel_branch',
1310
+ 'illustrator': {//{{{
1311
+ 'endnodes': 'this',
1312
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_compact.svg'
1313
+ }//}}}
1314
+ }; /*}}}*/
1315
+ this.elements.scripts = { /*{{{*/
1316
+ 'description': [self.adaptor.theme_dir + 'rngs/scripts.rng']
1317
+ }; /*}}}*/
1318
+ }