cpee-handlerwrapper-opcua 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cpee-handlerwrapper-opcua.gemspec +1 -1
- data/lib/cpee-handlerwrapper-opcua.rb +13 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5e99c034c7a91e6794c5c262c41cf7936f650181799dce95e20fcbc97fedf2e
|
4
|
+
data.tar.gz: b624904fa7d53581424512348891c558bb0c2bcd485497f99734c8ffcbeb90d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21bdb6a8e9919b110965160535e112e2f75b69d8476912037de9408c6d2134561e7c3da0248531738a20f69566c8ca5ab05a1f0a98439c3d79f80de3c41381f6
|
7
|
+
data.tar.gz: bc830bf16c10b98e94abad66c9737ff3b67dfb76b886ae84fd4f7bc3569f10b9887eca0af15ddb8acec40358af1b734d70d590ad1d78865ed97ea1f82f3ba34e
|
@@ -47,7 +47,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
47
47
|
@label = ''
|
48
48
|
end # }}}
|
49
49
|
|
50
|
-
def prepare(readonly, endpoints, parameters)
|
50
|
+
def prepare(readonly, endpoints, parameters) #{{{
|
51
51
|
@handler_endpoint = endpoints.is_a?(Array) ? endpoints.map{ |ep| readonly.endpoints[ep] }.compact : readonly.endpoints[endpoints]
|
52
52
|
parameters[:arguments]&.each do |ele|
|
53
53
|
if ele.value.is_a?(Proc)
|
@@ -55,7 +55,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
parameters
|
58
|
-
end
|
58
|
+
end #}}}
|
59
59
|
|
60
60
|
def activity_handle(passthrough, parameters) # {{{
|
61
61
|
raise "Wrong endpoint" if @handler_endpoint.nil? || @handler_endpoint.empty?
|
@@ -121,8 +121,14 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
121
121
|
if s.respond_to?(:mimetype)
|
122
122
|
params << Riddl::Parameter::Complex.new(s.name.to_s,v.mimetype,v.value)
|
123
123
|
else
|
124
|
-
if s.name.to_s =~ /
|
125
|
-
params << Riddl::Parameter::Simple.new(s.name.to_s.
|
124
|
+
if s.name.to_s =~ /^__Q_/
|
125
|
+
params << Riddl::Parameter::Simple.new(s.name.to_s.sub(/^__Q_/,''),CPEE::ValueHelper::generate(s.value),:query)
|
126
|
+
elsif s.name.to_s =~ /^__B_/
|
127
|
+
params << Riddl::Parameter::Simple.new(s.name.to_s.sub(/^__B_/,''),CPEE::ValueHelper::generate(s.value),:body)
|
128
|
+
elsif s.name.to_s =~ /^__H_/
|
129
|
+
params << Riddl::Header.new(s.name.to_s.sub(/^__H_/,''),CPEE::ValueHelper::generate(s.value))
|
130
|
+
elsif s.name.to_s =~ /^__C_/
|
131
|
+
params << Riddl::Parameter::Complex.new(s.name.to_s.sub(/^__C_/,''),*CPEE::ValueHelper::generate(s.value).split(';',2))
|
126
132
|
else
|
127
133
|
params << Riddl::Parameter::Simple.new(s.name.to_s,CPEE::ValueHelper::generate(s.value))
|
128
134
|
end
|
@@ -151,7 +157,9 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
151
157
|
|
152
158
|
status, result, headers = client.request type => params
|
153
159
|
if status < 200 || status >= 300
|
154
|
-
|
160
|
+
c = result[0]&.value
|
161
|
+
c = c.read if c.respond_to? :read
|
162
|
+
callback([ Riddl::Parameter::Complex.new('error','application/json',StringIO.new(JSON::generate({ 'status' => status, 'error' => c }))) ], 'CPEE_SALVAGE' => true)
|
155
163
|
else
|
156
164
|
if headers['CPEE_INSTANTIATION']
|
157
165
|
@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)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpee-handlerwrapper-opcua
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
8
8
|
autorequire:
|
9
9
|
bindir: tools
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cpee
|