cpee 1.3.120 → 1.3.121

Sign up to get free protection for your applications and to get access to all the features.
data/cockpit/css/ui.css CHANGED
@@ -1,3 +1,11 @@
1
+ body {
2
+ -webkit-user-select: none;
3
+ -moz-user-select: -moz-none;
4
+ -ms-user-select: none;
5
+ user-select: none;
6
+ }
7
+
8
+
1
9
  #areanew { height: 7em; }
2
10
  #areanew td:nth-child(1) { width: 7em; padding-right: 1em; }
3
11
  #areanew td:nth-child(3) { width: 16em; padding-left: 1em; }
@@ -173,10 +181,6 @@ span.vote {
173
181
  #dat_details tr:nth-child(odd) { background-color: ButtonFace; color: ButtonText; }
174
182
  #dat_details .header button { border: 1pt solid buttonshadow; }
175
183
 
176
- #disclaimer {
177
- margin: 1em;
178
- }
179
-
180
- #disclaimer p {
181
- max-width: 80ex;
182
- }
184
+ #disclaimer { margin: 1em; }
185
+ #disclaimer p { max-width: 80ex; text-align: justify; }
186
+ #disclaimer input { margin:0; padding:0; vertical-align:bottom; margin-right: 0.5em; }
data/cockpit/index.html CHANGED
@@ -53,6 +53,8 @@
53
53
  </head>
54
54
  <body>
55
55
  <div id='disclaimer' class='hidden'>
56
+ <h1>Disclaimer</h1>
57
+
56
58
  <p>
57
59
  We use reasonable care in creating and presenting the functionality
58
60
  found in this demonstrator. It is provided purely for demonstration purposes
@@ -93,7 +95,10 @@
93
95
  </p>
94
96
 
95
97
  <p>
96
- <button id='iagree'>OK, I Agree with this terms. I will be a happy person, and do no evil.</button>
98
+ <input id='iagree' type='checkbox'/><label for'iagree'><strong>OK, I Agree with this terms. I will be a happy person, and do no evil.</strong></label>
99
+ </p>
100
+ <p>
101
+ <button id='icontinue' disabled='disabled'>Continue</button>
97
102
  </p>
98
103
  </div>
99
104
 
@@ -272,13 +277,11 @@
272
277
  </td> <!--}}}-->
273
278
  </tr>
274
279
  </table>
275
- <div class="tabbelow">
276
- <div id="areadsl" class="inactive"></div>
277
- <div id="arealog" class="inactive"> <!--{{{-->
278
- <table id="dat_log" class="layout">
279
- </table>
280
- </div> <!--}}}-->
281
- </div>
280
+ <div id="areadsl" class="tabbelow inactive"></div>
281
+ <div id="arealog" class="tabbelow inactive"> <!--{{{-->
282
+ <table id="dat_log" class="layout">
283
+ </table>
284
+ </div> <!--}}}-->
282
285
  </div>
283
286
 
284
287
  </body>
