cpee-worklist 1.0.27 → 1.0.28

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78e489c5b9551ca63b031a1ef66dfc69270fd6ac32350acd48b37dac76672b1e
4
- data.tar.gz: 2a5b03b7532de707398700fedee13bbec60a976b9d2dfc9bd51de95812f6f019
3
+ metadata.gz: e8b2b7a12342dc0dceace797ea405aed10b1acca8cf83e863ef17c67716a16e1
4
+ data.tar.gz: db6fc08885a67c25a467f102a0798c8d0489a5e61e5978daaf92ec0f0124457d
5
5
  SHA512:
6
- metadata.gz: 027e27bb80a52a867d7bf156c320a30694a0751d142e6c7bba0146c7f9677de77c9a9f2af491c1722a78eb00e00e590906aee877eec6883d7417c95cab8661dc
7
- data.tar.gz: 24393ea839c5cbe173e5ace1d2030a6620a57925805b2edf30144d3443e267df5b3e04c346659cc03798a0ba8a3257e24bff366d2de9ca3a9d5df56e82229496
6
+ metadata.gz: 221fdccb019d35aa6454fad43aedbb251b013d69188d64d0625ece424b136752bc3bdb3685b69fe4b9b2ea5bfd776a5afec989fb7e579fb319ece70f2ad7ef57
7
+ data.tar.gz: bd670cba382e980c1bc650c59a8f2f11af5b24e9810173f897ce9581b876379cca8360eb9d42f897855cb40d6767b0d18f52b1b53259d697b6eb3c5fbe3a62ab
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-worklist"
3
- s.version = "1.0.27"
3
+ s.version = "1.0.28"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "GPL-3.0-or-later"
6
6
  s.summary = "Worklist for the cloud process execution engine (cpee.org)"
@@ -375,7 +375,8 @@ module CPEE
375
375
  opts[:ORG_SCHEMA] = ::File.join(__dir__, 'organisation.rng')
376
376
  opts[:topics] = ::File.join(__dir__, 'topics.xml')
377
377
 
378
- opts[:top] ||= ::File.join(__dir__, 'data')
378
+ opts[:top] ||= ::File.join(opts[:basepath], 'data')
379
+ FileUtils.mkdir_p ::File.join(opts[:top], 'orgmodels')
379
380
 
380
381
  opts[:watchdog_frequency] ||= 7
381
382
  opts[:watchdog_start_off] ||= false
@@ -0,0 +1 @@
1
+ 3602945
@@ -0,0 +1 @@
1
+ 3602951
@@ -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, uuid = message[0...index].split(',')
44
+ instance, uuid, seq = message[0...index].split(',')
45
45
  type, worker, event = what.split(':',3)
46
46
  topic = ::File::dirname(event)
47
47
  name = ::File::basename(event)
@@ -50,7 +50,8 @@ Daemonite.new do |opts|
50
50
  if opts[:redis].smembers("worklist:#{instance}/handlers/#{key}").include? long
51
51
  url = opts[:redis].get("worklist:#{instance}/handlers/#{key}/url")
52
52
  if url.nil? || url == ""
53
- opts[:redis].publish("forward:#{instance}/#{key}",mess)
53
+ sseq = opts[:redis].incr("worklist:#{instance}/handlers/#{key}/seq")
54
+ opts[:redis].publish("forward:#{instance}/#{key}","#{seq},#{sseq} #{mess}")
54
55
  else
55
56
  client = Riddl::Client.new(url)
