cpee 1.3.153 → 1.3.154

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21ec5e5f7ac3fa863944fbc529d2ba6c76a607af
4
- data.tar.gz: 62ece76319951cc933330e66790970c1459d9768
3
+ metadata.gz: 3b82462869a2853a428365a5d22819a6bc9012e7
4
+ data.tar.gz: dadf5ce874de2edc08552e8646e3ce1e15d65339
5
5
  SHA512:
6
- metadata.gz: e3864d4873c6828dd51521d1a43f627ebed013d8a98a3fbb36cfc27d4f3fdb938d1a025dda7ccd818f2f67c7f3acb8c54769402b4db32b1b1b4b9f88d6f11bdc
7
- data.tar.gz: 2205fc313cf30d7b99a0e6541dd57d434b61d574c22a9b915ec8536cfe526adc0788f0c45cd647ea37b30da1c31d5ec690747afcd4528460efb0cf5185e2bb4f
6
+ metadata.gz: 270cf087d7420d7a9a68623accbd86f4ae983b8434af89127eac41140cc046590320331f064d20afe1971a04fc8121395c85b66b36b63b728e30d8f8938e719f
7
+ data.tar.gz: 28f94599b36695d4acd61db487bc526e1aea42df4c879beaade34cc059626eed138c6467fd80db6a144a0cb9af69b4521971381fdefad2aa4980454dbfd851df
data/cpee.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "1.3.153"
3
+ s.version = "1.3.154"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3"
6
6
  s.summary = "Preliminary release of cloud process execution engine (cpee). If you just need workflow execution, without a rest/xmpp service exposing it, then use WEEL"
@@ -73,7 +73,7 @@ module CPEE
73
73
 
74
74
  def extract_nodelink(doc)
75
75
  doc.find("/bm:definitions/bm:process/bm:*[@id and @name and not(@itemSubjectRef) and not(name()='sequenceFlow')]").each do |e|
76
- n = Node.new(e.attributes['id'],e.qname.name.to_sym,e.attributes['name'].strip,e.find('count(bm:incoming)'),e.find('count(bm:outgoing)'))
76
+ n = Node.new(self.object_id,e.attributes['id'],e.qname.name.to_sym,e.attributes['name'].strip,e.find('count(bm:incoming)'),e.find('count(bm:outgoing)'))
77
77
 
78
78
  if e.attributes['scriptFormat'] != ''
79
79
  n.script_type = e.attributes['scriptFormat']
@@ -189,7 +189,8 @@ module CPEE
189
189
  if node = traces.same_first
190
190
  if branch.empty? && branch.respond_to?(:id)
191
191
  li = if (branch.id == traces.first_node.id)
192
- ### for tail controlled loops
192
+ ### for tail controlled loops, use the link from this to next
193
+ ### if a tasks loops to itself, then second_nodes returns the first
193
194
  @graph.link(branch.id,traces.second_nodes.first.id)
194
195
  else
195
196
  @graph.link(branch.id,traces.first_node.id)
@@ -238,7 +239,7 @@ module CPEE
238
239
  branch << InfiniteLoop.new(node.id)
239
240
  ### add the blank conditional to get a break
240
241
  len = loops.length
241
- loops.add_breaks
242
+ loops.add_breaks(self.object_id)
242
243
  puts '--> down loop2 to ' + (down + 1).to_s if debug
243
244
  build_ttree branch.last, loops.dup, nil, debug, down + 1
244
245
  puts '--> up loop2 from ' + (down + 1).to_s if debug
@@ -264,7 +265,7 @@ module CPEE
264
265
  nb = branch.last.new_branch
265
266
  if trcs.finished?
266
267
  puts '--> branch down to ' + (down + 1).to_s if debug
267
- build_ttree nb, Traces.new([[Break.new(1)]]), endnode, debug, down + 1
268
+ build_ttree nb, Traces.new([[Break.new(self.object_id,1)]]), endnode, debug, down + 1
268
269
  puts '--> branch up from ' + (down + 1).to_s if debug
269
270
  else
270
271
  puts '--> branch down to ' + (down + 1).to_s if debug
@@ -41,13 +41,14 @@ module CPEE
41
41
 
42
42
  class Node #{{{
43
43
  include Container
44
- @@niceid = -1
44
+ @@niceid = {}
45
45
  attr_reader :id, :label, :niceid
46
46
  attr_reader :endpoints, :methods, :parameters, :attributes
47
47
  attr_accessor :script, :script_id, :script_var, :script_type, :incoming, :outgoing, :type
