cpee-worklist 1.0.17 → 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: 5bf102e677abb150275c9f4b01ce89eb120053ba7d3dd49e5b8f76f5a97fdee8
4
- data.tar.gz: cec0662273259461355d533c9d3a5a15976369adf30fd6817f40b7d01e2141fa
3
+ metadata.gz: aa5816bad86bff070a0112a66e1b42f1ab72d59c21b7422b28b9662727ce18f3
4
+ data.tar.gz: 26d2f0839f38b7f34cc838692f574aeef309b07634d7cb647bf1704f4714d450
5
5
  SHA512:
6
- metadata.gz: 471180152239ec324890cfd1a8175c1400f2ec132c509070ea698a4f1ef0d4ffcadc0c692c1d223dc32652d6d82ccfce0a0c77807ef499ea21a98cf4fd37e215
7
- data.tar.gz: 5cfdf1e5abac3546f527526ee21d42c796b4db1576c78f6922baf7e69da4188d0e47316c037745ccee9dd1c4446cdbafdf6df997a74449354ed093b3a8770924
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.17"
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/'
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)
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee-worklist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
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
+ - Nataliia Klievtsova
10
11
  bindir: tools
11
12
  cert_chain: []
12
- date: 2025-04-17 00:00:00.000000000 Z
13
+ date: 2025-06-05 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: riddl