cpee 1.4.15 → 1.4.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/js/instance.js +15 -6
  3. data/cockpit/js/wfadaptor.js +18 -3
  4. data/cockpit/themes/compact/theme.js +5 -3
  5. data/cockpit/themes/default/rngs/choose.rng +2 -2
  6. data/cockpit/themes/default/rngs/parallel.rng +2 -2
  7. data/cockpit/themes/default/theme.js +5 -3
  8. data/cockpit/themes/extended/theme.js +1042 -0
  9. data/cockpit/track.html +118 -0
  10. data/cpee.gemspec +1 -1
  11. data/lib/cpee/controller.rb +24 -8
  12. data/lib/cpee/implementation.rb +3 -6
  13. data/server/handlerwrappers/default.rb +1 -1
  14. data/server/resources/properties.init +5 -4
  15. data/server/resources/properties.schema.active +9 -1
  16. data/server/resources/properties.schema.finished +8 -0
  17. data/server/resources/properties.schema.inactive +8 -0
  18. data/tools/cpee +42 -19
  19. metadata +4 -109
  20. data/log/logs/1/test +0 -1
  21. data/log/logs/3b0cfe66-5a3d-43de-b5a1-d7b9386be65a.xes.yaml +0 -413
  22. data/server/instances/1/properties.xml +0 -62
  23. data/server/instances/10/notifications/182434032285ca1d06a8b6554b8889c8/consumer-secret +0 -1
  24. data/server/instances/10/notifications/182434032285ca1d06a8b6554b8889c8/producer-secret +0 -1
  25. data/server/instances/10/notifications/182434032285ca1d06a8b6554b8889c8/subscription.xml +0 -23
  26. data/server/instances/10/notifications/512a3785631a5245dbb45fa150ea72ed/consumer-secret +0 -1
  27. data/server/instances/10/notifications/512a3785631a5245dbb45fa150ea72ed/producer-secret +0 -1
  28. data/server/instances/10/notifications/512a3785631a5245dbb45fa150ea72ed/subscription.xml +0 -6
  29. data/server/instances/10/properties.xml +0 -187
  30. data/server/instances/11/properties.xml +0 -191
  31. data/server/instances/12/properties.xml +0 -191
  32. data/server/instances/13/properties.xml +0 -204
  33. data/server/instances/14/properties.xml +0 -31
  34. data/server/instances/15/properties.xml +0 -30
  35. data/server/instances/16/properties.xml +0 -29
  36. data/server/instances/17/properties.xml +0 -29
  37. data/server/instances/18/properties.xml +0 -31
  38. data/server/instances/19/properties.xml +0 -31
  39. data/server/instances/2/properties.xml +0 -31
  40. data/server/instances/20/properties.xml +0 -191
  41. data/server/instances/21/properties.xml +0 -156
  42. data/server/instances/22/properties.xml +0 -118
  43. data/server/instances/23/properties.xml +0 -118
  44. data/server/instances/24/properties.xml +0 -156
  45. data/server/instances/25/properties.xml +0 -156
  46. data/server/instances/26/properties.xml +0 -156
  47. data/server/instances/27/properties.xml +0 -140
  48. data/server/instances/28/properties.xml +0 -156
  49. data/server/instances/29/properties.xml +0 -156
  50. data/server/instances/3/properties.xml +0 -120
  51. data/server/instances/30/properties.xml +0 -354
  52. data/server/instances/31/properties.xml +0 -354
  53. data/server/instances/313/notifications/crisp/consumer-secret +0 -1
  54. data/server/instances/313/notifications/crisp/producer-secret +0 -1
  55. data/server/instances/313/notifications/crisp/subscription.xml +0 -7
  56. data/server/instances/313/notifications/logging/consumer-secret +0 -1
  57. data/server/instances/313/notifications/logging/producer-secret +0 -1
  58. data/server/instances/313/notifications/logging/subscription.xml +0 -7
  59. data/server/instances/313/notifications/logging_yaml/consumer-secret +0 -1
  60. data/server/instances/313/notifications/logging_yaml/producer-secret +0 -1
  61. data/server/instances/313/notifications/logging_yaml/subscription.xml +0 -7
  62. data/server/instances/313/properties.xml +0 -524
  63. data/server/instances/32/properties.xml +0 -628
  64. data/server/instances/33/properties.xml +0 -156
  65. data/server/instances/4/properties.xml +0 -114
  66. data/server/instances/5/properties.xml +0 -114
  67. data/server/instances/6/properties.xml +0 -206
  68. data/server/instances/662/notifications/crisp/consumer-secret +0 -1
  69. data/server/instances/662/notifications/crisp/producer-secret +0 -1
  70. data/server/instances/662/notifications/crisp/subscription.xml +0 -7
  71. data/server/instances/662/notifications/logging/consumer-secret +0 -1
  72. data/server/instances/662/notifications/logging/producer-secret +0 -1
  73. data/server/instances/662/notifications/logging/subscription.xml +0 -7
  74. data/server/instances/662/notifications/logging_yaml/consumer-secret +0 -1
  75. data/server/instances/662/notifications/logging_yaml/producer-secret +0 -1
  76. data/server/instances/662/notifications/logging_yaml/subscription.xml +0 -7
  77. data/server/instances/662/properties.xml +0 -427
  78. data/server/instances/663/properties.xml +0 -31
  79. data/server/instances/664/properties.xml +0 -425
  80. data/server/instances/665/properties.xml +0 -425
  81. data/server/instances/666/properties.xml +0 -427
  82. data/server/instances/667/properties.xml +0 -427
  83. data/server/instances/668/properties.xml +0 -425
  84. data/server/instances/669/properties.xml +0 -425
  85. data/server/instances/670/properties.xml +0 -31
  86. data/server/instances/671/properties.xml +0 -158
  87. data/server/instances/672/properties.xml +0 -199
  88. data/server/instances/673/properties.xml +0 -52
  89. data/server/instances/674/properties.xml +0 -75
  90. data/server/instances/675/notifications/10fa09a02f1a981a931ebe75d8cabe48/consumer-secret +0 -1
  91. data/server/instances/675/notifications/10fa09a02f1a981a931ebe75d8cabe48/producer-secret +0 -1
  92. data/server/instances/675/notifications/10fa09a02f1a981a931ebe75d8cabe48/subscription.xml +0 -6
  93. data/server/instances/675/properties.xml +0 -74
  94. data/server/instances/676/properties.xml +0 -76
  95. data/server/instances/677/properties.xml +0 -76
  96. data/server/instances/678/properties.xml +0 -74
  97. data/server/instances/679/properties.xml +0 -76
  98. data/server/instances/680/properties.xml +0 -76
  99. data/server/instances/681/properties.xml +0 -156
  100. data/server/instances/682/properties.xml +0 -156
  101. data/server/instances/683/properties.xml +0 -156
  102. data/server/instances/684/properties.xml +0 -156
  103. data/server/instances/685/properties.xml +0 -156
  104. data/server/instances/686/properties.xml +0 -156
  105. data/server/instances/687/properties.xml +0 -156
  106. data/server/instances/688/properties.xml +0 -118
  107. data/server/instances/689/properties.xml +0 -156
  108. data/server/instances/690/properties.xml +0 -156
  109. data/server/instances/691/properties.xml +0 -129
  110. data/server/instances/692/properties.xml +0 -31
  111. data/server/instances/693/properties.xml +0 -118
  112. data/server/instances/694/properties.xml +0 -118
  113. data/server/instances/695/properties.xml +0 -156
  114. data/server/instances/696/properties.xml +0 -156
  115. data/server/instances/697/notifications/ruleengine/consumer-secret +0 -1
  116. data/server/instances/697/notifications/ruleengine/producer-secret +0 -1
  117. data/server/instances/697/notifications/ruleengine/subscription.xml +0 -16
  118. data/server/instances/697/properties.xml +0 -156
  119. data/server/instances/698/notifications/ruleengine/consumer-secret +0 -1
  120. data/server/instances/698/notifications/ruleengine/producer-secret +0 -1
  121. data/server/instances/698/notifications/ruleengine/subscription.xml +0 -16
  122. data/server/instances/698/properties.xml +0 -31
  123. data/server/instances/7/properties.xml +0 -156
  124. data/server/instances/8/properties.xml +0 -118
  125. data/server/instances/9/properties.xml +0 -120
  126. data/server/server.pid +0 -1
