cpee 1.3.152 → 1.3.153
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/lib/cpee/controller.rb +106 -89
- data/lib/cpee/handler_properties.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21ec5e5f7ac3fa863944fbc529d2ba6c76a607af
|
4
|
+
data.tar.gz: 62ece76319951cc933330e66790970c1459d9768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3864d4873c6828dd51521d1a43f627ebed013d8a98a3fbb36cfc27d4f3fdb938d1a025dda7ccd818f2f67c7f3acb8c54769402b4db32b1b1b4b9f88d6f11bdc
|
7
|
+
data.tar.gz: 2205fc313cf30d7b99a0e6541dd57d434b61d574c22a9b915ec8536cfe526adc0788f0c45cd647ea37b30da1c31d5ec690747afcd4528460efb0cf5185e2bb4f
|
data/cpee.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cpee"
|
3
|
-
s.version = "1.3.
|
3
|
+
s.version = "1.3.153"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.license = "LGPL-3"
|
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
@@ -333,100 +333,117 @@ module CPEE
|
|
333
333
|
dsl = nil
|
334
334
|
nots = []
|
335
335
|
@properties.modify do |doc|
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
336
|
+
begin
|
337
|
+
dsl = doc.find("/p:properties/p:dsl").first
|
338
|
+
dslx = doc.find("/p:properties/p:dslx").first
|
339
|
+
desc = doc.find("/p:properties/p:description").first
|
340
|
+
tdesc = doc.find("/p:properties/p:transformation/p:description").first
|
341
|
+
tdata = doc.find("/p:properties/p:transformation/p:dataelements").first
|
342
|
+
tendp = doc.find("/p:properties/p:transformation/p:endpoints").first
|
343
|
+
|
344
|
+
tdesctype = tdesc.attributes['type']
|
345
|
+
tdatatype = tdata.attributes['type']
|
346
|
+
tendptype = tendp.attributes['type']
|
347
|
+
|
348
|
+
if desc.children.empty?
|
349
|
+
tdesctype = tdatatype = tendptype = 'clean'
|
350
|
+
end
|
350
351
|
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
352
|
+
### description transformation, including dslx to dsl
|
353
|
+
addit = if tdesctype == 'copy' || tdesc.empty?
|
354
|
+
desc.children.first.to_doc.root
|
355
|
+
elsif tdesctype == 'rest' && !tdesc.empty?
|
356
|
+
srv = Riddl::Client.interface(tdesc.text,@opts[:transformation_service],:xmpp => @opts[:xmpp])
|
357
|
+
status, res = srv.post [
|
358
|
+
Riddl::Parameter::Complex.new("description","text/xml",desc.children.first.dump),
|
359
|
+
Riddl::Parameter::Simple.new("type","description")
|
360
|
+
]
|
361
|
+
if status >= 200 && status < 300
|
362
|
+
XML::Smart::string(res[0].value.read).root
|
363
|
+
else
|
364
|
+
raise 'Could not extract dslx'
|
365
|
+
end
|
366
|
+
elsif tdesctype == 'xslt' && !tdesc.empty?
|
367
|
+
trans = XML::Smart::open_unprotected(tdesc.text)
|
368
|
+
desc.children.first.to_doc.transform_with(trans).root
|
369
|
+
elsif tdesctype == 'clean'
|
370
|
+
XML::Smart::open_unprotected(@opts[:empty_dslx]).root
|
371
|
+
else
|
372
|
+
nil
|
373
|
+
end
|
374
|
+
unless addit.nil?
|
375
|
+
dslx.children.delete_all!
|
376
|
+
dslx.add addit
|
377
|
+
trans = XML::Smart::open_unprotected(@opts[:transformation_dslx])
|
378
|
+
dsl.text = dslx.to_doc.transform_with(trans)
|
379
|
+
@instance.description = dsl.text
|
380
|
+
end
|
376
381
|
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
addit.
|
398
|
-
|
399
|
-
node.
|
382
|
+
### dataelements extraction
|
383
|
+
addit = if tdatatype == 'rest' && !tdata.empty?
|
384
|
+
srv = Riddl::Client.interface(tdata.text,@opts[:transformation_service],:xmpp => @opts[:xmpp])
|
385
|
+
status, res = srv.post [
|
386
|
+
Riddl::Parameter::Complex.new("description","text/xml",desc.children.first.dump),
|
387
|
+
Riddl::Parameter::Simple.new("type","dataelements")
|
388
|
+
]
|
389
|
+
if status >= 200 && status < 300
|
390
|
+
res
|
391
|
+
else
|
392
|
+
raise 'Could not extract dataelements'
|
393
|
+
end
|
394
|
+
elsif tdatatype == 'xslt' && !tdata.empty?
|
395
|
+
trans = XML::Smart::open_unprotected(tdata.text)
|
396
|
+
desc.children.first.to_doc.transform_with(trans)
|
397
|
+
elsif tdatatype == 'clean'
|
398
|
+
[]
|
399
|
+
else
|
400
|
+
nil
|
401
|
+
end
|
402
|
+
unless addit.nil?
|
403
|
+
node = doc.find("/p:properties/p:dataelements").first
|
404
|
+
node.children.delete_all!
|
405
|
+
@instance.data.clear
|
406
|
+
addit.each_slice(2).each do |k,v|
|
407
|
+
@instance.data[k.value.to_sym] = ValueHelper::parse(v.value)
|
408
|
+
node.add(k.value,ValueHelper::generate(v.value))
|
409
|
+
end
|
410
|
+
nots << ["properties/dataelements/change", {:instance => instance, :changed => JSON::generate(@instance.data)}]
|
400
411
|
end
|
401
|
-
nots << ["properties/dataelements/change", {:instance => instance, :changed => JSON::generate(@instance.data)}]
|
402
|
-
end
|
403
412
|
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
@instance.endpoints.clear
|
424
|
-
addit.each_slice(2).each do |k,v|
|
425
|
-
@instance.endpoints[k.value.to_sym] = ValueHelper::parse(v.value)
|
426
|
-
node.add(k.value,ValueHelper::generate(v.value))
|
413
|
+
### endpoints extraction
|
414
|
+
addit = if tendptype == 'rest' && !tdata.empty?
|
415
|
+
srv = Riddl::Client.interface(tendp.text,@opts[:transformation_service],:xmpp => @opts[:xmpp])
|
416
|
+
status, res = srv.post [
|
417
|
+
Riddl::Parameter::Complex.new("description","text/xml",desc.children.first.dump),
|
418
|
+
Riddl::Parameter::Simple.new("type","endpoints")
|
419
|
+
]
|
420
|
+
if status >= 200 && status < 300
|
421
|
+
res
|
422
|
+
else
|
423
|
+
raise 'Could not extract endpoints'
|
424
|
+
end
|
425
|
+
elsif tendptype == 'xslt' && !tdata.empty?
|
426
|
+
trans = XML::Smart::open_unprotected(tendp.text)
|
427
|
+
desc.children.first.to_doc.transform_with(trans)
|
428
|
+
elsif tendptype == 'clean'
|
429
|
+
[]
|
430
|
+
else
|
431
|
+
nil
|
427
432
|
end
|
428
|
-
|
429
|
-
|
433
|
+
unless addit.nil?
|
434
|
+
node = doc.find("/p:properties/p:endpoints").first
|
435
|
+
node.children.delete_all!
|
436
|
+
@instance.endpoints.clear
|
437
|
+
addit.each_slice(2).each do |k,v|
|
438
|
+
@instance.endpoints[k.value.to_sym] = ValueHelper::parse(v.value)
|
439
|
+
node.add(k.value,ValueHelper::generate(v.value))
|
440
|
+
end
|
441
|
+
nots << ["properties/endpoints/change", {:instance => instance, :changed => JSON::generate(@instance.endpoints)}]
|
442
|
+
end
|
443
|
+
nots << ['properties/description/change', { :instance => instance }]
|
444
|
+
rescue => err
|
445
|
+
nots << ["properties/description/error", { :instance => instance, :message => err.message }]
|
446
|
+
end
|
430
447
|
end
|
431
448
|
nots
|
432
449
|
end #}}}
|
@@ -20,7 +20,6 @@ class PropertiesHandler < Riddl::Utils::Properties::HandlerBase
|
|
20
20
|
@data.notify('properties/handlerwrapper/change', :instance => @data.instance)
|
21
21
|
when 'description'
|
22
22
|
nots = @data.unserialize_description!
|
23
|
-
@data.notify('properties/description/change', :instance => @data.instance)
|
24
23
|
nots.uniq.each do |noti|
|
25
24
|
@data.notify(*noti)
|
26
25
|
end
|