cpee 1.4.8 → 1.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/cockpit/config.json +6 -0
- data/cockpit/css/ui.css +7 -7
- data/cockpit/index.html +4 -4
- data/cockpit/js/instance.js +6 -3
- data/cockpit/themes/compact/theme.js +107 -6
- data/cockpit/themes/default/rngs/call.rng +29 -0
- data/cockpit/themes/default/rngs/callmanipulate.rng +29 -0
- data/cpee.gemspec +1 -1
- data/lib/cpee/controller.rb +1 -1
- data/lib/cpee/instantiation.rb +44 -21
- data/lib/engine/instances.rng +5 -2
- data/lib/instantiation.xml +5 -1
- data/log/elasticsearch.rb +1 -106
- data/log/elasticsearch_logging.rb +237 -0
- data/log/legacy/test_es.rb +26 -0
- data/log/legacy/test_split.rb +211 -0
- data/log/trace.yaml +17717 -0
- data/log/trace_sic.yaml +18343 -0
- data/server/handlerwrappers/default.rb +28 -23
- data/server/instances/1/properties.xml +158 -31
- data/server/instances/2/properties.xml +137 -12
- data/server/instances/3/properties.xml +116 -80
- data/server/resources/base.xml +78 -0
- data/server/resources/test.rb +19 -0
- data/server/resources/test.xml +33 -0
- data/server/resources/topics.xml +6 -3
- data/server/resources/transformation_dslx.xsl +5 -0
- data/server/server.pid +1 -0
- metadata +13 -71
- data/log/logs/1/test +0 -1
- data/server/instances/10/notifications/182434032285ca1d06a8b6554b8889c8/consumer-secret +0 -1
- data/server/instances/10/notifications/182434032285ca1d06a8b6554b8889c8/producer-secret +0 -1
- data/server/instances/10/notifications/182434032285ca1d06a8b6554b8889c8/subscription.xml +0 -23
- data/server/instances/10/notifications/512a3785631a5245dbb45fa150ea72ed/consumer-secret +0 -1
- data/server/instances/10/notifications/512a3785631a5245dbb45fa150ea72ed/producer-secret +0 -1
- data/server/instances/10/notifications/512a3785631a5245dbb45fa150ea72ed/subscription.xml +0 -6
- data/server/instances/10/properties.xml +0 -187
- data/server/instances/11/properties.xml +0 -191
- data/server/instances/12/properties.xml +0 -191
- data/server/instances/13/properties.xml +0 -204
- data/server/instances/14/properties.xml +0 -31
- data/server/instances/15/properties.xml +0 -30
- data/server/instances/16/properties.xml +0 -29
- data/server/instances/17/properties.xml +0 -29
- data/server/instances/18/properties.xml +0 -31
- data/server/instances/19/properties.xml +0 -31
- data/server/instances/20/properties.xml +0 -191
- data/server/instances/21/properties.xml +0 -156
- data/server/instances/22/properties.xml +0 -118
- data/server/instances/23/properties.xml +0 -118
- data/server/instances/24/properties.xml +0 -156
- data/server/instances/25/properties.xml +0 -156
- data/server/instances/26/properties.xml +0 -156
- data/server/instances/27/properties.xml +0 -140
- data/server/instances/28/properties.xml +0 -156
- data/server/instances/29/properties.xml +0 -156
- data/server/instances/30/properties.xml +0 -354
- data/server/instances/31/properties.xml +0 -354
- data/server/instances/313/notifications/crisp/consumer-secret +0 -1
- data/server/instances/313/notifications/crisp/producer-secret +0 -1
- data/server/instances/313/notifications/crisp/subscription.xml +0 -7
- data/server/instances/313/notifications/logging/consumer-secret +0 -1
- data/server/instances/313/notifications/logging/producer-secret +0 -1
- data/server/instances/313/notifications/logging/subscription.xml +0 -7
- data/server/instances/313/notifications/logging_yaml/consumer-secret +0 -1
- data/server/instances/313/notifications/logging_yaml/producer-secret +0 -1
- data/server/instances/313/notifications/logging_yaml/subscription.xml +0 -7
- data/server/instances/313/properties.xml +0 -524
- data/server/instances/32/properties.xml +0 -628
- data/server/instances/33/properties.xml +0 -156
- data/server/instances/4/properties.xml +0 -114
- data/server/instances/5/properties.xml +0 -114
- data/server/instances/6/properties.xml +0 -206
- data/server/instances/662/notifications/crisp/consumer-secret +0 -1
- data/server/instances/662/notifications/crisp/producer-secret +0 -1
- data/server/instances/662/notifications/crisp/subscription.xml +0 -7
- data/server/instances/662/notifications/logging/consumer-secret +0 -1
- data/server/instances/662/notifications/logging/producer-secret +0 -1
- data/server/instances/662/notifications/logging/subscription.xml +0 -7
- data/server/instances/662/notifications/logging_yaml/consumer-secret +0 -1
- data/server/instances/662/notifications/logging_yaml/producer-secret +0 -1
- data/server/instances/662/notifications/logging_yaml/subscription.xml +0 -7
- data/server/instances/662/properties.xml +0 -427
- data/server/instances/663/properties.xml +0 -31
- data/server/instances/664/properties.xml +0 -425
- data/server/instances/665/properties.xml +0 -425
- data/server/instances/666/properties.xml +0 -427
- data/server/instances/667/properties.xml +0 -427
- data/server/instances/668/properties.xml +0 -425
- data/server/instances/669/properties.xml +0 -425
- data/server/instances/670/properties.xml +0 -31
- data/server/instances/671/properties.xml +0 -158
- data/server/instances/672/properties.xml +0 -199
- data/server/instances/673/properties.xml +0 -52
- data/server/instances/7/properties.xml +0 -156
- data/server/instances/8/properties.xml +0 -118
- data/server/instances/9/properties.xml +0 -120
@@ -16,21 +16,23 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
16
16
|
def self::inform_state_change(arguments,newstate) # {{{
|
17
17
|
controller = arguments[0]
|
18
18
|
controller.serialize_state!
|
19
|
-
controller.notify("state/change", :instance => controller.instance, :state => newstate)
|
19
|
+
controller.notify("state/change", :instance => controller.instance, :instance_uuid => controller.uuid, :state => newstate, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
|
20
20
|
controller.finalize_if_finished
|
21
21
|
end # }}}
|
22
22
|
def self::inform_syntax_error(arguments,err,code)# {{{
|
23
23
|
controller = arguments[0]
|
24
|
-
controller.notify("description/error", :instance => controller.instance, :message => err.message)
|
24
|
+
controller.notify("description/error", :instance => controller.instance, :instance_uuid => controller.uuid, :message => err.message, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
|
25
25
|
end# }}}
|
26
26
|
def self::inform_handlerwrapper_error(arguments,err) # {{{
|
27
27
|
controller = arguments[0]
|
28
|
-
controller.notify("handlerwrapper/error", :instance => controller.instance, :message => err.message)
|
28
|
+
controller.notify("handlerwrapper/error", :instance => controller.instance, :instance_uuid => controller.uuid, :message => err.message, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
|
29
29
|
end # }}}
|
30
30
|
def self::inform_position_change(arguments,ipc={}) # {{{
|
31
31
|
controller = arguments[0]
|
32
32
|
controller.serialize_positions!
|
33
33
|
ipc[:instance] = controller.instance
|
34
|
+
ipc[:instance_uuid] = controller.uuid
|
35
|
+
ipc[:timestamp] = Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z")
|
34
36
|
controller.notify("position/change", ipc)
|
35
37
|
end # }}}
|
36
38
|
|
@@ -46,7 +48,8 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
46
48
|
|
47
49
|
def activity_handle(passthrough, parameters) # {{{
|
48
50
|
@label = parameters[:label]
|
49
|
-
@
|
51
|
+
@sensors = parameters[:sensors]
|
52
|
+
@controller.notify("activity/calling", :instance => @controller.instance, :instance_uuid => @controller.uuid, :label => @label, :instance_name => @controller.info, :activity => @handler_position, :passthrough => passthrough, :endpoint => @handler_endpoint, :parameters => parameters, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
|
50
53
|
if passthrough.nil?
|
51
54
|
params = []
|
52
55
|
callback = Digest::MD5.hexdigest(Kernel::rand().to_s)
|
@@ -71,13 +74,13 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
71
74
|
type = parameters[:method] || 'post'
|
72
75
|
client = Riddl::Client.new(@handler_endpoint)
|
73
76
|
|
77
|
+
@controller.callbacks[callback] = CPEE::Callback.new("callback activity: #{@handler_position}",self,:callback,nil,nil,:http)
|
78
|
+
@handler_passthrough = callback
|
79
|
+
|
74
80
|
status, result, headers = client.request type => params
|
75
81
|
raise "Could not #{parameters[:method] || 'post'} #{@handler_endpoint}" if status < 200 || status >= 300
|
76
82
|
|
77
|
-
|
78
|
-
@controller.callbacks[callback] = CPEE::Callback.new("callback activity: #{@handler_position}",self,:callback,nil,nil,:http)
|
79
|
-
@handler_passthrough = callback
|
80
|
-
else
|
83
|
+
unless headers["CPEE_CALLBACK"] && headers["CPEE_CALLBACK"] == 'true'
|
81
84
|
callback result
|
82
85
|
end
|
83
86
|
else
|
@@ -107,36 +110,36 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
107
110
|
end # }}}
|
108
111
|
|
109
112
|
def inform_activity_done # {{{
|
110
|
-
@controller.notify("activity/done", :endpoint => @handler_endpoint, :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :
|
113
|
+
@controller.notify("activity/done", :endpoint => @handler_endpoint, :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
|
111
114
|
end # }}}
|
112
115
|
def inform_activity_manipulate # {{{
|
113
|
-
@controller.notify("activity/manipulating", :endpoint => @handler_endpoint, :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :
|
116
|
+
@controller.notify("activity/manipulating", :endpoint => @handler_endpoint, :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
|
114
117
|
end # }}}
|
115
118
|
def inform_activity_failed(err) # {{{
|
116
119
|
puts err.message
|
117
120
|
puts err.backtrace
|
118
|
-
@controller.notify("activity/failed", :endpoint => @handler_endpoint, :label => @label, :instance_name => @controller.info, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :message => err.message, :line => err.backtrace[0].match(/(.*?):(\d+):/)[2], :where => err.backtrace[0].match(/(.*?):(\d+):/)[1], :
|
121
|
+
@controller.notify("activity/failed", :endpoint => @handler_endpoint, :label => @label, :instance_name => @controller.info, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :message => err.message, :line => err.backtrace[0].match(/(.*?):(\d+):/)[2], :where => err.backtrace[0].match(/(.*?):(\d+):/)[1], :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
|
119
122
|
end # }}}
|
120
123
|
def inform_manipulate_change(status,changed_dataelements,changed_endpoints,dataelements,endpoints) # {{{
|
121
124
|
unless status.nil?
|
122
125
|
@controller.serialize_status!
|
123
|
-
@controller.notify("status/change", :endpoint => @handler_endpoint, :label => @label, :instance_name => @controller.info, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :id => status.id, :message => status.message, :attributes => @controller.attributes_translated)
|
126
|
+
@controller.notify("status/change", :endpoint => @handler_endpoint, :label => @label, :instance_name => @controller.info, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :id => status.id, :message => status.message, :attributes => @controller.attributes_translated, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
|
124
127
|
end
|
125
128
|
unless changed_dataelements.nil?
|
126
129
|
@controller.serialize_dataelements!
|
127
|
-
@controller.notify("dataelements/change", :endpoint => @handler_endpoint, :label => @label, :instance_name => @controller.info, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :changed => changed_dataelements, :values => dataelements, :attributes => @controller.attributes_translated)
|
130
|
+
@controller.notify("dataelements/change", :endpoint => @handler_endpoint, :label => @label, :instance_name => @controller.info, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :changed => changed_dataelements, :values => dataelements, :attributes => @controller.attributes_translated, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
|
128
131
|
end
|
129
132
|
unless changed_endpoints.nil?
|
130
133
|
@controller.serialize_endpoints!
|
131
|
-
@controller.notify("endpoints/change", :endpoint => @handler_endpoint, :label => @label, :instance_name => @controller.info, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :changed => changed_endpoints, :values => endpoints, :attributes => @controller.attributes_translated)
|
134
|
+
@controller.notify("endpoints/change", :endpoint => @handler_endpoint, :label => @label, :instance_name => @controller.info, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :changed => changed_endpoints, :values => endpoints, :attributes => @controller.attributes_translated, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
|
132
135
|
end
|
133
136
|
end # }}}
|
134
137
|
|
135
138
|
def vote_sync_after # {{{
|
136
|
-
@controller.call_vote("activity/syncing_after", :endpoint => @handler_endpoint, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :
|
139
|
+
@controller.call_vote("activity/syncing_after", :endpoint => @handler_endpoint, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
|
137
140
|
end # }}}
|
138
141
|
def vote_sync_before(parameters=nil) # {{{
|
139
|
-
@controller.call_vote("activity/syncing_before", :endpoint => @handler_endpoint, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :parameters => parameters, :
|
142
|
+
@controller.call_vote("activity/syncing_before", :endpoint => @handler_endpoint, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :parameters => parameters, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
|
140
143
|
end # }}}
|
141
144
|
|
142
145
|
def simplify_result(result)
|
@@ -172,7 +175,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
172
175
|
def structurize_result(result)
|
173
176
|
result.map do |r|
|
174
177
|
if r.is_a? Riddl::Parameter::Simple
|
175
|
-
{ r.name => r.value }
|
178
|
+
{ 'name' => r.name, 'data' => r.value }
|
176
179
|
elsif r.is_a? Riddl::Parameter::Complex
|
177
180
|
res = if r.mimetype == 'application/json'
|
178
181
|
JSON::parse(r.value.read) rescue nil
|
@@ -185,10 +188,9 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
185
188
|
r.value.read
|
186
189
|
end
|
187
190
|
tmp = {
|
188
|
-
r.name == '' ? 'result' : r.name
|
189
|
-
|
190
|
-
|
191
|
-
}
|
191
|
+
'name' => r.name == '' ? 'result' : r.name,
|
192
|
+
'mimetype' => r.mimetype,
|
193
|
+
'data' => res
|
192
194
|
}
|
193
195
|
r.value.rewind
|
194
196
|
tmp
|
@@ -197,12 +199,15 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
|
|
197
199
|
end
|
198
200
|
|
199
201
|
def callback(result=nil,options={})
|
200
|
-
@controller.notify("activity/receiving", :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :received => structurize_result(result), :
|
202
|
+
@controller.notify("activity/receiving", :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :received => structurize_result(result), :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated, :sensors => @sensors)
|
201
203
|
result = simplify_result(result)
|
204
|
+
if options['CPEE_INSTANTIATION']
|
205
|
+
@controller.notify("task/instantiation", :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :received => structurize_result(result), :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
|
206
|
+
end
|
202
207
|
if options['CPEE_UPDATE']
|
203
208
|
@handler_returnValue = result
|
204
209
|
if options['CPEE_UPDATE_STATUS']
|
205
|
-
@controller.notify("activity/status", :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :status => options['CPEE_UPDATE_STATUS'], :
|
210
|
+
@controller.notify("activity/status", :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :status => options['CPEE_UPDATE_STATUS'], :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
|
206
211
|
end
|
207
212
|
@handler_continue.continue WEEL::Signal::Again
|
208
213
|
else
|
@@ -1,38 +1,114 @@
|
|
1
1
|
<properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
|
2
2
|
<attributes>
|
3
|
-
<uuid
|
4
|
-
<info>
|
3
|
+
<uuid>34574182-a968-4e52-b401-4a16604be6a9</uuid>
|
4
|
+
<info>Spawn Machining</info>
|
5
5
|
<modeltype>CPEE</modeltype>
|
6
|
+
<theme>default</theme>
|
7
|
+
<customer>pilotfabrik</customer>
|
8
|
+
<status>development</status>
|
9
|
+
<artefacts>[ { "group": "Orders", "name": "3D Printer Side" } ]</artefacts>
|
6
10
|
</attributes>
|
7
|
-
<state>
|
11
|
+
<state>ready</state>
|
8
12
|
<handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
|
9
13
|
<positions/>
|
10
14
|
<dataelements>
|
11
|
-
<
|
15
|
+
<instances>[]</instances>
|
12
16
|
</dataelements>
|
13
17
|
<endpoints>
|
14
18
|
<timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
|
15
|
-
<
|
19
|
+
<start_instance>https://centurio.work/flow/start/instance/</start_instance>
|
20
|
+
<start_url>https://centurio.work/flow/start/url/</start_url>
|
21
|
+
<hoert_die_signale>https://centurio.work/data/mm500/signals/</hoert_die_signale>
|
16
22
|
</endpoints>
|
17
|
-
<dsl>
|
18
|
-
|
19
|
-
|
20
|
-
|
23
|
+
<dsl>parallel :wait => -1 do
|
24
|
+
parallel_branch do
|
25
|
+
call :a1, :hoert_die_signale, parameters: { :label => "Listen to NC Start signals", :method => :get, :arguments => nil, :sensors => nil }, update: <<-END
|
26
|
+
data.instances << result
|
27
|
+
status.nudge!
|
28
|
+
END
|
29
|
+
end
|
30
|
+
parallel_branch do
|
31
|
+
loop pre_test{true} do
|
32
|
+
choose :exclusive do
|
33
|
+
alternative test{data.instances.empty?} do
|
34
|
+
manipulate :a3, { :label => "Sleep" }, <<-END
|
35
|
+
status.wait_until_nudged!
|
36
|
+
END
|
37
|
+
end
|
38
|
+
otherwise do
|
39
|
+
call :a2, :start_url, parameters: { :label => "Spawn Subprocess", :method => :post, :arguments => [⭐(:name => :info, :value => "3D Drucker Seite"), ⭐(:name => :behavior, :value => "fork_running"), ⭐(:name => :url, :value => "https://centurio.work/customers/prime/Machining%20MM500.xml"), ⭐(:name => :init, :value => "{ \"instance\": \"#{data.instances.last}\" }")] }, finalize: <<-END
|
40
|
+
data.instances.pop
|
41
|
+
END
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
21
46
|
end
|
22
47
|
</dsl>
|
23
48
|
<dslx>
|
24
49
|
<description xmlns="http://cpee.org/ns/description/1.0">
|
25
|
-
<
|
26
|
-
<
|
27
|
-
<
|
28
|
-
<
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
50
|
+
<parallel wait="-1">
|
51
|
+
<parallel_branch>
|
52
|
+
<call id="a1" endpoint="hoert_die_signale">
|
53
|
+
<parameters>
|
54
|
+
<label>Listen to NC Start signals</label>
|
55
|
+
<method>:get</method>
|
56
|
+
<arguments/>
|
57
|
+
<sensors/>
|
58
|
+
</parameters>
|
59
|
+
<finalize output="result"/>
|
60
|
+
<update output="result">data.instances << result
|
61
|
+
status.nudge!</update>
|
62
|
+
<_timing>
|
63
|
+
<_timing_min/>
|
64
|
+
<_timing_max/>
|
65
|
+
<_timing_avg/>
|
66
|
+
</_timing>
|
67
|
+
<_notes>
|
68
|
+
<_notes_general/>
|
69
|
+
<_notes_output/>
|
70
|
+
<_attachments/>
|
71
|
+
</_notes>
|
72
|
+
</call>
|
73
|
+
</parallel_branch>
|
74
|
+
<parallel_branch>
|
75
|
+
<loop mode="pre_test" condition="true">
|
76
|
+
<choose mode="exclusive">
|
77
|
+
<alternative condition="data.instances.empty?">
|
78
|
+
<manipulate id="a3" label="Sleep">status.wait_until_nudged!</manipulate>
|
79
|
+
</alternative>
|
80
|
+
<otherwise>
|
81
|
+
<call id="a2" endpoint="start_url">
|
82
|
+
<parameters>
|
83
|
+
<label>Spawn Subprocess</label>
|
84
|
+
<method>:post</method>
|
85
|
+
<arguments>
|
86
|
+
<info>3D Drucker Seite</info>
|
87
|
+
<behavior>fork_running</behavior>
|
88
|
+
<url>https://centurio.work/customers/prime/Machining%20MM500.xml</url>
|
89
|
+
<init>
|
90
|
+
<instance>!data.instances.last</instance>
|
91
|
+
</init>
|
92
|
+
</arguments>
|
93
|
+
</parameters>
|
94
|
+
<finalize output="result">data.instances.pop</finalize>
|
95
|
+
<update output="result"/>
|
96
|
+
<_timing>
|
97
|
+
<_timing_min/>
|
98
|
+
<_timing_max/>
|
99
|
+
<_timing_avg/>
|
100
|
+
</_timing>
|
101
|
+
<_notes>
|
102
|
+
<_notes_general/>
|
103
|
+
<_notes_output/>
|
104
|
+
<_attachments/>
|
105
|
+
</_notes>
|
106
|
+
</call>
|
107
|
+
</otherwise>
|
108
|
+
</choose>
|
109
|
+
</loop>
|
110
|
+
</parallel_branch>
|
111
|
+
</parallel>
|
36
112
|
</description>
|
37
113
|
</dslx>
|
38
114
|
<status>
|
@@ -41,17 +117,68 @@ end
|
|
41
117
|
</status>
|
42
118
|
<description>
|
43
119
|
<description xmlns="http://cpee.org/ns/description/1.0">
|
44
|
-
<
|
45
|
-
<
|
46
|
-
<
|
47
|
-
<
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
120
|
+
<parallel wait="-1">
|
121
|
+
<parallel_branch>
|
122
|
+
<call id="a1" endpoint="hoert_die_signale">
|
123
|
+
<parameters>
|
124
|
+
<label>Listen to NC Start signals</label>
|
125
|
+
<method>:get</method>
|
126
|
+
<arguments/>
|
127
|
+
<sensors/>
|
128
|
+
</parameters>
|
129
|
+
<finalize output="result"/>
|
130
|
+
<update output="result">data.instances << result
|
131
|
+
status.nudge!</update>
|
132
|
+
<_timing>
|
133
|
+
<_timing_min/>
|
134
|
+
<_timing_max/>
|
135
|
+
<_timing_avg/>
|
136
|
+
</_timing>
|
137
|
+
<_notes>
|
138
|
+
<_notes_general/>
|
139
|
+
<_notes_output/>
|
140
|
+
<_attachments/>
|
141
|
+
</_notes>
|
142
|
+
</call>
|
143
|
+
</parallel_branch>
|
144
|
+
<parallel_branch>
|
145
|
+
<loop mode="pre_test" condition="true">
|
146
|
+
<choose mode="exclusive">
|
147
|
+
<alternative condition="data.instances.empty?">
|
148
|
+
<manipulate id="a3" label="Sleep">status.wait_until_nudged!</manipulate>
|
149
|
+
</alternative>
|
150
|
+
<otherwise>
|
151
|
+
<call id="a2" endpoint="start_url">
|
152
|
+
<parameters>
|
153
|
+
<label>Spawn Subprocess</label>
|
154
|
+
<method>:post</method>
|
155
|
+
<arguments>
|
156
|
+
<info>3D Drucker Seite</info>
|
157
|
+
<behavior>fork_running</behavior>
|
158
|
+
<url>https://centurio.work/customers/prime/Machining%20MM500.xml</url>
|
159
|
+
<init>
|
160
|
+
<instance>!data.instances.last</instance>
|
161
|
+
</init>
|
162
|
+
</arguments>
|
163
|
+
</parameters>
|
164
|
+
<finalize output="result">data.instances.pop</finalize>
|
165
|
+
<update output="result"/>
|
166
|
+
<_timing>
|
167
|
+
<_timing_min/>
|
168
|
+
<_timing_max/>
|
169
|
+
<_timing_avg/>
|
170
|
+
</_timing>
|
171
|
+
<_notes>
|
172
|
+
<_notes_general/>
|
173
|
+
<_notes_output/>
|
174
|
+
<_attachments/>
|
175
|
+
</_notes>
|
176
|
+
</call>
|
177
|
+
</otherwise>
|
178
|
+
</choose>
|
179
|
+
</loop>
|
180
|
+
</parallel_branch>
|
181
|
+
</parallel>
|
55
182
|
</description>
|
56
183
|
</description>
|
57
184
|
<transformation>
|
@@ -1,31 +1,156 @@
|
|
1
1
|
<properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
|
2
2
|
<attributes>
|
3
|
-
<
|
3
|
+
<uuid>ead087ef-ee6d-4ae3-b8b6-189ace13b39c</uuid>
|
4
|
+
<info>Enter info here</info>
|
4
5
|
<modeltype>CPEE</modeltype>
|
5
6
|
<theme>default</theme>
|
6
|
-
<uuid/>
|
7
7
|
</attributes>
|
8
|
-
<state>
|
8
|
+
<state>finished</state>
|
9
9
|
<handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
|
10
10
|
<positions/>
|
11
|
-
<dataelements
|
11
|
+
<dataelements>
|
12
|
+
<persons>0</persons>
|
13
|
+
<card>Visa_12345</card>
|
14
|
+
<airline>AUA</airline>
|
15
|
+
<hotels>["Ibis","Ibis","Ibis"]</hotels>
|
16
|
+
<from>Vienna</from>
|
17
|
+
<to>Prague</to>
|
18
|
+
<costs>1145.0</costs>
|
19
|
+
</dataelements>
|
12
20
|
<endpoints>
|
13
|
-
<
|
21
|
+
<bookAir>http://gruppe.wst.univie.ac.at/~mangler/services/airline.php</bookAir>
|
22
|
+
<bookHotel>http://gruppe.wst.univie.ac.at/~mangler/services/hotel.php</bookHotel>
|
23
|
+
<approve>http://gruppe.wst.univie.ac.at/~mangler/services/approval.php</approve>
|
14
24
|
</endpoints>
|
15
|
-
<dsl
|
25
|
+
<dsl>call :a1, :bookAir, parameters: { :label => "Book Airline", :method => :post, :arguments => [⭐(:name => :from, :value => "data.from"), ⭐(:name => :to, :value => "data.to"), ⭐(:name => :persons, :value => "data.persons")] }, finalize: <<-END
|
26
|
+
data.airline = result.value('id')
|
27
|
+
data.costs += result.value('costs').to_f
|
28
|
+
status.update 1, 'Hotel'
|
29
|
+
END
|
30
|
+
parallel do
|
31
|
+
loop pre_test{data.persons > 0} do
|
32
|
+
parallel_branch data.persons do |p|
|
33
|
+
call :a2, :bookHotel, parameters: { :label => "Book Hotel", :method => :post, :arguments => [⭐(:name => :to, :value => "data.to")] }, finalize: <<-END
|
34
|
+
data.hotels << result.value('id')
|
35
|
+
data.costs += result.value('costs').to_f
|
36
|
+
END
|
37
|
+
end
|
38
|
+
manipulate :a3, <<-END
|
39
|
+
data.persons -= 1
|
40
|
+
END
|
41
|
+
end
|
42
|
+
end
|
43
|
+
choose :inclusive do
|
44
|
+
alternative test{data.costs > 700} do
|
45
|
+
call :a4, :approve, parameters: { :label => "Approve Hotel", :method => :post, :arguments => [⭐(:name => :costs, :value => "data.costs")] }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
</dsl>
|
16
49
|
<dslx>
|
17
|
-
<description xmlns="http://cpee.org/ns/description/1.0"
|
50
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
51
|
+
<call id="a1" endpoint="bookAir">
|
52
|
+
<parameters>
|
53
|
+
<label>Book Airline</label>
|
54
|
+
<method>:post</method>
|
55
|
+
<arguments>
|
56
|
+
<from>data.from</from>
|
57
|
+
<to>data.to</to>
|
58
|
+
<persons>data.persons</persons>
|
59
|
+
</arguments>
|
60
|
+
</parameters>
|
61
|
+
<finalize output="result">data.airline = result.value('id')
|
62
|
+
data.costs += result.value('costs').to_f
|
63
|
+
status.update 1, 'Hotel'</finalize>
|
64
|
+
</call>
|
65
|
+
<parallel>
|
66
|
+
<loop mode="pre_test" condition="data.persons > 0">
|
67
|
+
<parallel_branch pass="data.persons" local="p">
|
68
|
+
<call id="a2" endpoint="bookHotel">
|
69
|
+
<parameters>
|
70
|
+
<label>Book Hotel</label>
|
71
|
+
<method>:post</method>
|
72
|
+
<arguments>
|
73
|
+
<to>data.to</to>
|
74
|
+
</arguments>
|
75
|
+
</parameters>
|
76
|
+
<finalize output="result">data.hotels << result.value('id')
|
77
|
+
data.costs += result.value('costs').to_f</finalize>
|
78
|
+
</call>
|
79
|
+
</parallel_branch>
|
80
|
+
<manipulate id="a3">data.persons -= 1</manipulate>
|
81
|
+
</loop>
|
82
|
+
</parallel>
|
83
|
+
<choose mode="inclusive">
|
84
|
+
<alternative condition="data.costs > 700">
|
85
|
+
<call id="a4" endpoint="approve">
|
86
|
+
<parameters>
|
87
|
+
<label>Approve Hotel</label>
|
88
|
+
<method>:post</method>
|
89
|
+
<arguments>
|
90
|
+
<costs>data.costs</costs>
|
91
|
+
</arguments>
|
92
|
+
</parameters>
|
93
|
+
</call>
|
94
|
+
</alternative>
|
95
|
+
</choose>
|
96
|
+
</description>
|
18
97
|
</dslx>
|
19
98
|
<status>
|
20
|
-
<id>
|
21
|
-
<message>
|
99
|
+
<id>1</id>
|
100
|
+
<message>Hotel</message>
|
22
101
|
</status>
|
23
102
|
<description>
|
24
|
-
<description xmlns="http://cpee.org/ns/description/1.0"
|
103
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
104
|
+
<call id="a1" endpoint="bookAir">
|
105
|
+
<parameters>
|
106
|
+
<label>Book Airline</label>
|
107
|
+
<method>:post</method>
|
108
|
+
<arguments>
|
109
|
+
<from>data.from</from>
|
110
|
+
<to>data.to</to>
|
111
|
+
<persons>data.persons</persons>
|
112
|
+
</arguments>
|
113
|
+
</parameters>
|
114
|
+
<finalize output="result">data.airline = result.value('id')
|
115
|
+
data.costs += result.value('costs').to_f
|
116
|
+
status.update 1, 'Hotel'</finalize>
|
117
|
+
</call>
|
118
|
+
<parallel>
|
119
|
+
<loop mode="pre_test" condition="data.persons > 0">
|
120
|
+
<parallel_branch pass="data.persons" local="p">
|
121
|
+
<call id="a2" endpoint="bookHotel">
|
122
|
+
<parameters>
|
123
|
+
<label>Book Hotel</label>
|
124
|
+
<method>:post</method>
|
125
|
+
<arguments>
|
126
|
+
<to>data.to</to>
|
127
|
+
</arguments>
|
128
|
+
</parameters>
|
129
|
+
<finalize output="result">data.hotels << result.value('id')
|
130
|
+
data.costs += result.value('costs').to_f</finalize>
|
131
|
+
</call>
|
132
|
+
</parallel_branch>
|
133
|
+
<manipulate id="a3">data.persons -= 1</manipulate>
|
134
|
+
</loop>
|
135
|
+
</parallel>
|
136
|
+
<choose mode="inclusive">
|
137
|
+
<alternative condition="data.costs > 700">
|
138
|
+
<call id="a4" endpoint="approve">
|
139
|
+
<parameters>
|
140
|
+
<label>Approve Hotel</label>
|
141
|
+
<method>:post</method>
|
142
|
+
<arguments>
|
143
|
+
<costs>data.costs</costs>
|
144
|
+
</arguments>
|
145
|
+
</parameters>
|
146
|
+
</call>
|
147
|
+
</alternative>
|
148
|
+
</choose>
|
149
|
+
</description>
|
25
150
|
</description>
|
26
151
|
<transformation>
|
27
152
|
<description type="copy"/>
|
28
|
-
<dataelements type="
|
29
|
-
<endpoints type="
|
153
|
+
<dataelements type="rest"/>
|
154
|
+
<endpoints type="rest"/>
|
30
155
|
</transformation>
|
31
156
|
</properties>
|