48
- def initialize(id,type,label,incoming,outgoing)
48
+ def initialize(context,id,type,label,incoming,outgoing)
49
+ @@niceid[context] ||= -1
50
+ @niceid = (@@niceid[context] += 1)
49
51
  @id = id
50
- @niceid = (@@niceid += 1)
51
52
  @type = type
52
53
  @label = label
53
54
  @endpoints = []
@@ -73,8 +74,8 @@ module CPEE
73
74
  end #}}}
74
75
 
75
76
  class Break < Node
76
- def initialize(incoming)
77
- super '-1', :break, 'BREAK', incoming, []
77
+ def initialize(context,incoming)
78
+ super context, '-1', :break, 'BREAK', incoming, []
78
79
  end
79
80
  end
80
81
 
@@ -283,7 +284,7 @@ module CPEE
283
284
  self.first.first
284
285
  end
285
286
  def second_nodes
286
- self.map { |t| t[1] }
287
+ self.map { |t| t.length > 1 ? t[1] : t[0] }
287
288
  end
288
289
 
289
290
  def shortest
@@ -338,13 +339,13 @@ module CPEE
338
339
  end
339
340
 
340
341
 
341
- def add_breaks
342
+ def add_breaks(context)
342
343
  trueloops = self.find_all{ |t| t.last == t.first }.length
343
344
  if trueloops == self.length
344
345
  self << [self.first_node] ### the blank conditional so that we get a break
345
346
  else
346
347
  self.each do |t|
347
- t << Break.new(1) unless t.last == t.first ### an explicit break
348
+ t << Break.new(context,1) unless t.last == t.first ### an explicit break
348
349
  end
349
350
  end
350
351
  end
@@ -1,65 +1,90 @@
1
1
  <properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
2
- <info>asd</info>
3
- <state>stopped</state>
2
+ <info>Enter info here</info>
3
+ <state>ready</state>
4
4
  <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
5
- <positions>
6
- <a1>after</a1>
7
- </positions>
5
+ <positions/>
8
6
  <dataelements>
9
- <x/>
7
+ <persons>3</persons>
8
+ <card>Visa_12345</card>
9
+ <airline>null</airline>
10
+ <hotels>[]</hotels>
11
+ <from>Vienna</from>
12
+ <to>Prague</to>
13
+ <costs>0</costs>
10
14
  </dataelements>
11
15
  <endpoints>
12
- <timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
16
+ <bookAir>http://gruppe.wst.univie.ac.at/~mangler/services/airline.php</bookAir>
17
+ <bookHotel>http://gruppe.wst.univie.ac.at/~mangler/services/hotel.php</bookHotel>
18
+ <approve>http://gruppe.wst.univie.ac.at/~mangler/services/approval.php</approve>
13
19
  </endpoints>
14
- <dsl>parallel do
15
- parallel_branch do
16
- call :a4, :timeout, { :label =&gt; nil, :method =&gt; "post", :parameters =&gt; { :timeout =&gt; a } }
17
- end
18
- parallel_branch do
19
- call :a5, :timeout, { :label =&gt; nil, :method =&gt; "post", :parameters =&gt; { :timeout =&gt; a } }
20
+ <dsl>call :a1, :bookAir, { :method =&gt; "post", :parameters =&gt; { :from =&gt; data.from, :to =&gt; data.to, :persons =&gt; data.persons } }, &lt;&lt;-end
21
+ data.airline = result.value('id')
22
+ data.costs += result.value('costs').to_f
23
+ status.update 1, 'Hotel'
24
+ end
25
+ parallel do
26
+ loop pre_test{data.persons &gt; 0} do
27
+ parallel_branch data.persons do |p|
28
+ call :a2, :bookHotel, { :method =&gt; "post", :parameters =&gt; { :to =&gt; data.to } }, &lt;&lt;-end
29
+ data.hotels &lt;&lt; result.value('id')
30
+ data.costs += result.value('costs').to_f
31
+ end
32
+ end
33
+ manipulate :a3, &lt;&lt;-end
34
+ data.persons -= 1
35
+ end
20
36
  end
21
37
  end
22
- call :a2, :timeout, { :label =&gt; nil, :method =&gt; "post", :parameters =&gt; { :timeout =&gt; b } }, &lt;&lt;-end
23
- data.x += "a2,"
38
+ choose do
39
+ alternative data.costs &gt; 700 do
40
+ call :a4, :approve, { :method =&gt; "post", :parameters =&gt; { :costs =&gt; data.costs } }
41
+ end
24
42
  end
25
43
  </dsl>
26
44
  <dslx>