@@ -4,11 +4,12 @@ $(document).ready(function() {
4
4
  // save buttons shown or not //{{{
5
5
  $('#main table.tabbar td.tab:not(.switch):not(.tabbehind)').click(function(event){
6
6
  var me = $(event.target).parents('td.tab');
7
- if (me.attr('id') == 'tabdetails') {
8
- $('#main .tabbehind button').show();
9
- } else {
10
- $('#main .tabbehind button').hide();
11
- }
7
+ if ($('#state').text() != 'finished')
8
+ if (me.attr('id') == 'tabdetails') {
9
+ $('#main .tabbehind button').show();
10
+ } else {
11
+ $('#main .tabbehind button').hide();
12
+ }
12
13
  }); //}}}
13
14
 
14
15
  // New entry //{{{
@@ -1,3 +1,4 @@
1
+ var ws;
1
2
  var running = false;
2
3
  var load;
3
4
  var graphrealization;
@@ -135,7 +136,7 @@ function create_instance() {// {{{
135
136
  function monitor_instance() {// {{{
136
137
  var url = $("input[name=instance-url]").val();
137
138
 
138
- $('#main .tabbehind button').hide();
139
+ $('.tabbehind button').hide();
139
140
  $('#dat_details').empty();
140
141
 
141
142
  $.ajax({
@@ -155,6 +156,8 @@ function monitor_instance() {// {{{
155
156
 
156
157
  // Change url to return to current instance when reloading (because new subscription is made)
157
158
  $("input[name=votecontinue]").removeAttr('checked');
159
+ subscription_state = 'less';
160
+
158
161
  $.ajax({
159
162
  type: "POST",
160
163
  url: url + "/notifications/subscriptions/",
@@ -168,6 +171,7 @@ function monitor_instance() {// {{{
168
171
  });
169
172
  append_to_log("monitoring", "id", subscription);
170
173
  var Socket = "MozWebSocket" in window ? MozWebSocket : WebSocket;
174
+ if (ws) ws.close();
171
175
  ws = new Socket(url.replace(/http/,'ws') + "/notifications/subscriptions/" + subscription + "/ws/");
172
176
  ws.onopen = function() {
173
177
  append_to_log("monitoring", "opened", "");
@@ -378,6 +382,12 @@ function monitor_instance_state_change(notification) { //{{{
378
382
  but = " ⇒ <button onclick='$(this).attr(\"disabled\",\"disabled\");stop_instance();'>stop</button>";
379
383
  }
380
384
 
385
+ if (notification == "finished") {
386
+ $('.tabbehind button').hide();
387
+ } else {
388
+ $('#parameters .tabbehind button').show();
389
+ }
390
+
381
391
  ctv.append(notification + but);
382
392
  }
383
393
  } //}}}
data/cockpit/js/ui.js CHANGED
@@ -17,6 +17,13 @@ $(document).ready(function() {
17
17
  });
18
18
 
19
19
  $("#iagree").click(function(){
20
+ if($(this).is(':checked')){
21
+ $("#icontinue").prop("disabled", false);
22
+ } else {
23
+ $("#icontinue").prop("disabled", true);
24
+ }
25
+ });
26
+ $("#icontinue").click(function(){
20
27
  $.cookie('cpee_iagree','yes');
21
28
  location.reload();
22
29
  });
@@ -117,7 +117,8 @@ function CPEE(adaptor) {
117
117
  return;
118
118
  }
119
119
 
120
- $('#main .tabbehind button').show();
120
+ if ($('#state').text() != 'finished')
121
+ $('#main .tabbehind button').show();
121
122
  if ($('#main .tabbehind button').hasClass('highlight')) {
122
123
  var check = confirm("Discard changes?");
123
124
  if (check)
@@ -7,9 +7,6 @@
7
7
  <testset>Mangler 2</testset>
8
8
  <testset>Concurrent</testset>
9
9
  <testset>Endpoints and Data Manipulation</testset>
10
- <testset>RESCUE - Book Movie - Local</testset>
11
- <testset>RESCUE - Book Movie</testset>
12
- <testset>RESCUE - Loop-Parallel Injection</testset>
13
10
  <testset>TEST - Wrong Positions</testset>
14
11
  <testset>TEST - Bad Loop</testset>
15
12
  <testset>Syncing P34</testset>
data/cpee.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "1.3.120"
3
+ s.version = "1.3.121"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3"
6
6
  s.summary = "Preliminary release of cloud process execution engine (cpee). If you just need workflow execution, without a rest/xmpp service exposing it, then use WEEL"
@@ -189,7 +189,11 @@ module CPEE
189
189
  def unserialize_notifications!(op,key)# {{{
190
190
  case op
191
191
  when :del
192
+ @notifications.subscriptions[key].delete if @notifications.subscriptions.include?(key)
193
+
194
+ @communication[key].io.close_connection if @communication[key].class == Riddl::Utils::Notifications::Producer::WS
192
195
  @communication.delete(key)
196
+
193
197
  @events.each do |eve,keys|
194
198
  keys.delete_if{|k,v| key == k}
195
199
  end
@@ -202,13 +206,13 @@ module CPEE
202
206
  end
203
207
  end
204
208
  when :upd
205
- if @notifications.subscriptions[key]
209
+ if @notifications.subscriptions.include?(key)
206
210
  url = @communication[key]
207
211
  evs = []
208
212
  vos = []
209
213
  @events.each { |e,v| evs << e }
210
214
  @votes.each { |e,v| vos << e }
211
- @notifications.subscriptions[key].view do |doc|
215
+ @notifications.subscriptions[key].read do |doc|
212
216
  turl = doc.find('string(/n:subscription/@url)')
213
217
  url = turl == '' ? url : turl
214
218
  @communication[key] = url
@@ -232,7 +236,7 @@ module CPEE
232
236
  end
233
237
  end
234
238
  when :cre
235
- @notifications.subscriptions[key].view do |doc|
239
+ @notifications.subscriptions[key].read do |doc|
236
240
  turl = doc.find('string(/n:subscription/@url)')
237
241
  url = turl == '' ? nil : turl
238
242
  @communication[key] = url
@@ -479,7 +483,7 @@ module CPEE
479
483
  end
480
484
  end # }}}
481
485
 
482
- def add_ws(key,socket)# {{{
486
+ def add_websocket(key,socket)# {{{
483
487
  @communication[key] = socket
484
488
  @events.each do |a|
485
489
  if a[1].has_key?(key)
@@ -493,20 +497,6 @@ module CPEE
493
497
  end
494
498
  end # }}}
495
499
 
496
- def del_ws(key)# {{{
497
- @communication[key] = nil
498
- @events.each do |a|
499
- if a[1].has_key?(key)
500
- a[1][key] = nil
501
- end
502
- end
503
- @votes.each do |a|
504
- if a[1].has_key?(key)
505
- a[1][key] = nil
506
- end
507
- end
508
- end # }}}
509
-
510
500
  private
511
501
 
512
502
  def build_notification(key,what,content,type,callback=nil)# {{{
@@ -14,10 +14,11 @@
14
14
 
15
15
  class NotificationsHandler < Riddl::Utils::Notifications::Producer::HandlerBase
16
16
  def ws_open(socket)
17
- @data.add_ws(@key,socket)
17
+ @data.add_websocket(@key,socket)
18
18
  end
19
19
  def ws_close
20
- @data.del_ws(@key)
20
+ @data.unserialize_notifications!(:del,@key)
21
+ @data.notify('properties/handlers/change', :instance => @data.instance_url)
21
22
  end
22
23
  def ws_message(data)
23
24
  begin
@@ -0,0 +1,145 @@
1
+ <properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
2
+ <info>Enter info here</info>
3
+ <state>ready</state>
4
+ <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
5
+ <positions/>
6
+ <dataelements>
7
+ <persons>3</persons>
8
+ <card>Visa_12345</card>
9
+ <airline>null</airline>
10
+ <hotels>[]</hotels>
11
+ <from>Vienna</from>
12
+ <to>Prague</to>
13
+ <costs>0</costs>
14
+ </dataelements>
15
+ <endpoints>
16
+ <bookAir>http://gruppe.wst.univie.ac.at/~mangler/services/airline.php</bookAir>
17
+ <bookHotel>http://gruppe.wst.univie.ac.at/~mangler/services/hotel.php</bookHotel>
18
+ <approve>http://gruppe.wst.univie.ac.at/~mangler/services/approval.php</approve>
19
+ </endpoints>
20
+ <dsl>call :a1, :bookAir, { :method =&gt; "post", :parameters =&gt; { :from =&gt; data.from, :to =&gt; data.to, :persons =&gt; data.persons } }, &lt;&lt;-end
21
+ data.airline = result.value('id')
22
+ data.costs += result.value('costs').to_f
23
+ status.update 1, 'Hotel'
24
+ end
25
+ parallel do
26
+ loop pre_test{data.persons &gt; 0} do
27
+ parallel_branch data.persons do |p|
28
+ call :a2, :bookHotel, { :method =&gt; "post", :parameters =&gt; { :to =&gt; data.to } }, &lt;&lt;-end
29
+ data.hotels &lt;&lt; result.value('id')
30
+ data.costs += result.value('costs').to_f
31
+ end
32
+ end
33
+ manipulate :a3, &lt;&lt;-end
34
+ data.persons -= 1
35
+ end
36
+ end
37
+ end
38
+ choose do
39
+ alternative data.costs &gt; 700 do
40
+ call :a4, :approve, { :method =&gt; "post", :parameters =&gt; { :costs =&gt; data.costs } }
41
+ end
42
+ end
43
+ </dsl>
44
+ <dslx>
45
+ <description xmlns="http://cpee.org/ns/description/1.0">
46
+ <call id="a1" endpoint="bookAir">
47
+ <parameters>
48
+ <method>post</method>
49
+ <parameters>
50
+ <from>data.from</from>
51
+ <to>data.to</to>
52
+ <persons>data.persons</persons>
53
+ </parameters>
54
+ </parameters>
55
+ <manipulate output="result"> data.airline = result.value('id')
56
+ data.costs += result.value('costs').to_f
57
+ status.update 1, 'Hotel'</manipulate>
58
+ </call>
59
+ <parallel>
60
+ <loop pre_test="data.persons &gt; 0">
61
+ <parallel_branch pass="data.persons" local="p">
62
+ <call id="a2" endpoint="bookHotel">
63
+ <parameters>
64
+ <method>post</method>
65
+ <parameters>
66
+ <to>data.to</to>
67
+ </parameters>
68
+ </parameters>
69
+ <manipulate output="result"> data.hotels &lt;&lt; result.value('id')
70
+ data.costs += result.value('costs').to_f</manipulate>
71
+ </call>
72
+ </parallel_branch>
73
+ <manipulate id="a3"> data.persons -= 1</manipulate>
74
+ </loop>
75
+ </parallel>
76
+ <choose>
77
+ <alternative condition="data.costs &gt; 700">
78
+ <call id="a4" endpoint="approve">
79
+ <parameters>
80
+ <method>post</method>
81
+ <parameters>
82
+ <costs>data.costs</costs>
83
+ </parameters>
84
+ </parameters>
85
+ </call>
86
+ </alternative>
87
+ </choose>
88
+ </description>
89
+ </dslx>
90
+ <status>
91
+ <id>0</id>
92
+ <message>undefined</message>
93
+ </status>
94
+ <description>
95
+ <description xmlns="http://cpee.org/ns/description/1.0">
96
+ <call id="a1" endpoint="bookAir">
97
+ <parameters>
98
+ <method>post</method>
99
+ <parameters>
100
+ <from>data.from</from>
101
+ <to>data.to</to>
102
+ <persons>data.persons</persons>
103
+ </parameters>
104
+ </parameters>
105
+ <manipulate output="result"> data.airline = result.value('id')
106
+ data.costs += result.value('costs').to_f
107
+ status.update 1, 'Hotel'</manipulate>
108
+ </call>
109
+ <parallel>
110
+ <loop pre_test="data.persons &gt; 0">
111
+ <parallel_branch pass="data.persons" local="p">
112
+ <call id="a2" endpoint="bookHotel">
113
+ <parameters>
114
+ <method>post</method>
115
+ <parameters>
116
+ <to>data.to</to>
117
+ </parameters>
118
+ </parameters>
119
+ <manipulate output="result"> data.hotels &lt;&lt; result.value('id')
120
+ data.costs += result.value('costs').to_f</manipulate>
121
+ </call>
122
+ </parallel_branch>
123
+ <manipulate id="a3"> data.persons -= 1</manipulate>
124
+ </loop>
125
+ </parallel>
126
+ <choose>
127
+ <alternative condition="data.costs &gt; 700">
128
+ <call id="a4" endpoint="approve">
129
+ <parameters>
130
+ <method>post</method>
131
+ <parameters>
132
+ <costs>data.costs</costs>
133
+ </parameters>
134
+ </parameters>
135
+ </call>
136
+ </alternative>
137
+ </choose>
138
+ </description>
139
+ </description>
140
+ <transformation>
141
+ <description type="copy"/>
142
+ <dataelements type="rest"/>
143
+ <endpoints type="rest"/>
144
+ </transformation>
145
+ </properties>
@@ -0,0 +1,109 @@
1
+ <properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
2
+ <info>Enter info here</info>
3
+ <state>ready</state>
4
+ <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
5
+ <positions>
6
+ <a1>after</a1>
7
+ </positions>
8
+ <dataelements>
9
+ <x/>
10
+ </dataelements>
11
+ <endpoints>
12
+ <timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
13
+ </endpoints>
14
+ <dsl>call :a1, :timeout, { :method =&gt; "post", :parameters =&gt; { :timeout =&gt; 2 } }, &lt;&lt;-end
15
+ data.x += "a1,"
16
+ end
17
+ call :a2, :timeout, { :method =&gt; "post", :parameters =&gt; { :timeout =&gt; 4 } }, &lt;&lt;-end
18
+ data.x += "a2,"
19
+ end
20
+ call :a3, :timeout, { :method =&gt; "post", :parameters =&gt; { :timeout =&gt; 4 } }, &lt;&lt;-end
21
+ data.x += "a3,"
22
+ end
23
+ </dsl>
24
+ <dslx>
25
+ <description xmlns="http://cpee.org/ns/description/1.0">
26
+ <!--{{{-->
27
+ <call id="a1" endpoint="timeout">
28
+ <parameters>
29
+ <!--{{{-->
30
+ <method>post</method>
31
+ <parameters>
32
+ <timeout>2</timeout>
33
+ </parameters>
34
+ </parameters>
35
+ <!--}}}-->
36
+ <manipulate output="result"> data.x += "a1,"</manipulate>
37
+ </call>
38
+ <call id="a2" endpoint="timeout">
39
+ <parameters>
40
+ <!--{{{-->
41
+ <method>post</method>
42
+ <parameters>
43
+ <timeout>4</timeout>
44
+ </parameters>
45
+ </parameters>
46
+ <!--}}}-->
47
+ <manipulate output="result"> data.x += "a2,"</manipulate>
48
+ </call>
49
+ <call id="a3" endpoint="timeout">
50
+ <parameters>
51
+ <!--{{{-->
52
+ <method>post</method>
53
+ <parameters>
54
+ <timeout>4</timeout>
55
+ </parameters>
56
+ </parameters>
57
+ <!--}}}-->
58
+ <manipulate output="result"> data.x += "a3,"</manipulate>
59
+ </call>
60
+ </description>
61
+ </dslx>
62
+ <status>
63
+ <id>0</id>
64
+ <message>undefined</message>
65
+ </status>
66
+ <description>
67
+ <description xmlns="http://cpee.org/ns/description/1.0">
68
+ <!--{{{-->
69
+ <call id="a1" endpoint="timeout">
70
+ <parameters>
71
+ <!--{{{-->
72
+ <method>post</method>
73
+ <parameters>
74
+ <timeout>2</timeout>
75
+ </parameters>
76
+ </parameters>
77
+ <!--}}}-->
78
+ <manipulate output="result"> data.x += "a1,"</manipulate>
79
+ </call>
80
+ <call id="a2" endpoint="timeout">
81
+ <parameters>
82
+ <!--{{{-->
83
+ <method>post</method>
84
+ <parameters>
85
+ <timeout>4</timeout>
86
+ </parameters>
87
+ </parameters>
88
+ <!--}}}-->
89
+ <manipulate output="result"> data.x += "a2,"</manipulate>
90
+ </call>
91
+ <call id="a3" endpoint="timeout">
92
+ <parameters>
93
+ <!--{{{-->
94
+ <method>post</method>
95
+ <parameters>
96
+ <timeout>4</timeout>
97
+ </parameters>
98
+ </parameters>
99
+ <!--}}}-->
100
+ <manipulate output="result"> data.x += "a3,"</manipulate>
101
+ </call>
102
+ </description>
103
+ </description>
104
+ <transformation>
105
+ <description type="copy"/>
106
+ <dataelements type="rest"/>
107
+ <endpoints type="rest"/>
108
+ </transformation>
109
+ </properties>