@@ -0,0 +1,118 @@
1
+ <!--
2
+ This file is part of CPEE.
3
+
4
+ CPEE is free software: you can redistribute it and/or modify it under the terms
5
+ of the GNU General Public License as published by the Free Software Foundation,
6
+ either version 3 of the License, or (at your option) any later version.
7
+
8
+ CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
9
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10
+ PARTICULAR PURPOSE. See the GNU General Public License for more details.
11
+
12
+ You should have received a copy of the GNU General Public License along with
13
+ CPEE (file COPYING in the main directory). If not, see
14
+ <http://www.gnu.org/licenses/>.
15
+ -->
16
+
17
+ <!DOCTYPE html>
18
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
19
+ <head>
20
+ <meta charset="utf-8"/>
21
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
22
+ <title>CPEE Cockpit</title>
23
+
24
+ <!-- libs, do not modify. When local than load local libs. -->
25
+ <script type="text/javascript" src="/js_libs/jquery.min.js"></script>
26
+ <script type="text/javascript" src="/js_libs/jquery.browser.js"></script>
27
+ <script type="text/javascript" src="/js_libs/jquery.svg.min.js"></script>
28
+ <script type="text/javascript" src="/js_libs/jquery.svgdom.min.js"></script>
29
+ <script type="text/javascript" src="/js_libs/vkbeautify.js"></script>
30
+ <script type="text/javascript" src="/js_libs/util.js"></script>
31
+ <script type="text/javascript" src="/js_libs/printf.js"></script>
32
+ <script type="text/javascript" src="/js_libs/strftime.min.js"></script>
33
+ <script type="text/javascript" src="/js_libs/parsequery.js"></script>
34
+ <script type="text/javascript" src="/js_libs/underscore.min.js"></script>
35
+ <script type="text/javascript" src="/js_libs/jquery.caret.min.js"></script>
36
+ <script type="text/javascript" src="/js_libs/jquery.cookie.js"></script>
37
+
38
+ <script type="text/javascript" src="/js_libs/relaxngui.js"></script>
39
+
40
+ <script type="text/javascript" src="/js_libs/ui.js"></script>
41
+ <script type="text/javascript" src="/js_libs/custommenu.js"></script>
42
+
43
+ <link rel="stylesheet" href="/js_libs/custommenu.css" type="text/css"/>
44
+ <link rel="stylesheet" href="/js_libs/ui.css" type="text/css"/>
45
+
46
+ <link rel="stylesheet" href="/js_libs/relaxngui.css" type="text/css"/>
47
+ <script>
48
+ var lines;
49
+ var ws;
50
+ var acts = {};
51
+ var transitions = [];
52
+ var lastpos;
53
+
54
+ var sub = 'topic' + '=' + 'activity' + '&' +// {{{
55
+ 'events' + '=' + 'receiving';// }}}
56
+
57
+ function websocket(what) { //{{{
58
+ var url = $('body').attr('current-instance');
59
+ var Socket = "MozWebSocket" in window ? MozWebSocket : WebSocket;
60
+ if (ws) ws.close();
61
+ ws = new Socket(url.replace(/http/,'ws') + "/notifications/subscriptions/" + what + "/ws/");
62
+ ws.onopen = function() {
63
+ console.log("monitoring", "opened", "");
64
+ };
65
+ ws.onmessage = function(e) {
66
+ data = $.parseXML(e.data);
67
+ if ($('event > topic',data).length > 0) {
68
+ switch($('event > topic',data).text()) {
69
+ case 'activity':
70
+ var data = JSON.parse($('event > notification',data).text());
71
+ if (data.endpoint == "https://centurio.work/flow/start/url/") {
72
+ var num = parseInt(data.received[0].data.match(/\d+$/)[0]);
73
+ console.log(num);
74
+ $('#bla1').attr('src','https://centurio.work/flow/graph.html?monitor=' + data.received[0].data);
75
+ setTimeout(function(){ $('#bla2').attr('src','https://centurio.work/flow/graph.html?monitor=' + data.received[0].data.replace(/\d+$/,num+1)); }, 2000);
76
+ setTimeout(function(){ $('#bla3').attr('src','https://centurio.work/flow/graph.html?monitor=' + data.received[0].data.replace(/\d+$/,num+2)); }, 4000);
77
+ }
78
+ break;
79
+ }
80
+ }
81
+ if ($('vote > topic',data).length > 0) {
82
+ }
83
+ };
84
+ ws.onclose = function() {
85
+ console.log("monitoring", "closed", "server down i assume.");
86
+ };
87
+ } //}}}
88
+
89
+ $(document).ready(function(){
90
+ var url = "https://centurio.work/flow/engine/11/";
91
+ $('body').attr('current-instance',url);
92
+ $.ajax({
93
+ type: "POST",
94
+ url: url + "/notifications/subscriptions/",
95
+ data: sub,
96
+ success: function(res){
97
+ res = res.unserialize();
98
+ $.each(res,function(a,b){
99
+ if (b[0] == 'key') {
100
+ websocket(b[1]);
101
+ }
102
+ });
103
+ }
104
+ });
105
+ });
106
+ </script>
107
+ </head>
108
+ <body data-base-port="8298" data-res-port="9303" data-theme-base="themes" is="x-ui" style="display: flex; flex-direction:row; align-items: stretch; height: 100vh;">
109
+ <div style="flex: 1 1 auto; display: flex; flex-direction:column; align-items: stretch; height: 100vh">
110
+ <iframe style="flex: 1 1 auto;" src="graph.html?monitor=https://centurio.work/flow/engine/11/"></iframe>
111
+ <iframe id="bla1" style="flex: 1 1 auto;" src=""></iframe>
112
+ </div>
113
+ <div style="flex: 1 1 auto; display: flex; flex-direction:column; align-items: stretch; height: 100vh">
114
+ <iframe id="bla2" style="flex: 1 1 auto;" src=""></iframe>
115
+ <iframe id="bla3" style="flex: 1 1 auto;" src=""></iframe>
116
+ </div>
117
+ </body>
118
+ </html>
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "1.4.15"
3
+ s.version = "1.4.16"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
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"
@@ -152,8 +152,8 @@ module CPEE
152
152
  end
