cpee 1.3.187 → 1.3.188

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,15 @@
13
13
  # <http://www.gnu.org/licenses/>.
14
14
 
15
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
+
16
25
  def initialize(arguments,endpoint=nil,position=nil,continue=nil) # {{{
17
26
  @controller = arguments[0]
18
27
  @log_hash = {}
@@ -23,12 +32,10 @@ class LogHandlerWrapper < WEEL::HandlerWrapperBase
23
32
  @handler_returnValue = nil
24
33
  instancenr=@controller.instance.split('/').last
25
34
  instance_dir = @controller.instance_variable_get(:@opts)[:instances]
26
- unless File.exist?(instance_dir+'/'+instancenr+'/log.xes')
27
- FileUtils.cp(instance_dir+'/template.xes', instance_dir+'/'+instancenr+'/log.xes')
28
- XML::Smart.modify(instance_dir+'/'+instancenr+'/log.xes') do |xml|
29
- trace = xml.find("/xmlns:log/xmlns:trace").first
30
- trace.add 'string', :key => "concept:name", :value => "Instance #{instancenr}"
31
- end
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}"
32
39
  end
33
40
  end # }}}
34
41
 
@@ -111,8 +118,6 @@ class LogHandlerWrapper < WEEL::HandlerWrapperBase
111
118
 
112
119
  def inform_activity_done # {{{
113
120
  @controller.notify("activity/done", :endpoint => @handler_endpoint, :instance => @controller.instance, :activity => @handler_position,:log_hash => @log_hash)
114
- p "log"
115
- p @log_hash
116
121
  time_added=false
117
122
  XML::Smart.modify(@controller.instance_variable_get(:@opts)[:instances]+'/'+@controller.instance.split('/').last+'/log.xes') do |xml|
118
123
  trace = xml.find("/xmlns:log/xmlns:trace").first
@@ -231,7 +236,6 @@ class LogHandlerWrapper < WEEL::HandlerWrapperBase
231
236
 
232
237
  def callback(result=nil,options={})
233
238
  result,notify_result = simplify_result(result)
234
- pp result
235
239
  @controller.notify("activity/change", :instance => @controller.instance, :activity => @handler_position, :endpoint => @handler_endpoint, :params => notify_result)
236
240
  @log_hash[:data_received]||=notify_result unless notify_result.nil?
237
241
  if options['CPEE_UPDATE']
