RESCUE - Book Movie - Local stopped DefaultHandlerWrapper after "Hobbit" "2013-01-16" null "" null "" null 1100 "Vienna" null {"properties":{"call_find":{"perform_search":{}},"call_book":{}}} "" "" "" "" "" "" {} http://localhost:9290/groups/Cinemas/ http://localhost:9291/ activity :collect_input, :call, :select, :method => "post", :info => "true", :templates => [ { :uri => 'http://gruppe.wst.univie.ac.at/~ralph/input-forms/cinemas.xsl' }, { :name => 'Cinemas-Input' }, { :lang => '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 => "true", :service => [ { :serviceoperation => "search_and_book" }, { :injection_handler => endpoints.injection_handler } ], :additional_endpoints => [ { :selector_service => "select" } ], :parameters => [ { :title => data.title }, { :date => 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 activity :use_repo_cinemas__call_find, :call, :services, :service => [ { :serviceoperation => "search" }, { :injection_handler => endpoints.injection_handler } ], :parameters => [ { :title => data.title }, { :date => data.date } ], :'call-oid' => '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 => [ { :serviceoperation => "search" }, { :injection_handler => endpoints.injection_handler } ], :parameters => [ { :title => data.title }, { :date => data.date } ], :'call-oid' => '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 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("<list_of_shows/>") 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.>(0)) do activity :use_repo_cinemas__perform_select, :call, :select, :templates => [ { :uri => 'http://localhost:9290/groups/Cinemas//operations/search_and_book/templates/perform_select' }, { :name => 'Select_Show' }, { :lang => 'EN' } ], :method => "post", :info => "true", :parameters => [ { :data => data.use_repo_cinemas__list_merge } ], :'call-oid' => '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 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 => [ { :serviceoperation => "book" }, { :injection_handler => endpoints.injection_handler } ], :parameters => [ { :show_id => data.use_repo_cinemas__show_id } ], :'call-oid' => '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 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 :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 => "post", :info => "true", :templates => [ { :uri => 'http://gruppe.wst.univie.ac.at/~ralph/input-forms/cinemas.xsl' }, { :name => 'Cinemas-Output' }, { :lang => 'EN' } ], :parameters => [ { :title => data.selected_title }, { :date => data.selected_date }, { :time => data.starting_time }, { :hall => data.hall }, { :res_nr => data.reservation_number }, { :cinema => data.selected_cinema } ] 0 undefined post true 'http://gruppe.wst.univie.ac.at/~ralph/input-forms/cinemas.xsl' 'Cinemas-Input' 'EN' data.title = result.data.value('title') data.date = result.data.value('date') data.city = result.data.value('city') true "search_and_book" endpoints.injection_handler "select" data.title data.date 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 = '' "search" endpoints.injection_handler data.title data.date data.result_use_repo_cinemas__call_find = RescueHash.new data.result_use_repo_cinemas['properties']["call_find"]["perform_search"] = RescueHash.new "search" endpoints.injection_handler data.title data.date 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') 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') data.delete(:"result_use_repo_cinemas__call_find") 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("<list_of_shows/>") 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 'http://localhost:9290/groups/Cinemas//operations/search_and_book/templates/perform_select' 'Select_Show' 'EN' post true data.use_repo_cinemas__list_merge # 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') 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 "book" endpoints.injection_handler data.use_repo_cinemas__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.result_use_repo_cinemas['reservation_id'] = result[0].value('reservation_number') status = 200 data.result_use_repo_cinemas['status'] = status status = 404 data.result_use_repo_cinemas['status'] = status 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 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") post true 'http://gruppe.wst.univie.ac.at/~ralph/input-forms/cinemas.xsl' 'Cinemas-Output' 'EN' data.selected_title data.selected_date data.hall data.reservation_number data.selected_cinema 2 1 activity : , :call, : , :'call-oid' => ' ' , :manipulate , nil, parallel :wait => do 1 end loop pre_test{ } post_test{ } do 1 end choose do 1 end critical : do 1 end 1 alternative do 1 end 1 otherwise do 1 end 1 parallel_branch do | | 1 end , : => [ ] " " { : => } , do | | 1 end