cpee-worklist 1.0.18 → 1.0.20
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-worklist.gemspec +2 -2
- data/lib/cpee-worklist/implementation.rb +10 -7
- data/lib/cpee-worklist/routing/end.rb +1 -1
- data/lib/cpee-worklist/routing/forward-events.rb +1 -1
- data/lib/cpee-worklist/routing/forward-votes.rb +1 -1
- data/tools/cpee-worklist +14 -0
- data/ui/container.html +45 -0
- data/ui/js/structured.js +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5f6fef7844b1068dc25aedad2ad96649e3821e68e8056a385ed7ff752f53071c
|
|
4
|
+
data.tar.gz: ec643d4a0e368d4e584aebf23352b38c23b71481965c07064cbc7bd0db67ca42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9fda76f7240d70935a5f8e7066d083dfbf4658e89b68772c268e86cc1ce5b6dd2b0f0ca620d8905a746be30e922fdccf331adbeb16eb7637720245dd4671d38e
|
|
7
|
+
data.tar.gz: 33ad966f1cc9302ed2f84dac3d5ffa485b971b56c4f7a53974c04500271e25faa19b0c977c21a207977861c46d3fd6f34de534ac1e0b6ddbdf9a42539cdefc48
|
data/cpee-worklist.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = "cpee-worklist"
|
|
3
|
-
s.version = "1.0.
|
|
3
|
+
s.version = "1.0.20"
|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
|
5
5
|
s.license = "LGPL-3.0-or-later"
|
|
6
6
|
s.summary = "Worklist for the cloud process execution engine (cpee.org)"
|
|
@@ -22,6 +22,6 @@ Gem::Specification.new do |s|
|
|
|
22
22
|
|
|
23
23
|
s.add_runtime_dependency 'riddl', '~> 1.0'
|
|
24
24
|
s.add_runtime_dependency 'json', '~> 2.1'
|
|
25
|
-
s.add_runtime_dependency 'cpee', '~> 2.1', '>= 2.1.
|
|
25
|
+
s.add_runtime_dependency 'cpee', '~> 2.1', '>= 2.1.88'
|
|
26
26
|
s.add_runtime_dependency 'chronic_duration', '~> 0.10', '>= 0.10.6'
|
|
27
27
|
end
|
|
@@ -25,6 +25,7 @@ require 'riddl/utils/fileserve'
|
|
|
25
25
|
require 'cpee/redis'
|
|
26
26
|
require 'cpee/message'
|
|
27
27
|
require 'cpee/persistence'
|
|
28
|
+
require 'cpee/statemachine'
|
|
28
29
|
require 'cpee/attributes_helper'
|
|
29
30
|
require 'cpee/implementation_notifications'
|
|
30
31
|
require 'cpee/implementation_callbacks'
|
|
@@ -91,7 +92,7 @@ module CPEE
|
|
|
91
92
|
activity['deadline'] = @p.first.name == 'deadline' ? ((Time.now + ChronicDuration.parse(@p.shift.value)) rescue nil): nil
|
|
92
93
|
activity['restrictions'] = []
|
|
93
94
|
rests = JSON::parse(@p.shift.value) rescue nil
|
|
94
|
-
activity['restrictions']
|
|
95
|
+
activity['restrictions'] += rests unless rests.nil?
|
|
95
96
|
if @p.first.name == 'prioritization'
|
|
96
97
|
val = @p.shift.value
|
|
97
98
|
activity['prioritization'] = (JSON::parse(val) rescue val.gsub(/[\[\]()<>"']/,'').split(/\s*[,;]\s*/))
|
|
@@ -163,7 +164,7 @@ module CPEE
|
|
|
163
164
|
activity = @a[0].activities[index]
|
|
164
165
|
if !force && activity['collected'] && (activity['collected'] + 1) < activity['collect_max']
|
|
165
166
|
activity['collected'] += 1
|
|
166
|
-
activity['restrictions'] << { "
|
|
167
|
+
activity['restrictions'] << { "mode" => "prohibit", "id" => @r[-3] }
|
|
167
168
|
@a[0].activities.serialize
|
|
168
169
|
@a[0].notify('user/finish', :callback_id => activity['id'], :user => @r[-3], :role => activity['role'], :instance_uuid => activity['uuid'], :cpee_callback => activity['url'], :cpee_instance => activity['cpee_instance'], :cpee_base => activity['cpee_base'], :cpee_label => activity['label'], :cpee_activity => activity['cpee_activity_id'], :orgmodel => activity['orgmodel'])
|
|
169
170
|
elsif !force && activity['handling'] == 'always'
|
|
@@ -237,7 +238,8 @@ module CPEE
|
|
|
237
238
|
@a[0].activities.each do |activity|
|
|
238
239
|
restrict = false
|
|
239
240
|
activity['restrictions'].each do |restriction|
|
|
240
|
-
|
|
241
|
+
restriction = restriction[0] if restriction.is_a? Array
|
|
242
|
+
restrict = true if restriction['mode'] == 'prohibit' && restriction['id'] == @r[-2]
|
|
241
243
|
end
|
|
242
244
|
if (
|
|
243
245
|
activity['role']=='*' ||
|
|
@@ -366,11 +368,10 @@ module CPEE
|
|
|
366
368
|
|
|
367
369
|
### set redis_cmd to nil if you want to do global
|
|
368
370
|
### at least redis_path or redis_url and redis_db have to be set if you do global
|
|
369
|
-
opts[:redis_path] ||= 'redis.sock' # use e.g. /tmp/redis.sock for global stuff. Look it up in your redis config
|
|
370
371
|
opts[:redis_db] ||= 0
|
|
371
|
-
|
|
372
|
-
opts[:
|
|
373
|
-
opts[:redis_cmd] ||= 'redis-server --port
|
|
372
|
+
opts[:redis_url] ||= 'unix://redis.sock' # sadly we have to do this for now
|
|
373
|
+
opts[:redis_unixsocket] ||= true
|
|
374
|
+
opts[:redis_cmd] ||= 'redis-server --port #redis_port# --unixsocket #redis_path# --unixsocketperm 600 --pidfile #redis_pid# --dir #redis_db_dir# --dbfilename #redis_db_name# --databases 1 --save 900 1 --save 300 10 --save 60 10000 --rdbcompression yes --daemonize yes --protected-mode no'
|
|
374
375
|
opts[:redis_pid] ||= 'redis.pid' # use e.g. /var/run/redis.pid if you do global. Look it up in your redis config
|
|
375
376
|
opts[:redis_db_name] ||= 'redis.rdb' # use e.g. /var/lib/redis.rdb for global stuff. Look it up in your redis config
|
|
376
377
|
|
|
@@ -381,6 +382,8 @@ module CPEE
|
|
|
381
382
|
opts[:sse_keepalive_frequency] ||= 10
|
|
382
383
|
opts[:sse_connections] = {}
|
|
383
384
|
|
|
385
|
+
opts[:statemachine] = CPEE::DummyStateMachine.new
|
|
386
|
+
|
|
384
387
|
opts[:finalize_frequency] ||= 10
|
|
385
388
|
|
|
386
389
|
CPEE::Message::set_workers(1)
|
|
@@ -41,7 +41,7 @@ Daemonite.new do |opts|
|
|
|
41
41
|
on.pmessage do |pat, what, message|
|
|
42
42
|
_, worker, key = what.split(':',3)
|
|
43
43
|
index = message.index(' ')
|
|
44
|
-
instance = message[0...index]
|
|
44
|
+
instance, uuid = message[0...index].split(',')
|
|
45
45
|
opts[:redis].multi do |multi|
|
|
46
46
|
multi.srem("worklist:#{instance}/callbacks",key)
|
|
47
47
|
multi.del("worklist:#{instance}/callback/#{key}/uuid")
|
|
@@ -41,7 +41,7 @@ Daemonite.new do |opts|
|
|
|
41
41
|
on.pmessage do |pat, what, message|
|
|
42
42
|
index = message.index(' ')
|
|
43
43
|
mess = message[index+1..-1]
|
|
44
|
-
instance = message[0...index]
|
|
44
|
+
instance, uuid = message[0...index].split(',')
|
|
45
45
|
type, worker, event = what.split(':',3)
|
|
46
46
|
topic = ::File::dirname(event)
|
|
47
47
|
name = ::File::basename(event)
|
|
@@ -67,7 +67,7 @@ Daemonite.new do |opts|
|
|
|
67
67
|
on.pmessage do |pat, what, message|
|
|
68
68
|
index = message.index(' ')
|
|
69
69
|
mess = message[index+1..-1]
|
|
70
|
-
instance = message[0...index]
|
|
70
|
+
instance, uuid = message[0...index].split(',')
|
|
71
71
|
type, worker, event = what.split(':',3)
|
|
72
72
|
topic = ::File::dirname(event)
|
|
73
73
|
name = ::File::basename(event)
|
data/tools/cpee-worklist
CHANGED
|
@@ -101,6 +101,20 @@ elsif command == 'filter'
|
|
|
101
101
|
puts "#{ele.attributes['callback_id']}; #{ele.attributes['cpee_label']}; #{ele.attributes['cpee_instance']}"
|
|
102
102
|
end
|
|
103
103
|
end
|
|
104
|
+
elsif command == 'delete_f'
|
|
105
|
+
if p1 !~ /^http/ || ARGV[2] !~ /^\w+=/
|
|
106
|
+
puts ARGV.options
|
|
107
|
+
exit
|
|
108
|
+
end
|
|
109
|
+
wl = File.join(p1,'/')
|
|
110
|
+
res = Typhoeus.get(wl)
|
|
111
|
+
pname, pkey = ARGV[2].split('=',2)
|
|
112
|
+
if res.success?
|
|
113
|
+
doc = XML::Smart.string(res.body)
|
|
114
|
+
doc.find("/tasks/task[@#{pname}=\"#{pkey}\"]").each do |ele|
|
|
115
|
+
Typhoeus.delete File.join(wl,'tasks',ele.attributes['callback_id'])
|
|
116
|
+
end
|
|
117
|
+
end
|
|
104
118
|
elsif command == 'filter_a'
|
|
105
119
|
if p1 !~ /^http/
|
|
106
120
|
puts ARGV.options
|
data/ui/container.html
CHANGED
|
@@ -35,6 +35,51 @@
|
|
|
35
35
|
<script type="text/javascript" src="/js_libs/jquery.cookie.js"></script>
|
|
36
36
|
<script type="text/javascript" src="/js_libs/marked.min.js"></script>
|
|
37
37
|
|
|
38
|
+
<script>
|
|
39
|
+
function load_script(src) {
|
|
40
|
+
// Initialize scripts queue
|
|
41
|
+
if (load_script.scripts === undefined) {
|
|
42
|
+
load_script.scripts = [];
|
|
43
|
+
load_script.index = -1;
|
|
44
|
+
load_script.loading = false;
|
|
45
|
+
load_script.next = function() {
|
|
46
|
+
if (load_script.loading) return;
|
|
47
|
+
|
|
48
|
+
// Load the next queue item
|
|
49
|
+
load_script.loading = true;
|
|
50
|
+
var item = load_script.scripts[++load_script.index];
|
|
51
|
+
var head = document.getElementsByTagName('head')[0];
|
|
52
|
+
var script = document.createElement('script');
|
|
53
|
+
script.type = 'text/javascript';
|
|
54
|
+
script.src = item.src;
|
|
55
|
+
// When complete, start next item in queue and resolve this item's promise
|
|
56
|
+
script.onload = () => {
|
|
57
|
+
load_script.loading = false;
|
|
58
|
+
if( load_script.index < load_script.scripts.length - 1 ) load_script.next();
|
|
59
|
+
item.resolve();
|
|
60
|
+
};
|
|
61
|
+
head.appendChild(script);
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// Adding a script to the queue
|
|
66
|
+
if (src) {
|
|
67
|
+
// Check if already added
|
|
68
|
+
for (var i=0; i < load_script.scripts.length; i++) {
|
|
69
|
+
if( load_script.scripts[i].src == src ) return load_script.scripts[i].promise;
|
|
70
|
+
}
|
|
71
|
+
// Add to the queue
|
|
72
|
+
var item = { src: src };
|
|
73
|
+
item.promise = new Promise(resolve => {item.resolve = resolve;});
|
|
74
|
+
load_script.scripts.push(item);
|
|
75
|
+
load_script.next();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Return the promise of the last queue item
|
|
79
|
+
return load_script.scripts[ load_script.scripts.length - 1 ].promise;
|
|
80
|
+
};
|
|
81
|
+
</script>
|
|
82
|
+
|
|
38
83
|
<link rel="stylesheet" href="css/container.css" type="text/css"/>
|
|
39
84
|
</head>
|
|
40
85
|
<body is='x-ui-'></body>
|
data/ui/js/structured.js
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cpee-worklist
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juergen eTM Mangler
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
- Nataliia Klievtsova
|
|
11
11
|
bindir: tools
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: riddl
|
|
@@ -49,7 +49,7 @@ dependencies:
|
|
|
49
49
|
version: '2.1'
|
|
50
50
|
- - ">="
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
|
-
version: 2.1.
|
|
52
|
+
version: 2.1.88
|
|
53
53
|
type: :runtime
|
|
54
54
|
prerelease: false
|
|
55
55
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -59,7 +59,7 @@ dependencies:
|
|
|
59
59
|
version: '2.1'
|
|
60
60
|
- - ">="
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: 2.1.
|
|
62
|
+
version: 2.1.88
|
|
63
63
|
- !ruby/object:Gem::Dependency
|
|
64
64
|
name: chronic_duration
|
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
136
136
|
- !ruby/object:Gem::Version
|
|
137
137
|
version: '0'
|
|
138
138
|
requirements: []
|
|
139
|
-
rubygems_version: 3.6.
|
|
139
|
+
rubygems_version: 3.6.9
|
|
140
140
|
specification_version: 4
|
|
141
141
|
summary: Worklist for the cloud process execution engine (cpee.org)
|
|
142
142
|
test_files: []
|