cpee 1.3.191 → 1.3.192
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 +4 -4
- data/cockpit/css/ui.css +13 -5
- data/cpee.gemspec +1 -1
- data/server/handlerwrappers/default.rb +20 -0
- data/server/instances/39/properties.xml +1 -1
- data/server/instances/41/properties.xml +1 -1
- data/server/instances/42/properties.xml +1 -1
- data/server/instances/43/properties.xml +1 -1
- data/server/instances/44/properties.xml +1 -1
- data/server/instances/45/properties.xml +1 -1
- data/server/instances/46/properties.xml +47 -0
- data/server/instances/47/properties.xml +149 -0
- data/server/instances/48/log.xes +122 -0
- data/server/instances/48/properties.xml +186 -0
- data/server/instances/49/notifications/da0b7d2ef42d814b853496e9f3748e2b/consumer-secret +1 -0
- data/server/instances/49/notifications/da0b7d2ef42d814b853496e9f3748e2b/producer-secret +1 -0
- data/server/instances/49/notifications/da0b7d2ef42d814b853496e9f3748e2b/subscription.xml +41 -0
- data/server/instances/49/properties.xml +186 -0
- data/server/resources/topics.xml +1 -0
- metadata +10 -4
- data/server/handlerwrappers/log.rb +0 -268
- data/server/server.pid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42201bf6ae8150fda07d193dcfa74ff93f8680aa
|
4
|
+
data.tar.gz: 5f5bef0e5a8212a977328a05969e5058555dabb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a49649ba5a52cc08390bf16fd51576a22f2ca6073d3d97346fb25c69a76ea7bd47b6b27cce4f7a7af88e660d6acf3f4ba0242a171a35bd7619795a393aa7eb38
|
7
|
+
data.tar.gz: d1a10b8278907b7350199008c9604fd5d61f43e188b22836f95d7bddc8f24de478636208b49995f5d17e0fb5344288265ddd9dabb5c1cbd546f361d2e4602eff
|
data/cockpit/css/ui.css
CHANGED
@@ -9,11 +9,19 @@ body {
|
|
9
9
|
|
10
10
|
#instance ui-content { height: 7em; }
|
11
11
|
|
12
|
-
#areanew td:nth-child(1) { width: 7em; padding-right:
|
13
|
-
#areanew td:nth-child(3) { width: 16em; padding-left:
|
14
|
-
#areanew input {
|
15
|
-
|
16
|
-
|
12
|
+
#areanew td:nth-child(1) { width: 7em; padding-right: 2em; }
|
13
|
+
#areanew td:nth-child(3) { width: 16em; padding-left: 2em; }
|
14
|
+
#areanew input {
|
15
|
+
width: 100%;
|
16
|
+
line-height: 1.5em;
|
17
|
+
height: 1.5em;
|
18
|
+
padding: 0.1em 0.5em;
|
19
|
+
border: 0.1em solid #a1a1a1;
|
20
|
+
border-radius: 0;
|
21
|
+
}
|
22
|
+
|
23
|
+
#areanew button[name=base] { width: 100%; padding: 0.5em 1em; margin-bottom: 0.1em; }
|
24
|
+
#areanew button[name=instance] { width: 100%; padding: 0.5em 1em; }
|
17
25
|
|
18
26
|
ui-tabbed ui-tabbar ui-behind button {
|
19
27
|
margin-left: 0.5em;
|
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.
|
3
|
+
s.version = "1.3.192"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.license = "LGPL-3.0"
|
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"
|
@@ -15,6 +15,7 @@
|
|
15
15
|
class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
16
16
|
def initialize(arguments,endpoint=nil,position=nil,continue=nil) # {{{
|
17
17
|
@controller = arguments[0]
|
18
|
+
@log_hash = {}
|
18
19
|
@handler_continue = continue
|
19
20
|
@handler_endpoint = endpoint
|
20
21
|
@handler_position = position
|
@@ -147,6 +148,8 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
147
148
|
result = XML::Smart::string(result[0].value.read) rescue nil
|
148
149
|
elsif result[0].mimetype == 'text/plain'
|
149
150
|
result = result[0].value.read
|
151
|
+
elsif result[0].mimetype == 'text/html'
|
152
|
+
result[0].value.read
|
150
153
|
else
|
151
154
|
result = result[0]
|
152
155
|
end
|
@@ -155,7 +158,24 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
155
158
|
result
|
156
159
|
end
|
157
160
|
|
161
|
+
def structurize_result(result)
|
162
|
+
result.map do |r|
|
163
|
+
if r.is_a? Riddl::Parameter::Simple
|
164
|
+
{ r.name => r.value }
|
165
|
+
elsif r.is_a? Riddl::Parameter::Complex
|
166
|
+
{
|
167
|
+
r.name => {
|
168
|
+
'mimetype' => r.mimetype,
|
169
|
+
'content' => r.value.read
|
170
|
+
}
|
171
|
+
}
|
172
|
+
r.value.rewind
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
158
177
|
def callback(result=nil,options={})
|
178
|
+
@controller.notify("activity/receiving", :instance => @controller.instance, :activity => @handler_position, :endpoint => @handler_endpoint, :received => structurize_result(result))
|
159
179
|
result = simplify_result(result)
|
160
180
|
if options['CPEE_UPDATE']
|
161
181
|
@handler_returnValue = result
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<?xml version="1.0"?>
|
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
|
+
|
18
|
+
<properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
|
19
|
+
<attributes>
|
20
|
+
<info/>
|
21
|
+
<modeltype>CPEE</modeltype>
|
22
|
+
<theme>default</theme>
|
23
|
+
</attributes>
|
24
|
+
<state>ready</state>
|
25
|
+
<handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
|
26
|
+
<positions/>
|
27
|
+
<dataelements/>
|
28
|
+
<endpoints>
|
29
|
+
<timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
|
30
|
+
</endpoints>
|
31
|
+
<dsl/>
|
32
|
+
<dslx>
|
33
|
+
<description xmlns="http://cpee.org/ns/description/1.0"/>
|
34
|
+
</dslx>
|
35
|
+
<status>
|
36
|
+
<id>0</id>
|
37
|
+
<message>undefined</message>
|
38
|
+
</status>
|
39
|
+
<description>
|
40
|
+
<description xmlns="http://cpee.org/ns/description/1.0"/>
|
41
|
+
</description>
|
42
|
+
<transformation>
|
43
|
+
<description type='copy'/>
|
44
|
+
<dataelements type='none'/>
|
45
|
+
<endpoints type='none'/>
|
46
|
+
</transformation>
|
47
|
+
</properties>
|
@@ -0,0 +1,149 @@
|
|
1
|
+
<properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
|
2
|
+
<attributes>
|
3
|
+
<info>Enter info here</info>
|
4
|
+
<modeltype>CPEE</modeltype>
|
5
|
+
<theme>default</theme>
|
6
|
+
</attributes>
|
7
|
+
<state>ready</state>
|
8
|
+
<handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
|
9
|
+
<positions/>
|
10
|
+
<dataelements>
|
11
|
+
<persons>3</persons>
|
12
|
+
<card>Visa_12345</card>
|
13
|
+
<airline>null</airline>
|
14
|
+
<hotels>[]</hotels>
|
15
|
+
<from>Vienna</from>
|
16
|
+
<to>Prague</to>
|
17
|
+
<costs>0</costs>
|
18
|
+
</dataelements>
|
19
|
+
<endpoints>
|
20
|
+
<bookAir>http://gruppe.wst.univie.ac.at/~mangler/services/airline.php</bookAir>
|
21
|
+
<bookHotel>http://gruppe.wst.univie.ac.at/~mangler/services/hotel.php</bookHotel>
|
22
|
+
<approve>http://gruppe.wst.univie.ac.at/~mangler/services/approval.php</approve>
|
23
|
+
</endpoints>
|
24
|
+
<dsl>call :a1, :bookAir, parameters: { :method => :post, :arguments => {:from => data.from, :to => data.to, :persons => data.persons} }, finalize: <<-END
|
25
|
+
data.airline = result.value('id')
|
26
|
+
data.costs += result.value('costs').to_f
|
27
|
+
status.update 1, 'Hotel'
|
28
|
+
END
|
29
|
+
parallel do
|
30
|
+
loop pre_test{data.persons > 0} do
|
31
|
+
parallel_branch data.persons do |p|
|
32
|
+
call :a2, :bookHotel, parameters: { :method => :post, :arguments => {:to => data.to} }, finalize: <<-END
|
33
|
+
data.hotels << result.value('id')
|
34
|
+
data.costs += result.value('costs').to_f
|
35
|
+
END
|
36
|
+
end
|
37
|
+
manipulate :a3, <<-END
|
38
|
+
data.persons -= 1
|
39
|
+
END
|
40
|
+
end
|
41
|
+
end
|
42
|
+
choose :inclusive do
|
43
|
+
alternative "data.costs > 700" do
|
44
|
+
call :a4, :approve, parameters: { :method => :post, :arguments => {:costs => data.costs} }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
</dsl>
|
48
|
+
<dslx>
|
49
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
50
|
+
<call id="a1" endpoint="bookAir">
|
51
|
+
<parameters>
|
52
|
+
<method>:post</method>
|
53
|
+
<arguments>
|
54
|
+
<from>data.from</from>
|
55
|
+
<to>data.to</to>
|
56
|
+
<persons>data.persons</persons>
|
57
|
+
</arguments>
|
58
|
+
</parameters>
|
59
|
+
<finalize output="result">data.airline = result.value('id')
|
60
|
+
data.costs += result.value('costs').to_f
|
61
|
+
status.update 1, 'Hotel'</finalize>
|
62
|
+
</call>
|
63
|
+
<parallel>
|
64
|
+
<loop mode="pre_test" condition="data.persons > 0">
|
65
|
+
<parallel_branch pass="data.persons" local="p">
|
66
|
+
<call id="a2" endpoint="bookHotel">
|
67
|
+
<parameters>
|
68
|
+
<method>:post</method>
|
69
|
+
<arguments>
|
70
|
+
<to>data.to</to>
|
71
|
+
</arguments>
|
72
|
+
</parameters>
|
73
|
+
<finalize output="result">data.hotels << result.value('id')
|
74
|
+
data.costs += result.value('costs').to_f</finalize>
|
75
|
+
</call>
|
76
|
+
</parallel_branch>
|
77
|
+
<manipulate id="a3">data.persons -= 1</manipulate>
|
78
|
+
</loop>
|
79
|
+
</parallel>
|
80
|
+
<choose>
|
81
|
+
<alternative condition="data.costs > 700">
|
82
|
+
<call id="a4" endpoint="approve">
|
83
|
+
<parameters>
|
84
|
+
<method>:post</method>
|
85
|
+
<arguments>
|
86
|
+
<costs>data.costs</costs>
|
87
|
+
</arguments>
|
88
|
+
</parameters>
|
89
|
+
</call>
|
90
|
+
</alternative>
|
91
|
+
</choose>
|
92
|
+
</description>
|
93
|
+
</dslx>
|
94
|
+
<status>
|
95
|
+
<id>0</id>
|
96
|
+
<message>undefined</message>
|
97
|
+
</status>
|
98
|
+
<description>
|
99
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
100
|
+
<call id="a1" endpoint="bookAir">
|
101
|
+
<parameters>
|
102
|
+
<method>:post</method>
|
103
|
+
<arguments>
|
104
|
+
<from>data.from</from>
|
105
|
+
<to>data.to</to>
|
106
|
+
<persons>data.persons</persons>
|
107
|
+
</arguments>
|
108
|
+
</parameters>
|
109
|
+
<finalize output="result">data.airline = result.value('id')
|
110
|
+
data.costs += result.value('costs').to_f
|
111
|
+
status.update 1, 'Hotel'</finalize>
|
112
|
+
</call>
|
113
|
+
<parallel>
|
114
|
+
<loop mode="pre_test" condition="data.persons > 0">
|
115
|
+
<parallel_branch pass="data.persons" local="p">
|
116
|
+
<call id="a2" endpoint="bookHotel">
|
117
|
+
<parameters>
|
118
|
+
<method>:post</method>
|
119
|
+
<arguments>
|
120
|
+
<to>data.to</to>
|
121
|
+
</arguments>
|
122
|
+
</parameters>
|
123
|
+
<finalize output="result">data.hotels << result.value('id')
|
124
|
+
data.costs += result.value('costs').to_f</finalize>
|
125
|
+
</call>
|
126
|
+
</parallel_branch>
|
127
|
+
<manipulate id="a3">data.persons -= 1</manipulate>
|
128
|
+
</loop>
|
129
|
+
</parallel>
|
130
|
+
<choose>
|
131
|
+
<alternative condition="data.costs > 700">
|
132
|
+
<call id="a4" endpoint="approve">
|
133
|
+
<parameters>
|
134
|
+
<method>:post</method>
|
135
|
+
<arguments>
|
136
|
+
<costs>data.costs</costs>
|
137
|
+
</arguments>
|
138
|
+
</parameters>
|
139
|
+
</call>
|
140
|
+
</alternative>
|
141
|
+
</choose>
|
142
|
+
</description>
|
143
|
+
</description>
|
144
|
+
<transformation>
|
145
|
+
<description type="copy"/>
|
146
|
+
<dataelements type="rest"/>
|
147
|
+
<endpoints type="rest"/>
|
148
|
+
</transformation>
|
149
|
+
</properties>
|
@@ -0,0 +1,122 @@
|
|
1
|
+
<log xmlns="http://www.xes-standard.org/" xes.version="1.0" xes.features="nested-attributes" openxes.version="1.0RC7">
|
2
|
+
<extension name="Time" prefix="time" uri="http://www.xes-standard.org/time.xesext"/>
|
3
|
+
<extension name="Concept" prefix="concept" uri="http://www.xes-standard.org/concept.xesext"/>
|
4
|
+
<extension name="Organizational" prefix="org" uri="http://www.xes-standard.org/org.xesext"/>
|
5
|
+
<trace>
|
6
|
+
<string key="concept:name" value="Instance 48"/>
|
7
|
+
<string key="concept:name" value="Instance 48"/>
|
8
|
+
<string key="concept:name" value="Instance 48"/>
|
9
|
+
<event>
|
10
|
+
<string key="concept:name" value="Sonja"/>
|
11
|
+
<list key="data_send">
|
12
|
+
<string key="timeout" value="2"/>
|
13
|
+
</list>
|
14
|
+
<list key="data_received">
|
15
|
+
<string key="html_text" value="Timeout: 2"/>
|
16
|
+
</list>
|
17
|
+
<date key="time:timestamp" value="2016-11-22 10:04:33 +0100"/>
|
18
|
+
</event>
|
19
|
+
<string key="concept:name" value="Instance 48"/>
|
20
|
+
<string key="concept:name" value="Instance 48"/>
|
21
|
+
<event>
|
22
|
+
<string key="concept:name" value=""/>
|
23
|
+
<list key="data_send">
|
24
|
+
<string key="timeout" value="2"/>
|
25
|
+
</list>
|
26
|
+
<list key="data_received">
|
27
|
+
<string key="html_text" value="Timeout: 2"/>
|
28
|
+
</list>
|
29
|
+
<date key="time:timestamp" value="2016-11-22 10:04:35 +0100"/>
|
30
|
+
</event>
|
31
|
+
<string key="concept:name" value="Instance 48"/>
|
32
|
+
<event>
|
33
|
+
<string key="concept:name" value=""/>
|
34
|
+
<list key="data_send">
|
35
|
+
<string key="timeout" value="3"/>
|
36
|
+
</list>
|
37
|
+
<list key="data_received">
|
38
|
+
<string key="html_text" value="Timeout: 3"/>
|
39
|
+
</list>
|
40
|
+
<date key="time:timestamp" value="2016-11-22 10:04:36 +0100"/>
|
41
|
+
</event>
|
42
|
+
<string key="concept:name" value="Instance 48"/>
|
43
|
+
<string key="concept:name" value="Instance 48"/>
|
44
|
+
<event>
|
45
|
+
<string key="concept:name" value=""/>
|
46
|
+
<list key="data_send">
|
47
|
+
<string key="timeout" value="1"/>
|
48
|
+
</list>
|
49
|
+
<list key="data_received">
|
50
|
+
<string key="html_text" value="Timeout: 1"/>
|
51
|
+
</list>
|
52
|
+
<date key="time:timestamp" value="2016-11-22 10:04:37 +0100"/>
|
53
|
+
</event>
|
54
|
+
<string key="concept:name" value="Instance 48"/>
|
55
|
+
<event>
|
56
|
+
<string key="concept:name" value=""/>
|
57
|
+
<date key="time:timestamp" value="2016-11-22 10:04:37 +0100"/>
|
58
|
+
</event>
|
59
|
+
<string key="concept:name" value="Instance 48"/>
|
60
|
+
<event>
|
61
|
+
<string key="concept:name" value=""/>
|
62
|
+
<list key="data_send">
|
63
|
+
<string key="timeout" value="1"/>
|
64
|
+
</list>
|
65
|
+
<list key="data_received">
|
66
|
+
<string key="html_text" value="Timeout: 1"/>
|
67
|
+
</list>
|
68
|
+
<date key="time:timestamp" value="2016-11-22 10:04:38 +0100"/>
|
69
|
+
</event>
|
70
|
+
<string key="concept:name" value="Instance 48"/>
|
71
|
+
<event>
|
72
|
+
<string key="concept:name" value=""/>
|
73
|
+
<date key="time:timestamp" value="2016-11-22 10:04:38 +0100"/>
|
74
|
+
</event>
|
75
|
+
<string key="concept:name" value="Instance 48"/>
|
76
|
+
<event>
|
77
|
+
<string key="concept:name" value=""/>
|
78
|
+
<list key="data_send">
|
79
|
+
<string key="timeout" value="1"/>
|
80
|
+
</list>
|
81
|
+
<list key="data_received">
|
82
|
+
<string key="html_text" value="Timeout: 1"/>
|
83
|
+
</list>
|
84
|
+
<date key="time:timestamp" value="2016-11-22 10:04:39 +0100"/>
|
85
|
+
</event>
|
86
|
+
<string key="concept:name" value="Instance 48"/>
|
87
|
+
<event>
|
88
|
+
<string key="concept:name" value=""/>
|
89
|
+
<date key="time:timestamp" value="2016-11-22 10:04:39 +0100"/>
|
90
|
+
</event>
|
91
|
+
<string key="concept:name" value="Instance 48"/>
|
92
|
+
<event>
|
93
|
+
<string key="concept:name" value=""/>
|
94
|
+
<list key="data_send">
|
95
|
+
<string key="timeout" value="1"/>
|
96
|
+
</list>
|
97
|
+
<list key="data_received">
|
98
|
+
<string key="html_text" value="Timeout: 1"/>
|
99
|
+
</list>
|
100
|
+
<date key="time:timestamp" value="2016-11-22 10:04:40 +0100"/>
|
101
|
+
</event>
|
102
|
+
<string key="concept:name" value="Instance 48"/>
|
103
|
+
<event>
|
104
|
+
<string key="concept:name" value=""/>
|
105
|
+
<date key="time:timestamp" value="2016-11-22 10:04:40 +0100"/>
|
106
|
+
</event>
|
107
|
+
<string key="concept:name" value="Instance 48"/>
|
108
|
+
<string key="concept:name" value="Instance 48"/>
|
109
|
+
<event>
|
110
|
+
<string key="concept:name" value=""/>
|
111
|
+
<list key="data_send">
|
112
|
+
<string key="timeout" value="1"/>
|
113
|
+
</list>
|
114
|
+
<list key="data_received">
|
115
|
+
<string key="html_text" value="Timeout: 1"/>
|
116
|
+
</list>
|
117
|
+
<date key="time:timestamp" value="2016-11-22 10:04:41 +0100"/>
|
118
|
+
</event>
|
119
|
+
<string key="concept:name" value="Instance 48"/>
|
120
|
+
<string key="concept:name" value="Instance 48"/>
|
121
|
+
</trace>
|
122
|
+
</log>
|
@@ -0,0 +1,186 @@
|
|
1
|
+
<properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
|
2
|
+
<attributes>
|
3
|
+
<info>Test</info>
|
4
|
+
<modeltype>CPEE</modeltype>
|
5
|
+
<theme>default</theme>
|
6
|
+
</attributes>
|
7
|
+
<state>finished</state>
|
8
|
+
<handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
|
9
|
+
<positions/>
|
10
|
+
<dataelements>
|
11
|
+
<i>-1</i>
|
12
|
+
</dataelements>
|
13
|
+
<endpoints>
|
14
|
+
<timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
|
15
|
+
</endpoints>
|
16
|
+
<dsl>call :a2, :timeout, parameters: { :label => "Sonja", :method => :post, :arguments => {:timeout => 2} }, finalize: <<-END
|
17
|
+
data.i += 1
|
18
|
+
data.i += 1
|
19
|
+
END
|
20
|
+
parallel :wait => -1 do
|
21
|
+
parallel_branch do ||
|
22
|
+
call :a3, :timeout, parameters: { :label => "", :method => :post, :arguments => {:timeout => 2} }
|
23
|
+
end
|
24
|
+
parallel_branch do ||
|
25
|
+
call :a4, :timeout, parameters: { :label => "", :method => :post, :arguments => {:timeout => 3} }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
loop pre_test{data.i > 0} do
|
29
|
+
call :a6, :timeout, parameters: { :label => "", :method => :post, :arguments => {:timeout => 1} }
|
30
|
+
manipulate :a7, <<-END
|
31
|
+
data.i -= 1
|
32
|
+
data.i -= 1
|
33
|
+
END
|
34
|
+
end
|
35
|
+
choose :exclusive do
|
36
|
+
alternative "true" do
|
37
|
+
call :a5, :timeout, parameters: { :label => "", :method => :post, :arguments => {:timeout => 1} }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
</dsl>
|
41
|
+
<dslx>
|
42
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
43
|
+
<call id="a2" endpoint="timeout">
|
44
|
+
<parameters>
|
45
|
+
<label>Sonja</label>
|
46
|
+
<method>:post</method>
|
47
|
+
<arguments>
|
48
|
+
<timeout>2</timeout>
|
49
|
+
</arguments>
|
50
|
+
</parameters>
|
51
|
+
<finalize output="result">
|
52
|
+
data.i += 1
|
53
|
+
data.i += 1</finalize>
|
54
|
+
<update output="result"/>
|
55
|
+
</call>
|
56
|
+
<parallel wait="-1">
|
57
|
+
<parallel_branch pass="" local="">
|
58
|
+
<call id="a3" endpoint="timeout">
|
59
|
+
<parameters>
|
60
|
+
<label/>
|
61
|
+
<method>:post</method>
|
62
|
+
<arguments>
|
63
|
+
<timeout>2</timeout>
|
64
|
+
</arguments>
|
65
|
+
</parameters>
|
66
|
+
</call>
|
67
|
+
</parallel_branch>
|
68
|
+
<parallel_branch pass="" local="">
|
69
|
+
<call id="a4" endpoint="timeout">
|
70
|
+
<parameters>
|
71
|
+
<label/>
|
72
|
+
<method>:post</method>
|
73
|
+
<arguments>
|
74
|
+
<timeout>3</timeout>
|
75
|
+
</arguments>
|
76
|
+
</parameters>
|
77
|
+
</call>
|
78
|
+
</parallel_branch>
|
79
|
+
</parallel>
|
80
|
+
<loop mode="pre_test" condition="data.i > 0">
|
81
|
+
<call id="a6" endpoint="timeout">
|
82
|
+
<parameters>
|
83
|
+
<label/>
|
84
|
+
<method>:post</method>
|
85
|
+
<arguments>
|
86
|
+
<timeout>1</timeout>
|
87
|
+
</arguments>
|
88
|
+
</parameters>
|
89
|
+
</call>
|
90
|
+
<manipulate id="a7">data.i -= 1
|
91
|
+
data.i -= 1</manipulate>
|
92
|
+
</loop>
|
93
|
+
<choose mode="exclusive">
|
94
|
+
<alternative condition="true">
|
95
|
+
<call id="a5" endpoint="timeout">
|
96
|
+
<parameters>
|
97
|
+
<label/>
|
98
|
+
<method>:post</method>
|
99
|
+
<arguments>
|
100
|
+
<timeout>1</timeout>
|
101
|
+
</arguments>
|
102
|
+
</parameters>
|
103
|
+
</call>
|
104
|
+
</alternative>
|
105
|
+
<otherwise/>
|
106
|
+
</choose>
|
107
|
+
</description>
|
108
|
+
</dslx>
|
109
|
+
<status>
|
110
|
+
<id>0</id>
|
111
|
+
<message>undefined</message>
|
112
|
+
</status>
|
113
|
+
<description>
|
114
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
115
|
+
<call id="a2" endpoint="timeout">
|
116
|
+
<parameters>
|
117
|
+
<label>Sonja</label>
|
118
|
+
<method>:post</method>
|
119
|
+
<arguments>
|
120
|
+
<timeout>2</timeout>
|
121
|
+
</arguments>
|
122
|
+
</parameters>
|
123
|
+
<finalize output="result">
|
124
|
+
data.i += 1
|
125
|
+
data.i += 1</finalize>
|
126
|
+
<update output="result"/>
|
127
|
+
</call>
|
128
|
+
<parallel wait="-1">
|
129
|
+
<parallel_branch pass="" local="">
|
130
|
+
<call id="a3" endpoint="timeout">
|
131
|
+
<parameters>
|
132
|
+
<label/>
|
133
|
+
<method>:post</method>
|
134
|
+
<arguments>
|
135
|
+
<timeout>2</timeout>
|
136
|
+
</arguments>
|
137
|
+
</parameters>
|
138
|
+
</call>
|
139
|
+
</parallel_branch>
|
140
|
+
<parallel_branch pass="" local="">
|
141
|
+
<call id="a4" endpoint="timeout">
|
142
|
+
<parameters>
|
143
|
+
<label/>
|
144
|
+
<method>:post</method>
|
145
|
+
<arguments>
|
146
|
+
<timeout>3</timeout>
|
147
|
+
</arguments>
|
148
|
+
</parameters>
|
149
|
+
</call>
|
150
|
+
</parallel_branch>
|
151
|
+
</parallel>
|
152
|
+
<loop mode="pre_test" condition="data.i > 0">
|
153
|
+
<call id="a6" endpoint="timeout">
|
154
|
+
<parameters>
|
155
|
+
<label/>
|
156
|
+
<method>:post</method>
|
157
|
+
<arguments>
|
158
|
+
<timeout>1</timeout>
|
159
|
+
</arguments>
|
160
|
+
</parameters>
|
161
|
+
</call>
|
162
|
+
<manipulate id="a7">data.i -= 1
|
163
|
+
data.i -= 1</manipulate>
|
164
|
+
</loop>
|
165
|
+
<choose mode="exclusive">
|
166
|
+
<alternative condition="true">
|
167
|
+
<call id="a5" endpoint="timeout">
|
168
|
+
<parameters>
|
169
|
+
<label/>
|
170
|
+
<method>:post</method>
|
171
|
+
<arguments>
|
172
|
+
<timeout>1</timeout>
|
173
|
+
</arguments>
|
174
|
+
</parameters>
|
175
|
+
</call>
|
176
|
+
</alternative>
|
177
|
+
<otherwise/>
|
178
|
+
</choose>
|
179
|
+
</description>
|
180
|
+
</description>
|
181
|
+
<transformation>
|
182
|
+
<description type="copy"/>
|
183
|
+
<dataelements type="none"/>
|
184
|
+
<endpoints type="none"/>
|
185
|
+
</transformation>
|
186
|
+
</properties>
|
@@ -0,0 +1 @@
|
|
1
|
+
3c80fa41431a46210ade5dca2f55fa66
|
@@ -0,0 +1 @@
|
|
1
|
+
39e7d320fac2877addf8a6d222b93cd8
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<subscription xmlns="http://riddl.org/ns/common-patterns/notifications-producer/1.0">
|
2
|
+
<topic id="activity">
|
3
|
+
<event>calling</event>
|
4
|
+
<event>status</event>
|
5
|
+
<event>manipulating</event>
|
6
|
+
<event>failed</event>
|
7
|
+
<event>done</event>
|
8
|
+
<vote>syncing_after</vote>
|
9
|
+
</topic>
|
10
|
+
<topic id="description">
|
11
|
+
<event>change</event>
|
12
|
+
<event>error</event>
|
13
|
+
</topic>
|
14
|
+
<topic id="position">
|
15
|
+
<event>change</event>
|
16
|
+
</topic>
|
17
|
+
<topic id="state">
|
18
|
+
<event>change</event>
|
19
|
+
</topic>
|
20
|
+
<topic id="dataelements">
|
21
|
+
<event>change</event>
|
22
|
+
</topic>
|
23
|
+
<topic id="endpoints">
|
24
|
+
<event>change</event>
|
25
|
+
</topic>
|
26
|
+
<topic id="attributes">
|
27
|
+
<event>change</event>
|
28
|
+
</topic>
|
29
|
+
<topic id="transformation">
|
30
|
+
<event>change</event>
|
31
|
+
</topic>
|
32
|
+
<topic id="handlerwrapper">
|
33
|
+
<event>result</event>
|
34
|
+
</topic>
|
35
|
+
<topic id="handlers">
|
36
|
+
<event>change</event>
|
37
|
+
</topic>
|
38
|
+
<topic id="xxx">
|
39
|
+
<fingerprint-with-producer-secre>xxx</fingerprint-with-producer-secre>
|
40
|
+
</topic>
|
41
|
+
</subscription>
|
@@ -0,0 +1,186 @@
|
|
1
|
+
<properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
|
2
|
+
<attributes>
|
3
|
+
<info>Test</info>
|
4
|
+
<modeltype>CPEE</modeltype>
|
5
|
+
<theme>default</theme>
|
6
|
+
</attributes>
|
7
|
+
<state>finished</state>
|
8
|
+
<handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
|
9
|
+
<positions/>
|
10
|
+
<dataelements>
|
11
|
+
<i>-1</i>
|
12
|
+
</dataelements>
|
13
|
+
<endpoints>
|
14
|
+
<timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
|
15
|
+
</endpoints>
|
16
|
+
<dsl>call :a2, :timeout, parameters: { :label => "Sonja", :method => :post, :arguments => {:timeout => 2} }, finalize: <<-END
|
17
|
+
data.i += 1
|
18
|
+
data.i += 1
|
19
|
+
END
|
20
|
+
parallel :wait => -1 do
|
21
|
+
parallel_branch do ||
|
22
|
+
call :a3, :timeout, parameters: { :label => "", :method => :post, :arguments => {:timeout => 2} }
|
23
|
+
end
|
24
|
+
parallel_branch do ||
|
25
|
+
call :a4, :timeout, parameters: { :label => "", :method => :post, :arguments => {:timeout => 3} }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
loop pre_test{data.i > 0} do
|
29
|
+
call :a6, :timeout, parameters: { :label => "", :method => :post, :arguments => {:timeout => 1} }
|
30
|
+
manipulate :a7, <<-END
|
31
|
+
data.i -= 1
|
32
|
+
data.i -= 1
|
33
|
+
END
|
34
|
+
end
|
35
|
+
choose :exclusive do
|
36
|
+
alternative "true" do
|
37
|
+
call :a5, :timeout, parameters: { :label => "", :method => :post, :arguments => {:timeout => 1} }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
</dsl>
|
41
|
+
<dslx>
|
42
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
43
|
+
<call id="a2" endpoint="timeout">
|
44
|
+
<parameters>
|
45
|
+
<label>Sonja</label>
|
46
|
+
<method>:post</method>
|
47
|
+
<arguments>
|
48
|
+
<timeout>2</timeout>
|
49
|
+
</arguments>
|
50
|
+
</parameters>
|
51
|
+
<finalize output="result">
|
52
|
+
data.i += 1
|
53
|
+
data.i += 1</finalize>
|
54
|
+
<update output="result"/>
|
55
|
+
</call>
|
56
|
+
<parallel wait="-1">
|
57
|
+
<parallel_branch pass="" local="">
|
58
|
+
<call id="a3" endpoint="timeout">
|
59
|
+
<parameters>
|
60
|
+
<label/>
|
61
|
+
<method>:post</method>
|
62
|
+
<arguments>
|
63
|
+
<timeout>2</timeout>
|
64
|
+
</arguments>
|
65
|
+
</parameters>
|
66
|
+
</call>
|
67
|
+
</parallel_branch>
|
68
|
+
<parallel_branch pass="" local="">
|
69
|
+
<call id="a4" endpoint="timeout">
|
70
|
+
<parameters>
|
71
|
+
<label/>
|
72
|
+
<method>:post</method>
|
73
|
+
<arguments>
|
74
|
+
<timeout>3</timeout>
|
75
|
+
</arguments>
|
76
|
+
</parameters>
|
77
|
+
</call>
|
78
|
+
</parallel_branch>
|
79
|
+
</parallel>
|
80
|
+
<loop mode="pre_test" condition="data.i > 0">
|
81
|
+
<call id="a6" endpoint="timeout">
|
82
|
+
<parameters>
|
83
|
+
<label/>
|
84
|
+
<method>:post</method>
|
85
|
+
<arguments>
|
86
|
+
<timeout>1</timeout>
|
87
|
+
</arguments>
|
88
|
+
</parameters>
|
89
|
+
</call>
|
90
|
+
<manipulate id="a7">data.i -= 1
|
91
|
+
data.i -= 1</manipulate>
|
92
|
+
</loop>
|
93
|
+
<choose mode="exclusive">
|
94
|
+
<alternative condition="true">
|
95
|
+
<call id="a5" endpoint="timeout">
|
96
|
+
<parameters>
|
97
|
+
<label/>
|
98
|
+
<method>:post</method>
|
99
|
+
<arguments>
|
100
|
+
<timeout>1</timeout>
|
101
|
+
</arguments>
|
102
|
+
</parameters>
|
103
|
+
</call>
|
104
|
+
</alternative>
|
105
|
+
<otherwise/>
|
106
|
+
</choose>
|
107
|
+
</description>
|
108
|
+
</dslx>
|
109
|
+
<status>
|
110
|
+
<id>0</id>
|
111
|
+
<message>undefined</message>
|
112
|
+
</status>
|
113
|
+
<description>
|
114
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
115
|
+
<call id="a2" endpoint="timeout">
|
116
|
+
<parameters>
|
117
|
+
<label>Sonja</label>
|
118
|
+
<method>:post</method>
|
119
|
+
<arguments>
|
120
|
+
<timeout>2</timeout>
|
121
|
+
</arguments>
|
122
|
+
</parameters>
|
123
|
+
<finalize output="result">
|
124
|
+
data.i += 1
|
125
|
+
data.i += 1</finalize>
|
126
|
+
<update output="result"/>
|
127
|
+
</call>
|
128
|
+
<parallel wait="-1">
|
129
|
+
<parallel_branch pass="" local="">
|
130
|
+
<call id="a3" endpoint="timeout">
|
131
|
+
<parameters>
|
132
|
+
<label/>
|
133
|
+
<method>:post</method>
|
134
|
+
<arguments>
|
135
|
+
<timeout>2</timeout>
|
136
|
+
</arguments>
|
137
|
+
</parameters>
|
138
|
+
</call>
|
139
|
+
</parallel_branch>
|
140
|
+
<parallel_branch pass="" local="">
|
141
|
+
<call id="a4" endpoint="timeout">
|
142
|
+
<parameters>
|
143
|
+
<label/>
|
144
|
+
<method>:post</method>
|
145
|
+
<arguments>
|
146
|
+
<timeout>3</timeout>
|
147
|
+
</arguments>
|
148
|
+
</parameters>
|
149
|
+
</call>
|
150
|
+
</parallel_branch>
|
151
|
+
</parallel>
|
152
|
+
<loop mode="pre_test" condition="data.i > 0">
|
153
|
+
<call id="a6" endpoint="timeout">
|
154
|
+
<parameters>
|
155
|
+
<label/>
|
156
|
+
<method>:post</method>
|
157
|
+
<arguments>
|
158
|
+
<timeout>1</timeout>
|
159
|
+
</arguments>
|
160
|
+
</parameters>
|
161
|
+
</call>
|
162
|
+
<manipulate id="a7">data.i -= 1
|
163
|
+
data.i -= 1</manipulate>
|
164
|
+
</loop>
|
165
|
+
<choose mode="exclusive">
|
166
|
+
<alternative condition="true">
|
167
|
+
<call id="a5" endpoint="timeout">
|
168
|
+
<parameters>
|
169
|
+
<label/>
|
170
|
+
<method>:post</method>
|
171
|
+
<arguments>
|
172
|
+
<timeout>1</timeout>
|
173
|
+
</arguments>
|
174
|
+
</parameters>
|
175
|
+
</call>
|
176
|
+
</alternative>
|
177
|
+
<otherwise/>
|
178
|
+
</choose>
|
179
|
+
</description>
|
180
|
+
</description>
|
181
|
+
<transformation>
|
182
|
+
<description type="copy"/>
|
183
|
+
<dataelements type="none"/>
|
184
|
+
<endpoints type="none"/>
|
185
|
+
</transformation>
|
186
|
+
</properties>
|
data/server/resources/topics.xml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.192
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-11-
|
14
|
+
date: 2016-11-22 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: riddl
|
@@ -275,7 +275,6 @@ files:
|
|
275
275
|
- log/template.xes
|
276
276
|
- log/topics.xml
|
277
277
|
- server/handlerwrappers/default.rb
|
278
|
-
- server/handlerwrappers/log.rb
|
279
278
|
- server/handlerwrappers/soap.rb
|
280
279
|
- server/instances/1/properties.xml
|
281
280
|
- server/instances/10/properties.xml
|
@@ -329,6 +328,14 @@ files:
|
|
329
328
|
- server/instances/44/properties.xml
|
330
329
|
- server/instances/45/log.xes
|
331
330
|
- server/instances/45/properties.xml
|
331
|
+
- server/instances/46/properties.xml
|
332
|
+
- server/instances/47/properties.xml
|
333
|
+
- server/instances/48/log.xes
|
334
|
+
- server/instances/48/properties.xml
|
335
|
+
- server/instances/49/notifications/da0b7d2ef42d814b853496e9f3748e2b/consumer-secret
|
336
|
+
- server/instances/49/notifications/da0b7d2ef42d814b853496e9f3748e2b/producer-secret
|
337
|
+
- server/instances/49/notifications/da0b7d2ef42d814b853496e9f3748e2b/subscription.xml
|
338
|
+
- server/instances/49/properties.xml
|
332
339
|
- server/instances/5/properties.xml
|
333
340
|
- server/instances/6/properties.xml
|
334
341
|
- server/instances/7/properties.xml
|
@@ -342,7 +349,6 @@ files:
|
|
342
349
|
- server/resources/topics.xml
|
343
350
|
- server/resources/transformation.xml
|
344
351
|
- server/resources/transformation_dslx.xsl
|
345
|
-
- server/server.pid
|
346
352
|
- server/server.rb
|
347
353
|
- test/callback.rb
|
348
354
|
homepage: http://cpee.org/
|
@@ -1,268 +0,0 @@
|
|
1
|
-
# This file is part of CPEE.
|
2
|
-
#
|
3
|
-
# CPEE is free software: you can redistribute it and/or modify it under the terms
|
4
|
-
# of the GNU General Public License as published by the Free Software Foundation,
|
5
|
-
# either version 3 of the License, or (at your option) any later version.
|
6
|
-
#
|
7
|
-
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
8
|
-
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
9
|
-
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
10
|
-
#
|
11
|
-
# You should have received a copy of the GNU General Public License along with
|
12
|
-
# CPEE (file COPYING in the main directory). If not, see
|
13
|
-
# <http://www.gnu.org/licenses/>.
|
14
|
-
|
15
|
-
class LogHandlerWrapper < WEEL::HandlerWrapperBase
|
16
|
-
LOGTEMPLATE = <<-END
|
17
|
-
<log xmlns="http://www.xes-standard.org/" xes.version="1.0" xes.features="nested-attributes" openxes.version="1.0RC7">
|
18
|
-
<extension name="Time" prefix="time" uri="http://www.xes-standard.org/time.xesext"/>
|
19
|
-
<extension name="Concept" prefix="concept" uri="http://www.xes-standard.org/concept.xesext"/>
|
20
|
-
<extension name="Organizational" prefix="org" uri="http://www.xes-standard.org/org.xesext"/>
|
21
|
-
<trace/>
|
22
|
-
</log>
|
23
|
-
END
|
24
|
-
|
25
|
-
def initialize(arguments,endpoint=nil,position=nil,continue=nil) # {{{
|
26
|
-
@controller = arguments[0]
|
27
|
-
@log_hash = {}
|
28
|
-
@handler_continue = continue
|
29
|
-
@handler_endpoint = endpoint
|
30
|
-
@handler_position = position
|
31
|
-
@handler_passthrough = nil
|
32
|
-
@handler_returnValue = nil
|
33
|
-
instancenr=@controller.instance.split('/').last
|
34
|
-
instance_dir = @controller.instance_variable_get(:@opts)[:instances]
|
35
|
-
|
36
|
-
XML::Smart.modify(instance_dir+'/'+instancenr+'/log.xes',LOGTEMPLATE) do |xml|
|
37
|
-
trace = xml.find("/xmlns:log/xmlns:trace").first
|
38
|
-
trace.add 'string', :key => "concept:name", :value => "Instance #{instancenr}"
|
39
|
-
end
|
40
|
-
end # }}}
|
41
|
-
|
42
|
-
def activity_handle(passthrough, parameters) # {{{
|
43
|
-
@controller.notify("activity/calling", :instance => @controller.instance, :activity => @handler_position, :passthrough => passthrough, :endpoint => @handler_endpoint, :parameters => parameters, :log_hash => @log_hash)
|
44
|
-
instancenr=@controller.instance.split('/').last
|
45
|
-
instance_dir = @controller.instance_variable_get(:@opts)[:instances]
|
46
|
-
unless File.exist?(instance_dir+'/'+instancenr+'/log.xes')
|
47
|
-
FileUtils.cp(instance_dir+'/template.xes', instance_dir+'/'+instancenr+'/log.xes')
|
48
|
-
XML::Smart.modify(instance_dir+'/'+instancenr+'/log.xes') do |xml|
|
49
|
-
trace = xml.find("/xmlns:log/xmlns:trace").first
|
50
|
-
trace.add 'string', :key => "concept:name", :value => "Instance #{instancenr}"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
@log_hash[:label]||=parameters[:label]
|
55
|
-
@log_hash[:data_send]||=parameters[:arguments] unless parameters[:arguments].nil?
|
56
|
-
result = []
|
57
|
-
if passthrough.nil?
|
58
|
-
params = []
|
59
|
-
callback = Digest::MD5.hexdigest(Kernel::rand().to_s)
|
60
|
-
(parameters[:arguments] || {}).each do |k,v|
|
61
|
-
if v.is_a?(Struct)
|
62
|
-
if v.respond_to?(:mimetype)
|
63
|
-
params << Riddl::Parameter::Complex.new("#{k}",v.mimetype,v.value)
|
64
|
-
else
|
65
|
-
params << Riddl::Parameter::Simple.new("#{k}",CPEE::ValueHelper::generate(v.value))
|
66
|
-
end
|
67
|
-
else
|
68
|
-
params << Riddl::Parameter::Simple.new("#{k}",CPEE::ValueHelper::generate(v))
|
69
|
-
end
|
70
|
-
end
|
71
|
-
params << Riddl::Header.new("CPEE_BASE",@controller.base_url)
|
72
|
-
params << Riddl::Header.new("CPEE_INSTANCE",@controller.instance_url)
|
73
|
-
params << Riddl::Header.new("CPEE_CALLBACK",@controller.instance_url + '/callbacks/' + callback)
|
74
|
-
params << Riddl::Header.new("CPEE_ACTIVITY",@handler_position)
|
75
|
-
params << Riddl::Header.new("CPEE_LABEL",parameters[:label])
|
76
|
-
@controller.attributes.each do |key,value|
|
77
|
-
params << Riddl::Header.new("CPEE_ATTR_#{key}",value)
|
78
|
-
end
|
79
|
-
|
80
|
-
type = parameters[:method] || 'post'
|
81
|
-
client = Riddl::Client.new(@handler_endpoint)
|
82
|
-
|
83
|
-
status, result, headers = client.request type => params
|
84
|
-
raise "Could not #{parameters[:method] || 'post'} #{@handler_endpoint}" if status != 200
|
85
|
-
|
86
|
-
if headers["CPEE_CALLBACK"] && headers["CPEE_CALLBACK"] == 'true'
|
87
|
-
@controller.callbacks[callback] = CPEE::Callback.new("callback activity: #{@handler_position}",self,:callback,nil,nil,:http)
|
88
|
-
@handler_passthrough = callback
|
89
|
-
else
|
90
|
-
callback result
|
91
|
-
end
|
92
|
-
else
|
93
|
-
@controller.callbacks[passthrough] = CPEE::Callback.new("callback activity: #{@handler_position}",self,:callback,nil,nil,:http)
|
94
|
-
@handler_passthrough = passthrough
|
95
|
-
end
|
96
|
-
end # }}}
|
97
|
-
|
98
|
-
def activity_result_status # {{{
|
99
|
-
WEEL::Status.new(1, "everything okay")
|
100
|
-
end # }}}
|
101
|
-
|
102
|
-
def activity_result_value # {{{
|
103
|
-
@handler_returnValue
|
104
|
-
end # }}}
|
105
|
-
|
106
|
-
def activity_stop # {{{
|
107
|
-
unless @handler_passthrough.nil?
|
108
|
-
@controller.callbacks.delete(@handler_passthrough)
|
109
|
-
end
|
110
|
-
end # }}}
|
111
|
-
def activity_passthrough_value # {{{
|
112
|
-
@handler_passthrough
|
113
|
-
end # }}}
|
114
|
-
|
115
|
-
def activity_no_longer_necessary # {{{
|
116
|
-
true
|
117
|
-
end # }}}
|
118
|
-
|
119
|
-
def inform_activity_done # {{{
|
120
|
-
@controller.notify("activity/done", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position,:log_hash => @log_hash)
|
121
|
-
time_added=false
|
122
|
-
XML::Smart.modify(@controller.instance_variable_get(:@opts)[:instances]+'/'+@controller.instance.split('/').last+'/log.xes') do |xml|
|
123
|
-
trace = xml.find("/xmlns:log/xmlns:trace").first
|
124
|
-
event = trace.add "event"
|
125
|
-
event.add 'string', :key => "concept:name", :value => @log_hash[:label]
|
126
|
-
if @log_hash.has_key?(:data_send)
|
127
|
-
list = event.add 'list', :key => "data_send"
|
128
|
-
@log_hash[:data_send].each do |k,v|
|
129
|
-
list.add 'string', :key => k , :value => v
|
130
|
-
end
|
131
|
-
end
|
132
|
-
if @log_hash.has_key?(:data_received)
|
133
|
-
@log_hash[:data_received].delete_if do |e|
|
134
|
-
if e.keys[0]=="timestamp"
|
135
|
-
event.add 'date', :key => "time:timestamp", :value => e.values[0]
|
136
|
-
time_added=true
|
137
|
-
true
|
138
|
-
else
|
139
|
-
false
|
140
|
-
end
|
141
|
-
end
|
142
|
-
if @log_hash[:data_received].length > 0
|
143
|
-
list = event.add 'list', :key => "data_received"
|
144
|
-
@log_hash[:data_received].each{|e| list.add 'string', :key => e.keys[0] , :value => e.values[0]}
|
145
|
-
end
|
146
|
-
end
|
147
|
-
event.add 'date', :key => "time:timestamp", :value => Time.now unless time_added
|
148
|
-
end
|
149
|
-
|
150
|
-
end # }}}
|
151
|
-
def inform_activity_manipulate # {{{
|
152
|
-
@controller.notify("activity/manipulating", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position)
|
153
|
-
end # }}}
|
154
|
-
def inform_activity_failed(err) # {{{
|
155
|
-
puts err.message
|
156
|
-
puts err.backtrace
|
157
|
-
@controller.notify("activity/failed", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position, :message => err.message, :line => err.backtrace[0].match(/(.*?):(\d+):/)[2], :where => err.backtrace[0].match(/(.*?):(\d+):/)[1])
|
158
|
-
end # }}}
|
159
|
-
|
160
|
-
def inform_syntax_error(err,code)# {{{
|
161
|
-
@controller.notify("description/error", :instance => @controller.instance, :message => err.message)
|
162
|
-
end# }}}
|
163
|
-
def inform_manipulate_change(status,changed_dataelements,changed_endpoints,dataelements,endpoints) # {{{
|
164
|
-
unless status.nil?
|
165
|
-
@controller.serialize_status!
|
166
|
-
@controller.notify("status/change", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position, :id => status.id, :message => status.message)
|
167
|
-
end
|
168
|
-
unless changed_dataelements.nil?
|
169
|
-
@controller.serialize_dataelements!
|
170
|
-
@controller.notify("dataelements/change", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position, :changed => changed_dataelements)
|
171
|
-
end
|
172
|
-
unless changed_endpoints.nil?
|
173
|
-
@controller.serialize_endpoints!
|
174
|
-
@controller.notify("endpoints/change", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position, :changed => changed_endpoints)
|
175
|
-
end
|
176
|
-
end # }}}
|
177
|
-
def inform_position_change(ipc={}) # {{{
|
178
|
-
@controller.serialize_positions!
|
179
|
-
ipc[:instance] = @controller.instance
|
180
|
-
@controller.notify("position/change", ipc)
|
181
|
-
end # }}}
|
182
|
-
def inform_state_change(newstate) # {{{
|
183
|
-
if @controller
|
184
|
-
@controller.serialize_state!
|
185
|
-
@controller.notify("state/change", :instance => @controller.instance, :state => newstate)
|
186
|
-
end
|
187
|
-
end # }}}
|
188
|
-
|
189
|
-
def vote_sync_after # {{{
|
190
|
-
@controller.call_vote("activity/syncing_after", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position)
|
191
|
-
end # }}}
|
192
|
-
def vote_sync_before(parameters=nil) # {{{
|
193
|
-
@controller.call_vote("activity/syncing_before", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position)
|
194
|
-
end # }}}
|
195
|
-
|
196
|
-
def simplify_result(result)
|
197
|
-
tmp = result.map do |r|
|
198
|
-
if r.is_a? Riddl::Parameter::Simple
|
199
|
-
{r.name => r.value}
|
200
|
-
elsif r.is_a? Riddl::Parameter::Complex
|
201
|
-
if r.mimetype == 'application/json'
|
202
|
-
x = JSON::parse(r.value.read)
|
203
|
-
r.value.rewind
|
204
|
-
x
|
205
|
-
elsif r.mimetype == 'application/xml' || r.mimetype == 'text/xml'
|
206
|
-
x = {"xml" => XML::Smart::string(result[0].value.read)}
|
207
|
-
x
|
208
|
-
elsif r.mimetype == 'text/plain'
|
209
|
-
{"plain_text" => r.value.read}
|
210
|
-
elsif r.mimetype == 'text/html'
|
211
|
-
{"html_text" => r.value.read}
|
212
|
-
else
|
213
|
-
r
|
214
|
-
end
|
215
|
-
end
|
216
|
-
end
|
217
|
-
if result.length == 1
|
218
|
-
if result[0].is_a? Riddl::Parameter::Simple
|
219
|
-
result = result[0].value
|
220
|
-
elsif result[0].is_a? Riddl::Parameter::Complex
|
221
|
-
if result[0].mimetype == 'application/json'
|
222
|
-
result = JSON::parse(result[0].value.read)
|
223
|
-
elsif result[0].mimetype == 'application/xml' || result[0].mimetype == 'text/xml'
|
224
|
-
result = XML::Smart::string(result[0].value.read)
|
225
|
-
elsif result[0].mimetype == 'text/plain'
|
226
|
-
result = result[0].value.read
|
227
|
-
elsif result[0].mimetype == 'text/html'
|
228
|
-
result[0].value.read
|
229
|
-
else
|
230
|
-
result = result[0]
|
231
|
-
end
|
232
|
-
end
|
233
|
-
end
|
234
|
-
[result,tmp]
|
235
|
-
end
|
236
|
-
|
237
|
-
def callback(result=nil,options={})
|
238
|
-
result,notify_result = simplify_result(result)
|
239
|
-
@controller.notify("activity/change", :instance => @controller.instance, :activity => @handler_position, :endpoint => @handler_endpoint, :params => notify_result)
|
240
|
-
@log_hash[:data_received]||=notify_result unless notify_result.nil?
|
241
|
-
if options['CPEE_UPDATE']
|
242
|
-
@handler_returnValue = result
|
243
|
-
if options['CPEE_UPDATE_STATUS']
|
244
|
-
@controller.notify("activity/status", :instance => @controller.instance, :activity => @handler_position, :endpoint => @handler_endpoint, :status => options['CPEE_UPDATE_STATUS'])
|
245
|
-
end
|
246
|
-
@handler_continue.continue WEEL::Signal::Again
|
247
|
-
else
|
248
|
-
@controller.callbacks.delete(@handler_passthrough)
|
249
|
-
@handler_returnValue = result
|
250
|
-
@handler_passthrough = nil
|
251
|
-
@handler_continue.continue
|
252
|
-
end
|
253
|
-
end
|
254
|
-
|
255
|
-
def simulate(type,nesting,tid,parent,parameters={}) #{{{
|
256
|
-
pp "#{type} - #{nesting} - #{tid} - #{parent} - #{parameters.inspect}"
|
257
|
-
|
258
|
-
@controller.call_vote("simulating/step",
|
259
|
-
:endpoint => @handler_endpoint,
|
260
|
-
:instance => @controller.instance,
|
261
|
-
:activity => tid,
|
262
|
-
:type => type,
|
263
|
-
:nesting => nesting,
|
264
|
-
:parent => parent,
|
265
|
-
:parameters => parameters
|
266
|
-
)
|
267
|
-
end #}}}
|
268
|
-
end
|
data/server/server.pid
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
25824
|