56
57
  client.post [
@@ -0,0 +1 @@
1
+ 3602957
@@ -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, uuid = message[0...index].split(',')
70
+ instance, uuid, seq = message[0...index].split(',')
71
71
  type, worker, event = what.split(':',3)
72
72
  topic = ::File::dirname(event)
73
73
  name = ::File::basename(event)
@@ -81,7 +81,8 @@ Daemonite.new do |opts|
81
81
 
82
82
  if url.nil? || url == ""
83
83
  persist_handler instance, callback_key, m, opts[:redis]
84
- opts[:redis].publish("forward:#{instance}/#{subscription_key}",mess)
84
+ sseq = opts[:redis].incr("worklist:#{instance}/handlers/#{subscription_key}/seq")
85
+ opts[:redis].publish("forward:#{instance}/#{subscription_key}","#{seq},#{sseq} #{mess}")
85
86
  else
86
87
  client = Riddl::Client.new(url)
87
88
  callback = File.join(m['instance-url'],'/callbacks/',subscription_key,'/')
@@ -0,0 +1 @@
1
+ 3602963
data/server/worklist CHANGED
@@ -16,9 +16,10 @@
16
16
  # along with CPEE-WORKLIST (file LICENSE in the main directory). If not, see
17
17
  # <http://www.gnu.org/licenses/>.
18
18
 
19
- require 'rubygems'
20
- if File.exist? File.join(__dir__,'../lib/cpee-worklist/implementation.rb')
21
- require_relative '../lib/cpee-worklist/implementation'
19
+ if File.exist?(File.join(__dir__,'..','lib','cpee-worklist','implementation.rb'))
20
+ require_relative File.join(__dir__,'..','lib','cpee-worklist','implementation')
21
+ elsif File.exist?(File.join(Dir.home,'Projects','cpee-worklist','lib','cpee-worklist','implementation.rb'))
22
+ require_relative File.join(Dir.home, 'Projects','cpee-worklist','lib','cpee-worklist','implementation')
22
23
  else
23
24
  require 'cpee-worklist/implementation'
24
25
  end
data/tools/cpee-worklist CHANGED
@@ -81,7 +81,6 @@ p1 = ARGV[1]
81
81
 
82
82
  if command == 'new'
83
83
  insta = "#{curpath}/../server/"
84
- FileUtils.mkdir(p1) rescue nil
85
84
  if !File.exist?(p1)
86
85
  FileUtils.cp_r(insta,p1)
87
86
  else
data/ui/direct.html CHANGED
@@ -72,6 +72,9 @@
72
72
  <template id="dat_template_orgmodels"> <!--{{{-->
73
73
  <li class="orgmodel"><a class='link' href=""></a> ⇒ [<a class='model' href="">View Model</a>]</li>
74
74
  </template> <!--}}}-->
75
+ <template id="dat_template_form_error"> <!--{{{-->
76
+ <p class="worklist-form-error">The form could not be loaded: <a class='url' href="" target="_blank"></a></p>
77
+ </template> <!--}}}-->
75
78
 
76
79
  <ui-tabbed class="hidden" id="worklist">
77
80
  <ui-tabbar>
data/ui/index.html CHANGED
@@ -71,6 +71,9 @@
71
71
  <template id="dat_template_orgmodels"> <!--{{{-->
72
72
  <li class="orgmodel"><a class='link' href=""></a> ⇒ [<a class='model' href="">View Model</a>]</li>
73
73
  </template> <!--}}}-->
74
+ <template id="dat_template_form_error"> <!--{{{-->
75
+ <p class="worklist-form-error">The form could not be loaded: <a class='url' href="" target="_blank"></a></p>
76
+ </template> <!--}}}-->
74
77
 
75
78
  <ui-tabbed id="worklist">
76
79
  <ui-tabbar>
data/ui/js/structured.js CHANGED
@@ -246,11 +246,13 @@ function do_work(taskid,taskidurl) { //{{{
246
246
  url: taskidurl,
247
247
  success:function(res) {
248
248
  if (!uidash_add_tab("#main", res.label, taskid, true, '')) { return; };
249
- $.ajax({
250
- type: "GET",
251
- url: res.form,
252
- dataType: 'text',
253
- success: async (iform) => {
249
+ let form_error = (url) => {
250
+ let node = $($("#dat_template_form_error")[0].content.cloneNode(true));
251
+ $('.url',node).text(url);
252
+ $('.url',node).attr('href',url);
253
+ return $('<div></div>').append(node).html();
254
+ };
255
+ let show_form = async (iform) => {
254
256
  let end = false;
255
257
  let evaltext = '';
256
258
  let rel = res.form.match(/.*\//)[0];
@@ -269,14 +271,17 @@ function do_work(taskid,taskidurl) { //{{{
269
271
  } else {
270
272
  inc = includes[4];
271
273
  }
272
- await $.ajax({
273
- type: "GET",
274
- url: inc,
275
- dataType: 'text',
276
- success: function(inctext) {
277
- iform = iform.replace(includes[0],inctext);
278
- }
279
- });
274
+ try {
275
+ let inctext = await $.ajax({
276
+ type: "GET",
277
+ url: inc,
278
+ dataType: 'text'
279
+ });
280
+ iform = iform.replace(includes[0],inctext);
281
+ } catch (e) {
282
+ console.log("Error while getting form include " + inc);
283
+ iform = iform.replace(includes[0],form_error(inc));
284
+ }
280
285
  } else {
281
286
  end = true;
282
287
  }
@@ -381,20 +386,16 @@ function do_work(taskid,taskidurl) { //{{{
381
386
  taskitem.append(iframe);
382
387
 
383
388
  uidash_activate_tab($('ui-tabbar ui-tab[data-tab=' + taskid + ']'));
384
- },
389
+ };
390
+ $.ajax({
391
+ type: "GET",
392
+ url: res.form,
393
+ dataType: 'text',
394
+ success: show_form,
385
395
  error: function(a,b,c){
386
- $.ajax({
387
- type: "DELETE",
388
- url: taskidurl,
389
- success: function(del){
390
- uidash_close_tab('ui-tab[data-tab='+taskid+'] ui-close');
391
- get_worklist();
392
- },
393
- error: function(a,b,c){
394
- console.log("Delete failed");
395
- }
396
- });
396
+ // e.g. CORS blocked: keep the task, open it with a message instead of the form
397
397
  console.log("Error while getting form html");
398
+ show_form(form_error(res.form));
398
399
  }
399
400
  });
400
401
  },
data/ui/structured.html CHANGED
@@ -71,6 +71,9 @@
71
71
  <template id="dat_template_orgmodels"> <!--{{{-->
72
72
  <li class="orgmodel"><a class='link' href=""></a> ⇒ [<a class='model' href="">View Model</a>]</li>
73
73
  </template> <!--}}}-->
74
+ <template id="dat_template_form_error"> <!--{{{-->
75
+ <p class="worklist-form-error">The form could not be loaded: <a class='url' href="" target="_blank"></a></p>
76
+ </template> <!--}}}-->
74
77
 
75
78
  <ui-tabbed id="worklist">
76
79
  <ui-tabbar>
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.27
4
+ version: 1.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -98,9 +98,13 @@ 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
101
102
  - lib/cpee-worklist/routing/end.rb
103
+ - lib/cpee-worklist/routing/forward-events.pid
102
104
  - lib/cpee-worklist/routing/forward-events.rb
105
+ - lib/cpee-worklist/routing/forward-votes.pid
103
106
  - lib/cpee-worklist/routing/forward-votes.rb
107
+ - lib/cpee-worklist/routing/persist.pid
104
108
  - lib/cpee-worklist/routing/persist.rb
105
109
  - lib/cpee-worklist/topics.xml
106
110
  - lib/cpee-worklist/user.rb