153
153
 
154
154
  attr_reader :id
155
- attr_reader :properties
156
155
  attr_reader :notifications
156
+ attr_reader :properties
157
157
  attr_reader :callbacks
158
158
  attr_reader :mutex
159
159
  attr_reader :attributes
@@ -223,10 +223,20 @@ module CPEE
223
223
  def info
224
224
  @properties.data.find("string(/p:properties/p:attributes/p:info)")
225
225
  end
226
+ def info=(text)
227
+ @properties.modify do |doc|
228
+ node = doc.find("/p:properties/p:attributes/p:info").first
229
+ node.text = text if node
230
+ end
231
+ end
232
+ def state
233
+ data.find("string(/p:properties/p:state)")
234
+ end
226
235
 
227
236
  def finalize_if_finished
228
237
  if @instance.state == :finished
229
- #@instance = nil
238
+ # TODO unlink engine, be careful race condition
239
+ # @instance = nil
230
240
  end
231
241
  end
232
242
 
@@ -255,6 +265,7 @@ module CPEE
255
265
  if [:finished, :stopped, :ready].include?(@instance.state)
256
266
  @properties.modify do |doc|
257
267
  node = doc.find("/p:properties/p:state").first
268
+ node.attributes['changed'] = Time.now.xmlschema
258
269
  node.text = @instance.state
