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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e899a082b8d6c5fbea2e1967c60aa4869ab51b40
4
- data.tar.gz: da32f08d62191f645a60ec18fb870faed7c279fb
3
+ metadata.gz: 21ec5e5f7ac3fa863944fbc529d2ba6c76a607af
4
+ data.tar.gz: 62ece76319951cc933330e66790970c1459d9768
5
5
  SHA512:
6
- metadata.gz: 167ac5e92dc07428f77d2402bb913ecaeeacf2e54177698eaad4adcef3db7d10ad75707ff4478475a1585320cfb572747d7be31110ffd0d0d853f6b4d2bb1dd2
7
- data.tar.gz: bc78e736bf4c5695b47b717fd02a22764f346decca66d0facea78b702a8bc88b50c543afaf98e0b1b9a0700ebef27ce0b51c9280225a532fe89b1b4e735cfa7e
6
+ metadata.gz: e3864d4873c6828dd51521d1a43f627ebed013d8a98a3fbb36cfc27d4f3fdb938d1a025dda7ccd818f2f67c7f3acb8c54769402b4db32b1b1b4b9f88d6f11bdc
7
+ data.tar.gz: 2205fc313cf30d7b99a0e6541dd57d434b61d574c22a9b915ec8536cfe526adc0788f0c45cd647ea37b30da1c31d5ec690747afcd4528460efb0cf5185e2bb4f
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "1.3.152"
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"
@@ -333,100 +333,117 @@ module CPEE
333
333
  dsl = nil
334
334
  nots = []
335
335
  @properties.modify do |doc|
336
- dsl = doc.find("/p:properties/p:dsl").first
337
- dslx = doc.find("/p:properties/p:dslx").first
338
- desc = doc.find("/p:properties/p:description").first
339
- tdesc = doc.find("/p:properties/p:transformation/p:description").first
340
- tdata = doc.find("/p:properties/p:transformation/p:dataelements").first
341
- tendp = doc.find("/p:properties/p:transformation/p:endpoints").first
342
-
343
- tdesctype = tdesc.attributes['type']
344
- tdatatype = tdata.attributes['type']
345
- tendptype = tendp.attributes['type']
346
-
347
- if desc.children.empty?
348
- tdesctype = tdatatype = tendptype = 'clean'
349
- end
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
- ### description transformation, including dslx to dsl
352
- addit = if tdesctype == 'copy' || tdesc.empty?
353
- desc.children.first.to_doc.root
354
- elsif tdesctype == 'rest' && !tdesc.empty?
355
- srv = Riddl::Client.interface(tdesc.text,@opts[:transformation_service],:xmpp => @opts[:xmpp])
356
- status, res = srv.post [
357
- Riddl::Parameter::Complex.new("description","text/xml",desc.children.first.dump),
358
- Riddl::Parameter::Simple.new("type","description")
359
- ]
360
- XML::Smart::string(res[0].value.read).root if status == 200
361
- elsif tdesctype == 'xslt' && !tdesc.empty?
362
- trans = XML::Smart::open_unprotected(tdesc.text)
363
- desc.children.first.to_doc.transform_with(trans).root
364
- elsif tdesctype == 'clean'
365
- XML::Smart::open_unprotected(@opts[:empty_dslx]).root
366
- else
367
- nil
368
- end
369
- unless addit.nil?
370
- dslx.children.delete_all!
371
- dslx.add addit
372
- trans = XML::Smart::open_unprotected(@opts[:transformation_dslx])
373
- dsl.text = dslx.to_doc.transform_with(trans)
374
- @instance.description = dsl.text
375
- end
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
- ### dataelements extraction
378
- addit = if tdatatype == 'rest' && !tdata.empty?
379
- srv = Riddl::Client.interface(tdata.text,@opts[:transformation_service],:xmpp => @opts[:xmpp])
380
- status, res = srv.post [
381
- Riddl::Parameter::Complex.new("description","text/xml",desc.children.first.dump),
382
- Riddl::Parameter::Simple.new("type","dataelements")
383
- ]
384
- res
385
- elsif tdatatype == 'xslt' && !tdata.empty?
386
- trans = XML::Smart::open_unprotected(tdata.text)
387
- desc.children.first.to_doc.transform_with(trans)
388
- elsif tdatatype == 'clean'
389
- []
390
- else
391
- nil
392
- end
393
- unless addit.nil?
394
- node = doc.find("/p:properties/p:dataelements").first
395
- node.children.delete_all!
396
- @instance.data.clear
397
- addit.each_slice(2).each do |k,v|
398
- @instance.data[k.value.to_sym] = ValueHelper::parse(v.value)
399
- node.add(k.value,ValueHelper::generate(v.value))
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
- ### enpoints extraction
405
- addit = if tendptype == 'rest' && !tdata.empty?
406
- srv = Riddl::Client.interface(tendp.text,@opts[:transformation_service],:xmpp => @opts[:xmpp])
407
- status, res = srv.post [
408
- Riddl::Parameter::Complex.new("description","text/xml",desc.children.first.dump),
409
- Riddl::Parameter::Simple.new("type","endpoints")
410
- ]
411
- res
412
- elsif tendptype == 'xslt' && !tdata.empty?
413
- trans = XML::Smart::open_unprotected(tendp.text)
414
- desc.children.first.to_doc.transform_with(trans)
415
- elsif tendptype == 'clean'
416
- []
417
- else
418
- nil
419
- end
420
- unless addit.nil?
421
- node = doc.find("/p:properties/p:endpoints").first
422
- node.children.delete_all!
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
- nots << ["properties/endpoints/change", {:instance => instance, :changed => JSON::generate(@instance.endpoints)}]
429
- end
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
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.3.152
4
+ version: 1.3.153
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler