cpee 2.1.87 → 2.1.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/cpee.gemspec +1 -1
- data/lib/cpee/implementation.rb +41 -32
- data/lib/cpee/message.rb +1 -1
- data/lib/cpee/statemachine.rb +6 -0
- data/server/executionhandlers/eval/controller.rb +1 -1
- data/server/executionhandlers/ruby/controller.rb +1 -1
- data/server/routing/end.pid +1 -0
- data/server/routing/end.rb +1 -1
- data/server/routing/forward-events-00.pid +1 -0
- data/server/routing/forward-events.rb +3 -1
- data/server/routing/forward-votes.pid +1 -0
- data/server/routing/forward-votes.rb +1 -1
- data/server/routing/persist.pid +1 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7826a9cc5914c6a2d2c33e1fbfc64bef917aef446ca899599edaf13dc9c52fdd
|
4
|
+
data.tar.gz: 9c25629356d3c85efe04ce7fd6b1317bfc053465ecd3384fd0d3a2bfc0df6190
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86cc1b6157b1e05dcd6bde0417f15e027e565e032cc4aa9714de25506a3dd3b1dd5802580552ab047c1e776b9f0a8f0286a9935f3a84edea6428720443519db3
|
7
|
+
data.tar.gz: 6b23dd951e896591748d05ff281fa673710d0eb5828c5e93d1fb64e03276092b26bbb49b86840576c91dc658e2bb63352fe8e585d7557b2e315e74c026bbdddb
|
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.91"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.license = "LGPL-3.0-or-later"
|
6
6
|
s.summary = "The cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
|
data/lib/cpee/implementation.rb
CHANGED
@@ -29,29 +29,29 @@ module CPEE
|
|
29
29
|
|
30
30
|
SERVER = File.expand_path(File.join(__dir__,'..','cpee.xml'))
|
31
31
|
PROPERTIES_PATHS_FULL = %w{
|
32
|
-
/p
|
33
|
-
/p
|
34
|
-
/p
|
35
|
-
/p
|
36
|
-
/p
|
37
|
-
/p
|
38
|
-
/p
|
39
|
-
/p
|
40
|
-
/p
|
41
|
-
/p
|
42
|
-
/p
|
43
|
-
/p
|
44
|
-
/p
|
45
|
-
/p
|
46
|
-
/p
|
32
|
+
/p:*/p:executionhandler
|
33
|
+
/p:*/p:positions/p:*
|
34
|
+
/p:*/p:positions/p:*/@*
|
35
|
+
/p:*/p:attributes/p:*
|
36
|
+
/p:*/p:dataelements/p:*
|
37
|
+
/p:*/p:endpoints/p:*
|
38
|
+
/p:*/p:transformation/p:*
|
39
|
+
/p:*/p:transformation/p:*/@*
|
40
|
+
/p:*/p:description
|
41
|
+
/p:*/p:dslx
|
42
|
+
/p:*/p:dsl
|
43
|
+
/p:*/p:status/p:id
|
44
|
+
/p:*/p:status/p:message
|
45
|
+
/p:*/p:state/@changed
|
46
|
+
/p:*/p:state
|
47
47
|
}
|
48
48
|
PROPERTIES_PATHS_INDEX_UNORDERED = %w{
|
49
|
-
/p
|
49
|
+
/p:*/p:positions/p:*
|
50
50
|
}
|
51
51
|
PROPERTIES_PATHS_INDEX_ORDERED = %w{
|
52
|
-
/p
|
53
|
-
/p
|
54
|
-
/p
|
52
|
+
/p:*/p:dataelements/p:*
|
53
|
+
/p:*/p:endpoints/p:*
|
54
|
+
/p:*/p:attributes/p:*
|
55
55
|
}
|
56
56
|
def self::implementation(opts)
|
57
57
|
opts[:see_instances] ||= opts[:see_instances].nil? ? false : opts[:see_instances]
|
@@ -318,7 +318,9 @@ module CPEE
|
|
318
318
|
doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
|
319
319
|
doc.register_namespace 'sub', 'http://riddl.org/ns/common-patterns/notifications-producer/2.0'
|
320
320
|
|
321
|
-
|
321
|
+
name = doc.find('string(/*/p:attributes/p:info)')
|
322
|
+
|
323
|
+
id, uuid = NewInstance::create(opts,redis,name,doc)
|
322
324
|
|
323
325
|
subscriptions = []
|
324
326
|
(doc.find('/*/sub:subscriptions/sub:subscription') rescue []).each do |s|
|
@@ -343,7 +345,13 @@ module CPEE
|
|
343
345
|
CPEE::Persistence::set_handler(id,opts,*sub)
|
344
346
|
end
|
345
347
|
|
346
|
-
|
348
|
+
content = {
|
349
|
+
:state => 'ready',
|
350
|
+
:attributes => CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
351
|
+
}
|
352
|
+
CPEE::Message::send(:event,'state/change',File.join(opts[:url],'/'),id,uuid,name,content,redis)
|
353
|
+
|
354
|
+
CPEE::Properties::Put::change_first(id,opts,doc) # change again, for proper event sending
|
347
355
|
CPEE::Properties::PutState::run(id,opts,'running') if doc.find('string(/*/p:state)') == 'running'
|
348
356
|
|
349
357
|
@headers << Riddl::Header.new("CPEE-INSTANCE", id.to_s)
|
@@ -357,15 +365,15 @@ module CPEE
|
|
357
365
|
class NewInstance < Riddl::Implementation #{{{
|
358
366
|
def self::path(e)
|
359
367
|
ret = []
|
360
|
-
until e.
|
368
|
+
until e.parent.is_a? XML::Smart::Dom
|
361
369
|
ret << (e.class == XML::Smart::Dom::Attribute ? '@' : '') + e.qname.name
|
362
370
|
e = e.parent
|
363
371
|
end
|
364
372
|
File.join(*ret.reverse)
|
365
373
|
end
|
366
374
|
|
367
|
-
def self::create(opts,redis,name)
|
368
|
-
doc = XML::Smart::open_unprotected(opts[:properties_init])
|
375
|
+
def self::create(opts,redis,name,doc=nil)
|
376
|
+
doc = XML::Smart::open_unprotected(opts[:properties_init]) if doc.nil?
|
369
377
|
doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
|
370
378
|
id = CPEE::Persistence::new_object(opts)
|
371
379
|
uuid = SecureRandom.uuid
|
@@ -373,11 +381,12 @@ module CPEE
|
|
373
381
|
redis.multi do |multi|
|
374
382
|
multi.zadd('instances',id,id)
|
375
383
|
doc.root.find(PROPERTIES_PATHS_FULL.join(' | ')).each do |e|
|
384
|
+
p = NewInstance::path(e)
|
376
385
|
if e.class == XML::Smart::Dom::Element && e.element_only?
|
377
386
|
val = e.find('*').map { |f| f.dump }.join
|
378
|
-
multi.set(File.join(instance,
|
387
|
+
multi.set(File.join(instance, p), val)
|
379
388
|
else
|
380
|
-
multi.set(File.join(instance,
|
389
|
+
multi.set(File.join(instance, p), e.text)
|
381
390
|
end
|
382
391
|
end
|
383
392
|
doc.root.find(PROPERTIES_PATHS_INDEX_UNORDERED.join(' | ')).each do |e|
|
@@ -408,13 +417,8 @@ module CPEE
|
|
408
417
|
multi.zadd(File.join(instance, 'attributes'), -1, 'info')
|
409
418
|
multi.set(File.join(instance, 'state', '@changed'), Time.now.xmlschema(3))
|
410
419
|
end
|
411
|
-
content = {
|
412
|
-
:state => 'ready',
|
413
|
-
:attributes => CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
414
|
-
}
|
415
|
-
CPEE::Message::send(:event,'state/change',File.join(opts[:url],'/'),id,uuid,name,content,redis)
|
416
420
|
|
417
|
-
|
421
|
+
[id, uuid]
|
418
422
|
end
|
419
423
|
|
420
424
|
def response
|
@@ -423,6 +427,11 @@ module CPEE
|
|
423
427
|
name = @p[0].value
|
424
428
|
|
425
429
|
id, uuid = NewInstance::create(opts,redis,name)
|
430
|
+
content = {
|
431
|
+
:state => 'ready',
|
432
|
+
:attributes => CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
433
|
+
}
|
434
|
+
CPEE::Message::send(:event,'state/change',File.join(opts[:url],'/'),id,uuid,name,content,redis)
|
426
435
|
|
427
436
|
@headers << Riddl::Header.new("CPEE-INSTANCE", id.to_s)
|
428
437
|
@headers << Riddl::Header.new("CPEE-INSTANCE-URL", File.join(opts[:url].to_s,id.to_s,'/'))
|
data/lib/cpee/message.rb
CHANGED
data/lib/cpee/statemachine.rb
CHANGED
@@ -14,6 +14,12 @@
|
|
14
14
|
|
15
15
|
module CPEE
|
16
16
|
|
17
|
+
class DummyStateMachine
|
18
|
+
def setable?(id,nval); true end
|
19
|
+
def readonly?(id); true end
|
20
|
+
def final?(id); true end
|
21
|
+
end
|
22
|
+
|
17
23
|
class StateMachine
|
18
24
|
def initialize(file,&state)
|
19
25
|
@states = XML::Smart.open_unprotected(file)
|
@@ -63,7 +63,7 @@ class Controller
|
|
63
63
|
if @callback_keys.has_key?(identifier)
|
64
64
|
index = message.index(' ')
|
65
65
|
mess = message[index+1..-1]
|
66
|
-
instance = message[0...index]
|
66
|
+
instance, uuid = message[0...index].split(',')
|
67
67
|
m = JSON.parse(mess)
|
68
68
|
resp = []
|
69
69
|
m['content']['values'].each do |e|
|
@@ -63,7 +63,7 @@ class Controller
|
|
63
63
|
if @callback_keys.has_key?(identifier)
|
64
64
|
index = message.index(' ')
|
65
65
|
mess = message[index+1..-1]
|
66
|
-
instance = message[0...index]
|
66
|
+
instance, uuid = message[0...index].split(',')
|
67
67
|
m = JSON.parse(mess)
|
68
68
|
resp = []
|
69
69
|
m['content']['values'].each do |e|
|
@@ -0,0 +1 @@
|
|
1
|
+
1396178
|
data/server/routing/end.rb
CHANGED
@@ -40,7 +40,7 @@ Daemonite.new do |opts|
|
|
40
40
|
on.pmessage do |pat, what, message|
|
41
41
|
_, worker, key = what.split(':',3)
|
42
42
|
index = message.index(' ')
|
43
|
-
instance = message[0...index]
|
43
|
+
instance, uuid = message[0...index].split(',')
|
44
44
|
opts[:redis].multi do |multi|
|
45
45
|
multi.srem("instance:#{instance}/callbacks",key)
|
46
46
|
multi.del("instance:#{instance}/callback/#{key}/uuid")
|
@@ -0,0 +1 @@
|
|
1
|
+
1396198
|
@@ -45,7 +45,7 @@ Daemonite.new do |opts|
|
|
45
45
|
on.pmessage do |pat, what, message|
|
46
46
|
index = message.index(' ')
|
47
47
|
mess = message[index+1..-1]
|
48
|
-
instance = message[0...index]
|
48
|
+
instance, uuid = message[0...index].split(',')
|
49
49
|
type, worker, event = what.split(':',3)
|
50
50
|
topic = ::File::dirname(event)
|
51
51
|
name = ::File::basename(event)
|
@@ -60,6 +60,8 @@ Daemonite.new do |opts|
|
|
60
60
|
# sadly typhoes does not support ractors
|
61
61
|
Thread.new do
|
62
62
|
Riddl::Client.new(url).post [
|
63
|
+
Riddl::Header.new("CPEE-INSTANCE",instance),
|
64
|
+
Riddl::Header.new("CPEE-INSTANCE-UUID",uuid),
|
63
65
|
Riddl::Parameter::Simple::new('type',type),
|
64
66
|
Riddl::Parameter::Simple::new('topic',topic),
|
65
67
|
Riddl::Parameter::Simple::new('event',name),
|
@@ -0,0 +1 @@
|
|
1
|
+
1396191
|
@@ -66,7 +66,7 @@ Daemonite.new do |opts|
|
|
66
66
|
opts[:pubsubredis].psubscribe('vote:*') do |on|
|
67
67
|
on.pmessage do |pat, what, message|
|
68
68
|
index = message.index(' ')
|
69
|
-
instance = message[0...index]
|
69
|
+
instance, uuid = message[0...index].split(',')
|
70
70
|
mess = message[index+1..-1]
|
71
71
|
|
72
72
|
type, worker, event = what.split(':',3)
|
@@ -0,0 +1 @@
|
|
1
|
+
1396184
|
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: 2.1.
|
4
|
+
version: 2.1.91
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
- Gerhard Stuermer
|
10
10
|
bindir: tools
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: riddl
|
@@ -929,9 +929,13 @@ files:
|
|
929
929
|
- server/resources/states.dot
|
930
930
|
- server/resources/states.xml
|
931
931
|
- server/resources/topics.xml
|
932
|
+
- server/routing/end.pid
|
932
933
|
- server/routing/end.rb
|
934
|
+
- server/routing/forward-events-00.pid
|
933
935
|
- server/routing/forward-events.rb
|
936
|
+
- server/routing/forward-votes.pid
|
934
937
|
- server/routing/forward-votes.rb
|
938
|
+
- server/routing/persist.pid
|
935
939
|
- server/routing/persist.rb
|
936
940
|
- server/server.pid
|
937
941
|
- tools/cpee
|
@@ -957,7 +961,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
957
961
|
- !ruby/object:Gem::Version
|
958
962
|
version: '0'
|
959
963
|
requirements: []
|
960
|
-
rubygems_version: 3.6.
|
964
|
+
rubygems_version: 3.6.7
|
961
965
|
specification_version: 4
|
962
966
|
summary: The cloud process execution engine (cpee.org). If you just need workflow
|
963
967
|
execution, without a rest service exposing it, then use WEEL.
|