259
270
  end
260
271
  end
@@ -265,7 +276,7 @@ module CPEE
265
276
  pos.children.delete_all!
266
277
  @positions = @instance.positions
267
278
  @instance.positions.each do |p|
268
- pos.add("#{p.position}",[p.detail,p.passthrough].compact.join(';'))
279
+ pos.add("#{p.position}",p.detail,'passthrough' => p.passthrough)
269
280
  end
270
281
  end
271
282
  end # }}}
@@ -352,7 +363,7 @@ module CPEE
352
363
  @attributes[ele.qname.name.to_sym] = ele.text
353
364
  end
354
365
  uuid = @properties.data.find("/p:properties/p:attributes/p:uuid")
355
- if uuid.empty? || uuid.length != 1 || @properties.data.find("/p:properties/p:attributes/p:uuid[.=\"#{@uuid}\"]").empty?
366
+ if uuid.empty? || uuid.length != 1 || uuid.first.text != @uuid
356
367
  @properties.modify do |doc|
357
368
  attr = doc.find("/p:properties/p:attributes").first
358
369
  attr.find('p:uuid').delete_all!
@@ -373,7 +384,12 @@ module CPEE
373
384
  end
374
385
  end #}}}
375
386
  def unserialize_state! #{{{
376
- state = @properties.data.find("string(/p:properties/p:state)")
387
+ state = 'ready'
388
+ @properties.modify do |doc|
389
+ node = doc.find("/p:properties/p:state").first
390
+ node.attributes['changed'] = Time.now.xmlschema
391
+ state = node.text
392
+ end
377
393
  if call_vote("state/change", :instance => @id, :info => info, :state => state)
