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