cpee-worklist 1.0.15 → 1.0.16
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 +19 -8
- 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 +6 -3
- data/ui/structured.html +9 -0
- metadata +3 -7
- 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: b6a55694476f53122fb39aa05551f55b84e14f5c622b0ef1d935215cf69c8f06
|
4
|
+
data.tar.gz: 81b84ac33a7b8bb4fa581641a08c118caeffed34037732f21a522f79d98ccfc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f057175e245d17e490347ff2b0b931c909b891b86382daf4accd13fe9a7f352827d856db405fd8ce8e776ee7f17fffd5c5e28127e00879a0c0dcbf117676900
|
7
|
+
data.tar.gz: 6cbb6ba01ea9eb928c71f973bfdd687c5eb560c566ae826d2720c9b0ef008e786884dead4547000c2bb7e797c696d656966ac2561899113974769e3fb738835a
|
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(', ') || ''
|
@@ -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,13 @@ function do_work(taskid,taskidurl) { //{{{
|
|
367
369
|
var form_data = $(this).serializeArray();
|
368
370
|
var send_data = {};
|
369
371
|
var headers = {};
|
370
|
-
|
372
|
+
console.log(res);
|
373
|
+
if (res.collect || res.always) { headers['CPEE-UPDATE'] = 'true'; }
|
371
374
|
send_data['user'] = $("input[name=user-name]").val();
|
372
375
|
send_data['raw'] = form_data;
|
373
376
|
send_data['data'] = {};
|
374
377
|
$.map(send_data['raw'], function(n, i){
|
375
|
-
|
378
|
+
send_data['data'][n['name']] = n['value'];
|
376
379
|
});
|
377
380
|
$.ajax({
|
378
381
|
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,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.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: tools
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2025-04-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: riddl
|
@@ -98,13 +98,9 @@ files:
|
|
98
98
|
- lib/cpee-worklist/implementation.rb
|
99
99
|
- lib/cpee-worklist/implementation.xml
|
100
100
|
- lib/cpee-worklist/organisation.rng
|
101
|
-
- lib/cpee-worklist/routing/end.pid
|
102
101
|
- lib/cpee-worklist/routing/end.rb
|
103
|
-
- lib/cpee-worklist/routing/forward-events.pid
|
104
102
|
- lib/cpee-worklist/routing/forward-events.rb
|
105
|
-
- lib/cpee-worklist/routing/forward-votes.pid
|
106
103
|
- lib/cpee-worklist/routing/forward-votes.rb
|
107
|
-
- lib/cpee-worklist/routing/persist.pid
|
108
104
|
- lib/cpee-worklist/routing/persist.rb
|
109
105
|
- lib/cpee-worklist/topics.xml
|
110
106
|
- lib/cpee-worklist/user.rb
|
@@ -141,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
137
|
- !ruby/object:Gem::Version
|
142
138
|
version: '0'
|
143
139
|
requirements: []
|
144
|
-
rubygems_version: 3.5.
|
140
|
+
rubygems_version: 3.5.22
|
145
141
|
signing_key:
|
146
142
|
specification_version: 4
|
147
143
|
summary: Worklist for the cloud process execution engine (cpee.org)
|
@@ -1 +0,0 @@
|
|
1
|
-
551411
|
@@ -1 +0,0 @@
|
|
1
|
-
551417
|
@@ -1 +0,0 @@
|
|
1
|
-
551423
|
@@ -1 +0,0 @@
|
|
1
|
-
551429
|