378
394
  case state
379
395
  when 'stopping'
@@ -394,8 +410,8 @@ module CPEE
394
410
  def unserialize_handlerwrapper! #{{{
395
411
  hw = nil
396
412
  begin
397
- hw = eval(@properties.data.find("string(/p:properties/p:handlerwrapper)"))
398
- @instance.handlerwrapper = hw
413
+ hw = @properties.data.find("string(/p:properties/p:handlerwrapper)")
414
+ @instance.handlerwrapper = eval(hw)
399
415
  rescue => e
400
416
  @instance.handlerwrapper = DefaultHandlerWrapper
401
417
  end
@@ -410,7 +426,7 @@ module CPEE
410
426
  @positions = []
411
427
  @properties.data.find("/p:properties/p:positions/p:*").each do |e|
412
428
  val = e.text.split(';')
413
- @positions << ::WEEL::Position.new(e.qname.to_s.to_sym,val[0].to_sym,val[1])
429
+ @positions << ::WEEL::Position.new(e.qname.to_s.to_sym,e.text.to_sym,e.attributes['passthrough'])
414
430
  end
415
431
  end #}}}
416
432
  def unserialize_dsl! #{{{
@@ -141,10 +141,8 @@ module CPEE
141
141
  controller = @a[0]
142
142
  Riddl::Parameter::Complex.new("wis","text/xml") do
143
143
  ins = XML::Smart::string('<instances/>')
144
- controller.each do |k,v|
145
- name = v.properties.data.find("string(/p:properties/p:attributes/p:info)")
146
- state = v.properties.data.find("string(/p:properties/p:state)")
147
- ins.root.add('instance',name, 'uuid' => v.uuid, 'id' => k, 'state' => state)
144
+ controller.sort{|a,b| b[0] <=> a[0] }.each do |k,v|
145
+ ins.root.add('instance', v.info, 'uuid' => v.uuid, 'id' => k, 'state' => v.state)
148
146
  end
149
147
  ins.to_s
150
148
  end
@@ -167,8 +165,7 @@ module CPEE
167
165
  end
168
166
 
169
167
  controller[id] = Controller.new(id,opts)
170
- info = controller[id].properties.data.find("/p:properties/p:attributes/p:info")
171
- info.first.text = name if info.length == 1
168
+ controller[id].info = name
172
169
 
173
170
  Riddl::Parameter::Simple.new("id", id)
174
171
  end
@@ -82,7 +82,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
82
82
  @handler_passthrough = callback
83
83
 
84
84
  status, result, headers = client.request type => params
85
- raise "Could not #{parameters[:method] || 'post'} #{@handler_endpoint}" if status < 200 || status >= 300
85
+ raise "Could not #{parameters[:method] || 'post'} #{@handler_endpoint} - status: #{status}: #{result&.dig(0)&.value&.read}" if status < 200 || status >= 300
86
86
 
87
87
  unless headers["CPEE_CALLBACK"] && headers["CPEE_CALLBACK"] == 'true'
88
88
  callback result
@@ -2,16 +2,17 @@
2
2
  <!--
3
3
  This file is part of CPEE.
4
4
 
5
- CPEE is free software: you can redistribute it and/or modify it under the terms
6
- of the GNU General Public License as published by the Free Software Foundation,
7
- either version 3 of the License, or (at your option) any later version.
5
+ CPEE is free software: you can redistribute it and/or modify it under the
6
+ terms of the GNU General Public License as published by the Free Software
7
+ Foundation, either version 3 of the License, or (at your option) any later
8
+ version.
8
9
 
9
10
  CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
10
11
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
12
  PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13
 
13
14
  You should have received a copy of the GNU General Public License along with
14
- CPEE (file COPYING in the main directory). If not, see
15
+ CPEE (file COPYING in the main directory). If not, see
15
16
  <http://www.gnu.org/licenses/>.
16
17
  -->
17
18
 
@@ -71,6 +71,7 @@
71
71
  <running putable="true"/>
72
72
  <ready putable="true"/>
73
73
  <simulating putable="true"/>
74
+ <abandoned putable="true"/>
74
75
  </ready>
