cpee 1.5.4 → 1.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cpee.gemspec +2 -2
- data/server/handlerwrappers/default.rb +17 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaad30b7640b6c68b4acb529265f577e4a53a6fd034ebd11db4dc5eae34173fe
|
4
|
+
data.tar.gz: 7a3a4862bfd543268546d1385ec8d7b5ea7311b0fa4be84075b57890ff2c4bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b247689d4132d5ba3814197ec51dcc2e5ba8fe950610417cf0be4616a11c3dc5fa35c8804e1a533fa9749dcc5f3d37741dbc610adb4043ed52c4a40cc78e588b
|
7
|
+
data.tar.gz: fdf0ceb72d630ff34fb9cdaf26d009317b8652aea51f2fe8a7a44306cfc04b14a45e377a635dbab17cab7f834e349f9817ca10ce6b11e20d27eda168c61fd25d
|
data/cpee.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cpee"
|
3
|
-
s.version = "1.5.
|
3
|
+
s.version = "1.5.6"
|
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"
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.homepage = 'http://cpee.org/'
|
23
23
|
|
24
24
|
s.add_runtime_dependency 'riddl', '~> 0.99'
|
25
|
-
s.add_runtime_dependency 'weel', '~> 1.99', '>= 1.99.
|
25
|
+
s.add_runtime_dependency 'weel', '~> 1.99', '>= 1.99.78'
|
26
26
|
s.add_runtime_dependency 'savon', '~> 2'
|
27
27
|
s.add_runtime_dependency 'highline', '~> 1.6'
|
28
28
|
s.add_runtime_dependency 'json', '~>2.1'
|
@@ -42,17 +42,22 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
42
42
|
@handler_position = position
|
43
43
|
@handler_passthrough = nil
|
44
44
|
@handler_returnValue = nil
|
45
|
+
@handler_returnOptions = nil
|
45
46
|
@label = ''
|
46
47
|
end # }}}
|
47
48
|
|
48
49
|
def prepare(readonly, endpoints, parameters) #{{{
|
49
50
|
@handler_endpoint = endpoints.is_a?(Array) ? endpoints.map{ |ep| readonly.endpoints[ep] }.compact : readonly.endpoints[endpoints]
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
params = parameters.dup
|
52
|
+
params[:arguments] = params[:arguments].dup if params[:arguments]
|
53
|
+
params[:arguments]&.map! do |ele|
|
54
|
+
t = ele.dup
|
55
|
+
if t.value.is_a?(Proc)
|
56
|
+
t.value = readonly.instance_exec &t.value
|
53
57
|
end
|
58
|
+
t
|
54
59
|
end
|
55
|
-
|
60
|
+
params
|
56
61
|
end #}}}
|
57
62
|
|
58
63
|
def activity_handle(passthrough, parameters) # {{{
|
@@ -105,9 +110,10 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
105
110
|
|
106
111
|
status, result, headers = client.request type => params
|
107
112
|
if status < 200 || status >= 300
|
113
|
+
headers['CPEE_SALVAGE'] = true
|
108
114
|
c = result[0]&.value
|
109
115
|
c = c.read if c.respond_to? :read
|
110
|
-
callback([ Riddl::Parameter::Complex.new('error','application/json',StringIO.new(JSON::generate({ 'status' => status, 'error' => c }))) ],
|
116
|
+
callback([ Riddl::Parameter::Complex.new('error','application/json',StringIO.new(JSON::generate({ 'status' => status, 'error' => c }))) ], headers)
|
111
117
|
else
|
112
118
|
if headers['CPEE_INSTANTIATION']
|
113
119
|
@controller.notify("task/instantiation", :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :received => CPEE::ValueHelper.parse(headers['CPEE_INSTANTIATION']), :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
|
@@ -118,7 +124,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
118
124
|
elsif headers['CPEE_CALLBACK'] && headers['CPEE_CALLBACK'] == 'true' && result.empty?
|
119
125
|
# do nothing, later on things will happend
|
120
126
|
else
|
121
|
-
callback result
|
127
|
+
callback result, headers
|
122
128
|
end
|
123
129
|
end
|
124
130
|
else
|
@@ -133,6 +139,9 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
133
139
|
def activity_result_value # {{{
|
134
140
|
@handler_returnValue
|
135
141
|
end # }}}
|
142
|
+
def activity_result_options # {{{
|
143
|
+
@handler_returnOptions
|
144
|
+
end # }}}
|
136
145
|
|
137
146
|
def activity_stop # {{{
|
138
147
|
unless @handler_passthrough.nil?
|
@@ -238,15 +247,15 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
238
247
|
def callback(result=nil,options={})
|
239
248
|
@controller.notify("activity/receiving", :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :received => structurize_result(result), :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated, :sensors => @sensors, :aggregators => @aggregators, :costs => @costs)
|
240
249
|
result = simplify_result(result)
|
250
|
+
@handler_returnValue = result
|
251
|
+
@handler_returnOptions = options
|
241
252
|
if options['CPEE_UPDATE']
|
242
|
-
@handler_returnValue = result
|
243
253
|
if options['CPEE_UPDATE_STATUS']
|
244
254
|
@controller.notify("activity/status", :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :status => options['CPEE_UPDATE_STATUS'], :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
|
245
255
|
end
|
246
256
|
@handler_continue.continue WEEL::Signal::Again
|
247
257
|
else
|
248
258
|
@controller.callbacks.delete(@handler_passthrough)
|
249
|
-
@handler_returnValue = result
|
250
259
|
@handler_passthrough = nil
|
251
260
|
if options['CPEE_SALVAGE']
|
252
261
|
@handler_continue.continue WEEL::Signal::Salvage
|
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.5.
|
4
|
+
version: 1.5.6
|
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: 2019-10-
|
14
|
+
date: 2019-10-15 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: riddl
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
version: '1.99'
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 1.99.
|
39
|
+
version: 1.99.78
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
version: '1.99'
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 1.99.
|
49
|
+
version: 1.99.78
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: savon
|
52
52
|
requirement: !ruby/object:Gem::Requirement
|