cpee-instantiation 1.1.3 → 1.1.5
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-instantiation.gemspec +1 -1
- data/lib/cpee-instantiation/instantiation.rb +18 -6
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8e16d204b34a37277bd75a4971eb72716af21f4c6792f6f4281d15c61d53bd6
|
4
|
+
data.tar.gz: 1e34b02335ca3242cc7c915ccceb8422b0653e057877afd385ad20717ce08785
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26b3f9c3f8cabc8fca64353fc267a6b6a5cfd0249a7f10f63d863f621b098e8809c231819fa44aba5083cccaae2a7158c7e950314f93ee84b3d8c7e735e8d449
|
7
|
+
data.tar.gz: 659bd9d0d59e35f75fe7b2e7d762322870ac934f1a3769b9e89a1185936531adfdd6ddf82bfe12c7f4e51eaaa5d4cfc826c2d866d126e64b6a97273f81f4beff
|
data/cpee-instantiation.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cpee-instantiation"
|
3
|
-
s.version = "1.1.
|
3
|
+
s.version = "1.1.5"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.license = "LGPL-3.0-or-later"
|
6
6
|
s.summary = "Subprocess instantiation service for the cloud process execution engine (cpee.org)"
|
@@ -36,7 +36,8 @@ module CPEE
|
|
36
36
|
|
37
37
|
def add_to_testset(tdoc,what,data) #{{{
|
38
38
|
if data && !data.empty?
|
39
|
-
JSON::parse(data).
|
39
|
+
data = JSON::parse(data) if data.is_a? String
|
40
|
+
data.each do |k,v|
|
40
41
|
ele = tdoc.find("/*/prop:#{what}/prop:#{k}")
|
41
42
|
if ele.any?
|
42
43
|
ele.first.text = CPEE::ValueHelper::generate(v)
|
@@ -53,7 +54,7 @@ module CPEE
|
|
53
54
|
end
|
54
55
|
end #}}}
|
55
56
|
|
56
|
-
def augment_testset(tdoc,p) #{{{
|
57
|
+
def augment_testset(tdoc,p,h) #{{{
|
57
58
|
tdoc = XML::Smart.string(tdoc)
|
58
59
|
tdoc.register_namespace 'desc', 'http://cpee.org/ns/description/1.0'
|
59
60
|
tdoc.register_namespace 'prop', 'http://cpee.org/ns/properties/2.0'
|
@@ -68,6 +69,13 @@ module CPEE
|
|
68
69
|
if data = p.find{ |e| e.name == 'attributes' }&.value
|
69
70
|
add_to_testset(tdoc,'attributes',data)
|
70
71
|
end
|
72
|
+
data = {}
|
73
|
+
data['parent_instance'] = h['CPEE_INSTANCE'] if h['CPEE_INSTANCE']
|
74
|
+
data['parent_instance_uuid'] = h['CPEE_INSTANCE_UUID'] if h['CPEE_INSTANCE_UUID']
|
75
|
+
data['parent_instance_model'] = h['CPEE_ATTR_INFO'] if h['CPEE_ATTR_INFO']
|
76
|
+
data['parent_instance_task_id'] = h['CPEE_ACTIVITY'] if h['CPEE_ACTIVITY']
|
77
|
+
data['parent_instance_task_label'] = h['CPEE_LABEL'] if h['CPEE_LABEL']
|
78
|
+
add_to_testset(tdoc,'attributes',data)
|
71
79
|
tdoc
|
72
80
|
end #}}}
|
73
81
|
|
@@ -97,11 +105,13 @@ module CPEE
|
|
97
105
|
condition = behavior.match(/_([^_]+)_/)&.[](1) || 'finished'
|
98
106
|
|
99
107
|
if cb
|
100
|
-
cbk = '
|
108
|
+
cbk = 'instantiation_' + Digest::MD5.hexdigest(Kernel::rand().to_s)
|
101
109
|
n = doc.find('/*/sub:subscriptions') rescue []
|
102
110
|
if (n.empty?)
|
103
111
|
n = doc.root.add('subscriptions')
|
104
112
|
n.namespaces.add(nil,'http://riddl.org/ns/common-patterns/notifications-producer/2.0')
|
113
|
+
else
|
114
|
+
n = n.first
|
105
115
|
end
|
106
116
|
n.append('subscription', :id => cbk, :url => File.join(selfurl,'callback',cbk))
|
107
117
|
.append('topic', :id => 'state')
|
@@ -168,7 +178,7 @@ module CPEE
|
|
168
178
|
end
|
169
179
|
customization = @p.find{ |e| e.name == 'customization' }&.value
|
170
180
|
|
171
|
-
doc = augment_testset(tdoc,@p)
|
181
|
+
doc = augment_testset(tdoc,@p,@h)
|
172
182
|
customize_testset(customization,doc)
|
173
183
|
cbk, condition = add_waiting_to_testset(behavior,@h['CPEE_CALLBACK'],doc,selfurl)
|
174
184
|
add_running_to_testset(behavior,doc)
|
@@ -195,7 +205,7 @@ module CPEE
|
|
195
205
|
end
|
196
206
|
customization = @p.find{ |e| e.name == 'customization' }&.value
|
197
207
|
|
198
|
-
doc = augment_testset(tdoc,@p)
|
208
|
+
doc = augment_testset(tdoc,@p,@h)
|
199
209
|
customize_testset(customization,doc)
|
200
210
|
cbk, condition = add_waiting_to_testset(behavior,@h['CPEE_CALLBACK'],doc,selfurl)
|
201
211
|
add_running_to_testset(behavior,doc)
|
@@ -219,7 +229,7 @@ module CPEE
|
|
219
229
|
@p[data].value.read
|
220
230
|
end
|
221
231
|
|
222
|
-
doc = augment_testset(tdoc,@p)
|
232
|
+
doc = augment_testset(tdoc,@p,@h)
|
223
233
|
cbk, condition = add_waiting_to_testset(behavior,@h['CPEE_CALLBACK'],doc,selfurl)
|
224
234
|
add_running_to_testset(behavior,doc)
|
225
235
|
|
@@ -241,6 +251,8 @@ module CPEE
|
|
241
251
|
key = @r.last
|
242
252
|
cb, condition, instance, uuid, instance_url = cblist.lrange(key,0,-1)
|
243
253
|
|
254
|
+
return if cb.nil?
|
255
|
+
|
244
256
|
cpee = File.dirname(instance_url)
|
245
257
|
|
246
258
|
send = {
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpee-instantiation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
8
8
|
- Heinrich Fenkart
|
9
|
-
autorequire:
|
10
9
|
bindir: tools
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: riddl
|
@@ -95,7 +94,6 @@ homepage: http://cpee.org/
|
|
95
94
|
licenses:
|
96
95
|
- LGPL-3.0-or-later
|
97
96
|
metadata: {}
|
98
|
-
post_install_message:
|
99
97
|
rdoc_options: []
|
100
98
|
require_paths:
|
101
99
|
- lib
|
@@ -110,8 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
108
|
- !ruby/object:Gem::Version
|
111
109
|
version: '0'
|
112
110
|
requirements: []
|
113
|
-
rubygems_version: 3.
|
114
|
-
signing_key:
|
111
|
+
rubygems_version: 3.6.7
|
115
112
|
specification_version: 4
|
116
113
|
summary: Subprocess instantiation service for the cloud process execution engine (cpee.org)
|
117
114
|
test_files: []
|