75
76
  <running>
76
77
  <stopping putable="true"/>
@@ -85,10 +86,12 @@
85
86
  <stopped putable="false"/>
86
87
  </stopping>
87
88
  <stopped>
89
+ <abandoned putable="true"/>
88
90
  <stopped putable="true"/>
89
91
  <running putable="true"/>
90
92
  <simulating putable="true"/>
91
93
  </stopped>
94
+ <abandoned/>
92
95
  <finished/>
93
96
  </state>
94
97
  <status type="complex" modifiable="false" mutable="true">
@@ -105,8 +108,13 @@
105
108
  <zeroOrMore>
106
109
  <element>
107
110
  <anyName/>
111
+ <optional>
112
+ <attribute name='passthrough'>
113
+ <data type="string"/>
114
+ </attribute>
115
+ </optional>
108
116
  <data type="string">
109
- <param name="pattern">(at|after)(;[A-Za-z0-9]+)?</param>
117
+ <param name="pattern">(at|after)</param>
110
118
  </data>
111
119
  </element>
112
120
  </zeroOrMore>
@@ -71,6 +71,7 @@
71
71
  <ready putable="true"/>
72
72
  <running putable="true"/>
73
73
  <simulating putable="true"/>
74
+ <abandoned putable="true"/>
74
75
  </ready>
75
76
  <running>
76
77
  <stopping putable="true"/>
@@ -85,10 +86,12 @@
85
86
  <stopped putable="false"/>
86
87
  </stopping>
87
88
  <stopped>
89
+ <abandoned putable="true"/>
88
90
  <stopped putable="true"/>
89
91
  <running putable="true"/>
90
92
  <simulating putable="true"/>
91
93
  </stopped>
94
+ <abandoned/>
92
95
  <finished/>
93
96
  </state>
94
97
  <status type="complex" modifiable="false" mutable="false">
@@ -105,6 +108,11 @@
105
108
  <zeroOrMore>
106
109
  <element>
107
110
  <anyName/>
111
+ <optional>
112
+ <attribute name='passthrough'>
113
+ <data type="string"/>
114
+ </attribute>
115
+ </optional>
108
116
  <data type="string">
109
117
  <param name="pattern">(at|after)(;[A-Za-z0-9]+)?</param>
110
118
  </data>
@@ -71,6 +71,7 @@
71
71
  <running putable="true"/>
72
72
  <ready putable="true"/>
73
73
  <simulating putable="true"/>
74
+ <abandoned putable="true"/>
74
75
  </ready>
75
76
  <running>
76
77
  <stopping putable="true"/>
@@ -85,10 +86,12 @@
85
86
  <stopped putable="false"/>
86
87
  </stopping>
87
88
  <stopped>
89
+ <abandoned putable="true"/>
88
90
  <stopped putable="true"/>
89
91
  <running putable="true"/>
90
92
  <simulating putable="true"/>
91
93
  </stopped>
94
+ <abandoned/>
92
95
  <finished/>
93
96
  </state>
94
97
  <status type="complex" modifiable="false" mutable="false">
@@ -105,6 +108,11 @@
105
108
  <zeroOrMore>
106
109
  <element>
107
110
  <anyName/>
111
+ <optional>
112
+ <attribute name='passthrough'>
113
+ <data type="string"/>
114
+ </attribute>
115
+ </optional>
108
116
  <data type="string">
109
117
  <param name="pattern">(at|after)(;[A-Za-z0-9]+)?</param>
110
118
  </data>
data/tools/cpee CHANGED
@@ -4,19 +4,24 @@ require 'rubygems'
4
4
  require 'optparse'
5
5
  require 'fileutils'
6
6
  require 'webrick'
7
+ require 'typhoeus'
8
+ require 'xml/smart'
7
9
 
8
- def wrap(s, width=78, indent=11)
10
+ def wrap(s, width=78, indent=18)
9
11
  lines = []
10
12
  line, s = s[0..indent-2], s[indent..-1]
11
- s.split(/\s+/).each do |word|
12
- if line.size + word.size >= width
13
- lines << line
14
- line = (" " * (indent)) + word
15
- else
16
- line << " " << word
17
- end
18
- end
19
- lines << line if line
13
+ s.split(/\n/).each do |ss|
14
+ ss.split(/[ \t]+/).each do |word|
15
+ if line.size + word.size >= width
16
+ lines << line
17
+ line = (" " * (indent)) + word
18
+ else
19
+ line << " " << word
20
+ end
21
+ end
22
+ lines << line if line
23
+ line = (" " * (indent-1))
24
+ end
20
25
  return lines.join "\n"