27
45
  <description xmlns="http://cpee.org/ns/description/1.0">
28
- <!--{{{-->
29
- <parallel svg-label="">
30
- <parallel_branch svg-label="">
31
- <call id="a4" endpoint="timeout" svg-label="">
32
- <parameters>
33
- <label/>
34
- <method>post</method>
46
+ <call id="a1" endpoint="bookAir">
47
+ <parameters>
48
+ <method>post</method>
49
+ <parameters>
50
+ <from>data.from</from>
51
+ <to>data.to</to>
52
+ <persons>data.persons</persons>
53
+ </parameters>
54
+ </parameters>
55
+ <manipulate output="result"> data.airline = result.value('id')
56
+ data.costs += result.value('costs').to_f
57
+ status.update 1, 'Hotel'</manipulate>
58
+ </call>
59
+ <parallel>
60
+ <loop pre_test="data.persons &gt; 0">
61
+ <parallel_branch pass="data.persons" local="p">
62
+ <call id="a2" endpoint="bookHotel">
35
63
  <parameters>
36
- <timeout>a</timeout>
64
+ <method>post</method>
65
+ <parameters>
66
+ <to>data.to</to>
67
+ </parameters>
37
68
  </parameters>
38
- </parameters>
39
- </call>
40
- </parallel_branch>
41
- <parallel_branch svg-label="">
42
- <call id="a5" endpoint="timeout" svg-label="">
69
+ <manipulate output="result"> data.hotels &lt;&lt; result.value('id')
70
+ data.costs += result.value('costs').to_f</manipulate>
71
+ </call>
72
+ </parallel_branch>
73
+ <manipulate id="a3"> data.persons -= 1</manipulate>
74
+ </loop>
75
+ </parallel>
76
+ <choose>
77
+ <alternative condition="data.costs &gt; 700">
78
+ <call id="a4" endpoint="approve">
43
79
  <parameters>
44
- <label/>
45
80
  <method>post</method>
46
81
  <parameters>
47
- <timeout>a</timeout>
82
+ <costs>data.costs</costs>
48
83
  </parameters>
49
84
  </parameters>
50
85
  </call>
51
- </parallel_branch>
52
- </parallel>
53
- <call id="a2" endpoint="timeout">
54
- <parameters>
55
- <label/>
56
- <method>post</method>
57
- <parameters>
58
- <timeout>b</timeout>
59
- </parameters>
60
- </parameters>
61
- <manipulate>data.x += "a2,"</manipulate>
62
- </call>
86
+ </alternative>
87
+ </choose>
63
88
  </description>
64
89
  </dslx>
65
90
  <status>
@@ -68,41 +93,48 @@ end
68
93
  </status>
69
94
  <description>
70
95
  <description xmlns="http://cpee.org/ns/description/1.0">
71
- <!--{{{-->
72
- <parallel svg-label="">
73
- <parallel_branch svg-label="">
74
- <call id="a4" endpoint="timeout" svg-label="">
75
- <parameters>
76
- <label/>
77
- <method>post</method>
96
+ <call id="a1" endpoint="bookAir">
97
+ <parameters>
98
+ <method>post</method>
99
+ <parameters>
100
+ <from>data.from</from>
101
+ <to>data.to</to>
102
+ <persons>data.persons</persons>
103
+ </parameters>
104
+ </parameters>
105
+ <manipulate output="result"> data.airline = result.value('id')
106
+ data.costs += result.value('costs').to_f
107
+ status.update 1, 'Hotel'</manipulate>
108
+ </call>
109
+ <parallel>
110
+ <loop pre_test="data.persons &gt; 0">
111
+ <parallel_branch pass="data.persons" local="p">
112
+ <call id="a2" endpoint="bookHotel">
78
113
  <parameters>
79
- <timeout>a</timeout>
114
+ <method>post</method>
115
+ <parameters>
116
+ <to>data.to</to>
117
+ </parameters>
80
118
  </parameters>
81
- </parameters>
82
- </call>
83
- </parallel_branch>
84
- <parallel_branch svg-label="">
85
- <call id="a5" endpoint="timeout" svg-label="">
119
+ <manipulate output="result"> data.hotels &lt;&lt; result.value('id')
120
+ data.costs += result.value('costs').to_f</manipulate>
121
+ </call>
122
+ </parallel_branch>
123
+ <manipulate id="a3"> data.persons -= 1</manipulate>
124
+ </loop>
125
+ </parallel>
126
+ <choose>
127
+ <alternative condition="data.costs &gt; 700">
128
+ <call id="a4" endpoint="approve">
86
129
  <parameters>
87
- <label/>
88
130
  <method>post</method>
89
131
  <parameters>
90
- <timeout>a</timeout>
132
+ <costs>data.costs</costs>
91
133
  </parameters>
92
134
  </parameters>
93
135
  </call>
94
- </parallel_branch>
95
- </parallel>
96
- <call id="a2" endpoint="timeout">
97
- <parameters>
98
- <label/>
99
- <method>post</method>
100
- <parameters>
101
- <timeout>b</timeout>
102
- </parameters>
103
- </parameters>
104
- <manipulate>data.x += "a2,"</manipulate>
105
- </call>
136
+ </alternative>
137
+ </choose>
106
138
  </description>
107
139
  </description>
108
140
  <transformation>
@@ -1,90 +1,62 @@
1
1
  <properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
2
2
  <info>Enter info here</info>
3
- <state>finished</state>
3
+ <state>ready</state>
4
4
  <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
5
- <positions/>
5
+ <positions>
6
+ <a1>after</a1>
7
+ </positions>
6
8
  <dataelements>
7
- <persons>0</persons>
8
- <card>Visa_12345</card>
9
- <airline>Lufthansa</airline>
10
- <hotels>["Rathaus","Rathaus","Ibis"]</hotels>
11
- <from>Vienna</from>
12
- <to>Prague</to>
13
- <costs>940.0</costs>
9
+ <x/>
14
10
  </dataelements>
15
11
  <endpoints>
16
- <bookAir>http://gruppe.wst.univie.ac.at/~mangler/services/airline.php</bookAir>
17
- <bookHotel>http://gruppe.wst.univie.ac.at/~mangler/services/hotel.php</bookHotel>
18
- <approve>http://gruppe.wst.univie.ac.at/~mangler/services/approval.php</approve>
12
+ <timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
19
13
  </endpoints>
20
- <dsl>call :a1, :bookAir, { :method =&gt; :post, :parameters =&gt; {:from =&gt; data.from, :to =&gt; data.to, :persons =&gt; data.persons} }, &lt;&lt;-end
21
- data.airline = result.value('id')
22
- data.costs += result.value('costs').to_f
23
- status.update 1, 'Hotel'
14
+ <dsl>call :a1, :timeout, { :method =&gt; "post", :parameters =&gt; { :timeout =&gt; 2 } }, &lt;&lt;-end
15
+ data.x += "a1,"
24
16
  end
25
- parallel do
26
- loop pre_test{data.persons &gt; 0} do
27
- parallel_branch data.persons do |p|
28
- call :a2, :bookHotel, { :method =&gt; :post, :parameters =&gt; {:to =&gt; data.to} }, &lt;&lt;-end
29
- data.hotels &lt;&lt; result.value('id')
30
- data.costs += result.value('costs').to_f
31
- end
32
- end
33
- manipulate :a3, &lt;&lt;-end
34
- data.persons -= 1
35
- end
36
- end
17
+ call :a2, :timeout, { :method =&gt; "post", :parameters =&gt; { :timeout =&gt; 4 } }, &lt;&lt;-end
18
+ data.x += "a2,"
37
19
  end
38
- choose :inclusive do
39
- alternative "data.costs &gt; 700" do
40
- call :a4, :approve, { :method =&gt; :post, :parameters =&gt; {:costs =&gt; data.costs} }
41
- end
20
+ call :a3, :timeout, { :method =&gt; "post", :parameters =&gt; { :timeout =&gt; 4 } }, &lt;&lt;-end
21
+ data.x += "a3,"
42
22
  end
43
23
  </dsl>
44
24
  <dslx>
45
25
  <description xmlns="http://cpee.org/ns/description/1.0">
46
- <call id="a1" endpoint="bookAir">
26
+ <!--{{{-->
27
+ <call id="a1" endpoint="timeout">
47
28
  <parameters>
48
- <method>:post</method>
29
+ <!--{{{-->
30
+ <method>post</method>
49
31
  <parameters>
50
- <from>data.from</from>
51
- <to>data.to</to>
52
- <persons>data.persons</persons>
32
+ <timeout>2</timeout>
53
33
  </parameters>
54
34
  </parameters>
55
- <manipulate output="result"> data.airline = result.value('id')
56
- data.costs += result.value('costs').to_f
57
- status.update 1, 'Hotel'</manipulate>
35
+ <!--}}}-->
36
+ <manipulate output="result"> data.x += "a1,"</manipulate>
37
+ </call>
38
+ <call id="a2" endpoint="timeout">
39
+ <parameters>
40
+ <!--{{{-->
41
+ <method>post</method>
42
+ <parameters>
43
+ <timeout>4</timeout>
44
+ </parameters>
45
+ </parameters>
46
+ <!--}}}-->
47
+ <manipulate output="result"> data.x += "a2,"</manipulate>
48
+ </call>
49
+ <call id="a3" endpoint="timeout">
50
+ <parameters>
51
+ <!--{{{-->
52
+ <method>post</method>
53
+ <parameters>
54
+ <timeout>4</timeout>
55
+ </parameters>
56
+ </parameters>
57
+ <!--}}}-->
58
+ <manipulate output="result"> data.x += "a3,"</manipulate>
58
59
  </call>
59
- <parallel>
60
- <loop pre_test="data.persons &gt; 0">
61
- <parallel_branch pass="data.persons" local="p">
62
- <call id="a2" endpoint="bookHotel">
63
- <parameters>
64
- <method>:post</method>
65
- <parameters>
66
- <to>data.to</to>
67
- </parameters>
68
- </parameters>
69
- <manipulate output="result"> data.hotels &lt;&lt; result.value('id')
70
- data.costs += result.value('costs').to_f</manipulate>
71
- </call>
72
- </parallel_branch>
73
- <manipulate id="a3"> data.persons -= 1</manipulate>
74
- </loop>
75
- </parallel>
76
- <choose>
77
- <alternative condition="data.costs &gt; 700">
78
- <call id="a4" endpoint="approve">
79
- <parameters>
80
- <method>:post</method>
81
- <parameters>
82
- <costs>data.costs</costs>
83
- </parameters>
84
- </parameters>
85
- </call>
86
- </alternative>
87
- </choose>
88
60
  </description>
89
61
  </dslx>
90
62
  <status>
@@ -93,48 +65,40 @@ end
93
65
  </status>
94
66
  <description>
95
67
  <description xmlns="http://cpee.org/ns/description/1.0">
96
- <call id="a1" endpoint="bookAir">
68
+ <!--{{{-->
69
+ <call id="a1" endpoint="timeout">
70
+ <parameters>
71
+ <!--{{{-->
72
+ <method>post</method>
73
+ <parameters>
74
+ <timeout>2</timeout>
75
+ </parameters>
76
+ </parameters>
77
+ <!--}}}-->
78
+ <manipulate output="result"> data.x += "a1,"</manipulate>
79
+ </call>
80
+ <call id="a2" endpoint="timeout">
81
+ <parameters>
82
+ <!--{{{-->
83
+ <method>post</method>
84
+ <parameters>
85
+ <timeout>4</timeout>
86
+ </parameters>
87
+ </parameters>
88
+ <!--}}}-->
89
+ <manipulate output="result"> data.x += "a2,"</manipulate>
90
+ </call>
91
+ <call id="a3" endpoint="timeout">
97
92
  <parameters>
98
- <method>:post</method>
93
+ <!--{{{-->
94
+ <method>post</method>
99
95
  <parameters>
100
- <from>data.from</from>
101
- <to>data.to</to>
102
- <persons>data.persons</persons>
96
+ <timeout>4</timeout>
103
97
  </parameters>
104
98
  </parameters>
105
- <manipulate output="result"> data.airline = result.value('id')
106
- data.costs += result.value('costs').to_f
107
- status.update 1, 'Hotel'</manipulate>
99
+ <!--}}}-->
100
+ <manipulate output="result"> data.x += "a3,"</manipulate>
108
101
  </call>
109
- <parallel>
110
- <loop pre_test="data.persons &gt; 0">
111
- <parallel_branch pass="data.persons" local="p">
112
- <call id="a2" endpoint="bookHotel">
113
- <parameters>
114
- <method>:post</method>
115
- <parameters>
116
- <to>data.to</to>
117
- </parameters>
118
- </parameters>
119
- <manipulate output="result"> data.hotels &lt;&lt; result.value('id')
120
- data.costs += result.value('costs').to_f</manipulate>
121
- </call>
122
- </parallel_branch>
123
- <manipulate id="a3"> data.persons -= 1</manipulate>
124
- </loop>
125
- </parallel>
126
- <choose>
127
- <alternative condition="data.costs &gt; 700">
128
- <call id="a4" endpoint="approve">
129
- <parameters>
130
- <method>:post</method>
131
- <parameters>
132
- <costs>data.costs</costs>
133
- </parameters>
134
- </parameters>
135
- </call>
136
- </alternative>
137
- </choose>
138
102
  </description>
139
103
  </description>
140
104
  <transformation>