cpee 2.1.79 → 2.1.83

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: c964061a70cac85b0e31055837221a3a29682b805b09896eaf5625834950f8f9
4
- data.tar.gz: 67cb5bf54c347a06c90862645e0b59cb47319be0088ec9a1f2b0b92f6d0fdd5c
3
+ metadata.gz: 2e3fdbc0afe42014b71076ce61c30e7cb3942296d18d9b9e69589e498198fa54
4
+ data.tar.gz: 27743df8fef01b352f3f0dd22584a707e17112c7c7ea3fe483e29d89dff0dfbc
5
5
  SHA512:
6
- metadata.gz: 1c28c2b6a6c3e4440ffc5dbb5bb610cd501b76e98e5021c9b2fe391b93b2128d52b5e319db8f4d2b45fe7c136abc23b56e5a1b25061b4d18f725ec8f8d3af482
7
- data.tar.gz: 899cefe9a892dc6e9159c3c0bf35109b26c141b775e74cd65dbc1d6b0aedaa2fdc73ad372641ee756b8906ce94de4243f2c7ba753430f8b3778f4d39df21a750
6
+ metadata.gz: fadeddcddb31ef17785cd016a6fc198a31b0ff7fc0807eba9f50bd2a595274c93534088e46482627b16a22f3ffac10c2b1866ea16294e14f66929aafa00ade99
7
+ data.tar.gz: f4489da3ae07ecbb5441ccbacb6c6b76cc9f605754f61698d49afcca3419b543fcaeccc8f215f059ec7db8245b99bbb1b642aa60870a2343ab4b8883a79275ca
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  All code in this package is provided under the LGPL-3 license.
2
2
  Please read the file COPYING in the main directory.
3
3
 
4
- Tested for MRI 2.6, 2.7
4
+ Tested for MRI 2.6, >= 2.7
5
5
 
6
6
  Searching for mem-leaks:
7
7
  valgrind --num-callers=50 --error-limit=no --partial-loads-ok=yes --undef-value-errors=no ./server/server.rb -v start
@@ -102,6 +102,15 @@ svg rect.tile {
102
102
  fill-opacity: 0.3;
103
103
  display: none;
104
104
  }
