server/instances/7/properties.xml in cpee-1.3.105 vs server/instances/7/properties.xml in cpee-1.3.106

- old
+ new

@@ -1,199 +1,483 @@ <properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0"> - <name>ADVENTURE Order</name> - <state>finished</state> + <name>RESCUE - Book Movie - Local</name> + <state>stopped</state> <handlerwrapper>DefaultHandlerWrapper</handlerwrapper> - <positions/> + <positions> + <use_repo_cinemas__call_find__perform_search>after</use_repo_cinemas__call_find__perform_search> + </positions> <dataelements> - <test>success</test> + <title>"Hobbit"</title> + <date>"2013-01-16"</date> + <selected_date>null</selected_date> + <starting_time>""</starting_time> + <selected_cinema>null</selected_cinema> + <selected_title>""</selected_title> + <hall>null</hall> + <zip>1100</zip> + <city>"Vienna"</city> + <reservation_number>null</reservation_number> + <result_use_repo_cinemas>{"properties":{"call_find":{"perform_search":{}},"call_book":{}}}</result_use_repo_cinemas> + <use_repo_cinemas__show_id>""</use_repo_cinemas__show_id> + <use_repo_cinemas__list>""</use_repo_cinemas__list> + <use_repo_cinemas__res>""</use_repo_cinemas__res> + <use_repo_cinemas__list_merge>""</use_repo_cinemas__list_merge> + <use_repo_cinemas__number_of_shows>""</use_repo_cinemas__number_of_shows> + <use_repo_cinemas__endpoint>""</use_repo_cinemas__endpoint> + <result_use_repo_cinemas__call_find>{}</result_use_repo_cinemas__call_find> </dataelements> <endpoints> - <gateway>http://localhost/gateways/timeout.php</gateway> + <services>http://localhost:9290/groups/Cinemas/</services> + <injection_handler>http://localhost:9291/</injection_handler> + <select>http://localhost:9293/pgwl</select> + <use_repo_cinemas__selected_cinema/> </endpoints> - <dsl>parallel do - parallel_branch do - activity :a9, :call, :gateway, :label =&gt; "Produce Headcap Subsystem", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] - activity :a10, :call, :gateway, :label =&gt; "Delivery", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] + <dsl>activity :collect_input, :call, :select, :method =&gt; "post", :info =&gt; "true", :templates =&gt; [ { :uri =&gt; 'http://gruppe.wst.univie.ac.at/~ralph/input-forms/cinemas.xsl' }, { :name =&gt; 'Cinemas-Input' }, { :lang =&gt; 'EN' } ] do |result| + + data.title = result.data.value('title') + data.date = result.data.value('date') + data.city = result.data.value('city') + +end +activity :use_repo_cinemas, :call, :services, :info =&gt; "true", :service =&gt; [ { :serviceoperation =&gt; "search_and_book" }, { :injection_handler =&gt; endpoints.injection_handler } ], :additional_endpoints =&gt; [ { :selector_service =&gt; "select" } ], :parameters =&gt; [ { :title =&gt; data.title }, { :date =&gt; data.date } ] + activity :create_objects_for_use_repo_cinemas, :manipulate do + data.result_use_repo_cinemas = RescueHash.new + data.result_use_repo_cinemas['properties'] = RescueHash.new + data.result_use_repo_cinemas['properties']["call_find"] = RescueHash.new + data.result_use_repo_cinemas['properties']["call_book"] = RescueHash.new + endpoints.use_repo_cinemas__selected_cinema = "" + data.use_repo_cinemas__show_id = '' + data.use_repo_cinemas__list = '' + data.use_repo_cinemas__res = '' + data.use_repo_cinemas__list_merge = '' + data.use_repo_cinemas__number_of_shows = '' + data.use_repo_cinemas__endpoint = '' + end - parallel_branch do - activity :a5, :call, :gateway, :label =&gt; "Supply Mechanical Parts", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] - activity :a6, :call, :gateway, :label =&gt; "Produce Mechanical Parts (A-Z)", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] - activity :a7, :call, :gateway, :label =&gt; "Perform Surface Treatment", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] - activity :a8, :call, :gateway, :label =&gt; "Mechanical Parts Assembly", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] + activity :use_repo_cinemas__call_find, :call, :services, :service =&gt; [ { :serviceoperation =&gt; "search" }, { :injection_handler =&gt; endpoints.injection_handler } ], :parameters =&gt; [ { :title =&gt; data.title }, { :date =&gt; data.date } ], :'call-oid' =&gt; 'call_find' + activity :create_objects_for_use_repo_cinemas__call_find, :manipulate do + data.result_use_repo_cinemas__call_find = RescueHash.new + data.result_use_repo_cinemas['properties']["call_find"]["perform_search"] = RescueHash.new + + end + activity :use_repo_cinemas__call_find__perform_search, :call, :services, :service =&gt; [ { :serviceoperation =&gt; "search" }, { :injection_handler =&gt; endpoints.injection_handler } ], :parameters =&gt; [ { :title =&gt; data.title }, { :date =&gt; data.date } ], :'call-oid' =&gt; 'perform_search' + parallel do + end + + activity :manipulate_from_use_repo_cinemas__call_find__perform_search, :manipulate, nil,data.result_use_repo_cinemas__call_find do |result| +properties = data.result_use_repo_cinemas['properties']["call_find"] +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas__call_find['list_shows'] = result[0].value('list') + + end + + activity :manipulate_from_use_repo_cinemas__call_find, :manipulate, nil,data.result_use_repo_cinemas__call_find do |result| +properties = data.result_use_repo_cinemas['properties'] +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.use_repo_cinemas__list = result[0].value('list') + end - parallel_branch do - parallel do - parallel_branch do - activity :a2, :call, :gateway, :label =&gt; "Supply Electric Parts", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] - activity :a3, :call, :gateway, :label =&gt; "Delivery", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] + activity :remove_objects_of_use_repo_cinemas__call_find, :manipulate do + data.delete(:"result_use_repo_cinemas__call_find") + + end + activity :use_repo_cinemas__merge_result, :manipulate do +list = data.use_repo_cinemas__list +m_list = data.use_repo_cinemas__list_merge +nos = data.use_repo_cinemas__number_of_shows + +title = data.title +date = data.date + xml = XML::Smart.string("&lt;list_of_shows/&gt;") + if list.class == Array + list.each do |v| + l = XML::Smart.string(v) + xml.root.add(l.find("//show")) + end + elsif list.class == String + l = XML::Smart.string(list) + xml.root.add(l.find("//show")) + else + raise "Unexpected class of return-value - class: #{list.class}" + end + m_list = xml.root.dump + nos = xml.root.children.length +data.use_repo_cinemas__list = list +data.use_repo_cinemas__list_merge = m_list +data.use_repo_cinemas__number_of_shows = nos + + end + choose do + alternative (data.use_repo_cinemas__number_of_shows.&gt;(0)) do + activity :use_repo_cinemas__perform_select, :call, :select, :templates =&gt; [ { :uri =&gt; 'http://localhost:9290/groups/Cinemas//operations/search_and_book/templates/perform_select' }, { :name =&gt; 'Select_Show' }, { :lang =&gt; 'EN' } ], :method =&gt; "post", :info =&gt; "true", :parameters =&gt; [ { :data =&gt; data.use_repo_cinemas__list_merge } ], :'call-oid' =&gt; 'perform_select' do |result| +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.use_repo_cinemas__show_id = result[0].value('show_id') +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.use_repo_cinemas__endpoint = result[0].value('target') +data.result_use_repo_cinemas['status'] = result[1] + +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas['movie_title'] = result[0].value('movie_title') +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas['selected_date'] = result[0].value('date') +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas['starting_time'] = result[0].value('starting_time') +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas['hall'] = result[0].value('hall') + end - parallel_branch do - activity :a1, :call, :gateway, :label =&gt; "Develop Control System", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] + activity :use_repo_cinemas__set_selected_endpoint, :manipulate do +ep = data.use_repo_cinemas__endpoint +selected = endpoints.use_repo_cinemas__selected_cinema + + selected = ep + data.use_repo_cinemas__endpoint = ep +endpoints.use_repo_cinemas__selected_cinema = selected + end + activity :use_repo_cinemas__call_book, :call, :use_repo_cinemas__selected_cinema, :service =&gt; [ { :serviceoperation =&gt; "book" }, { :injection_handler =&gt; endpoints.injection_handler } ], :parameters =&gt; [ { :show_id =&gt; data.use_repo_cinemas__show_id } ], :'call-oid' =&gt; 'call_book' do |result| +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas['reservation_id'] = result[0].value('reservation_number') + + end + activity :use_repo_cinemas__set_status_success, :manipulate do + + status = 200 + data.result_use_repo_cinemas['status'] = status + + end end - activity :a4, :call, :gateway, :label =&gt; "Electric Board Assembly", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] + otherwise do + activity :use_repo_cinemas__set_status_failed, :manipulate do + + status = 404 + data.result_use_repo_cinemas['status'] = status + + end + end end + +activity :manipulate_from_use_repo_cinemas, :manipulate, nil,data.result_use_repo_cinemas do |result| +properties = data.result_use_repo_cinemas['properties'] + + res = result[0] + if res['status'] == 200 + # Computing service responses + data.reservation_number = res['reservation_id'] + data.starting_time = res['starting_time'] + data.selected_title = res['movie_title'] + data.selected_date = res['selected_date'] + data.hall = res['hall'] + # Computing properties of executed services + perf_book = properties['call_book']['perform_book'] + data.selected_cinema = " #{perf_book.values[0]['vendor']['name']}\n#{perf_book.values[0]['address']['street']}\n#{perf_book.values[0]['address']['zip']} #{perf_book.values[0]['address']['city']}" + end + end -activity :a11, :call, :gateway, :label =&gt; "Systems Integration", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] -activity :a12, :call, :gateway, :label =&gt; "Test", :method =&gt; "post", :parameters =&gt; [ { :timeout =&gt; 4 } ] do |result| - data.test = "success" +activity :remove_objects_of_use_repo_cinemas, :manipulate do + data.delete(:"result_use_repo_cinemas") + data.delete(:"properties_use_repo_cinemas") + endpoints.delete(:"use_repo_cinemas__selected_cinema") + data.delete(:"use_repo_cinemas__show_id") + data.delete(:"use_repo_cinemas__list") + data.delete(:"use_repo_cinemas__res") + data.delete(:"use_repo_cinemas__list_merge") + data.delete(:"use_repo_cinemas__number_of_shows") + data.delete(:"use_repo_cinemas__endpoint") + end +activity :confirm, :call, :select, :method =&gt; "post", :info =&gt; "true", :templates =&gt; [ { :uri =&gt; 'http://gruppe.wst.univie.ac.at/~ralph/input-forms/cinemas.xsl' }, { :name =&gt; 'Cinemas-Output' }, { :lang =&gt; 'EN' } ], :parameters =&gt; [ { :title =&gt; data.selected_title }, { :date =&gt; data.selected_date }, { :time =&gt; data.starting_time }, { :hall =&gt; data.hall }, { :res_nr =&gt; data.reservation_number }, { :cinema =&gt; data.selected_cinema } ] </dsl> <status> <id>0</id> <message>undefined</message> </status> <description> <description xmlns="http://cpee.org/ns/description/1.0"> - <!--{{{--> - <parallel> - <parallel_branch> - <call id="a9" endpoint="gateway"> + <call id="collect_input" endpoint="select"> + <parameters> + <method>post</method> + <info>true</info> + <templates> + <uri>'http://gruppe.wst.univie.ac.at/~ralph/input-forms/cinemas.xsl'</uri> + <name>'Cinemas-Input'</name> + <lang>'EN'</lang> + </templates> + </parameters> + <manipulate output="result"> + data.title = result.data.value('title') + data.date = result.data.value('date') + data.city = result.data.value('city') + </manipulate> + </call> + <call id="use_repo_cinemas" endpoint="services"> + <constraints> + <constraint xpath="address/city" comparator="==" variable="city"/> + </constraints> + <parameters> + <!--{{{--> + <info>true</info> + <service> + <serviceoperation>"search_and_book"</serviceoperation> + <injection_handler>endpoints.injection_handler</injection_handler> + </service> + <additional_endpoints> + <selector_service>"select"</selector_service> + </additional_endpoints> + <parameters> + <title>data.title</title> + <date>data.date</date> + </parameters> + </parameters> + <!--}}}--> + </call> + <group type="injection" source="use_repo_cinemas" serviceoperation="&quot;search_and_book&quot;" result="data.result_use_repo_cinemas" properties="data.result_use_repo_cinemas['properties']"> + <manipulate id="create_objects_for_use_repo_cinemas" generated="true"> data.result_use_repo_cinemas = RescueHash.new + data.result_use_repo_cinemas['properties'] = RescueHash.new + data.result_use_repo_cinemas['properties']["call_find"] = RescueHash.new + data.result_use_repo_cinemas['properties']["call_book"] = RescueHash.new + endpoints.use_repo_cinemas__selected_cinema = "" + data.use_repo_cinemas__show_id = '' + data.use_repo_cinemas__list = '' + data.use_repo_cinemas__res = '' + data.use_repo_cinemas__list_merge = '' + data.use_repo_cinemas__number_of_shows = '' + data.use_repo_cinemas__endpoint = '' +</manipulate> + <constraints> + <constraint xpath="address/city" comparator="==" variable="city"/> + </constraints> + <call id="use_repo_cinemas__call_find" endpoint="services" oid="call_find"> + <parameters> + <service> + <serviceoperation>"search"</serviceoperation> + <injection_handler>endpoints.injection_handler</injection_handler> + </service> <parameters> - <!--{{{--> - <label>Produce Headcap Subsystem</label> - <method>post</method> - <parameters> - <timeout>4</timeout> - </parameters> + <title>data.title</title> + <date>data.date</date> </parameters> - <!--}}}--> - </call> - <call id="a10" endpoint="gateway"> + </parameters> + </call> + <group type="injection" source="use_repo_cinemas__call_find" serviceoperation="&quot;search&quot;" result="data.result_use_repo_cinemas__call_find" properties="data.result_use_repo_cinemas['properties'][&quot;call_find&quot;]"> + <manipulate id="create_objects_for_use_repo_cinemas__call_find" generated="true"> data.result_use_repo_cinemas__call_find = RescueHash.new + data.result_use_repo_cinemas['properties']["call_find"]["perform_search"] = RescueHash.new +</manipulate> + <call id="use_repo_cinemas__call_find__perform_search" endpoint="services" oid="perform_search"> <parameters> - <!--{{{--> - <label>Delivery</label> - <method>post</method> + <service> + <serviceoperation>"search"</serviceoperation> + <injection_handler>endpoints.injection_handler</injection_handler> + </service> <parameters> - <timeout>4</timeout> + <title>data.title</title> + <date>data.date</date> </parameters> </parameters> - <!--}}}--> </call> - </parallel_branch> - <parallel_branch> - <call id="a5" endpoint="gateway"> - <parameters> - <!--{{{--> - <label>Supply Mechanical Parts</label> - <method>post</method> + <group type="injection" source="use_repo_cinemas__call_find__perform_search" serviceoperation="&quot;search&quot;" properties="data.result_use_repo_cinemas['properties'][&quot;call_find&quot;][&quot;perform_search&quot;]"> + <parallel generated="true"/> + </group> + <manipulate output="result" id="manipulate_from_use_repo_cinemas__call_find__perform_search" data="data.result_use_repo_cinemas__call_find" properties="data.result_use_repo_cinemas['properties'][&quot;call_find&quot;]">properties = data.result_use_repo_cinemas['properties']["call_find"] +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas__call_find['list_shows'] = result[0].value('list') +</manipulate> + </group> + <manipulate output="result" id="manipulate_from_use_repo_cinemas__call_find" data="data.result_use_repo_cinemas__call_find" properties="data.result_use_repo_cinemas['properties']">properties = data.result_use_repo_cinemas['properties'] +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.use_repo_cinemas__list = result[0].value('list') +</manipulate> + <manipulate id="remove_objects_of_use_repo_cinemas__call_find" generated="true"> data.delete(:"result_use_repo_cinemas__call_find") +</manipulate> + <manipulate id="use_repo_cinemas__merge_result" oid="merge_result">list = data.use_repo_cinemas__list +m_list = data.use_repo_cinemas__list_merge +nos = data.use_repo_cinemas__number_of_shows + +title = data.title +date = data.date + xml = XML::Smart.string("&lt;list_of_shows/&gt;") + if list.class == Array + list.each do |v| + l = XML::Smart.string(v) + xml.root.add(l.find("//show")) + end + elsif list.class == String + l = XML::Smart.string(list) + xml.root.add(l.find("//show")) + else + raise "Unexpected class of return-value - class: #{list.class}" + end + m_list = xml.root.dump + nos = xml.root.children.length +data.use_repo_cinemas__list = list +data.use_repo_cinemas__list_merge = m_list +data.use_repo_cinemas__number_of_shows = nos +</manipulate> + <choose> + <alternative condition="(data.use_repo_cinemas__number_of_shows.&gt;(0))"> + <call id="use_repo_cinemas__perform_select" endpoint="select" oid="perform_select"> <parameters> - <timeout>4</timeout> + <templates> + <uri>'http://localhost:9290/groups/Cinemas//operations/search_and_book/templates/perform_select'</uri> + <name>'Select_Show'</name> + <lang>'EN'</lang> + </templates> + <method>post</method> + <info>true</info> + <parameters> + <data>data.use_repo_cinemas__list_merge</data> + </parameters> </parameters> - </parameters> - <!--}}}--> - </call> - <call id="a6" endpoint="gateway"> - <parameters> - <!--{{{--> - <label>Produce Mechanical Parts (A-Z)</label> - <method>post</method> + <manipulate output="result"># Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.use_repo_cinemas__show_id = result[0].value('show_id') +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.use_repo_cinemas__endpoint = result[0].value('target') +data.result_use_repo_cinemas['status'] = result[1] + +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas['movie_title'] = result[0].value('movie_title') +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas['selected_date'] = result[0].value('date') +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas['starting_time'] = result[0].value('starting_time') +# Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas['hall'] = result[0].value('hall') +</manipulate> + </call> + <manipulate id="use_repo_cinemas__set_selected_endpoint" oid="set_selected_endpoint">ep = data.use_repo_cinemas__endpoint +selected = endpoints.use_repo_cinemas__selected_cinema + + selected = ep + data.use_repo_cinemas__endpoint = ep +endpoints.use_repo_cinemas__selected_cinema = selected +</manipulate> + <call id="use_repo_cinemas__call_book" endpoint="use_repo_cinemas__selected_cinema" oid="call_book"> <parameters> - <timeout>4</timeout> - </parameters> - </parameters> - <!--}}}--> - </call> - <call id="a7" endpoint="gateway"> - <parameters> - <!--{{{--> - <label>Perform Surface Treatment</label> - <method>post</method> - <parameters> - <timeout>4</timeout> - </parameters> - </parameters> - <!--}}}--> - </call> - <call id="a8" endpoint="gateway"> - <parameters> - <!--{{{--> - <label>Mechanical Parts Assembly</label> - <method>post</method> - <parameters> - <timeout>4</timeout> - </parameters> - </parameters> - <!--}}}--> - </call> - </parallel_branch> - <parallel_branch> - <parallel> - <parallel_branch> - <call id="a2" endpoint="gateway"> + <service> + <serviceoperation>"book"</serviceoperation> + <injection_handler>endpoints.injection_handler</injection_handler> + </service> <parameters> - <!--{{{--> - <label>Supply Electric Parts</label> - <method>post</method> - <parameters> - <timeout>4</timeout> - </parameters> + <show_id>data.use_repo_cinemas__show_id</show_id> </parameters> - <!--}}}--> - </call> - <call id="a3" endpoint="gateway"> - <parameters> - <!--{{{--> - <label>Delivery</label> - <method>post</method> - <parameters> - <timeout>4</timeout> - </parameters> - </parameters> - <!--}}}--> - </call> - </parallel_branch> - <parallel_branch> - <call id="a1" endpoint="gateway"> - <parameters> - <!--{{{--> - <label>Develop Control System</label> - <method>post</method> - <parameters> - <timeout>4</timeout> - </parameters> - </parameters> - <!--}}}--> - </call> - </parallel_branch> - </parallel> - <call id="a4" endpoint="gateway"> - <parameters> - <!--{{{--> - <label>Electric Board Assembly</label> - <method>post</method> - <parameters> - <timeout>4</timeout> </parameters> - </parameters> - <!--}}}--> - </call> - </parallel_branch> - </parallel> - <call id="a11" endpoint="gateway"> + <manipulate output="result"># Dirty, Dirty, Dirty Monkey-Hacking, but I coudln't figure out the JSON Problem with this Object +if result[0].class.to_s == "Hash" + result[0] = RescueHash.new_from_obj(result[0]) +end +data.result_use_repo_cinemas['reservation_id'] = result[0].value('reservation_number') +</manipulate> + </call> + <manipulate id="use_repo_cinemas__set_status_success" oid="set_status_success"> + status = 200 + data.result_use_repo_cinemas['status'] = status +</manipulate> + </alternative> + <otherwise> + <manipulate id="use_repo_cinemas__set_status_failed" oid="set_status_failed"> + status = 404 + data.result_use_repo_cinemas['status'] = status +</manipulate> + </otherwise> + </choose> + </group> + <manipulate output="result" id="manipulate_from_use_repo_cinemas" data="data.result_use_repo_cinemas" properties="data.result_use_repo_cinemas['properties']">properties = data.result_use_repo_cinemas['properties'] + + res = result[0] + if res['status'] == 200 + # Computing service responses + data.reservation_number = res['reservation_id'] + data.starting_time = res['starting_time'] + data.selected_title = res['movie_title'] + data.selected_date = res['selected_date'] + data.hall = res['hall'] + # Computing properties of executed services + perf_book = properties['call_book']['perform_book'] + data.selected_cinema = " #{perf_book.values[0]['vendor']['name']}\n#{perf_book.values[0]['address']['street']}\n#{perf_book.values[0]['address']['zip']} #{perf_book.values[0]['address']['city']}" + end + </manipulate> + <manipulate id="remove_objects_of_use_repo_cinemas" generated="true"> data.delete(:"result_use_repo_cinemas") + data.delete(:"properties_use_repo_cinemas") + endpoints.delete(:"use_repo_cinemas__selected_cinema") + data.delete(:"use_repo_cinemas__show_id") + data.delete(:"use_repo_cinemas__list") + data.delete(:"use_repo_cinemas__res") + data.delete(:"use_repo_cinemas__list_merge") + data.delete(:"use_repo_cinemas__number_of_shows") + data.delete(:"use_repo_cinemas__endpoint") +</manipulate> + <call id="confirm" endpoint="select"> <parameters> - <!--{{{--> - <label>Systems Integration</label> <method>post</method> + <info>true</info> + <templates> + <uri>'http://gruppe.wst.univie.ac.at/~ralph/input-forms/cinemas.xsl'</uri> + <!-- uri>'http://gus.lan/input-forms/cinemas.xsl'</uri --> + <name>'Cinemas-Output'</name> + <lang>'EN'</lang> + </templates> <parameters> - <timeout>4</timeout> + <title>data.selected_title</title> + <date>data.selected_date</date> + <time>data.starting_time</time> + <hall>data.hall</hall> + <res_nr>data.reservation_number</res_nr> + <cinema>data.selected_cinema</cinema> </parameters> </parameters> - <!--}}}--> </call> - <call id="a12" endpoint="gateway"> - <parameters> - <!--{{{--> - <label>Test</label> - <method>post</method> - <parameters> - <timeout>4</timeout> - </parameters> - </parameters> - <!--}}}--> - <manipulate output="result"> data.test = "success"</manipulate> - </call> </description> </description> <transformation> <!--{{{--> <!--}}}--> @@ -225,18 +509,29 @@ </xsl:if> <xsl:if test="name()='call'"> <xsl:text>, :call, :</xsl:text> <xsl:value-of select="@endpoint"/> <xsl:apply-templates select="d:parameters"/> + <xsl:if test="@oid"> + <xsl:text>, :'call-oid' =&gt; '</xsl:text> + <xsl:value-of select="@oid"/> + <xsl:text>'</xsl:text> + </xsl:if> <xsl:apply-templates select="d:manipulate" mode="part-of-call"> <xsl:with-param name="myspace"> <xsl:value-of select="$myspace"/> </xsl:with-param> </xsl:apply-templates> <xsl:call-template name="print-newline"/> </xsl:if> <xsl:if test="name()='manipulate'"> <xsl:text>, :manipulate</xsl:text> + <!-- RESCUE: manipulate with dataelement as result object --> + <xsl:if test="@data"> + <xsl:text>, nil,</xsl:text> + <xsl:value-of select="@data"/> + </xsl:if> + <!-- RESCUE --> <xsl:call-template name="print-content"> <xsl:with-param name="myspace"> <xsl:value-of select="$myspace"/> </xsl:with-param> </xsl:call-template> \ No newline at end of file