@@ -0,0 +1,137 @@
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 39"/>
7
+ <string key="concept:name" value="Instance 39"/>
8
+ <event>
9
+ <string key="concept:name" value=""/>
10
+ <list key="data_send">
11
+ <string key="timeout" value="2"/>
12
+ </list>
13
+ <list key="data_received">
14
+ <string key="html_text" value="Timeout: 2"/>
15
+ </list>
16
+ <date key="time:timestamp" value="2016-11-21 17:19:11 +0100"/>
17
+ </event>
18
+ <string key="concept:name" value="Instance 39"/>
19
+ <string key="concept:name" value="Instance 39"/>
20
+ <event>
21
+ <string key="concept:name" value=""/>
22
+ <list key="data_send">
23
+ <string key="timeout" value="2"/>
24
+ </list>
25
+ <list key="data_received">
26
+ <string key="html_text" value="Timeout: 2"/>
27
+ </list>
28
+ <date key="time:timestamp" value="2016-11-21 17:19:13 +0100"/>
29
+ </event>
30
+ <string key="concept:name" value="Instance 39"/>
31
+ <event>
32
+ <string key="concept:name" value=""/>
33
+ <list key="data_send">
34
+ <string key="timeout" value="3"/>
35
+ </list>
36
+ <list key="data_received">
37
+ <string key="html_text" value="Timeout: 3"/>
38
+ </list>
39
+ <date key="time:timestamp" value="2016-11-21 17:19:14 +0100"/>
40
+ </event>
41
+ <string key="concept:name" value="Instance 39"/>
42
+ <string key="concept:name" value="Instance 39"/>
43
+ <event>
44
+ <string key="concept:name" value=""/>
45
+ <list key="data_send">
46
+ <string key="timeout" value="1"/>
47
+ </list>
48
+ <list key="data_received">
49
+ <string key="html_text" value="Timeout: 1"/>
50
+ </list>
51
+ <date key="time:timestamp" value="2016-11-21 17:19:15 +0100"/>
52
+ </event>
53
+ <string key="concept:name" value="Instance 39"/>
54
+ <event>
55
+ <string key="concept:name" value=""/>
56
+ <date key="time:timestamp" value="2016-11-21 17:19:15 +0100"/>
57
+ </event>
58
+ <string key="concept:name" value="Instance 39"/>
59
+ <event>
60
+ <string key="concept:name" value=""/>
61
+ <list key="data_send">
62
+ <string key="timeout" value="1"/>
63
+ </list>
64
+ <list key="data_received">
65
+ <string key="html_text" value="Timeout: 1"/>
66
+ </list>
67
+ <date key="time:timestamp" value="2016-11-21 17:19:16 +0100"/>
68
+ </event>
69
+ <string key="concept:name" value="Instance 39"/>
70
+ <event>
71
+ <string key="concept:name" value=""/>
72
+ <date key="time:timestamp" value="2016-11-21 17:19:16 +0100"/>
73
+ </event>
74
+ <string key="concept:name" value="Instance 39"/>
75
+ <event>
76
+ <string key="concept:name" value=""/>
77
+ <list key="data_send">
78
+ <string key="timeout" value="1"/>
79
+ </list>
80
+ <list key="data_received">
81
+ <string key="html_text" value="Timeout: 1"/>
82
+ </list>
83
+ <date key="time:timestamp" value="2016-11-21 17:19:17 +0100"/>
84
+ </event>
85
+ <string key="concept:name" value="Instance 39"/>
86
+ <event>
87
+ <string key="concept:name" value=""/>
88
+ <date key="time:timestamp" value="2016-11-21 17:19:17 +0100"/>
89
+ </event>
90
+ <string key="concept:name" value="Instance 39"/>
91
+ <event>
92
+ <string key="concept:name" value=""/>
93
+ <list key="data_send">
94
+ <string key="timeout" value="1"/>
95
+ </list>
96
+ <list key="data_received">
97
+ <string key="html_text" value="Timeout: 1"/>
98
+ </list>
99
+ <date key="time:timestamp" value="2016-11-21 17:19:18 +0100"/>
100
+ </event>
101
+ <string key="concept:name" value="Instance 39"/>
102
+ <event>
103
+ <string key="concept:name" value=""/>
104
+ <date key="time:timestamp" value="2016-11-21 17:19:18 +0100"/>
105
+ </event>
106
+ <string key="concept:name" value="Instance 39"/>
107
+ <event>
108
+ <string key="concept:name" value=""/>
109
+ <list key="data_send">
110
+ <string key="timeout" value="1"/>
111
+ </list>
112
+ <list key="data_received">
113
+ <string key="html_text" value="Timeout: 1"/>
114
+ </list>
115
+ <date key="time:timestamp" value="2016-11-21 17:19:19 +0100"/>
116
+ </event>
117
+ <string key="concept:name" value="Instance 39"/>
118
+ <event>
119
+ <string key="concept:name" value=""/>
120
+ <date key="time:timestamp" value="2016-11-21 17:19:19 +0100"/>
121
+ </event>
122
+ <string key="concept:name" value="Instance 39"/>
123
+ <string key="concept:name" value="Instance 39"/>
124
+ <event>
125
+ <string key="concept:name" value=""/>
126
+ <list key="data_send">
127
+ <string key="timeout" value="1"/>
128
+ </list>
129
+ <list key="data_received">
130
+ <string key="html_text" value="Timeout: 1"/>
131
+ </list>
132
+ <date key="time:timestamp" value="2016-11-21 17:19:20 +0100"/>
133
+ </event>
134
+ <string key="concept:name" value="Instance 39"/>
135
+ <string key="concept:name" value="Instance 39"/>
136
+ </trace>
137
+ </log>
@@ -0,0 +1,176 @@
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>LogHandlerWrapper</handlerwrapper>
9
+ <positions/>
10
+ <dataelements>
11
+ <i>0</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 =&gt; nil, :method =&gt; :post, :arguments =&gt; {:timeout =&gt; 2} }
17
+ parallel :wait =&gt; -1 do
18
+ parallel_branch do ||
19
+ call :a3, :timeout, parameters: { :label =&gt; nil, :method =&gt; :post, :arguments =&gt; {:timeout =&gt; 2} }
20
+ end
21
+ parallel_branch do ||
22
+ call :a4, :timeout, parameters: { :label =&gt; nil, :method =&gt; :post, :arguments =&gt; {:timeout =&gt; 3} }
23
+ end
24
+ end
25
+ loop pre_test{data.i &gt; 0} do
26
+ call :a6, :timeout, parameters: { :label =&gt; nil, :method =&gt; :post, :arguments =&gt; {:timeout =&gt; 1} }
27
+ manipulate :a7, &lt;&lt;-END
28
+ data.i -= 1
29
+ END
30
+ end
31
+ choose :exclusive do
32
+ alternative "true" do
33
+ call :a5, :timeout, parameters: { :label =&gt; nil, :method =&gt; :post, :arguments =&gt; {:timeout =&gt; 1} }
34
+ end
35
+ end
36
+ </dsl>
37
+ <dslx>
38
+ <description xmlns="http://cpee.org/ns/description/1.0">
39
+ <call id="a2" endpoint="timeout">
40
+ <parameters>
41
+ <label/>
42
+ <method>:post</method>
43
+ <arguments>
44
+ <timeout>2</timeout>
45
+ </arguments>
46
+ </parameters>
47
+ <finalize output="result"/>
48
+ <update output="result"/>
49
+ </call>
50
+ <parallel wait="-1">
51
+ <parallel_branch pass="" local="">
52
+ <call id="a3" endpoint="timeout">
53
+ <parameters>
54
+ <label/>
55
+ <method>:post</method>
56
+ <arguments>
57
+ <timeout>2</timeout>
58
+ </arguments>
59
+ </parameters>
60
+ </call>
61
+ </parallel_branch>
62
+ <parallel_branch pass="" local="">
63
+ <call id="a4" endpoint="timeout">
64
+ <parameters>
65
+ <label/>
66
+ <method>:post</method>
67
+ <arguments>
68
+ <timeout>3</timeout>
69
+ </arguments>
70
+ </parameters>
71
+ </call>
72
+ </parallel_branch>
73
+ </parallel>
74
+ <loop mode="pre_test" condition="data.i &gt; 0">
75
+ <call id="a6" endpoint="timeout">
76
+ <parameters>
77
+ <label/>
78
+ <method>:post</method>
79
+ <arguments>
80
+ <timeout>1</timeout>
81
+ </arguments>
82
+ </parameters>
83
+ </call>
84
+ <manipulate id="a7">data.i -= 1</manipulate>
85
+ </loop>
86
+ <choose mode="exclusive">
87
+ <alternative condition="true">
88
+ <call id="a5" endpoint="timeout">
89
+ <parameters>
90
+ <label/>
91
+ <method>:post</method>
92
+ <arguments>
93
+ <timeout>1</timeout>
94
+ </arguments>
95
+ </parameters>
96
+ </call>
97
+ </alternative>
98
+ <otherwise/>
99
+ </choose>
100
+ </description>
101
+ </dslx>
102
+ <status>
103
+ <id>0</id>
104
+ <message>undefined</message>
105
+ </status>
106
+ <description>
107
+ <description xmlns="http://cpee.org/ns/description/1.0">
108
+ <call id="a2" endpoint="timeout">
109
+ <parameters>
110
+ <label/>
111
+ <method>:post</method>
112
+ <arguments>
113
+ <timeout>2</timeout>
114
+ </arguments>
115
+ </parameters>
116
+ <finalize output="result"/>
117
+ <update output="result"/>
118
+ </call>
119
+ <parallel wait="-1">
120
+ <parallel_branch pass="" local="">
121
+ <call id="a3" endpoint="timeout">
122
+ <parameters>
123
+ <label/>
124
+ <method>:post</method>
125
+ <arguments>
126
+ <timeout>2</timeout>
127
+ </arguments>
128
+ </parameters>
129
+ </call>
130
+ </parallel_branch>
131
+ <parallel_branch pass="" local="">
132
+ <call id="a4" endpoint="timeout">
133
+ <parameters>
134
+ <label/>
135
+ <method>:post</method>
136
+ <arguments>
137
+ <timeout>3</timeout>
138
+ </arguments>
139
+ </parameters>
140
+ </call>
141
+ </parallel_branch>
142
+ </parallel>
143
+ <loop mode="pre_test" condition="data.i &gt; 0">
144
+ <call id="a6" endpoint="timeout">
145
+ <parameters>
146
+ <label/>
147
+ <method>:post</method>
148
+ <arguments>
149
+ <timeout>1</timeout>
150
+ </arguments>
151
+ </parameters>
152
+ </call>
153
+ <manipulate id="a7">data.i -= 1</manipulate>
154
+ </loop>
155
+ <choose mode="exclusive">
156
+ <alternative condition="true">
157
+ <call id="a5" endpoint="timeout">
158
+ <parameters>
159
+ <label/>
160
+ <method>:post</method>
161
+ <arguments>
162
+ <timeout>1</timeout>
163
+ </arguments>
164
+ </parameters>
165
+ </call>
166
+ </alternative>
167
+ <otherwise/>
168
+ </choose>
169
+ </description>
170
+ </description>
171
+ <transformation>
172
+ <description type="copy"/>
173
+ <dataelements type="none"/>
174
+ <endpoints type="none"/>
175
+ </transformation>
176
+ </properties>
@@ -0,0 +1,44 @@
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
+ <endpoints>
12
+ <timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
13
+ </endpoints>
14
+ <dsl>parallel :wait =&gt; -1 do
15
+ end
16
+ choose :exclusive do
17
+ end
18
+ loop pre_test{} do
19
+ end
20
+ </dsl>
21
+ <dslx>
22
+ <description xmlns="http://cpee.org/ns/description/1.0">
23
+ <parallel wait="-1"/>
24
+ <choose mode="exclusive"/>
25
+ <loop mode="pre_test" condition=""/>
26
+ </description>
27
+ </dslx>
28
+ <status>
29
+ <id>0</id>
30
+ <message>undefined</message>
31
+ </status>
32
+ <description>
33
+ <description xmlns="http://cpee.org/ns/description/1.0">
34
+ <parallel wait="-1"/>
35
+ <choose mode="exclusive"/>
36
+ <loop mode="pre_test" condition=""/>
37
+ </description>
38
+ </description>
39
+ <transformation>
40
+ <description type="copy"/>
41
+ <dataelements type="none"/>
42
+ <endpoints type="none"/>
43
+ </transformation>
44
+ </properties>
@@ -0,0 +1,138 @@
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 41"/>
7
+ <string key="concept:name" value="Instance 41"/>
8
+ <string key="concept:name" value="Instance 41"/>
9
+ <event>
10
+ <string key="concept:name" value=""/>
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-21 17:25:39 +0100"/>
18
+ </event>
19
+ <string key="concept:name" value="Instance 41"/>
20
+ <string key="concept:name" value="Instance 41"/>
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-21 17:25:41 +0100"/>
30
+ </event>
31
+ <string key="concept:name" value="Instance 41"/>
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-21 17:25:42 +0100"/>
41
+ </event>
42
+ <string key="concept:name" value="Instance 41"/>
43
+ <string key="concept:name" value="Instance 41"/>
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-21 17:25:43 +0100"/>
53
+ </event>
54
+ <string key="concept:name" value="Instance 41"/>
55
+ <event>
56
+ <string key="concept:name" value=""/>
57
+ <date key="time:timestamp" value="2016-11-21 17:25:43 +0100"/>
58
+ </event>
59
+ <string key="concept:name" value="Instance 41"/>
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-21 17:25:44 +0100"/>
69
+ </event>
70
+ <string key="concept:name" value="Instance 41"/>
71
+ <event>
72
+ <string key="concept:name" value=""/>
73
+ <date key="time:timestamp" value="2016-11-21 17:25:44 +0100"/>
74
+ </event>
75
+ <string key="concept:name" value="Instance 41"/>
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-21 17:25:45 +0100"/>
85
+ </event>
86
+ <string key="concept:name" value="Instance 41"/>
87
+ <event>
88
+ <string key="concept:name" value=""/>
89
+ <date key="time:timestamp" value="2016-11-21 17:25:45 +0100"/>
90
+ </event>
91
+ <string key="concept:name" value="Instance 41"/>
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-21 17:25:46 +0100"/>
101
+ </event>
102
+ <string key="concept:name" value="Instance 41"/>
103
+ <event>
104
+ <string key="concept:name" value=""/>
105
+ <date key="time:timestamp" value="2016-11-21 17:25:46 +0100"/>
106
+ </event>
107
+ <string key="concept:name" value="Instance 41"/>
108
+ <event>
109
+ <string key="concept:name" value=""/>
110
+ <list key="data_send">
111
+ <string key="timeout" value="1"/>
112
+ </list>
113
+ <list key="data_received">
114
+ <string key="html_text" value="Timeout: 1"/>
115
+ </list>
116
+ <date key="time:timestamp" value="2016-11-21 17:25:47 +0100"/>
117
+ </event>
118
+ <string key="concept:name" value="Instance 41"/>
119
+ <event>
120
+ <string key="concept:name" value=""/>
121
+ <date key="time:timestamp" value="2016-11-21 17:25:47 +0100"/>
122
+ </event>
123
+ <string key="concept:name" value="Instance 41"/>
124
+ <string key="concept:name" value="Instance 41"/>
125
+ <event>
126
+ <string key="concept:name" value=""/>
127
+ <list key="data_send">
128
+ <string key="timeout" value="1"/>
129
+ </list>
130
+ <list key="data_received">
131
+ <string key="html_text" value="Timeout: 1"/>
132
+ </list>
133
+ <date key="time:timestamp" value="2016-11-21 17:25:48 +0100"/>
134
+ </event>
135
+ <string key="concept:name" value="Instance 41"/>
136
+ <string key="concept:name" value="Instance 41"/>
137
+ </trace>
138
+ </log>