cpee 1.3.124 → 1.3.125
Sign up to get free protection for your applications and to get access to all the features.
- data/cpee.gemspec +1 -1
- data/lib/cpee/controller.rb +8 -2
- data/lib/cpee/handler_notifications.rb +4 -4
- data/lib/cpee/handler_properties.rb +5 -5
- data/server/handlerwrappers/default.rb +13 -13
- metadata +1 -1
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.125"
|
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
@@ -116,6 +116,12 @@ module CPEE
|
|
116
116
|
def xmpp
|
117
117
|
@opts[:xmpp]
|
118
118
|
end
|
119
|
+
def base
|
120
|
+
@opts[:jid] ? base_url + "," + base_jid : base_url
|
121
|
+
end
|
122
|
+
def instance
|
123
|
+
@opts[:jid] ? instance_url + "," + instance_jid : instance_url
|
124
|
+
end
|
119
125
|
|
120
126
|
def sim # {{{
|
121
127
|
@thread.join if !@thread.nil? && @thread.alive?
|
@@ -377,7 +383,7 @@ module CPEE
|
|
377
383
|
@instance.data[k.value.to_sym] = ValueHelper::parse(v.value)
|
378
384
|
node.add(k.value,ValueHelper::generate(v.value))
|
379
385
|
end
|
380
|
-
nots << ["properties/dataelements/change", {:instance =>
|
386
|
+
nots << ["properties/dataelements/change", {:instance => instance, :changed => JSON::generate(@instance.data)}]
|
381
387
|
end
|
382
388
|
|
383
389
|
### enpoints extraction
|
@@ -402,7 +408,7 @@ module CPEE
|
|
402
408
|
@instance.endpoints[k.value.to_sym] = ValueHelper::parse(v.value)
|
403
409
|
node.add(k.value,ValueHelper::generate(v.value))
|
404
410
|
end
|
405
|
-
nots << ["properties/endpoints/change", {:instance =>
|
411
|
+
nots << ["properties/endpoints/change", {:instance => instance, :changed => JSON::generate(@instance.endpoints)}]
|
406
412
|
end
|
407
413
|
end
|
408
414
|
nots
|
@@ -18,7 +18,7 @@ class NotificationsHandler < Riddl::Utils::Notifications::Producer::HandlerBase
|
|
18
18
|
end
|
19
19
|
def ws_close
|
20
20
|
@data.unserialize_notifications!(:del,@key)
|
21
|
-
@data.notify('properties/handlers/change', :instance => @data.
|
21
|
+
@data.notify('properties/handlers/change', :instance => @data.instance)
|
22
22
|
end
|
23
23
|
def ws_message(data)
|
24
24
|
begin
|
@@ -34,14 +34,14 @@ class NotificationsHandler < Riddl::Utils::Notifications::Producer::HandlerBase
|
|
34
34
|
|
35
35
|
def create
|
36
36
|
@data.unserialize_notifications!(:cre,@key)
|
37
|
-
@data.notify('properties/handlers/change', :instance => @data.
|
37
|
+
@data.notify('properties/handlers/change', :instance => @data.instance)
|
38
38
|
end
|
39
39
|
def delete
|
40
40
|
@data.unserialize_notifications!(:del,@key)
|
41
|
-
@data.notify('properties/handlers/change', :instance => @data.
|
41
|
+
@data.notify('properties/handlers/change', :instance => @data.instance)
|
42
42
|
end
|
43
43
|
def update
|
44
44
|
@data.unserialize_notifications!(:upd,@key)
|
45
|
-
@data.notify('properties/handlers/change', :instance => @data.
|
45
|
+
@data.notify('properties/handlers/change', :instance => @data.instance)
|
46
46
|
end
|
47
47
|
end
|
@@ -17,22 +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', :instance => @data.
|
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.
|
23
|
+
@data.notify('properties/description/change', :instance => @data.instance)
|
24
24
|
nots.uniq.each do |noti|
|
25
25
|
@data.notify(*noti)
|
26
26
|
end
|
27
27
|
when 'endpoints'
|
28
28
|
@data.unserialize_endpoints!
|
29
|
-
@data.notify('properties/endpoints/change', :instance => @data.
|
29
|
+
@data.notify('properties/endpoints/change', :instance => @data.instance)
|
30
30
|
when 'dataelements'
|
31
31
|
@data.unserialize_dataelements!
|
32
|
-
@data.notify('properties/dataelements/change', :instance => @data.
|
32
|
+
@data.notify('properties/dataelements/change', :instance => @data.instance)
|
33
33
|
when 'positions'
|
34
34
|
@data.unserialize_positions!
|
35
|
-
@data.notify('properties/position/change', :instance => @data.
|
35
|
+
@data.notify('properties/position/change', :instance => @data.instance)
|
36
36
|
when 'state'
|
37
37
|
@data.unserialize_state!
|
38
38
|
else
|
@@ -23,7 +23,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
23
23
|
end # }}}
|
24
24
|
|
25
25
|
def activity_handle(passthrough, parameters) # {{{
|
26
|
-
@controller.notify("running/activity_calling", :instance => @controller.
|
26
|
+
@controller.notify("running/activity_calling", :instance => @controller.instance, :activity => @handler_position, :passthrough => passthrough, :endpoint => @handler_endpoint, :parameters => parameters)
|
27
27
|
|
28
28
|
if passthrough.nil?
|
29
29
|
params = []
|
@@ -91,53 +91,53 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
91
91
|
end # }}}
|
92
92
|
|
93
93
|
def inform_activity_done # {{{
|
94
|
-
@controller.notify("running/activity_done", :endpoint => @handler_endpoint, :instance => @controller.
|
94
|
+
@controller.notify("running/activity_done", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position)
|
95
95
|
end # }}}
|
96
96
|
def inform_activity_manipulate # {{{
|
97
|
-
@controller.notify("running/activity_manipulating", :endpoint => @handler_endpoint, :instance => @controller.
|
97
|
+
@controller.notify("running/activity_manipulating", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position)
|
98
98
|
end # }}}
|
99
99
|
def inform_activity_failed(err) # {{{
|
100
100
|
puts err.message
|
101
101
|
puts err.backtrace
|
102
|
-
@controller.notify("running/activity_failed", :endpoint => @handler_endpoint, :instance => @controller.
|
102
|
+
@controller.notify("running/activity_failed", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position, :message => err.message, :line => err.backtrace[0].match(/(.*?):(\d+):/)[2], :where => err.backtrace[0].match(/(.*?):(\d+):/)[1])
|
103
103
|
end # }}}
|
104
104
|
|
105
105
|
def inform_syntax_error(err,code)# {{{
|
106
106
|
puts err.message
|
107
107
|
puts err.backtrace
|
108
|
-
@controller.notify("properties/description/error", :instance => @controller.
|
108
|
+
@controller.notify("properties/description/error", :instance => @controller.instance, :message => err.message)
|
109
109
|
end# }}}
|
110
110
|
def inform_manipulate_change(status,dataelements,endpoints) # {{{
|
111
111
|
unless status.nil?
|
112
112
|
@controller.serialize_status!
|
113
|
-
@controller.notify("properties/status/change", :endpoint => @handler_endpoint, :instance => @controller.
|
113
|
+
@controller.notify("properties/status/change", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position, :id => status.id, :message => status.message)
|
114
114
|
end
|
115
115
|
unless dataelements.nil?
|
116
116
|
@controller.serialize_dataelements!
|
117
|
-
@controller.notify("properties/dataelements/change", :endpoint => @handler_endpoint, :instance => @controller.
|
117
|
+
@controller.notify("properties/dataelements/change", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position, :changed => dataelements)
|
118
118
|
end
|
119
119
|
unless endpoints.nil?
|
120
120
|
@controller.serialize_endpoints!
|
121
|
-
@controller.notify("properties/endpoints/change", :endpoint => @handler_endpoint, :instance => @controller.
|
121
|
+
@controller.notify("properties/endpoints/change", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position, :changed => endpoints)
|
122
122
|
end
|
123
123
|
end # }}}
|
124
124
|
def inform_position_change(ipc={}) # {{{
|
125
125
|
@controller.serialize_positions!
|
126
|
-
ipc[:instance] = @controller.
|
126
|
+
ipc[:instance] = @controller.instance
|
127
127
|
@controller.notify("properties/position/change", ipc)
|
128
128
|
end # }}}
|
129
129
|
def inform_state_change(newstate) # {{{
|
130
130
|
if @controller
|
131
131
|
@controller.serialize_state!
|
132
|
-
@controller.notify("properties/state/change", :instance => @controller.
|
132
|
+
@controller.notify("properties/state/change", :instance => @controller.instance, :state => newstate)
|
133
133
|
end
|
134
134
|
end # }}}
|
135
135
|
|
136
136
|
def vote_sync_after # {{{
|
137
|
-
@controller.call_vote("running/syncing_after", :endpoint => @handler_endpoint, :instance => @controller.
|
137
|
+
@controller.call_vote("running/syncing_after", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position)
|
138
138
|
end # }}}
|
139
139
|
def vote_sync_before(parameters=nil) # {{{
|
140
|
-
@controller.call_vote("running/syncing_before", :endpoint => @handler_endpoint, :instance => @controller.
|
140
|
+
@controller.call_vote("running/syncing_before", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position)
|
141
141
|
end # }}}
|
142
142
|
|
143
143
|
def callback(result)
|
@@ -165,7 +165,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
165
165
|
|
166
166
|
@controller.call_vote("simulating/step",
|
167
167
|
:endpoint => @handler_endpoint,
|
168
|
-
:instance => @controller.
|
168
|
+
:instance => @controller.instance,
|
169
169
|
:activity => tid,
|
170
170
|
:type => type,
|
171
171
|
:nesting => nesting,
|