cpee-worklist 1.0.15 → 1.0.17
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 +1 -1
- data/lib/cpee-worklist/implementation.rb +20 -9
- data/lib/cpee-worklist/wlengine.xml +13 -5
- data/ui/direct.html +9 -0
- data/ui/index.html +9 -0
- data/ui/js/structured.js +5 -3
- data/ui/structured.html +9 -0
- metadata +3 -10
- data/lib/cpee-worklist/routing/end.pid +0 -1
- data/lib/cpee-worklist/routing/forward-events.pid +0 -1
- data/lib/cpee-worklist/routing/forward-votes.pid +0 -1
- data/lib/cpee-worklist/routing/persist.pid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bf102e677abb150275c9f4b01ce89eb120053ba7d3dd49e5b8f76f5a97fdee8
|
4
|
+
data.tar.gz: cec0662273259461355d533c9d3a5a15976369adf30fd6817f40b7d01e2141fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 471180152239ec324890cfd1a8175c1400f2ec132c509070ea698a4f1ef0d4ffcadc0c692c1d223dc32652d6d82ccfce0a0c77807ef499ea21a98cf4fd37e215
|
7
|
+
data.tar.gz: 5cfdf1e5abac3546f527526ee21d42c796b4db1576c78f6922baf7e69da4188d0e47316c037745ccee9dd1c4446cdbafdf6df997a74449354ed093b3a8770924
|
data/cpee-worklist.gemspec
CHANGED
@@ -81,6 +81,12 @@ module CPEE
|
|
81
81
|
activity['unit'] = @p.first.name == 'unit' ? @p.shift.value : '*'
|
82
82
|
activity['role'] = @p.first.name == 'role' ? @p.shift.value : '*'
|
83
83
|
activity['priority'] = @p.first.name == 'priority' ? @p.shift.value.to_i : 1
|
84
|
+
activity['handling'] = @p.first.name == 'handling' ? @p.shift.value : 'single'
|
85
|
+
|
86
|
+
unless %w{single collect always}.include?(activity['handling'])
|
87
|
+
activity['handling'] == 'single'
|
88
|
+
end
|
89
|
+
|
84
90
|
activity['collect'] = @p.first.name == 'collect' ? @p.shift.value.to_i : nil
|
85
91
|
activity['deadline'] = @p.first.name == 'deadline' ? ((Time.now + ChronicDuration.parse(@p.shift.value)) rescue nil): nil
|
86
92
|
activity['restrictions'] = []
|
@@ -152,18 +158,21 @@ module CPEE
|
|
152
158
|
class TaskDel < Riddl::Implementation #{{{
|
153
159
|
def response
|
154
160
|
index = @a[0].activities.index{ |e| e["id"] == @r.last }
|
161
|
+
force = @a[1]
|
155
162
|
if index
|
156
163
|
activity = @a[0].activities[index]
|
157
|
-
if activity['collected'] && (activity['collected'] + 1) < activity['collect_max']
|
164
|
+
if !force && activity['collected'] && (activity['collected'] + 1) < activity['collect_max']
|
158
165
|
activity['collected'] += 1
|
159
166
|
activity['restrictions'] << { "restriction" => { "mode" => "prohibit", "id" => @r[-3] } }
|
160
167
|
@a[0].activities.serialize
|
161
|
-
@a[0].notify('user/finish', :callback_id => activity['id'], :user => @r[-3], :role => activity['role']
|
168
|
+
@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
|
+
elsif !force && activity['handling'] == 'always'
|
170
|
+
@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'])
|
162
171
|
else
|
163
172
|
activity = @a[0].activities.delete_at(index)
|
164
173
|
@a[0].activities.serialize
|
165
174
|
if @r.length == 3
|
166
|
-
@a[0].notify('task/delete', :callback_id => activity['id'],
|
175
|
+
@a[0].notify('task/delete', :callback_id => activity['id'], :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'])
|
167
176
|
Riddl::Client.new(activity['url']).put
|
168
177
|
else
|
169
178
|
info = CPEE::Worklist::User::info(@a[0].opts,activity,@r[-3])
|
@@ -237,11 +246,13 @@ module CPEE
|
|
237
246
|
activity['unit'] == '*' ||
|
238
247
|
activity['unit'].casecmp(rel.attributes['unit']) == 0
|
239
248
|
) && (
|
240
|
-
activity['
|
249
|
+
activity['handling'] == 'collect' ||
|
250
|
+
activity['handling'] == 'always' ||
|
241
251
|
activity['user'].empty? ||
|
242
252
|
activity['user'].include?(@r[-2])
|
243
|
-
)
|
244
|
-
|
253
|
+
)
|
254
|
+
!restrict
|
255
|
+
tasks["#{activity['id']}"] = { :always => activity['handling'] == 'always', :all => activity.has_key?('collect') && !activity['collect'].nil?, :uid => @r[-2], :priority => activity['priority'], :label => activity['process'] + ': ' + activity['label'] }
|
245
256
|
tasks["#{activity['id']}"][:own] = activity['user'].include?(@r[-2])
|
246
257
|
tasks["#{activity['id']}"][:deadline] = activity['deadline'] if activity['deadline']
|
247
258
|
tasks["#{activity['id']}"][:prioritization] = activity['prioritization']&.join(', ') || ''
|
@@ -265,7 +276,7 @@ module CPEE
|
|
265
276
|
index = @a[0].activities.index{ |c| c["id"] == @r.last }
|
266
277
|
if index
|
267
278
|
activity = @a[0].activities[index]
|
268
|
-
activity['user'].push @r[-3]if CPEE::Worklist::User::ok?(@a[0].opts,activity,@r[-3]) && !activity['user'].include?(@r[-3])
|
279
|
+
activity['user'].push @r[-3] if CPEE::Worklist::User::ok?(@a[0].opts,activity,@r[-3]) && !activity['user'].include?(@r[-3])
|
269
280
|
info = CPEE::Worklist::User::info(@a[0].opts,activity,@r[-3])
|
270
281
|
@a[0].activities.serialize
|
271
282
|
@a[0].notify('user/take', :user => @r[-3], :callback_id => activity['id'], :cpee_callback => activity['url'], :cpee_instance => activity['cpee_instance'],:instance_uuid => activity['uuid'], :cpee_base => activity['cpee_base'], :cpee_label => activity['label'], :cpee_activity => activity['cpee_activity_id'], :orgmodel => activity['orgmodel'], :organisation => info)
|
@@ -307,7 +318,7 @@ module CPEE
|
|
307
318
|
def response
|
308
319
|
index = @a[0].activities.index{ |c| c["id"] == @r.last }
|
309
320
|
if index
|
310
|
-
Riddl::Parameter::Complex.new "data","application/json", JSON.generate({:collect => @a[0].activities[index].has_key?('collect') && !@a[0].activities[index]['collect'].nil?, 'url' => @a[0].activities[index]['url'], 'form' => @a[0].activities[index]['form'], 'parameters' => @a[0].activities[index]['parameters'], 'label' => @a[0].activities[index]['label']})
|
321
|
+
Riddl::Parameter::Complex.new "data","application/json", JSON.generate({:always => @a[0].activities[index]['handling'] == 'always' ? true : false, :collect => @a[0].activities[index].has_key?('collect') && !@a[0].activities[index]['collect'].nil?, 'url' => @a[0].activities[index]['url'], 'form' => @a[0].activities[index]['form'], 'parameters' => @a[0].activities[index]['parameters'], 'label' => @a[0].activities[index]['label']})
|
311
322
|
else
|
312
323
|
@status = 404
|
313
324
|
end
|
@@ -419,7 +430,7 @@ module CPEE
|
|
419
430
|
on resource 'tasks' do
|
420
431
|
on resource do
|
421
432
|
run AssignTask,controller if put 'uid'
|
422
|
-
run TaskDel,controller if delete
|
433
|
+
run TaskDel,controller,true if delete
|
423
434
|
end
|
424
435
|
end
|
425
436
|
on resource do
|
@@ -28,9 +28,14 @@
|
|
28
28
|
<parameter name="role" type="string"/>
|
29
29
|
</group>
|
30
30
|
</choice>
|
31
|
-
<
|
32
|
-
|
33
|
-
|
31
|
+
<parameter name="priority" type="positiveInteger"/>
|
32
|
+
<parameter name="handling" type="string">
|
33
|
+
<choice>
|
34
|
+
<value>single</value>
|
35
|
+
<value>collect</value>
|
36
|
+
<value>always</value>
|
37
|
+
</choice>
|
38
|
+
</parameter>
|
34
39
|
<optional>
|
35
40
|
<parameter name="collect" type="nonNegativeInteger"/>
|
36
41
|
</optional>
|
@@ -64,7 +69,7 @@
|
|
64
69
|
</message>
|
65
70
|
|
66
71
|
<message name="tasks">
|
67
|
-
<parameter name="tasks" mimetype="
|
72
|
+
<parameter name="tasks" mimetype="*/xml" handler="http://riddl.org/ns/handlers/relaxng">
|
68
73
|
<element name="tasks" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0">
|
69
74
|
<zeroOrMore>
|
70
75
|
<element name="task">
|
@@ -92,6 +97,9 @@
|
|
92
97
|
<attribute name="orgmodel">
|
93
98
|
<data type="string"/>
|
94
99
|
</attribute>
|
100
|
+
<element name="process">
|
101
|
+
<data type="string"/>
|
102
|
+
</element>
|
95
103
|
<element name="label">
|
96
104
|
<data type="string"/>
|
97
105
|
</element>
|
@@ -101,7 +109,7 @@
|
|
101
109
|
<element name="unit">
|
102
110
|
<data type="string"/>
|
103
111
|
</element>
|
104
|
-
<
|
112
|
+
<zeroOrMore>
|
105
113
|
<element name="user">
|
106
114
|
<attribute name="uid">
|
107
115
|
<data type="string"/>
|
data/ui/direct.html
CHANGED
@@ -73,6 +73,15 @@
|
|
73
73
|
<td class='deadline filler'><em>(until <span></span></em>)</td>
|
74
74
|
</tr>
|
75
75
|
</template> <!--}}}-->
|
76
|
+
<template id="dat_template_tasks_always"> <!--{{{-->
|
77
|
+
<tr class="task">
|
78
|
+
<td class='name'></td>
|
79
|
+
<td class='buttons'>
|
80
|
+
<button class='task_do task_continue' value=''>Do it!</button>
|
81
|
+
</td>
|
82
|
+
<td class='filler'></td>
|
83
|
+
</tr>
|
84
|
+
</template> <!--}}}-->
|
76
85
|
<template id="dat_template_orgmodels"> <!--{{{-->
|
77
86
|
<li class="orgmodel"><a class='link' href=""></a> ⇒ [<a class='model' href="">View Model</a>]</li>
|
78
87
|
</template> <!--}}}-->
|
data/ui/index.html
CHANGED
@@ -72,6 +72,15 @@
|
|
72
72
|
<td class='deadline filler'><em>(until <span></span></em>)</td>
|
73
73
|
</tr>
|
74
74
|
</template> <!--}}}-->
|
75
|
+
<template id="dat_template_tasks_always"> <!--{{{-->
|
76
|
+
<tr class="task">
|
77
|
+
<td class='name'></td>
|
78
|
+
<td class='buttons'>
|
79
|
+
<button class='task_do task_continue' value=''>Do it!</button>
|
80
|
+
</td>
|
81
|
+
<td class='filler'></td>
|
82
|
+
</tr>
|
83
|
+
</template> <!--}}}-->
|
75
84
|
<template id="dat_template_orgmodels"> <!--{{{-->
|
76
85
|
<li class="orgmodel"><a class='link' href=""></a> ⇒ [<a class='model' href="">View Model</a>]</li>
|
77
86
|
</template> <!--}}}-->
|
data/ui/js/structured.js
CHANGED
@@ -210,6 +210,8 @@ function get_worklist() {// {{{
|
|
210
210
|
if ($(this).attr('all') == "true") {
|
211
211
|
var node = $($("#dat_template_tasks_multi")[0].content.cloneNode(true));
|
212
212
|
$('.deadline span',node).text($(this).attr('deadline'));
|
213
|
+
} else if ($(this).attr('always') == "true") {
|
214
|
+
var node = $($("#dat_template_tasks_always")[0].content.cloneNode(true));
|
213
215
|
} else {
|
214
216
|
var node = $($("#dat_template_tasks_single")[0].content.cloneNode(true));
|
215
217
|
}
|
@@ -248,7 +250,7 @@ function get_worklist() {// {{{
|
|
248
250
|
$('#detailcolumn iframe').attr('src',$(this).attr('label_extension_details'));
|
249
251
|
});
|
250
252
|
}
|
251
|
-
place_worklist_item(node.find('tr'),$(this).attr('own'));
|
253
|
+
place_worklist_item(node.find('tr'),$(this).attr('own') == 'true' || $(this).attr('always') == 'true' ? 'true' : 'false');
|
252
254
|
});
|
253
255
|
toggle_message();
|
254
256
|
},
|
@@ -367,12 +369,12 @@ function do_work(taskid,taskidurl) { //{{{
|
|
367
369
|
var form_data = $(this).serializeArray();
|
368
370
|
var send_data = {};
|
369
371
|
var headers = {};
|
370
|
-
if (res.collect) { headers['CPEE-UPDATE'] = 'true'; }
|
372
|
+
if (res.collect || res.always) { headers['CPEE-UPDATE'] = 'true'; }
|
371
373
|
send_data['user'] = $("input[name=user-name]").val();
|
372
374
|
send_data['raw'] = form_data;
|
373
375
|
send_data['data'] = {};
|
374
376
|
$.map(send_data['raw'], function(n, i){
|
375
|
-
|
377
|
+
send_data['data'][n['name']] = n['value'];
|
376
378
|
});
|
377
379
|
$.ajax({
|
378
380
|
type: "PUT",
|
data/ui/structured.html
CHANGED
@@ -72,6 +72,15 @@
|
|
72
72
|
<td class='deadline filler'><em>(until <span></span></em>)</td>
|
73
73
|
</tr>
|
74
74
|
</template> <!--}}}-->
|
75
|
+
<template id="dat_template_tasks_always"> <!--{{{-->
|
76
|
+
<tr class="task">
|
77
|
+
<td class='name'></td>
|
78
|
+
<td class='buttons'>
|
79
|
+
<button class='task_do task_continue' value=''>Do it!</button>
|
80
|
+
</td>
|
81
|
+
<td class='filler'></td>
|
82
|
+
</tr>
|
83
|
+
</template> <!--}}}-->
|
75
84
|
<template id="dat_template_orgmodels"> <!--{{{-->
|
76
85
|
<li class="orgmodel"><a class='link' href=""></a> ⇒ [<a class='model' href="">View Model</a>]</li>
|
77
86
|
</template> <!--}}}-->
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
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.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
8
8
|
- Florian Stertz
|
9
9
|
- Patrik Koenig
|
10
|
-
autorequire:
|
11
10
|
bindir: tools
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2025-04-17 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: riddl
|
@@ -98,13 +97,9 @@ files:
|
|
98
97
|
- lib/cpee-worklist/implementation.rb
|
99
98
|
- lib/cpee-worklist/implementation.xml
|
100
99
|
- lib/cpee-worklist/organisation.rng
|
101
|
-
- lib/cpee-worklist/routing/end.pid
|
102
100
|
- lib/cpee-worklist/routing/end.rb
|
103
|
-
- lib/cpee-worklist/routing/forward-events.pid
|
104
101
|
- lib/cpee-worklist/routing/forward-events.rb
|
105
|
-
- lib/cpee-worklist/routing/forward-votes.pid
|
106
102
|
- lib/cpee-worklist/routing/forward-votes.rb
|
107
|
-
- lib/cpee-worklist/routing/persist.pid
|
108
103
|
- lib/cpee-worklist/routing/persist.rb
|
109
104
|
- lib/cpee-worklist/topics.xml
|
110
105
|
- lib/cpee-worklist/user.rb
|
@@ -126,7 +121,6 @@ homepage: http://cpee.org/
|
|
126
121
|
licenses:
|
127
122
|
- LGPL-3.0-or-later
|
128
123
|
metadata: {}
|
129
|
-
post_install_message:
|
130
124
|
rdoc_options: []
|
131
125
|
require_paths:
|
132
126
|
- lib
|
@@ -141,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
135
|
- !ruby/object:Gem::Version
|
142
136
|
version: '0'
|
143
137
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
145
|
-
signing_key:
|
138
|
+
rubygems_version: 3.6.2
|
146
139
|
specification_version: 4
|
147
140
|
summary: Worklist for the cloud process execution engine (cpee.org)
|
148
141
|
test_files: []
|
@@ -1 +0,0 @@
|
|
1
|
-
551411
|
@@ -1 +0,0 @@
|
|
1
|
-
551417
|
@@ -1 +0,0 @@
|
|
1
|
-
551423
|
@@ -1 +0,0 @@
|
|
1
|
-
551429
|