cpee 1.3.111 → 1.3.115

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "1.3.111"
3
+ s.version = "1.3.115"
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"
@@ -100,6 +100,10 @@ module CPEE
100
100
  attr_reader :notifications
101
101
  attr_reader :callbacks
102
102
  attr_reader :mutex
103
+
104
+ def instance_url
105
+ "#{@opts[:url]}/#{@id}"
106
+ end
103
107
 
104
108
  def sim # {{{
105
109
  @thread.join if !@thread.nil? && @thread.alive?
@@ -302,6 +306,7 @@ module CPEE
302
306
  end #}}}
303
307
  def unserialize_description! #{{{
304
308
  dsl = nil
309
+ nots = []
305
310
  @properties.modify do |doc|
306
311
  dsl = doc.find("/p:properties/p:dsl").first
307
312
  dslx = doc.find("/p:properties/p:dslx").first
@@ -356,6 +361,7 @@ module CPEE
356
361
  @instance.data[k.value] = ValueHelper::parse(v.value)
357
362
  node.add(k.value,ValueHelper::generate(v.value))
358
363
  end
364
+ nots << ["properties/dataelements/change", {:instance => instance_url, :changed => JSON::generate(@instance.data)}]
359
365
  end
360
366
 
361
367
  ### enpoints extraction
@@ -380,8 +386,10 @@ module CPEE
380
386
  @instance.endpoints[k.value] = ValueHelper::parse(v.value)
381
387
  node.add(k.value,ValueHelper::generate(v.value))
382
388
  end
389
+ nots << ["properties/endpoints/change", {:instance => instance_url, :changed => JSON::generate(@instance.endpoints)}]
383
390
  end
384
391
  end
392
+ nots
385
393
  end #}}}
386
394
 
387
395
  def notify(what,content={})# {{{
@@ -33,14 +33,14 @@ class NotificationsHandler < Riddl::Utils::Notifications::Producer::HandlerBase
33
33
 
34
34
  def create
35
35
  @data.unserialize_notifications!(:cre,@key)
36
- @data.notify('properties/handlers/change')
36
+ @data.notify('properties/handlers/change', :instance => @data.instance_url)
37
37
  end
38
38
  def delete
39
39
  @data.unserialize_notifications!(:del,@key)
40
- @data.notify('properties/handlers/change')
40
+ @data.notify('properties/handlers/change', :instance => @data.instance_url)
41
41
  end
42
42
  def update
43
43
  @data.unserialize_notifications!(:upd,@key)
44
- @data.notify('properties/handlers/change')
44
+ @data.notify('properties/handlers/change', :instance => @data.instance_url)
45
45
  end
46
46
  end
@@ -17,19 +17,22 @@ class PropertiesHandler < Riddl::Utils::Properties::HandlerBase
17
17
  case @property
18
18
  when 'handlerwrapper'
19
19
  @data.unserialize_handlerwrapper!
20
- @data.notify('properties/handlerwrapper/change')
20
+ @data.notify('properties/handlerwrapper/change', :instance => @data.instance_url)
21
21
  when 'description'
22
- @data.unserialize_description!
23
- @data.notify('properties/description/change')
22
+ nots = @data.unserialize_description!
23
+ @data.notify('properties/description/change', :instance => @data.instance_url)
24
+ nots.uniq.each do |noti|
25
+ @data.notify(*noti)
26
+ end
24
27
  when 'endpoints'
25
28
  @data.unserialize_endpoints!
26
- @data.notify('properties/endpoints/change')
29
+ @data.notify('properties/endpoints/change', :instance => @data.instance_url)
27
30
  when 'dataelements'
28
31
  @data.unserialize_dataelements!
29
- @data.notify('properties/dataelements/change')
32
+ @data.notify('properties/dataelements/change', :instance => @data.instance_url)
30
33
  when 'positions'
31
34
  @data.unserialize_positions!
32
- @data.notify('properties/position/change')
35
+ @data.notify('properties/position/change', :instance => @data.instance_url)
33
36
  when 'state'
34
37
  @data.unserialize_state!
35
38
  else
@@ -35,13 +35,14 @@ module CPEE
35
35
  opts[:transformation_service] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/resources/transformation.xml')
36
36
 
37
37
  Proc.new do
38
+ Dir[opts[:handlerwrappers] + "/*.rb"].each do |h|
39
+ require h
40
+ end
41
+
38
42
  controller = {}
39
43
  Dir[opts[:instances] + '/*/properties.xml'].map{|e|::File::basename(::File::dirname(e))}.each do |id|
40
44
  controller[id.to_i] = Controller.new(id,opts)
41
45
  end
42
- Dir[opts[:handlerwrappers] + "/*.rb"].each do |h|
43
- require h
44
- end
45
46
 
46
47
  interface 'properties' do |r|
47
48
  id = r[:h]['RIDDL_DECLARATION_PATH'].split('/')[1].to_i
@@ -61,6 +61,7 @@
61
61
  <state type="state" modifiable="true">
62
62
  <ready>
63
63
  <running putable="true"/>
64
+ <ready putable="true"/>
64
65
  <simulating putable="true"/>
65
66
  </ready>
66
67
  <running>
@@ -72,6 +73,7 @@
72
73
  <stopped putable="false"/>
73
74
  </stopping>
74
75
  <stopped>
76
+ <stopped putable="true"/>
75
77
  <running putable="true"/>
76
78
  <simulating putable="true"/>
77
79
  </stopped>
@@ -60,6 +60,7 @@
60
60
  </transformation>
61
61
  <state type="state" modifiable="false" mutable="false">
62
62
  <ready>
63
+ <ready putable="true"/>
63
64
  <running putable="true"/>
64
65
  <simulating putable="true"/>
65
66
  </ready>
@@ -72,6 +73,7 @@
72
73
  <stopped putable="false"/>
73
74
  </stopping>
74
75
  <stopped>
76
+ <stopped putable="true"/>
75
77
  <running putable="true"/>
76
78
  <simulating putable="true"/>
77
79
  </stopped>
@@ -61,6 +61,7 @@
61
61
  <state type="state" modifiable="true">
62
62
  <ready>
63
63
  <running putable="true"/>
64
+ <ready putable="true"/>
64
65
  <simulating putable="true"/>
65
66
  </ready>
66
67
  <running>
@@ -72,6 +73,7 @@
72
73
  <stopped putable="false"/>
73
74
  </stopping>
74
75
  <stopped>
76
+ <stopped putable="true"/>
75
77
  <running putable="true"/>
76
78
  <simulating putable="true"/>
77
79
  </stopped>
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.111
4
+ version: 1.3.115
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-10-13 00:00:00.000000000 Z
14
+ date: 2013-10-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: riddl