cpee 1.3.223 → 1.3.224

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/css/ui.css +14 -14
  3. data/cockpit/css/wfadaptor.css +50 -0
  4. data/cockpit/graph.html +116 -0
  5. data/cockpit/index.html +41 -41
  6. data/cockpit/js/instance.js +15 -5
  7. data/cockpit/js/ui.js +5 -11
  8. data/cockpit/js/wfadaptor.js +20 -7
  9. data/cockpit/themes/{labels → compact}/theme.js +199 -48
  10. data/cockpit/themes/default/rngs/call.rng +26 -0
  11. data/cockpit/themes/default/rngs/callmanipulate.rng +29 -0
  12. data/cockpit/themes/default/rngs/manipulate.rng +3 -0
  13. data/cockpit/themes/default/symbols/alternative.svg +1 -1
  14. data/cockpit/themes/default/symbols/arrow.svg +3 -0
  15. data/cockpit/themes/default/symbols/call.svg +1 -1
  16. data/cockpit/themes/default/symbols/callcorrelationreceive.svg +1 -1
  17. data/cockpit/themes/default/symbols/callcorrelationsend.svg +2 -2
  18. data/cockpit/themes/default/symbols/callinstantiation.svg +1 -1
  19. data/cockpit/themes/default/symbols/callmanipulate.svg +1 -1
  20. data/cockpit/themes/default/symbols/callmanipulateworklist.svg +2 -2
  21. data/cockpit/themes/default/symbols/callworklist.svg +1 -1
  22. data/cockpit/themes/default/symbols/choose.svg +1 -1
  23. data/cockpit/themes/default/symbols/choose_exclusive.svg +1 -1
  24. data/cockpit/themes/default/symbols/choose_inclusive.svg +1 -1
  25. data/cockpit/themes/default/symbols/critical.svg +2 -2
  26. data/cockpit/themes/default/symbols/escape.svg +1 -1
  27. data/cockpit/themes/default/symbols/loop.svg +1 -1
  28. data/cockpit/themes/default/symbols/manipulate.svg +1 -1
  29. data/cockpit/themes/default/symbols/otherwise.svg +1 -1
  30. data/cockpit/themes/default/symbols/parallel.svg +1 -1
  31. data/cockpit/themes/default/symbols/parallel_branch.svg +1 -1
  32. data/cockpit/themes/default/symbols/scripts.svg +1 -1
  33. data/cockpit/themes/default/theme.js +198 -57
  34. data/cockpit/themes/lego/theme.js +459 -400
  35. data/cockpit/themes/promise/theme.js +459 -400
  36. data/cpee.gemspec +1 -1
  37. data/server/resources/transformation_dslx.xsl +98 -0
  38. metadata +5 -67
  39. data/cockpit/themes/adventure/rngs/alternative.rng +0 -5
  40. data/cockpit/themes/adventure/rngs/call.rng +0 -29
  41. data/cockpit/themes/adventure/rngs/callmanipulate.rng +0 -41
  42. data/cockpit/themes/adventure/rngs/choose.rng +0 -8
  43. data/cockpit/themes/adventure/rngs/critical.rng +0 -5
  44. data/cockpit/themes/adventure/rngs/escape.rng +0 -1
  45. data/cockpit/themes/adventure/rngs/finalize.rng +0 -6
  46. data/cockpit/themes/adventure/rngs/group.rng +0 -3
  47. data/cockpit/themes/adventure/rngs/loop.rng +0 -11
  48. data/cockpit/themes/adventure/rngs/manipulate.rng +0 -6
  49. data/cockpit/themes/adventure/rngs/otherwise.rng +0 -1
  50. data/cockpit/themes/adventure/rngs/parallel.rng +0 -5
  51. data/cockpit/themes/adventure/rngs/parallel_branch.rng +0 -8
  52. data/cockpit/themes/adventure/rngs/update.rng +0 -6
  53. data/cockpit/themes/adventure/symbols/alternative.svg +0 -4
  54. data/cockpit/themes/adventure/symbols/call.svg +0 -4
  55. data/cockpit/themes/adventure/symbols/callmanipulate.svg +0 -6
  56. data/cockpit/themes/adventure/symbols/choose.svg +0 -5
  57. data/cockpit/themes/adventure/symbols/choose_exclusive.svg +0 -5
  58. data/cockpit/themes/adventure/symbols/choose_inclusive.svg +0 -4
  59. data/cockpit/themes/adventure/symbols/critical.svg +0 -4
  60. data/cockpit/themes/adventure/symbols/escape.svg +0 -5
  61. data/cockpit/themes/adventure/symbols/loop.svg +0 -5
  62. data/cockpit/themes/adventure/symbols/manipulate.svg +0 -4
  63. data/cockpit/themes/adventure/symbols/otherwise.svg +0 -4
  64. data/cockpit/themes/adventure/symbols/parallel.svg +0 -5
  65. data/cockpit/themes/adventure/symbols/parallel_branch.svg +0 -4
  66. data/cockpit/themes/adventure/symbols/scripts.svg +0 -4
  67. data/cockpit/themes/adventure/symbols/start.svg +0 -3
  68. data/cockpit/themes/adventure/theme.js +0 -739
  69. data/cockpit/themes/labels/rngs/alternative.rng +0 -5
  70. data/cockpit/themes/labels/rngs/call.rng +0 -32
  71. data/cockpit/themes/labels/rngs/callmanipulate.rng +0 -47
  72. data/cockpit/themes/labels/rngs/choose.rng +0 -8
  73. data/cockpit/themes/labels/rngs/critical.rng +0 -5
  74. data/cockpit/themes/labels/rngs/escape.rng +0 -1
  75. data/cockpit/themes/labels/rngs/finalize.rng +0 -6
  76. data/cockpit/themes/labels/rngs/group.rng +0 -3
  77. data/cockpit/themes/labels/rngs/loop.rng +0 -11
  78. data/cockpit/themes/labels/rngs/manipulate.rng +0 -6
  79. data/cockpit/themes/labels/rngs/otherwise.rng +0 -1
  80. data/cockpit/themes/labels/rngs/parallel.rng +0 -5
  81. data/cockpit/themes/labels/rngs/parallel_branch.rng +0 -8
  82. data/cockpit/themes/labels/rngs/update.rng +0 -6
  83. data/cockpit/themes/labels/symbols/alternative.svg +0 -4
  84. data/cockpit/themes/labels/symbols/call.svg +0 -4
  85. data/cockpit/themes/labels/symbols/callcorrelationreceive.svg +0 -6
  86. data/cockpit/themes/labels/symbols/callcorrelationsend.svg +0 -6
  87. data/cockpit/themes/labels/symbols/callinstantiation.svg +0 -3
  88. data/cockpit/themes/labels/symbols/callmanipulate.svg +0 -6
  89. data/cockpit/themes/labels/symbols/callmanipulateworklist.svg +0 -6
  90. data/cockpit/themes/labels/symbols/callworklist.svg +0 -4
  91. data/cockpit/themes/labels/symbols/choose.svg +0 -5
  92. data/cockpit/themes/labels/symbols/choose_exclusive.svg +0 -5
  93. data/cockpit/themes/labels/symbols/choose_inclusive.svg +0 -4
  94. data/cockpit/themes/labels/symbols/critical.svg +0 -4
  95. data/cockpit/themes/labels/symbols/escape.svg +0 -5
  96. data/cockpit/themes/labels/symbols/loop.svg +0 -5
  97. data/cockpit/themes/labels/symbols/manipulate.svg +0 -4
  98. data/cockpit/themes/labels/symbols/otherwise.svg +0 -4
  99. data/cockpit/themes/labels/symbols/parallel.svg +0 -5
  100. data/cockpit/themes/labels/symbols/parallel_branch.svg +0 -4
  101. data/cockpit/themes/labels/symbols/scripts.svg +0 -4
  102. data/cockpit/themes/labels/symbols/start.svg +0 -3
@@ -2,20 +2,34 @@ function WFAdaptorManifestation(adaptor) {
2
2
  var self = this;
3
3
 
4
4
  this.adaptor = adaptor;
5
+ this.resources = {};
5
6
  this.elements = {};
6
7
  this.events = {};
7
- this.compact = false;
8
+ this.compact = true;
8
9
 
9
10
  this.noarrow = ['alternative', 'otherwise'];
10
- this.source = function(rng) {
11
- $('#relaxngworker').empty();
12
- var rngw = new RelaxNGui(rng,$('#relaxngworker'),self.adaptor.description.context_eval);
13
- var nnew = $(rngw.save().documentElement);
14
- nnew.attr('trans-xmlns','http://cpee.org/ns/description/1.0');
15
- var ntxt = nnew.serializeXML();
16
- ntxt = ntxt.replace(/trans-xmlns/,'xmlns');
11
+ this.source = function(base,opts) {
12
+ if (base[0].namespaceURI == "http://relaxng.org/ns/structure/1.0") {
13
+ $('#relaxngworker').empty();
14
+ var rngw = new RelaxNGui(base,$('#relaxngworker'),self.adaptor.description.context_eval);
15
+ var nnew = $(rngw.save().documentElement);
16
+ nnew.attr('trans-xmlns','http://cpee.org/ns/description/1.0');
17
+ var ntxt = nnew.serializeXML();
18
+ ntxt = ntxt.replace(/trans-xmlns/,'xmlns');
17
19
 
18
- return($X(ntxt));
20
+ return($X(ntxt));
21
+ } else {
22
+ if (opts && opts == 'clone') {
23
+ if (base.attr('id')) {
24
+ base = base.clone();
25
+ // not very generic, because it is assumed that id is attribute of top level
26
+ // a better solution would be to parse rng for get_free_id()
27
+ // but: there is lots of lock-in to element-id, so fuck it
28
+ base.attr('id',self.adaptor.description.get_free_id());
29
+ }
30
+ }
31
+ return base;
32
+ }
19
33
  };
20
34
  this.clicked = function(){
21
35
  var svgid = 'unknown';
@@ -26,6 +40,56 @@ function WFAdaptorManifestation(adaptor) {
26
40
  });
27
41
  return svgid;
28
42
  };
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
+
53
+ function copyOrMove(menu,group,xml_node,mode) {
54
+ var markymark = self.marked();
55
+ var check1 = [];
56
+ var check2 = [];
57
+ $(markymark).each(function(key,svgid){
58
+ var node = self.adaptor.description.get_node_by_svg_id(svgid);
59
+ check1.push($(node).attr('svg-type'));
60
+ });
61
+ $(group).each(function(key,value){
62
+ check2.push(value.type);
63
+ });
64
+
65
+ if (markymark.length > 0 && _.uniq(check1).length == _.intersection(check1,check2).length) {
66
+ var nodes = [];
67
+ $(markymark).each(function(key,svgid){
68
+ var node = self.adaptor.description.get_node_by_svg_id(svgid);
69
+ nodes.unshift(node);
70
+ });
71
+
72
+ var iconm = self.resources['arrow'].clone();
73
+ var iconc = self.resources['arrow'].clone();
74
+ iconm.children('.rfill').addClass('menu');
75
+ menu.push(
76
+ {
77
+ 'label': '<em>Move Marked Elements</em>',
78
+ 'function_call': mode,
79
+ 'menu_icon': iconm,
80
+ 'type': undefined,
81
+ 'params': [nodes, xml_node]
82
+ },
83
+ {
84
+ 'label': '<em>Copy Marked Elements</em>',
85
+ 'function_call': mode,
86
+ 'menu_icon': iconc,
87
+ 'type': undefined,
88
+ 'params': [nodes, xml_node, 'clone']
89
+ }
90
+ );
91
+ }
92
+ }
29
93
 
30
94
  // Events
31
95
  this.events.mousedown = function(svgid, e, child, sibling) { // {{{
@@ -37,31 +101,39 @@ function WFAdaptorManifestation(adaptor) {
37
101
  var menu = {};
38
102
 
39
103
  if (child) {
40
- group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node);
41
- if(group.length > 0) menu['Insert into'] = group;
104
+ group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node,'into');
105
+ if(group.length > 0) {
106
+ menu['Insert into'] = group;
107
+ copyOrMove(menu['Insert into'],group,self.adaptor.description.insert_first_into);
108
+ }
42
109
  }
43
110
  if (sibling) {
44
- group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node);
45
- if(group.length > 0) menu['Insert after'] = group;
111
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node,'after');
112
+ if(group.length > 0) {
113
+ menu['Insert after'] = group;
114
+ copyOrMove(menu['Insert after'],group,xml_node,self.adaptor.description.insert_after);
115
+ }
46
116
  }
