cpee-worklist 1.0.16 → 1.0.18

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: b6a55694476f53122fb39aa05551f55b84e14f5c622b0ef1d935215cf69c8f06
4
- data.tar.gz: 81b84ac33a7b8bb4fa581641a08c118caeffed34037732f21a522f79d98ccfc4
3
+ metadata.gz: aa5816bad86bff070a0112a66e1b42f1ab72d59c21b7422b28b9662727ce18f3
4
+ data.tar.gz: 26d2f0839f38b7f34cc838692f574aeef309b07634d7cb647bf1704f4714d450
5
5
  SHA512:
6
- metadata.gz: 0f057175e245d17e490347ff2b0b931c909b891b86382daf4accd13fe9a7f352827d856db405fd8ce8e776ee7f17fffd5c5e28127e00879a0c0dcbf117676900
7
- data.tar.gz: 6cbb6ba01ea9eb928c71f973bfdd687c5eb560c566ae826d2720c9b0ef008e786884dead4547000c2bb7e797c696d656966ac2561899113974769e3fb738835a
6
+ metadata.gz: 8ea7ef4c13a0ab028453607d218251b1f5c5431cbb1db86e634a5becf81c1a0761c8fb97ff894231c0244847abe2d8d32af3c03e9f6037a3b0e0e5711ff30c6e
7
+ data.tar.gz: 2927e84f1f4677e9017d0a725ab773c5c65dade72cdb888f47e710e2f3f70ee8ba2609d3f6659cc25101ec07b3ee7b5bbb4185e9da2a31cd6f4a1600d2682cb1
data/AUTHORS CHANGED
@@ -1,3 +1,4 @@
1
1
  Jürgen 'eTM' Mangler <juergen.mangler@univie.ac.at>
2
2
  Florian 'Triarier' Stertz <florian.stertz@gmail.com>
3
3
  Patrik 'The King' Koenig
4
+ Nathaliia 'com-pot' Klievtsova
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-worklist"
3
- s.version = "1.0.16"
3
+ s.version = "1.0.18"
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)"
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.required_ruby_version = '>=2.4.0'
17
17
 
18
- s.authors = ['Juergen eTM Mangler','Florian Stertz', 'Patrik Koenig']
18
+ s.authors = ['Juergen eTM Mangler','Florian Stertz', 'Patrik Koenig', 'Nataliia Klievtsova']
19
19
 
20
20
  s.email = 'juergen.mangler@gmail.com'
21
21
  s.homepage = 'http://cpee.org/'
@@ -276,7 +276,7 @@ module CPEE
276
276
  index = @a[0].activities.index{ |c| c["id"] == @r.last }
277
277
  if index
278
278
  activity = @a[0].activities[index]
279
- 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])
280
280
  info = CPEE::Worklist::User::info(@a[0].opts,activity,@r[-3])
281
281
  @a[0].activities.serialize
282
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)
data/tools/cpee-worklist CHANGED
@@ -58,11 +58,21 @@ ARGV.options { |opt|
58
58
  opt.on(wrap("[cpui DIR] scaffolds a sample html client. New versions might require manual merging if you changed something."))
59
59
  opt.on("")
60
60
  opt.on(wrap("[new DIR] scaffolds a sample instantiation service. Post a testset to a model to keep going in one operation."))
61
+ opt.on("")
62
+ opt.on(wrap("[filter URL key] return all tasks that match a certain filter criterion."))
63
+ opt.on("")
64
+ opt.on(wrap("[filter_a URL] return all tasks that point to abandoned instances."))
65
+ opt.on("")
66
+ opt.on(wrap("[delete_a URL] delete all tasks that point to abandoned instances."))
67
+ opt.on("")
68
+ opt.on(wrap("[delete_f URL] delete all tasks that match a certain filter criterion."))
61
69
  opt.parse!
62
70
  }
71
+
63
72
  if (ARGV.length < 2) ||
64
- (ARGV.length == 2 && !(%w(cpui new).include?(ARGV[0]))) ||
65
- (ARGV.length > 2)
73
+ (ARGV.length == 2 && !(%w(cpui new filter_a delete_a).include?(ARGV[0]))) ||
74
+ (ARGV.length == 3 && !(%w(filter delete_f).include?(ARGV[0]))) ||
75
+ (ARGV.length > 3)
66
76
  puts ARGV.options
67
77
  exit
68
78
  end
@@ -78,6 +88,62 @@ if command == 'new'
78
88
  FileUtils.cp_r(Dir.glob(File.join(insta,'*')).delete_if{|e| e =~ /\.conf/ },p1,remove_destination: true)