105
+ svg .standline {
106
+ stroke: var(--wfadaptor-base);
107
+ stroke-width:1.6;
108
+ stroke-linecap:round;
109
+ stroke-linejoin:round;
110
+ stroke-miterlimit:4;
111
+ stroke-opacity:1;
112
+ stroke-dasharray:none;
113
+ }
105
114
  svg .stand {
106
115
  fill: var(--wfadaptor-background);
107
116
  fill-opacity:1;
@@ -105,7 +105,7 @@ function WfAdaptor(theme_base,doit) { // Controller {{{
105
105
  }
106
106
  for(element in manifestation.elements) {
107
107
  if (manifestation.elements[element].illustrator) {
108
- if (manifestation.elements[element].illustrator.svg) {
108
+ if (manifestation.elements[element].illustrator.svg && (typeof manifestation.elements[element].illustrator.svg === 'string' || manifestation.elements[element].illustrator.svg instanceof String)) {
109
109
  deferreds.push(
110
110
  $.ajax({
111
111
  type: "GET",
@@ -117,6 +117,46 @@ function WfAdaptor(theme_base,doit) { // Controller {{{
117
117
  }
118
118
  })
119
119
  );
120
+ } else if (manifestation.elements[element].illustrator.svg && (typeof manifestation.elements[element].illustrator.svg === 'object' || manifestation.elements[element].illustrator.svg instanceof Object)) {
121
+ if (manifestation.elements[element].illustrator.svg.start) {
122
+ deferreds.push(
123
+ $.ajax({
124
+ type: "GET",
125
+ dataType: "xml",
126
+ url: manifestation.elements[element].illustrator.svg.start,
127
+ context: element,
128
+ success: function(res){
129
+ manifestation.elements[this].illustrator.svg.start = $(res.documentElement);
130
+ }
131
+ })
132
+ );
133
+ }
134
+ if (manifestation.elements[element].illustrator.svg.middle) {
135
+ deferreds.push(
136
+ $.ajax({
137
+ type: "GET",
138
+ dataType: "xml",
139
+ url: manifestation.elements[element].illustrator.svg.middle,
140
+ context: element,
141
+ success: function(res){
142
+ manifestation.elements[this].illustrator.svg.middle = $(res.documentElement);
143
+ }
144
+ })
145
+ );
146
+ }
147
+ if (manifestation.elements[element].illustrator.svg.end) {
148
+ deferreds.push(
149
+ $.ajax({
150
+ type: "GET",
151
+ dataType: "xml",
152
+ url: manifestation.elements[element].illustrator.svg.end,
153
+ context: element,
154
+ success: function(res){
155
+ manifestation.elements[this].illustrator.svg.end = $(res.documentElement);
156
+ }
157
+ })
158
+ );
159
+ }
120
160
  }
121
161
  illustrator.elements[element] = manifestation.elements[element].illustrator;
122
162
  illustrator.elements[element].type = manifestation.elements[element].type || 'abstract';
@@ -182,6 +222,9 @@ function WfIllustrator(wf_adaptor) { // View {{{
182
222
  ' <marker id="arrow" viewBox="0 0 10 10" refX="33" refY="5" orient="auto" markerUnits="strokeWidth" markerWidth="4.5" makerHeight="4.5">' +
183
223
  ' <path d="m 2 2 l 6 3 l -6 3 z"/>' +
184
224
  ' </marker>' +
225
+ ' <clipPath id="squareclip">' +
226
+ ' <rect x="-1" y="-1" width="32" height="32"/>' +
227
+ ' </clipPath>' +
185
228
  '</defs>'));
186
229
  self.svg.defs = {};
187
230
  self.svg.defs['unknown'] = $X('<g xmlns="http://www.w3.org/2000/svg" class="unknown">' +
@@ -190,6 +233,7 @@ function WfIllustrator(wf_adaptor) { // View {{{
190
233
  '</g>');
191
234
  for(element in self.elements)
192
235
  if(self.elements[element].svg) {
236
+ console.log(self.elements[element].svg);
193
237
  var sym = $X('<g xmlns="http://www.w3.org/2000/svg"/>').append(self.elements[element].svg.clone().children()); // append all children to symbol
194
238
  $.each(self.elements[element].svg.attr('class').split(/\s+/), function(index, item) { sym.addClass(item); }); // copy all classes from the root node
195
239
  self.svg.defs[element] = sym;
@@ -382,7 +426,7 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
382
426
  id_counter = {};
383
427
  labels = [];
384
428
  illustrator.clear();
385
- var graph = parse(description.children('description').get(0), {'row':0,'col':0,final:false,wide:false});
429
+ var graph = parse(description.children('description').get(0), {'row':0,'col':0,dim:{},final:false,wide:false});
386
430
  illustrator.set_svg(graph);
387
431
  // set labels
388
432
  self.set_labels(graph);
@@ -434,7 +478,7 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
434
478
  id_counter = {};
435
479
  labels = [];
436
480
  illustrator.clear();
437
- var graph = parse(description.children('description').get(0), {'row':0,'col':0});
481
+ var graph = parse(description.children('description').get(0), {'row':0,'col':0,dim:{}});
438
482
  illustrator.set_svg(graph);
439
483
  // set labels
440
484
  self.set_labels(graph);
@@ -445,7 +489,7 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
445
489
  if(update_illustrator){
446
490
  labels = [];
447
491
  illustrator.clear();
448
- var graph = parse(description.children('description').get(0), {'row':0,'col':0});
492
+ var graph = parse(description.children('description').get(0), {'row':0,'col':0,dim:{}});
449
493
  illustrator.set_svg(graph);
450
494
  self.set_labels(graph);
451
495
  }
@@ -524,7 +568,7 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
524
568
  // }}}
525
569
  // Helper Functions {{{
526
570
  var parse = function(root, parent_pos) { // private {{{
527
- var pos = jQuery.extend(true, {}, parent_pos);
571
+ var pos = $.extend(true, {}, parent_pos);
528
572
  var max = {'row': 0,'col': 0};
529
573
  var prev = [parent_pos]; // connects parent with child(s), depending on the expansion
530
574
  var endnodes = [];
@@ -571,7 +615,7 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
571
615
  if(illustrator.elements[tname] != undefined && illustrator.elements[tname].type == 'complex') {
572
616
  if(illustrator.elements[tname] != undefined && !illustrator.elements[tname].svg) pos.row--;
573
617
  // TODO: Remaining problem is the order inside the svg. Thats why the connection is above the icon
574
- block = parse(context, jQuery.extend(true, {}, pos));
618
+ block = parse(context, $.extend(true, {}, pos));
575
619
  group.append(block.svg);
576
620
  block.svg.attr('id', 'group-' + $(context).attr('svg-id'));
577
621
  if(illustrator.elements[sname].endnodes == 'aggregate') endnodes = []; // resets endpoints e.g. potential preceding primitive
@@ -588,11 +632,11 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
588
632
  var g;
589
633
  set_details(tname,sname,pos,context);
590
634
 
591
- var origpos = jQuery.extend(true, {}, pos);
635
+ var origpos = $.extend(true, {}, pos);
592
636
  [g, endnodes] = draw_position(tname,origpos,prev,block,group,endnodes,context);
593
637
 
594
638
  // Prepare next iteration {{{
595
- if(root_expansion == 'vertical') { prev = jQuery.extend(true, {}, endnodes); pos.row = block.max.row;} // covers e.g. input's for alternative, parallel_branch, ... everything with horizontal expansion
639
+ if(root_expansion == 'vertical') { prev = $.extend(true, {}, endnodes); pos.row = block.max.row;} // covers e.g. input's for alternative, parallel_branch, ... everything with horizontal expansion
596
640
  if(root_expansion == 'horizontal') pos.col = block.max.col;
597
641
  if(max.row < block.max.row) max.row = block.max.row;
598
642
  if(max.col < block.max.col) max.col = block.max.col;
@@ -616,7 +660,7 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
616
660
  [undefined, endnodes] = draw_position(ctname,pos,prev,block,group,[],context,{svg: g, pos: origpos});
617
661
  }
618
662
  set_details(ctname,csname,pos,context,true);
619
- prev = jQuery.extend(true, {}, endnodes);
663
+ prev = $.extend(true, {}, endnodes);
620
664
  }
621
665
  });
622
666
 
@@ -711,7 +755,7 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
711
755
  }
712
756
  if(illustrator.elements[sname] != undefined && illustrator.elements[sname].endnodes != 'this') {
713
757
  for(i in block.endnodes) { endnodes.push(block.endnodes[i]); } // collects all endpoints from different childs e.g. alternatives from choose
714
- } else { endnodes = [jQuery.extend(true, {}, pos)]; } // sets this element as only endpoint (aggregate)
758
+ } else { endnodes = [$.extend(true, {}, pos)]; } // sets this element as only endpoint (aggregate)
715
759
  if(prev[0].row == 0 || prev[0].col == 0) { // this enforces the connection from description to the first element
716
760
  illustrator.draw.draw_connection(group, { row: 1, col: 1 }, pos, null, null, true);
717
761
  } else {
@@ -719,7 +763,7 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
719
763
  for (node in prev) {
720
764
  if (!prev[node].final) {
721
765
  if (prev[node].wide) {
722
- var pn = jQuery.extend(true, {}, prev[node]);
766
+ var pn = $.extend(true, {}, prev[node]);
723
767
  if (pos.col > prev[node].col) {
724
768
  pn.col = pos.col;
725
769
  }
@@ -1,9 +1,16 @@
1
1
  <?xml version="1.0"?>
2
2
  <testset xmlns="http://cpee.org/ns/properties/2.0">
3
3
  <executionhandler>ruby</executionhandler>
4
- <dataelements/>
4
+ <dataelements>
5
+ <res>{"CPEE-INSTANCE":"51480","CPEE-INSTANCE-URL":"https://cpee.org/flow/engine/51480","CPEE-INSTANCE-UUID":"61291a99-86a7-4396-8e0c-456728c60d09","CPEE-STATE":"finished","b":4,"end":1741703309.6717181,"start":1741703308.456953,"teams":["Eugen Rigger","Celine Mader","Nataliia Klievtsova","Juergen Mangler","David Williamson","Alan Joannidi","Dariusz Opoka","David Ellis","Martin Hintzen","Mark Mattimoe","Ekaterina Zhuravleva","Joanne Mailen","Andreas Schmid","Iain Wilkie","Luke Chan","Eliot Horsman","MEHDI FARIK","Nic Winter","Salim Akram","ROMAIN VIRY","CORINNE DELOR","YANN LISSILLOUR","Julian Chatwin","Gregor Mayr","Andreas Fussenegger","Alexandru Zloteanu","Clemens Neuner","Birthe Bittner","Jan Schrottenholzer","Michael Schoech","J&#xF6;rg Linden","Peter John Keill","Tobias Jonk","Ralf Mueller","Peter Kovacs","Sara Mota","Ulrich Juergenschellert","Yi Ju","Sven Scharfe","Armando Hoedl","Fabienne Meier","Olaf Zalewski","Stefan Bildstein","Sebastian Schade","Tomi Walter","Pascal Wolf","Thibaut Escourrou","Peter Jezsoviczki","Felix Breuss","Thomas Kladensky","Hossam Haridy","Christoph Stadler","Jens Beecken","Bernhard Klocker"]}</res>
6
+ <start>1741706229.7376199</start>
7
+ <substart>0.8481366634368896</substart>
8
+ <subend>2.062901735305786</subend>
9
+ <duration>69.02397441864014</duration>
10
+ <teams>{"CPEE-INSTANCE":"51480","CPEE-INSTANCE-URL":"https://cpee.org/flow/engine/51480","CPEE-INSTANCE-UUID":"61291a99-86a7-4396-8e0c-456728c60d09","CPEE-STATE":"finished","b":4,"end":1741703309.6717181,"start":1741703308.456953,"teams":["Eugen Rigger","Celine Mader","Nataliia Klievtsova","Juergen Mangler","David Williamson","Alan Joannidi","Dariusz Opoka","David Ellis","Martin Hintzen","Mark Mattimoe","Ekaterina Zhuravleva","Joanne Mailen","Andreas Schmid","Iain Wilkie","Luke Chan","Eliot Horsman","MEHDI FARIK","Nic Winter","Salim Akram","ROMAIN VIRY","CORINNE DELOR","YANN LISSILLOUR","Julian Chatwin","Gregor Mayr","Andreas Fussenegger","Alexandru Zloteanu","Clemens Neuner","Birthe Bittner","Jan Schrottenholzer","Michael Schoech","J&#xF6;rg Linden","Peter John Keill","Tobias Jonk","Ralf Mueller","Peter Kovacs","Sara Mota","Ulrich Juergenschellert","Yi Ju","Sven Scharfe","Armando Hoedl","Fabienne Meier","Olaf Zalewski","Stefan Bildstein","Sebastian Schade","Tomi Walter","Pascal Wolf","Thibaut Escourrou","Peter Jezsoviczki","Felix Breuss","Thomas Kladensky","Hossam Haridy","Christoph Stadler","Jens Beecken","Bernhard Klocker"]}</teams>
11
+ </dataelements>
5
12
  <endpoints>
6
- <subprocess>https-post://echo.bpm.in.tum.de/flow/start/url/</subprocess>
13
+ <subprocess>https-post://cpee.org/flow/start/url/</subprocess>
7
14
  <user>https-post://cpee.org/services/timeout-user.php</user>
8
15
  <auto>https-post://cpee.org/services/timeout-auto.php</auto>
9
16
  <timeout>https://cpee.org/services/timeout.php</timeout>
@@ -12,11 +19,11 @@
12
19
  </endpoints>
13
20
  <attributes>
14
21
  <guarded>none</guarded>
15
- <info>Subprocess</info>
16
22
  <modeltype>CPEE</modeltype>
17
23
  <theme>extended</theme>
18
- <creator>Christine Ashcreek</creator>
19
24
  <guarded_id/>
25
+ <info>Subprocess</info>
26
+ <creator>Christine Ashcreek</creator>
20
27
  <author>Christine Ashcreek</author>
21
28
  <model_uuid>1fc43528-3e4a-40ee-8503-c0ed7e5d883c</model_uuid>
22
29
  <model_version/>
@@ -45,7 +52,8 @@
45
52
  <finalize output="result">data.res = result
46
53
  data.substart = result['start'].to_f - data.start.to_f
47
54
  data.subend = result['end'].to_f - data.start.to_f
48
- data.duration = Time.now.to_f - data.start.to_f</finalize>
55
+ data.duration = Time.now.to_f - data.start.to_f
56
+ data.teams = result</finalize>
49
57
  <update output="result"/>
50
58
  <rescue output="result"/>
51
59
  </code>
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "guarded": "none",
3
- "info": "Subprocess",
4
3
  "modeltype": "CPEE",
5
4
  "theme": "extended",
6
- "creator": "Christine Ashcreek",
7
5
  "guarded_id": "",
6
+ "info": "Subprocess",
7
+ "creator": "Christine Ashcreek",
8
8
  "author": "Christine Ashcreek",
9
9
  "model_uuid": "1fc43528-3e4a-40ee-8503-c0ed7e5d883c",
10
10
  "model_version": "",
@@ -1,18 +1,23 @@
1
1
  <?xml version="1.0"?>
2
2
  <testset xmlns="http://cpee.org/ns/properties/2.0">
3
3
  <executionhandler>ruby</executionhandler>
4
- <dataelements/>
4
+ <dataelements>
5
+ <b>4</b>
6
+ <end>1741703309.6717181</end>
7
+ <start>1741703308.456953</start>
8
+ </dataelements>
5
9
  <endpoints>
6
10
  <timeout>https://cpee.org/services/timeout.php</timeout>
7
11
  <subprocess>https://cpee.org/flow/start/url/</subprocess>
12
+ <orgmodel>http://localhost/data/ideas_phase1/zt.xml</orgmodel>
8
13
  </endpoints>
9
14
  <attributes>
10
15
  <guarded>none</guarded>
11
- <info>Wait</info>
12
16
  <modeltype>CPEE</modeltype>
13
17
  <theme>extended</theme>
14
- <creator>Christine Ashcreek</creator>
15
18
  <guarded_id/>
19
+ <info>Wait</info>
20
+ <creator>Christine Ashcreek</creator>
16
21
  <author>Christine Ashcreek</author>
17
22
  <model_uuid>c92d0c0b-8bbd-40dd-baad-01c5616dfceb</model_uuid>
18
23
  <model_version/>
@@ -68,6 +73,51 @@
68
73
  </code>
69
74
  </documentation>
70
75
  </call>
76
+ <call id="a3" endpoint="orgmodel">
77
+ <parameters>
78
+ <label>Names</label>
79
+ <method>:get</method>
80
+ <arguments/>
81
+ </parameters>
82
+ <code>
83
+ <prepare/>
84
+ <finalize output="result">result.register_namespace 'o', 'http://cpee.org/ns/organisation/1.0'
85
+ data.teams = result.find("/o:organisation/o:subjects/o:subject[o:relation/@role='Product Manager']/@id").to_a</finalize>
86
+ <update output="result"/>
87
+ <rescue output="result"/>
88
+ </code>
89
+ <annotations>
90
+ <_generic/>
91
+ <_timing>
92
+ <_timing_weight/>
93
+ <_timing_avg/>
94
+ <explanations/>
95
+ </_timing>
96
+ <_shifting>
97
+ <_shifting_type>Duration</_shifting_type>
98
+ </_shifting>
99
+ <_context_data_analysis>
100
+ <probes/>
101
+ <ips/>
102
+ </_context_data_analysis>
103
+ <report>
104
+ <url/>
105
+ </report>
106
+ <_notes>
107
+ <_notes_general/>
108
+ </_notes>
109
+ </annotations>
110
+ <documentation>
111
+ <input/>
112
+ <output/>
113
+ <implementation>
114
+ <description/>
115
+ </implementation>
116
+ <code>
117
+ <description/>
118
+ </code>
119
+ </documentation>
120
+ </call>
71
121
  </description>
72
122
  </description>
73
123
  <transformation>
@@ -75,4 +125,11 @@
75
125
  <dataelements type="none"/>
76
126
  <endpoints type="none"/>
77
127
  </transformation>
128
+ <subscriptions xmlns="http://riddl.org/ns/common-patterns/notifications-producer/2.0">
129
+ <subscription id="_instantiation_9c70f0aec95a9c021bb58785ecd8b674" url="http://localhost:9296/callback/_instantiation_9c70f0aec95a9c021bb58785ecd8b674">
130
+ <topic id="state">
131
+ <event>change</event>
132
+ </topic>
133
+ </subscription>
134
+ </subscriptions>
78
135
  </testset>
data/cpee.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "2.1.79"
3
+ s.version = "2.1.83"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0-or-later"
6
6
  s.summary = "The cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
@@ -93,7 +93,7 @@ module CPEE
93
93
  CPEE::redis_connect opts, 'Server Main'
94
94
 
95
95
  ### start by server
96
- if opts[:libs_preload]&.is_a?(Array) && opts[:libs_preload].length > 0
96
+ if opts[:libs_preload]&.is_a?(Array) && opts[:libs_preload].length > 0 && opts[:libs_preloader]&.is_a?(String) && opts[:libs_preloader]&.strip != ''
97
97
  puts '(re)starting by-server ...'
98
98
  `pkill -f #{File.basename(opts[:libs_preloader])}`
99
99
  `#{opts[:libs_preloader]} '#{opts[:libs_preload].join("' '")}'`
@@ -108,6 +108,13 @@ module CPEE
108
108
  end #}}}
109
109
 
110
110
  class ExCallback < Riddl::Implementation #{{{
111
+ def cleanup_encoding(val)
112
+ enc = CharlockHolmes::EncodingDetector.detect(val)
113
+ if enc[:type] == :text && enc[:confidence] > 40
114
+ val.force_encoding(enc[:ruby_encoding])
115
+ end
116
+ val
117
+ end
111
118
  def response
112
119
  id = @a[0]
113
120
  opts = @a[1]
@@ -125,10 +132,10 @@ module CPEE
125
132
  if e.class == Riddl::Parameter::Simple
126
133
  [:simple,e.value]
127
134
  elsif e.class == Riddl::Parameter::Complex && e.value.size <= 512000
128
- [:complex,e.mimetype,e.value.read]
135
+ [:complex,e.mimetype,cleanup_encoding(e.value.read)]
129
136
  else
130
- # [:complex,'cpee-external-' + e.mimetype,e.value.read]
131
- [:complex, e.mimetype,e.value.read]
137
+ # [:complex,'cpee-external-' + e.mimetype,cleanup_encoding(e.value.read)]
138
+ [:complex, e.mimetype,cleanup_encoding(e.value.read)]
132
139
  end
133
140
  ]
134
141
  }
data/lib/cpee/message.rb CHANGED
@@ -17,6 +17,9 @@ module CPEE
17
17
  module Message
18
18
  @@who = 'cpee'
19
19
  @@type = 'instance'
20
+ @@tworkers = 1
21
+ @@last = -1
22
+
20
23
  def self::who #{{{
21
24
  @@who
22
25
  end #}}}
@@ -12,6 +12,9 @@
12
12
  # CPEE (file COPYING in the main directory). If not, see
13
13
  # <http://www.gnu.org/licenses/>.
14
14
 
15
+ require_relative 'attributes_helper'
16
+ require_relative 'message'
17
+
15
18
  module CPEE
16
19
 
17
20
  module Persistence
@@ -1,5 +1,3 @@
1
- #!/usr/bin/env by
2
- # require 'rbtrace'
3
1
  require 'yaml'
4
2
  opts = YAML::load_file(File.join(__dir__,'opts.yaml'))
5
3
  opts[:pidf] = __FILE__ + '.pid'
@@ -297,13 +297,19 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
297
297
  end
298
298
  if options['CPEE_EVENT']
299
299
  @controller.notify("task/#{options['CPEE_EVENT'].gsub(/[^\w_-]/,'')}", :ecid => Thread.current.__id__, :'activity-uuid' => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint, :received => recv)
300
- else
301
- @handler_returnValue = recv
302
- @handler_returnOptions = options
303
300
  end
304
301
  if options['CPEE_STATUS']
305
302
  @controller.notify("activity/status", :ecid => Thread.current.__id__, :'activity-uuid' => @handler_activity_uuid, :label => @label, :activity => @handler_position, :endpoint => @handler_endpoint, :status => options['CPEE_STATUS'])
306
303
  end
304
+
305
+ if options['CPEE_STATUS'] || options['CPEE_EVENT'] || options['CPEE_INSTANTIATION']
306
+ @handler_returnValue = nil
307
+ @handler_returnOptions = nil
308
+ else
309
+ @handler_returnValue = recv
310
+ @handler_returnOptions = options
311
+ end
312
+
307
313
  if options['CPEE_UPDATE']
308
314
  @handler_continue.continue WEEL::Signal::UpdateAgain
309
315
  else
@@ -55,7 +55,6 @@ module CPEE
55
55
  end
56
56
  template = ERB.new(File.read(ExecutionHandler::Ruby::BACKEND_TEMPLATE), trim_mode: '-')
57
57
  res = template.result_with_hash(dsl: dsl, dataelements: dataelements, endpoints: endpoints, positions: positions)
58
- pp dataelements
59
58
  File.write(File.join(opts[:instances],id.to_s,ExecutionHandler::Ruby::BACKEND_INSTANCE),res)
60
59
  end
61
60
 
data/tools/cpee CHANGED
@@ -6,6 +6,7 @@ require 'fileutils'
6
6
  require 'webrick'
7
7
  require 'typhoeus'
8
8
  require 'xml/smart'
9
+ require 'redis'
9
10
  require 'zip'
10
11
  require 'pp'
11
12
 
@@ -55,10 +56,12 @@ ARGV.options { |opt|
55
56
  opt.on(wrap("[ui] starts a simple static web server with the ui on http://localhost:8080. Use [cpui DIR] if you want stuff in apache or nginx."))
56
57
  opt.on("")
57
58
  opt.on(wrap("[convert] converts all testsets in the current directory to the newest format"))
59
+ opt.on("")
60
+ opt.on(wrap("[vacuum] clean a redis.rdb in the current directory"))
58
61
  opt.parse!
59
62
  }
60
63
  if (ARGV.length == 0) ||
61
- (ARGV.length == 1 && !(%w(ui convert).include?(ARGV[0]))) ||
64
+ (ARGV.length == 1 && !(%w(ui convert vacuum).include?(ARGV[0]))) ||
62
65
  (ARGV.length == 2 && !(%w(abandon abandon! stopping start delete! cpui new).include?(ARGV[0]))) ||
63
66
  (ARGV.length == 3 && !(%w(archive a_by_name).include?(ARGV[0]))) ||
64
67
  (ARGV.length > 3)
@@ -424,4 +427,17 @@ elsif command == 'new'
424
427
  else
425
428
  puts 'Directory already exists.'
426
429
  end
430
+ elsif command == 'vacuum'
431
+ begin
432
+ redis = Redis.new(path: 'redis.sock', db: 0, id: 'vacuum')
433
+ instances = redis.zrange('instances', 0, -1)
434
+ redis.keys('*').each do |key|
435
+ k = key.match(/instance:(\d+)/)
436
+ if k && ! instances.include?(k[1])
437
+ redis.del key
438
+ end
439
+ end
440
+ rescue => e
441
+ puts 'no redis.sock or no redis db 0 found ...'
442
+ end
427
443
  end
@@ -0,0 +1,4 @@
1
+ :workers: 1
2
+ :libs_preload: []
3
+ :libs_preloader: ''
4
+ :libs_preloaderrun: /usr/bin/ruby
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.79
4
+ version: 2.1.83
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
8
8
  - Ralph Vigne
9
9
  - Gerhard Stuermer
10
- autorequire:
11
10
  bindir: tools
12
11
  cert_chain: []
13
- date: 2025-02-21 00:00:00.000000000 Z
12
+ date: 2025-04-17 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: riddl
@@ -914,7 +913,6 @@ files:
914
913
  - lib/properties/t_status.rng
915
914
  - lib/properties/t_transformation.rng
916
915
  - lib/properties/transformation.rng
917
- - server/dev.rb
918
916
  - server/executionhandlers/eval/backend/README.md
919
917
  - server/executionhandlers/eval/backend/instance.template
920
918
  - server/executionhandlers/eval/backend/opts.yaml
@@ -939,25 +937,20 @@ files:
939
937
  - server/resources/states.xml
940
938
  - server/resources/topics.xml
941
939
  - server/resources/transformation.xml
942
- - server/routing/end.pid
943
940
  - server/routing/end.rb
944
- - server/routing/forward-events-00.pid
945
941
  - server/routing/forward-events.rb
946
- - server/routing/forward-votes.pid
947
942
  - server/routing/forward-votes.rb
948
- - server/routing/persist.pid
949
943
  - server/routing/persist.rb
950
944
  - server/server.pid
951
- - server/server.rb
952
945
  - tools/cpee
953
946
  - tools/server/cpee
947
+ - tools/server/cpee.conf
954
948
  - tools/server/resources/notifications/logging/subscription.xml
955
949
  - tools/server/resources/properties.init
956
950
  homepage: http://cpee.org/
957
951
  licenses:
958
952
  - LGPL-3.0-or-later
959
953
  metadata: {}
960
- post_install_message:
961
954
  rdoc_options: []
962
955
  require_paths:
963
956
  - lib
@@ -972,8 +965,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
972
965
  - !ruby/object:Gem::Version
973
966
  version: '0'
974
967
  requirements: []
975
- rubygems_version: 3.5.22
976
- signing_key:
968
+ rubygems_version: 3.6.2
977
969
  specification_version: 4
978
970
  summary: The cloud process execution engine (cpee.org). If you just need workflow
979
971
  execution, without a rest service exposing it, then use WEEL.
data/server/dev.rb DELETED
@@ -1,34 +0,0 @@
1
- #!/usr/bin/ruby
2
- #
3
- # This file is part of CPEE.
4
- #
5
- # CPEE is free software: you can redistribute it and/or modify it under the terms
6
- # of the GNU General Public License as published by the Free Software Foundation,
7
- # either version 3 of the License, or (at your option) any later version.
8
- #
9
- # CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
10
- # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
- # PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU General Public License along with
14
- # CPEE (file COPYING in the main directory). If not, see
15
- # <http://www.gnu.org/licenses/>.
16
-
17
- module CPEE
18
- module DEVELOP
19
- RIDDL = "/home/mangler/Projects/riddl/lib/ruby"
20
- WEEL = "/home/mangler/Projects/weel/lib/"
21
- end
22
- end
23
-
24
- require 'rubygems'
25
- gem 'nokogiri'
26
- require File.expand_path(File.dirname(__FILE__) + '/../lib/cpee/implementation')
27
-
28
- Riddl::Server.new(CPEE::SERVER, :port => 8298) do |opts|
29
- accessible_description true
30
- cross_site_xhr true
31
- opts[:watchdog_start_off] true
32
-
33
- use CPEE::implementation(opts)
34
- end.loop!
@@ -1 +0,0 @@
1
- 55683
@@ -1 +0,0 @@
1
- 55702
@@ -1 +0,0 @@
1
- 55696
@@ -1 +0,0 @@
1
- 55689
data/server/server.rb DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/ruby
2
- #
3
- # This file is part of CPEE.
4
- #
5
- # CPEE is free software: you can redistribute it and/or modify it under the terms
6
- # of the GNU General Public License as published by the Free Software Foundation,
7
- # either version 3 of the License, or (at your option) any later version.
8
- #
9
- # CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
10
- # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
- # PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU General Public License along with
14
- # CPEE (file COPYING in the main directory). If not, see
15
- # <http://www.gnu.org/licenses/>.
16
-
17
- require 'rubygems'
18
- gem 'nokogiri'
19
- require File.expand_path(File.dirname(__FILE__) + '/../lib/cpee/implementation')
20
-
21
- Riddl::Server.new(CPEE::SERVER, :port => 8298) do |opts|
22
- accessible_description true
23
- cross_site_xhr true
24
- process_out false
25
-
26
- use CPEE::implementation(opts)
27
- end.loop!