47
117
 
48
118
  if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
49
119
  var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
50
- icon.children('.rfill').css({'fill':'#ff7f7f','fill-opacity':'1'});
120
+ icon.children('.rfill').addClass('menu');
51
121
  menu['Delete'] = [{
52
122
  'label': 'Remove Element',
53
123
  'function_call': self.adaptor.description.remove,
54
124
  'menu_icon': icon,
125
+ 'type': undefined,
55
126
  'params': [null, xml_node]
56
127
  }];
57
128
  }
58
129
  if($('> finalize, > update', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
59
130
  var icon = self.elements.callmanipulate.illustrator.svg.clone();
60
- icon.children('.rfill:last').css({'fill':'#ff7f7f','fill-opacity':'1'});
131
+ icon.children('.rfill:last').addClass('menu');
61
132
  menu['Delete'].push({
62
133
  'label': 'Remove Scripts',
63
134
  'function_call': self.adaptor.description.remove,
64
135
  'menu_icon': icon,
136
+ 'type': undefined,
65
137
  'params': ['> finalize, > update', xml_node]
66
138
  });
67
139
  }
@@ -69,27 +141,37 @@ function WFAdaptorManifestation(adaptor) {
69
141
  }
70
142
  return false;
71
143
  } // }}}
72
- this.events.click = function(svgid) { // {{{
144
+ this.events.click = function(svgid, e) { // {{{
145
+ if (self.adaptor.description.get_node_by_svg_id(svgid).length == 0) {
146
+ return;
147
+ }
148
+
73
149
  var visid = 'details';
74
150
  var tab = $('#dat_' + visid);
75
151
  tab.empty();
76
152
 
77
- if (self.adaptor.description.get_node_by_svg_id(svgid).length == 0) {
78
- return;
79
- }
80
153
  self.adaptor.illustrator.get_elements().removeClass('clicked');
81
154
 
82
- var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
83
- if (vtarget.length > 0) {
84
- vtarget.parents('g.element[element-id]').addClass('clicked');
85
- }
155
+ if (e && e.ctrlKey) {
156
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
157
+ if (vtarget.length > 0) {
158
+ vtarget.parents('g.element[element-id]').toggleClass('marked');
159
+ }
160
+ } else {
161
+ self.adaptor.illustrator.get_elements().removeClass('marked');
162
+
163
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
164
+ if (vtarget.length > 0) {
165
+ vtarget.parents('g.element[element-id]').addClass('clicked');
166
+ }
86
167
 
87
- var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
168
+ var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
88
169
 
89
- if (self.adaptor.description.elements[$(node).attr('svg-type')]) {
90
- save[visid + '_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
91
- save[visid] = new RelaxNGui(self.adaptor.description.elements[$(node).attr('svg-type')],tab,self.adaptor.description.context_eval);
92
- save[visid].content(node);
170
+ if (self.adaptor.description.elements[$(node).attr('svg-type')]) {
171
+ save[visid + '_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
172
+ save[visid] = new RelaxNGui(self.adaptor.description.elements[$(node).attr('svg-type')],tab,self.adaptor.description.context_eval);
173
+ save[visid].content(node);
174
+ }
93
175
  }
94
176
  } // }}}
95
177
  this.events.dblclick = function(svgid, e) { // {{{
@@ -105,6 +187,9 @@ function WFAdaptorManifestation(adaptor) {
105
187
  this.events.dragstart = function (svgid, e) { //{{{
106
188
  } //}}}
107
189
 
190
+ // other resources
191
+ this.resources.arrow = self.adaptor.theme_dir + 'symbols/arrow.svg';
192
+
108
193
  // Primitive Elements
109
194
  this.elements.call = { /*{{{*/
110
195
  'type': 'primitive',
@@ -133,12 +218,13 @@ function WFAdaptorManifestation(adaptor) {
133
218
  'svg': self.adaptor.theme_dir + 'symbols/call.svg'
134
219
  },//}}}
135
220
  'description': self.adaptor.theme_dir + 'rngs/call.rng',
136
- 'permissible_children': function(node) { //{{{
221
+ 'permissible_children': function(node,mode) { //{{{
137
222
  if(node.children('finalize,update').length < 1)
138
223
  return [
139
224
  {'label': 'Scripts',
140
225
  'function_call': self.adaptor.description.insert_last_into,
141
226
  'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
227
+ 'type': undefined,
142
228
  'params': [self.adaptor.description.elements.scripts, node]}
143
229
  ];
144
230
  return [];
@@ -153,10 +239,18 @@ function WFAdaptorManifestation(adaptor) {
153
239
  'type': 'primitive',
154
240
  'illustrator': {//{{{
155
241
  'endnodes': 'this',
242
+ 'label': function(node){
243
+ var lab = $(node).attr('label');
244
+ if (lab) {
245
+ return lab.replace(/^['"]/,'').replace(/['"]$/,'');
246
+ } else {
247
+ return "";
248
+ }
249
+ },
156
250
  'svg': self.adaptor.theme_dir + 'symbols/manipulate.svg'
157
251
  },//}}}
158
252
  'description': self.adaptor.theme_dir + 'rngs/manipulate.rng',
159
- 'permissible_children': function(node) { //{{{
253
+ 'permissible_children': function(node,mode) { //{{{
160
254
  return [];
161
255
  }, //}}}
162
256
  'adaptor': {//{{{
@@ -171,7 +265,7 @@ function WFAdaptorManifestation(adaptor) {
171
265
  'svg': self.adaptor.theme_dir + 'symbols/escape.svg'
172
266
  },//}}}
173
267
  'description': self.adaptor.theme_dir + 'rngs/escape.rng',
174
- 'permissible_children': function(node) { //{{{
268
+ 'permissible_children': function(node,mode) { //{{{
175
269
  return [];
176
270
  }, //}}}
177
271
  'adaptor': {//{{{
@@ -203,29 +297,33 @@ function WFAdaptorManifestation(adaptor) {
203
297
  'svg': self.adaptor.theme_dir + 'symbols/choose.svg'
204
298
  },//}}}
205
299
  'description': self.adaptor.theme_dir + 'rngs/choose.rng',
206
- 'permissible_children': function(node) { //{{{
300
+ 'permissible_children': function(node,mode) { //{{{
207
301
  var func = null;
208
- if(node.get(0).tagName == 'choose') { func = self.adaptor.description.insert_first_into }
302
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
209
303
  else { func = self.adaptor.description.insert_after }
210
304
  if(node.children('parallel_branch').length > 0) {
211
305
  return [{'label': 'Parallel Branch',
212
306
  'function_call': func,
213
307
  'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
308
+ 'type': 'parallel_branch',
214
309
  'params': [self.adaptor.description.elements.parallel_branch, node]}];
215
310
  }
216
311
  var childs = [{'label': 'Alternative',
217
312
  'function_call': func,
218
313
  'menu_icon': self.elements.alternative.illustrator.svg.clone(),
314
+ 'type': 'alternative',
219
315
  'params': [self.adaptor.description.elements.alternative, node]}];
220
316
  if((node.children('otherwise').length == 0) && node.parents('parallel').length == node.parents('parallel_branch').length)
221
317
  childs.push({'label': 'Otherwise',
222
318
  'function_call': self.adaptor.description.insert_last_into,
223
319
  'menu_icon': self.elements.otherwise.illustrator.svg.clone(),
320
+ 'type': 'otherwise',
224
321
  'params': [self.adaptor.description.elements.otherwise, node]});
225
322
  if(node.parents('parallel').length > node.parents('parallel_branch').length)
226
323
  childs.push({'label': 'Parallel Branch',
227
324
  'function_call': func,
228
325
  'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
326
+ 'type': 'parallel_branch',
229
327
  'params': [self.adaptor.description.elements.parallel_branch, node]});
230
328
  return childs;
231
329
  }, //}}}
@@ -254,39 +352,46 @@ function WFAdaptorManifestation(adaptor) {
254
352
  },//}}}
255
353
  'description': self.adaptor.theme_dir + 'rngs/otherwise.rng',
256
354
  'neverdelete': true,
257
- 'permissible_children': function(node) { //{{{
355
+ 'permissible_children': function(node,mode) { //{{{
258
356
  var func = null;
259
357
  var childs = null;
260
- if(node.get(0).tagName == 'otherwise') { func = self.adaptor.description.insert_first_into }
358
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
261
359
  else { func = self.adaptor.description.insert_after }
262
360
  return [
263
361
  {'label': 'Service Call with Scripts',
264
362
  'function_call': func,
265
363
  'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
364
+ 'type': 'callmanipulate',
266
365
  'params': [self.adaptor.description.elements.callmanipulate, node]},
267
366
  {'label': 'Service Call',
268
367
  'function_call': func,
269
368
  'menu_icon': self.elements.call.illustrator.svg.clone(),
369
+ 'type': 'call',
270
370
  'params': [self.adaptor.description.elements.call, node]},
271
371
  {'label': 'Script',
272
372
  'function_call': func,
273
373
  'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
374
+ 'type': 'manipulate',
274
375
  'params': [self.adaptor.description.elements.manipulate, node]},
275
376
  {'label': 'Parallel',
276
377
  'function_call': func,
277
378
  'menu_icon': self.elements.parallel.illustrator.svg.clone(),
379
+ 'type': 'parallel',
278
380
  'params': [self.adaptor.description.elements.parallel, node]},
279
381
  {'label': 'Decision',
280
382
  'function_call': func,
281
383
  'menu_icon': self.elements.choose.illustrator.svg.clone(),
384
+ 'type': 'choose',
282
385
  'params': [self.adaptor.description.elements.choose, node]},
283
386
  {'label': 'Loop',
284
387
  'function_call': func,
285
388
  'menu_icon': self.elements.loop.illustrator.svg.clone(),
389
+ 'type': 'loop',
286
390
  'params': [self.adaptor.description.elements.loop, node]},
287
391
  {'label': 'Critical',
288
392
  'function_call': func,
289
393
  'menu_icon': self.elements.critical.illustrator.svg.clone(),
394
+ 'type': 'critical',
290
395
  'params': [self.adaptor.description.elements.critical, node]}
291
396
  ];
292
397
  }, //}}}
@@ -315,43 +420,51 @@ function WFAdaptorManifestation(adaptor) {
315
420
  'svg': self.adaptor.theme_dir + 'symbols/alternative.svg'
316
421
  },//}}}
317
422
  'description': self.adaptor.theme_dir + 'rngs/alternative.rng',
318
- 'permissible_children': function(node) { //{{{
319
- if(node.get(0).tagName == 'alternative') { func = self.adaptor.description.insert_first_into }
423
+ 'permissible_children': function(node,mode) { //{{{
424
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
320
425
  else { func = self.adaptor.description.insert_after }
321
426
  if(node.parents('parallel').length > node.parents('parallel_branch').length && node.get(0).tagName == 'alternative') {
322
427
  return [{'label': 'Parallel Branch',
323
428
  'function_call': func,
324
429
  'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
430
+ 'type': 'parallel_branch',
325
431
  'params': [self.adaptor.description.elements.parallel_branch, node]}];
326
432
  }
327
433
  return [
328
434
  {'label': 'Service Call with Scripts',
329
435
  'function_call': func,
330
436
  'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
437
+ 'type': 'callmanipulate',
331
438
  'params': [self.adaptor.description.elements.callmanipulate, node]},
332
439
  {'label': 'Service Call',
333
440
  'function_call': func,
334
441
  'menu_icon': self.elements.call.illustrator.svg.clone(),
442
+ 'type': 'call',
335
443
  'params': [self.adaptor.description.elements.call, node]},
336
444
  {'label': 'Script',
337
445
  'function_call': func,
338
446
  'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
447
+ 'type': 'manipulate',
339
448
  'params': [self.adaptor.description.elements.manipulate, node]},
340
449
  {'label': 'Parallel',
341
450
  'function_call': func,
342
451
  'menu_icon': self.elements.parallel.illustrator.svg.clone(),
452
+ 'type': 'parallel',
343
453
  'params': [self.adaptor.description.elements.parallel, node]},
344
454
  {'label': 'Decision',
345
455
  'function_call': func,
346
456
  'menu_icon': self.elements.choose.illustrator.svg.clone(),
457
+ 'type': 'choose',
347
458
  'params': [self.adaptor.description.elements.choose, node]},
348
459
  {'label': 'Loop',
349
460
  'function_call': func,
350
461
  'menu_icon': self.elements.loop.illustrator.svg.clone(),
462
+ 'type': 'loop',
351
463
  'params': [self.adaptor.description.elements.loop, node]},
352
464
  {'label': 'Critical',
353
465
  'function_call': func,
354
466
  'menu_icon': self.elements.critical.illustrator.svg.clone(),
467
+ 'type': 'critical',
355
468
  'params': [self.adaptor.description.elements.critical, node]}
356
469
  ];
357
470
  }, //}}}
@@ -380,46 +493,54 @@ function WFAdaptorManifestation(adaptor) {
380
493
  'svg': self.adaptor.theme_dir + 'symbols/loop.svg'
381
494
  },// }}}
382
495
  'description': self.adaptor.theme_dir + 'rngs/loop.rng',
383
- 'permissible_children': function(node) { //{{{
496
+ 'permissible_children': function(node,mode) { //{{{
384
497
  var func = null;
385
- if(node.get(0).tagName == 'loop') { func = self.adaptor.description.insert_first_into }
498
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
386
499
  else { func = self.adaptor.description.insert_after }
387
500
  var childs = [
388
501
  {'label': 'Service Call with Scripts',
389
502
  'function_call': func,
390
503
  'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
504
+ 'type': 'callmanipulate',
391
505
  'params': [self.adaptor.description.elements.callmanipulate, node]},
392
506
  {'label': 'Service Call',
393
507
  'function_call': func,
394
508
  'menu_icon': self.elements.call.illustrator.svg.clone(),
509
+ 'type': 'call',
395
510
  'params': [self.adaptor.description.elements.call, node]},
396
511
  {'label': 'Manipulate',
397
512
  'function_call': func,
398
513
  'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
514
+ 'type': 'manipulate',
399
515
  'params': [self.adaptor.description.elements.manipulate, node]},
400
516
  {'label': 'Decision',
401
517
  'function_call': func,
402
518
  'menu_icon': self.elements.choose.illustrator.svg.clone(),
519
+ 'type': 'choose',
403
520
  'params': [self.adaptor.description.elements.choose, node]},
404
521
  {'label': 'Loop',
405
522
  'function_call': func,
406
523
  'menu_icon': self.elements.loop.illustrator.svg.clone(),
524
+ 'type': 'loop',
407
525
  'params': [self.adaptor.description.elements.loop, node]},
408
526
  {'label': 'Critical',
409
527
  'function_call': func,
410
528
  'menu_icon': self.elements.critical.illustrator.svg.clone(),
529
+ 'type': 'critical',
411
530
  'params': [self.adaptor.description.elements.critical, node]}
412
531
  ];
413
532
  if(node.parent('parallel').length > node.parent('parallel_branch').length) {
414
533
  childs.push({'label': 'Parallel Branch',
415
534
  'function_call': func,
416
535
  'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
536
+ 'type': 'parallel_branch',
417
537
  'params': [self.adaptor.description.elements.parallel_branch, node]}
418
538
  );
419
539
  } else {
420
540
  childs.push({'label': 'Parallel',
421
541
  'function_call': func,
422
542
  'menu_icon': self.elements.parallel.illustrator.svg.clone(),
543
+ 'type': 'parallel',
423
544
  'params': [self.adaptor.description.elements.parallel, node]}
424
545
  );
425
546
  }
@@ -452,41 +573,49 @@ function WFAdaptorManifestation(adaptor) {
452
573
  'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
453
574
  },//}}}
454
575
  'description': self.adaptor.theme_dir + 'rngs/parallel.rng',
455
- 'permissible_children': function(node) { //{{{
576
+ 'permissible_children': function(node,mode) { //{{{
456
577
  var childs = [
457
578
  {'label': 'Service Call with Scripts',
458
579
  'function_call': self.adaptor.description.insert_last_into,
459
580
  'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
581
+ 'type': 'callmanipulate',
460
582
  'params': [self.adaptor.description.elements.callmanipulate, node]},
461
583
  {'label': 'Service Call',
462
584
  'function_call': self.adaptor.description.insert_last_into,
463
585
  'menu_icon': self.elements.call.illustrator.svg.clone(),
586
+ 'type': 'call',
464
587
  'params': [self.adaptor.description.elements.call, node]},
465
588
  {'label': 'Manipulate',
466
589
  'function_call': self.adaptor.description.insert_last_into,
467
590
  'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
591
+ 'type': 'manipulate',
468
592
  'params': [self.adaptor.description.elements.manipulate, node]},
469
593
  {'label': 'Decision',
470
594
  'function_call': self.adaptor.description.insert_last_into,
471
595
  'menu_icon': self.elements.choose.illustrator.svg.clone(),
596
+ 'type': 'choose',
472
597
  'params': [self.adaptor.description.elements.choose, node]},
473
598
  {'label': 'Loop',
474
599
  'function_call': self.adaptor.description.insert_last_into,
475
600
  'menu_icon': self.elements.loop.illustrator.svg.clone(),
601
+ 'type': 'loop',
476
602
  'params': [self.adaptor.description.elements.loop, node]},
477
603
  {'label': 'Critical',
478
604
  'function_call': self.adaptor.description.insert_last_into,
479
605
  'menu_icon': self.elements.critical.illustrator.svg.clone(),
606
+ 'type': 'critical',
480
607
  'params': [self.adaptor.description.elements.critical, node]},
481
608
  {'label': 'Parallel Branch',
482
609
  'function_call': self.adaptor.description.insert_last_into,
483
610
  'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
611
+ 'type': 'parallel_branch',
484
612
  'params': [self.adaptor.description.elements.parallel_branch, node]}
485
613
  ];
486
614
  if(node.get(0).tagName != 'parallel')
487
615
  childs.push({'label': 'Parallel',
488
616
  'function_call': self.adaptor.description.insert_last_into,
489
617
  'menu_icon': self.elements.parallel.illustrator.svg.clone(),
618
+ 'type': 'parallel',
490
619
  'params': [self.adaptor.description.elements.parallel, node]});
491
620
  return childs;
492
621
  }, //}}}
@@ -516,45 +645,53 @@ function WFAdaptorManifestation(adaptor) {
516
645
  'svg': self.adaptor.theme_dir + 'symbols/parallel_branch.svg'
517
646
  },//}}}
518
647
  'description': self.adaptor.theme_dir + 'rngs/parallel_branch.rng',
519
- 'permissible_children': function(node) { //{{{
648
+ 'permissible_children': function(node,mode) { //{{{
520
649
  var func = null;
521
650
  var childs = null;
522
- if(node.get(0).tagName == 'parallel_branch') { func = self.adaptor.description.insert_first_into }
651
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
523
652
  else { func = self.adaptor.description.insert_after }
524
653
  childs = [
525
654
  {'label': 'Service Call with Scripts',
526
655
  'function_call': func,
527
656
  'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
657
+ 'type': 'callmanipulate',
528
658
  'params': [self.adaptor.description.elements.callmanipulate, node]},
529
659
  {'label': 'Service Call',
530
660
  'function_call': func,
531
661
  'menu_icon': self.elements.call.illustrator.svg.clone(),
662
+ 'type': 'call',
532
663
  'params': [self.adaptor.description.elements.call, node]},
533
664
  {'label': 'Script',
534
665
  'function_call': func,
535
666
  'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
667
+ 'type': 'manipulate',
536
668
  'params': [self.adaptor.description.elements.manipulate, node]},
537
669
  {'label': 'Parallel',
538
670
  'function_call': func,
539
671
  'menu_icon': self.elements.parallel.illustrator.svg.clone(),
672
+ 'type': 'parallel',
540
673
  'params': [self.adaptor.description.elements.parallel, node]},
541
674
  {'label': 'Decision',
542
675
  'function_call': func,
543
676
  'menu_icon': self.elements.choose.illustrator.svg.clone(),
677
+ 'type': 'choose',
544
678
  'params': [self.adaptor.description.elements.choose, node]},
545
679
  {'label': 'Loop',
546
680
  'function_call': func,
547
681
  'menu_icon': self.elements.loop.illustrator.svg.clone(),
682
+ 'type': 'loop',
548
683
  'params': [self.adaptor.description.elements.loop, node]},
549
684
  {'label': 'Critical',
550
685
  'function_call': func,
551
686
  'menu_icon': self.elements.critical.illustrator.svg.clone(),
687
+ 'type': 'critical',
552
688
  'params': [self.adaptor.description.elements.critical, node]},
553
689
  ];
554
690
  if(node.parents('choose').length > node.parents('alternative, otherwise').length && node.get(0).tagName == 'parallel_branch') {
555
691
  return [{'label': 'Alternative',
556
692
  'function_call': func,
557
693
  'menu_icon': self.elements.alternative.illustrator.svg.clone(),
694
+ 'type': 'alternative',
558
695
  'params': [self.adaptor.description.elements.alternative, node]}];
559
696
  }
560
697
  return childs;
@@ -584,38 +721,45 @@ function WFAdaptorManifestation(adaptor) {
584
721
  'svg': self.adaptor.theme_dir + 'symbols/critical.svg'
585
722
  },//}}}
586
723
  'description': self.adaptor.theme_dir + 'rngs/critical.rng',
587
- 'permissible_children': function(node) { //{{{
724
+ 'permissible_children': function(node,mode) { //{{{
588
725
  var func = null;
589
- if(node.get(0).tagName == 'critical') { func = self.adaptor.description.insert_first_into }
726
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
590
727
  else { func = self.adaptor.description.insert_after }
591
728
  return [
592
729
  {'label': 'Service Call with Scripts',
593
730
  'function_call': func,
594
731
  'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
732
+ 'type': 'callmanipulate',
595
733
  'params': [self.adaptor.description.elements.callmanipulate, node]},
596
734
  {'label': 'Service Call',
597
735
  'function_call': func,
598
736
  'menu_icon': self.elements.call.illustrator.svg.clone(),
737
+ 'type': 'call',
599
738
  'params': [self.adaptor.description.elements.call, node]},
600
739
  {'label': 'Script',
601
740
  'function_call': func,
602
741
  'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
742
+ 'type': 'manipulate',
603
743
  'params': [self.adaptor.description.elements.manipulate, node]},
604
744
  {'label': 'Parallel',
605
745
  'function_call': func,
606
746
  'menu_icon': self.elements.parallel.illustrator.svg.clone(),
747
+ 'type': 'parallel',
607
748
  'params': [self.adaptor.description.elements.parallel, node]},
608
749
  {'label': 'Decision',
609
750
  'function_call': func,
610
751
  'menu_icon': self.elements.choose.illustrator.svg.clone(),
752
+ 'type': 'choose',
611
753
  'params': [self.adaptor.description.elements.choose, node]},
612
754
  {'label': 'Loop',
613
755
  'function_call': func,
614
756
  'menu_icon': self.elements.loop.illustrator.svg.clone(),
757
+ 'type': 'loop',
615
758
  'params': [self.adaptor.description.elements.loop, node]},
616
759
  {'label': 'Critical',
617
760
  'function_call': func,
618
761
  'menu_icon': self.elements.critical.illustrator.svg.clone(),
762
+ 'type': 'critical',
619
763
  'params': [self.adaptor.description.elements.critical, node]},
620
764
  ];
621
765
  }, //}}}
@@ -644,9 +788,9 @@ function WFAdaptorManifestation(adaptor) {
644
788
  'svg': null
645
789
  },//}}}
646
790
  'description': self.adaptor.theme_dir + 'rngs/group.rng',
647
- 'permissible_children': function(node) { //{{{
791
+ 'permissible_children': function(node,mode) { //{{{
648
792
  var func = null;
649
- if(node.get(0).tagName == 'group') { func = self.adaptor.description.insert_first_into }
793
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
650
794
  else { func = self.adaptor.description.insert_after }
651
795
  return [
652
796
  ];
@@ -675,38 +819,45 @@ function WFAdaptorManifestation(adaptor) {
675
819
  'svg': self.adaptor.theme_dir + 'symbols/start.svg'
676
820
  },//}}}
677
821
  'description': null,
678
- 'permissible_children': function(node) { //{{{
822
+ 'permissible_children': function(node,mode) { //{{{
679
823
  var func = null;
680
- if(node.get(0).tagName == 'description') { func = self.adaptor.description.insert_first_into }
824
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
681
825
  else { func = self.adaptor.description.insert_after }
682
826
  return [
683
827
  {'label': 'Service Call with Scripts',
684
828
  'function_call': func,
685
829
  'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
830
+ 'type': 'callmanipulate',
686
831
  'params': [self.adaptor.description.elements.callmanipulate, node]},
687
832
  {'label': 'Service Call',
688
833
  'function_call': func,
689
834
  'menu_icon': self.elements.call.illustrator.svg.clone(),
835
+ 'type': 'call',
690
836
  'params': [self.adaptor.description.elements.call, node]},
691
837
  {'label': 'Script Task',
692
838
  'function_call': func,
693
839
  'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
840
+ 'type': 'manipulate',
694
841
  'params': [self.adaptor.description.elements.manipulate, node]},
695
842
  {'label': 'Parallel',
696
843
  'function_call': func,
697
844
  'menu_icon': self.elements.parallel.illustrator.svg.clone(),
845
+ 'type': 'parallel',
698
846
  'params': [self.adaptor.description.elements.parallel, node]},
699
847
  {'label': 'Decision',
700
848
  'function_call': func,
701
849
  'menu_icon': self.elements.choose.illustrator.svg.clone(),
850
+ 'type': 'choose',
702
851
  'params': [self.adaptor.description.elements.choose, node]},
703
852
  {'label': 'Loop',
704
853
  'function_call': func,
705
854
  'menu_icon': self.elements.loop.illustrator.svg.clone(),
855
+ 'type': 'loop',
706
856
  'params': [self.adaptor.description.elements.loop, node]},
707
857
  {'label': 'Critical',
708
858
  'function_call': func,
709
859
  'menu_icon': self.elements.critical.illustrator.svg.clone(),
860
+ 'type': 'critical',
710
861
  'params': [self.adaptor.description.elements.critical, node]}
711
862
  ];
712
863
  }, //}}}