79
89
  puts 'Directory already exists, updating ...'
80
90
  end
91
+ elsif command == 'filter'
92
+ if p1 !~ /^http/ || ARGV[2] !~ /^\w+=/
93
+ puts ARGV.options
94
+ exit
95
+ end
96
+ res = Typhoeus.get(File.join(p1,'/'))
97
+ pname, pkey = ARGV[2].split('=',2)
98
+ if res.success?
99
+ doc = XML::Smart.string(res.body)
100
+ doc.find("/tasks/task[@#{pname}=\"#{pkey}\"]").each do |ele|
101
+ puts "#{ele.attributes['callback_id']}; #{ele.attributes['cpee_label']}; #{ele.attributes['cpee_instance']}"
102
+ end
103
+ end
104
+ elsif command == 'filter_a'
105
+ if p1 !~ /^http/
106
+ puts ARGV.options
107
+ exit
108
+ end
109
+ res = Typhoeus.get(File.join(p1,'/'))
110
+ if res.success?
111
+ doc = XML::Smart.string(res.body)
112
+ doc.find("/tasks/task").each do |ele|
113
+ res = Typhoeus.get(File.join(ele.attributes['cpee_base'],ele.attributes['cpee_instance'],'properties','attributes','uuid','/'))
114
+ if res.success?
115
+ if res.body != ele.attributes['instance_uuid']
116
+ puts "#{ele.attributes['callback_id']}; #{ele.attributes['cpee_label']}; #{ele.attributes['cpee_instance']}"
117
+ else
118
+ ### TODO check if abandoned or finished to catch the rest of the the mischiefous tasks
119
+ end
120
+ else
121
+ puts "#{ele.attributes['callback_id']}; #{ele.attributes['cpee_label']}; #{ele.attributes['cpee_instance']}"
122
+ end
123
+ end
124
+ end
125
+ elsif command == 'delete_a'
126
+ if p1 !~ /^http/
127
+ puts ARGV.options
128
+ exit
129
+ end
130
+ wl = File.join(p1,'/')
131
+ res = Typhoeus.get(wl)
132
+ if res.success?
133
+ doc = XML::Smart.string(res.body)
134
+ doc.find("/tasks/task").each do |ele|
135
+ res = Typhoeus.get(File.join(ele.attributes['cpee_base'],ele.attributes['cpee_instance'],'properties','attributes','uuid','/'))
136
+ if res.success?
137
+ if res.body != ele.attributes['instance_uuid']
138
+ Typhoeus.delete File.join(wl,'tasks',ele.attributes['callback_id'])
139
+ else
140
+ ### TODO check if abandoned or finished to catch the rest of the the mischiefous tasks
141
+ end
142
+ else
143
+ Typhoeus.delete File.join(wl,'tasks',ele.attributes['callback_id'])
144
+ end
145
+ end
146
+ end
81
147
  elsif command == 'cpui'
82
148
  insta = "#{curpath}/../ui/"
83
149
  if !File.exist?(p1)
data/ui/js/structured.js CHANGED
@@ -369,7 +369,6 @@ function do_work(taskid,taskidurl) { //{{{
369
369
  var form_data = $(this).serializeArray();
370
370
  var send_data = {};
371
371
  var headers = {};
372
- console.log(res);
373
372
  if (res.collect || res.always) { headers['CPEE-UPDATE'] = 'true'; }
374
373
  send_data['user'] = $("input[name=user-name]").val();
375
374
  send_data['raw'] = form_data;
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee-worklist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.16
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
8
8
  - Florian Stertz
9
9
  - Patrik Koenig
10
- autorequire:
10
+ - Nataliia Klievtsova
11
11
  bindir: tools
12
12
  cert_chain: []
13
- date: 2025-04-15 00:00:00.000000000 Z
13
+ date: 2025-06-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: riddl
@@ -122,7 +122,6 @@ homepage: http://cpee.org/
122
122
  licenses:
123
123
  - LGPL-3.0-or-later
124
124
  metadata: {}
125
- post_install_message:
126
125
  rdoc_options: []
127
126
  require_paths:
128
127
  - lib
@@ -137,8 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
136
  - !ruby/object:Gem::Version
138
137
  version: '0'
139
138
  requirements: []
140
- rubygems_version: 3.5.22
141
- signing_key:
139
+ rubygems_version: 3.6.2
142
140
  specification_version: 4
143
141
  summary: Worklist for the cloud process execution engine (cpee.org)
144
142
  test_files: []