cpee 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/cpee.gemspec +1 -1
- data/lib/cpee/controller.rb +22 -1
- data/lib/cpee/implementation.rb +40 -1
- data/lib/engine.xml +4 -0
- data/server/instances/67/properties.xml +184 -0
- metadata +3 -3
- data/server/server.pid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76dece96979c9fd2b662bbe5318ad2ac0871601dc56fa90f36a4ba89f3d60733
|
4
|
+
data.tar.gz: 96d10d1fe2355344fe2aa706826c2be3e51ade8dd2b112ee7b5af02bf50a467f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e4f93f11be453e5c38ae921285de2bd0a46b744426f1a6f8cb3a6c9a19e359dcecf2e5833ab6d3db3fce468f35e9a72a29ace8786fae2d44e08860dfd015aad
|
7
|
+
data.tar.gz: b77099e85c99de14ebf96e7562acd819b0e980045750f20d3a7e3c014aedbc07d7ab9638f692c74b8afeef3bfbeedd273d2bec9a965abeadb8e91ae8048df8ff
|
data/cpee.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cpee"
|
3
|
-
s.version = "1.4.
|
3
|
+
s.version = "1.4.3"
|
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"
|
data/lib/cpee/controller.rb
CHANGED
@@ -101,6 +101,26 @@ module CPEE
|
|
101
101
|
unserialize_attributes!
|
102
102
|
end
|
103
103
|
|
104
|
+
def help
|
105
|
+
"\033[1m\033[31mpm or public_methods(false)\033[0m\033[0m\n Methods.\n" +
|
106
|
+
"\033[1m\033[31miv or instance_variables\033[0m\033[0m\n Attributes.\n" +
|
107
|
+
"\033[1m\033[31mgc or GC.stat\033[0m\033[0m\n GC stats to look for memleaks. Google for 'GC.stat ruby'.\n"
|
108
|
+
end
|
109
|
+
def pm
|
110
|
+
public_methods(false)
|
111
|
+
end
|
112
|
+
def iv
|
113
|
+
instance_variables
|
114
|
+
end
|
115
|
+
def gc
|
116
|
+
x = GC.stat
|
117
|
+
y = {}
|
118
|
+
y[:heap_live_slots] = x[:heap_live_slots]
|
119
|
+
y[:total_allocated_objects] = x[:total_allocated_objects]
|
120
|
+
y[:total_freed_objects] = x[:total_freed_objects]
|
121
|
+
y
|
122
|
+
end
|
123
|
+
|
104
124
|
attr_reader :id
|
105
125
|
attr_reader :properties
|
106
126
|
attr_reader :notifications
|
@@ -110,7 +130,8 @@ module CPEE
|
|
110
130
|
attr_reader :uuid
|
111
131
|
|
112
132
|
def console(cmd)
|
113
|
-
eval(cmd)
|
133
|
+
x = eval(cmd)
|
134
|
+
x.class == String ? x : x.pretty_inspect
|
114
135
|
end
|
115
136
|
|
116
137
|
def base_url
|
data/lib/cpee/implementation.rb
CHANGED
@@ -17,7 +17,7 @@ require 'riddl/server'
|
|
17
17
|
require 'riddl/client'
|
18
18
|
require 'riddl/utils/notifications_producer'
|
19
19
|
require 'riddl/utils/properties'
|
20
|
-
require_relative
|
20
|
+
require_relative 'controller'
|
21
21
|
|
22
22
|
require 'ostruct'
|
23
23
|
class ParaStruct < OpenStruct
|
@@ -81,6 +81,7 @@ module CPEE
|
|
81
81
|
run CPEE::Info, controller if get
|
82
82
|
run CPEE::DeleteInstance, controller, opts if delete
|
83
83
|
on resource 'console' do
|
84
|
+
run CPEE::ConsoleUI, controller if get
|
84
85
|
run CPEE::Console, controller if get 'cmdin'
|
85
86
|
end
|
86
87
|
on resource 'callbacks' do
|
@@ -192,6 +193,44 @@ module CPEE
|
|
192
193
|
end
|
193
194
|
end #}}}
|
194
195
|
|
196
|
+
class ConsoleUI < Riddl::Implementation #{{{
|
197
|
+
def response
|
198
|
+
controller = @a[0]
|
199
|
+
id = @r[0].to_i
|
200
|
+
unless controller[id]
|
201
|
+
@status = 400
|
202
|
+
return
|
203
|
+
end
|
204
|
+
Riddl::Parameter::Complex.new("res","text/html") do
|
205
|
+
<<-END
|
206
|
+
<!DOCTYPE html>
|
207
|
+
<html>
|
208
|
+
<head>
|
209
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
210
|
+
<title>Instance Web Console</title>
|
211
|
+
<style type="text/css">
|
212
|
+
[contenteditable] { display: inline; }
|
213
|
+
[contenteditable]:focus { outline: 0px solid transparent; }
|
214
|
+
body{ font-family: Courier,Courier New,Monospace}
|
215
|
+
</style>
|
216
|
+
<script type="text/javascript" src="//localhost/js_libs/jquery.min.js"></script>
|
217
|
+
<script type="text/javascript" src="//localhost/js_libs/ansi_up.js"></script>
|
218
|
+
<script type="text/javascript" src="//localhost/js_libs/console.js"></script>
|
219
|
+
</head>
|
220
|
+
<body>
|
221
|
+
<p>Instance Web Console. Type "help" to get started.</p>
|
222
|
+
<div class="console-line" id="console-template" style="display: none">
|
223
|
+
<strong>console$ </strong><div class='edit' contenteditable="true" ></div>
|
224
|
+
</div>
|
225
|
+
<div class="console-line">
|
226
|
+
<strong>console$ </strong><div class='edit' contenteditable="true"></div>
|
227
|
+
</div>
|
228
|
+
</body>
|
229
|
+
</html>
|
230
|
+
END
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end #}}}
|
195
234
|
class Console < Riddl::Implementation #{{{
|
196
235
|
def response
|
197
236
|
controller = @a[0]
|
data/lib/engine.xml
CHANGED
@@ -51,6 +51,9 @@
|
|
51
51
|
<message name="cmdout">
|
52
52
|
<parameter name="res" mimetype="text/plain"/>
|
53
53
|
</message>
|
54
|
+
<message name="cmdui">
|
55
|
+
<parameter name="res" mimetype="text/html"/>
|
56
|
+
</message>
|
54
57
|
|
55
58
|
<message name="message">
|
56
59
|
<parameter name="type" type="integer"/>
|
@@ -71,6 +74,7 @@
|
|
71
74
|
<get in="*" out="instance-info"/>
|
72
75
|
<delete in="*"/>
|
73
76
|
<resource relative="console">
|
77
|
+
<get out="cmdui"/>
|
74
78
|
<get in="cmdin" out="cmdout"/>
|
75
79
|
</resource>
|
76
80
|
<resource relative="callbacks">
|
@@ -0,0 +1,184 @@
|
|
1
|
+
<properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
|
2
|
+
<attributes>
|
3
|
+
<uuid>8d2fcb93-01b8-4993-8d6f-69caf1c677f4</uuid>
|
4
|
+
<info>Spawn Machining</info>
|
5
|
+
<modeltype>CPEE</modeltype>
|
6
|
+
<theme>default</theme>
|
7
|
+
<customer>pilotfabrik</customer>
|
8
|
+
<status>development</status>
|
9
|
+
</attributes>
|
10
|
+
<state>stopped</state>
|
11
|
+
<handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
|
12
|
+
<positions/>
|
13
|
+
<dataelements>
|
14
|
+
<instances>[]</instances>
|
15
|
+
</dataelements>
|
16
|
+
<endpoints>
|
17
|
+
<timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
|
18
|
+
<start_instance>https://centurio.work/flow/start/instance/</start_instance>
|
19
|
+
<start_url>https://centurio.work/flow/start/url/</start_url>
|
20
|
+
<hoert_die_signale>https://centurio.work/signals/signals/</hoert_die_signale>
|
21
|
+
</endpoints>
|
22
|
+
<dsl>parallel :wait => -1 do
|
23
|
+
parallel_branch do
|
24
|
+
call :a1, :hoert_die_signale, parameters: { :label => "", :method => :get, :arguments => nil }, update: <<-END
|
25
|
+
data.instances << result
|
26
|
+
status.nudge!
|
27
|
+
END
|
28
|
+
end
|
29
|
+
parallel_branch do
|
30
|
+
loop pre_test{true} do
|
31
|
+
choose :exclusive do
|
32
|
+
alternative test{data.instances.empty?} do
|
33
|
+
manipulate :a3, { :label => "Sleep" }, <<-END
|
34
|
+
status.wait_until_nudged!
|
35
|
+
END
|
36
|
+
end
|
37
|
+
otherwise do
|
38
|
+
call :a2, :start_url, parameters: { :label => "", :method => :post, :arguments => [⭐(:name => :behavior, :value => "fork_running"), ⭐(:name => :url, :value => "https://centurio.work/customers/prime/Machining.xml"), ⭐(:name => :init, :value => "{ \"instance\": \"#{data.instances.last}\" }")] }, finalize: <<-END
|
39
|
+
data.instances.pop
|
40
|
+
END
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
</dsl>
|
47
|
+
<dslx>
|
48
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
49
|
+
<parallel wait="-1">
|
50
|
+
<parallel_branch>
|
51
|
+
<call id="a1" endpoint="hoert_die_signale">
|
52
|
+
<parameters>
|
53
|
+
<label/>
|
54
|
+
<method>:get</method>
|
55
|
+
<arguments/>
|
56
|
+
</parameters>
|
57
|
+
<finalize output="result"/>
|
58
|
+
<update output="result">data.instances << result
|
59
|
+
status.nudge!</update>
|
60
|
+
<_timing>
|
61
|
+
<_timing_min/>
|
62
|
+
<_timing_max/>
|
63
|
+
<_timing_avg/>
|
64
|
+
</_timing>
|
65
|
+
<_notes>
|
66
|
+
<_notes_general/>
|
67
|
+
<_notes_output/>
|
68
|
+
<_attachments/>
|
69
|
+
</_notes>
|
70
|
+
</call>
|
71
|
+
</parallel_branch>
|
72
|
+
<parallel_branch>
|
73
|
+
<loop mode="pre_test" condition="true">
|
74
|
+
<choose mode="exclusive">
|
75
|
+
<alternative condition="data.instances.empty?">
|
76
|
+
<manipulate id="a3" label="Sleep">status.wait_until_nudged!</manipulate>
|
77
|
+
</alternative>
|
78
|
+
<otherwise>
|
79
|
+
<call id="a2" endpoint="start_url">
|
80
|
+
<parameters>
|
81
|
+
<label/>
|
82
|
+
<method>:post</method>
|
83
|
+
<arguments>
|
84
|
+
<behavior>fork_running</behavior>
|
85
|
+
<url>https://centurio.work/customers/prime/Machining.xml</url>
|
86
|
+
<init>
|
87
|
+
<instance>!data.instances.last</instance>
|
88
|
+
</init>
|
89
|
+
</arguments>
|
90
|
+
</parameters>
|
91
|
+
<finalize output="result">data.instances.pop</finalize>
|
92
|
+
<update output="result"/>
|
93
|
+
<_timing>
|
94
|
+
<_timing_min/>
|
95
|
+
<_timing_max/>
|
96
|
+
<_timing_avg/>
|
97
|
+
</_timing>
|
98
|
+
<_notes>
|
99
|
+
<_notes_general/>
|
100
|
+
<_notes_output/>
|
101
|
+
<_attachments/>
|
102
|
+
</_notes>
|
103
|
+
</call>
|
104
|
+
</otherwise>
|
105
|
+
</choose>
|
106
|
+
</loop>
|
107
|
+
</parallel_branch>
|
108
|
+
</parallel>
|
109
|
+
</description>
|
110
|
+
</dslx>
|
111
|
+
<status>
|
112
|
+
<id>0</id>
|
113
|
+
<message>undefined</message>
|
114
|
+
</status>
|
115
|
+
<description>
|
116
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
117
|
+
<parallel wait="-1">
|
118
|
+
<parallel_branch>
|
119
|
+
<call id="a1" endpoint="hoert_die_signale">
|
120
|
+
<parameters>
|
121
|
+
<label/>
|
122
|
+
<method>:get</method>
|
123
|
+
<arguments/>
|
124
|
+
</parameters>
|
125
|
+
<finalize output="result"/>
|
126
|
+
<update output="result">data.instances << result
|
127
|
+
status.nudge!</update>
|
128
|
+
<_timing>
|
129
|
+
<_timing_min/>
|
130
|
+
<_timing_max/>
|
131
|
+
<_timing_avg/>
|
132
|
+
</_timing>
|
133
|
+
<_notes>
|
134
|
+
<_notes_general/>
|
135
|
+
<_notes_output/>
|
136
|
+
<_attachments/>
|
137
|
+
</_notes>
|
138
|
+
</call>
|
139
|
+
</parallel_branch>
|
140
|
+
<parallel_branch>
|
141
|
+
<loop mode="pre_test" condition="true">
|
142
|
+
<choose mode="exclusive">
|
143
|
+
<alternative condition="data.instances.empty?">
|
144
|
+
<manipulate id="a3" label="Sleep">status.wait_until_nudged!</manipulate>
|
145
|
+
</alternative>
|
146
|
+
<otherwise>
|
147
|
+
<call id="a2" endpoint="start_url">
|
148
|
+
<parameters>
|
149
|
+
<label/>
|
150
|
+
<method>:post</method>
|
151
|
+
<arguments>
|
152
|
+
<behavior>fork_running</behavior>
|
153
|
+
<url>https://centurio.work/customers/prime/Machining.xml</url>
|
154
|
+
<init>
|
155
|
+
<instance>!data.instances.last</instance>
|
156
|
+
</init>
|
157
|
+
</arguments>
|
158
|
+
</parameters>
|
159
|
+
<finalize output="result">data.instances.pop</finalize>
|
160
|
+
<update output="result"/>
|
161
|
+
<_timing>
|
162
|
+
<_timing_min/>
|
163
|
+
<_timing_max/>
|
164
|
+
<_timing_avg/>
|
165
|
+
</_timing>
|
166
|
+
<_notes>
|
167
|
+
<_notes_general/>
|
168
|
+
<_notes_output/>
|
169
|
+
<_attachments/>
|
170
|
+
</_notes>
|
171
|
+
</call>
|
172
|
+
</otherwise>
|
173
|
+
</choose>
|
174
|
+
</loop>
|
175
|
+
</parallel_branch>
|
176
|
+
</parallel>
|
177
|
+
</description>
|
178
|
+
</description>
|
179
|
+
<transformation>
|
180
|
+
<description type="copy"/>
|
181
|
+
<dataelements type="none"/>
|
182
|
+
<endpoints type="none"/>
|
183
|
+
</transformation>
|
184
|
+
</properties>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: tools
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-04-
|
14
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: riddl
|
@@ -346,6 +346,7 @@ files:
|
|
346
346
|
- server/instances/64/properties.xml
|
347
347
|
- server/instances/65/properties.xml
|
348
348
|
- server/instances/66/properties.xml
|
349
|
+
- server/instances/67/properties.xml
|
349
350
|
- server/instances/7/properties.xml
|
350
351
|
- server/instances/8/properties.xml
|
351
352
|
- server/instances/9/properties.xml
|
@@ -360,7 +361,6 @@ files:
|
|
360
361
|
- server/resources/topics.xml
|
361
362
|
- server/resources/transformation.xml
|
362
363
|
- server/resources/transformation_dslx.xsl
|
363
|
-
- server/server.pid
|
364
364
|
- server/server.rb
|
365
365
|
- server/test.rb
|
366
366
|
- test/callback.rb
|
data/server/server.pid
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
16038
|