21
26
  end
22
27
 
@@ -26,37 +31,55 @@ ARGV.options { |opt|
26
31
  opt.on("Options:")
27
32
  opt.on("--help", "-h", "This text") { puts opt; exit }
28
33
  opt.on("")
29
- opt.on(wrap("[new DIR] scaffolds a sample execution engine. Everything except instances can be removed for default behaviour."))
34
+ opt.on(wrap("[archive DIR URL] save properties from all finished instances listed at URL into DIR.\ne.g. cpee ./archive http://localhost:9298/"))
35
+ opt.on("")
36
+ opt.on(wrap("[new DIR] scaffolds a sample execution engine. Everything except instances can be removed for default behaviour."))
30
37
  opt.on("")
31
- opt.on(wrap("[inst DIR] scaffolds a sample instantiation service. Post a testset to a model to keep going in one operation."))
38
+ opt.on(wrap("[inst DIR] scaffolds a sample instantiation service. Post a testset to a model to keep going in one operation."))
32
39
  opt.on("")
33
- opt.on(wrap("[cpui DIR] scaffolds a sample html client. New versions might require manual merging if you changed something."))
40
+ opt.on(wrap("[cpui DIR] scaffolds a sample html client. New versions might require manual merging if you changed something."))
34
41
  opt.on("")
35
- opt.on(wrap("[ui] starts a simple static web server with the ui on http://localhost:8080. Use [cpui DIR] if you want stuff in apache or nginx."))
42
+ opt.on(wrap("[ui] starts a simple static web server with the ui on http://localhost:8080. Use [cpui DIR] if you want stuff in apache or nginx."))
36
43
  opt.parse!
37
44
  }
38
- if ARGV.length == 0 || (ARGV.length == 1 && ARGV[0] != 'ui') || (ARGV.length == 2 && %w(cpui new).include?(ARGV[1])) || ARGV.length > 2
45
+ if ARGV.length == 0 || (ARGV.length == 1 && ARGV[0] != 'ui') || (ARGV.length == 2 && %w(cpui new).include?(ARGV[1])) || (ARGV.length == 3 && ARGV[0] != 'archive') || ARGV.length > 3
39
46
  puts ARGV.options
40
47
  exit
41
48
  end
42
49
  command = ARGV[0]
43
50
  dir = ARGV[1]
51
+ url = ARGV[2]
44
52
 
45
53
  if command == 'ui'
46
54
  s = WEBrick::HTTPServer.new(:Port => 8080, :DocumentRoot => "#{curpath}/../cockpit/")
47
55
  trap("INT"){ s.shutdown }
48
56
  s.start
49
- elsif command == "cpui"
57
+ elsif command == 'cpui'
50
58
  if !File.exists?(dir)
51
59
  FileUtils.cp_r("#{curpath}/../cockpit/",dir)
52
60
  else
53
61
  puts "Directory already exists."
54
62
  end
55
- elsif command == "inst"
63
+ elsif command == 'inst'
56
64
  if !File.exists?(dir)
57
65
  FileUtils.cp_r("#{curpath}/instantiation/",dir)
58
66
  else
59
- puts "Directory already exists."
67
+ puts 'Directory already exists.'
68
+ end
69
+ elsif command == 'archive'
70
+ res = Typhoeus.get(url)
71
+ if res.success?
72
+ if res.headers['content-type'] == 'text/xml'
73
+ XML::Smart.string(res.body) do |doc|
74
+ puts doc.to_s
75
+ tcount = 0
76
+ fcount = 0
77
+ doc.root.children.each do |i|
78
+ p i.attributes['id']
79
+ p i.attributes['state']
80
+ end
81
+ end
82
+ end
60
83
  end
61
84
  else
62
85
  if !File.exists?(dir)
@@ -65,6 +88,6 @@ else
65
88
  FileUtils.mkdir("#{dir}/resources") rescue nil
66
89
  FileUtils.mkdir("#{dir}/handlerwrappers") rescue nil
67
90
  else
68
- puts "Directory already exists."
91
+ puts 'Directory already exists.'
69
92
  end
70
93
  end