cpee 2.1.14 → 2.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cpee.gemspec +1 -1
- data/server/executionhandlers/ruby/connection.rb +10 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdba71d5df8124590a3b932d83af91b87801663f3e21d8ebbafb9d4e2b339869
|
4
|
+
data.tar.gz: 73e7507c88a39096b2d418178a03150165a0966cd94ce4d452565a21c0e31683
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '093136bfeee58f4ba9152b15c5a83220aa219734160a50b60739f30337e08e2b99d2b503addcec8cd72c832bf67430b4e177110007f5693a593c8a513d620fec'
|
7
|
+
data.tar.gz: d50286266ac5d15a94f4c0f86cdd2d87b8730948e0f1a6bdfe0d0ca73af8104fdcf720620abf06b8819aaea005d6cf264954c0b063841f4dba22c29c977e2bd2
|
data/cpee.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cpee"
|
3
|
-
s.version = "2.1.
|
3
|
+
s.version = "2.1.15"
|
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.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
|
@@ -13,6 +13,7 @@
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
14
14
|
|
15
15
|
require 'charlock_holmes'
|
16
|
+
require 'base64'
|
16
17
|
|
17
18
|
class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
18
19
|
def self::loop_guard(arguments,id,count) # {{{
|
@@ -197,11 +198,12 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
197
198
|
unless status.nil?
|
198
199
|
@controller.notify("status/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :id => status.id, :message => status.message)
|
199
200
|
end
|
200
|
-
unless changed_dataelements.nil?
|
201
|
-
|
201
|
+
unless changed_dataelements.nil? || changed_dataelements.empty?
|
202
|
+
de = dataelements.slice(*changed_dataelements).transform_values { |v| detect_encoding(v) == 'UTF-8' ? v : convert_to_base64(v) }
|
203
|
+
@controller.notify("dataelements/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_dataelements, :values => de)
|
202
204
|
end
|
203
|
-
unless changed_endpoints.nil?
|
204
|
-
@controller.notify("endpoints/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_endpoints, :values => endpoints)
|
205
|
+
unless changed_endpoints.nil? || changed_endpoints.empty?
|
206
|
+
@controller.notify("endpoints/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_endpoints, :values => endpoints.slice(*changed_endpoints))
|
205
207
|
end
|
206
208
|
end # }}}
|
207
209
|
|
@@ -241,12 +243,12 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
241
243
|
result
|
242
244
|
end
|
243
245
|
|
244
|
-
def
|
246
|
+
def detect_encoding(text)
|
245
247
|
CharlockHolmes::EncodingDetector.detect(text)[:encoding] || 'ISO-8859-1'
|
246
248
|
end
|
247
249
|
|
248
|
-
def
|
249
|
-
|
250
|
+
def convert_to_base64(text)
|
251
|
+
'data:application/octet-stream;base64,' + Base64::urlsafe_encode64(text)
|
250
252
|
end
|
251
253
|
|
252
254
|
def structurize_result(result)
|
@@ -267,7 +269,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
267
269
|
tmp = {
|
268
270
|
'name' => r.name == '' ? 'result' : r.name,
|
269
271
|
'mimetype' => r.mimetype,
|
270
|
-
'data' => res
|
272
|
+
'data' => (detect_encoding(res) == 'UTF-8' ? res : convert_to_base64(res))
|
271
273
|
}
|
272
274
|
r.value.rewind
|
273
275
|
tmp
|