Changeset 238
- Timestamp:
- 12/15/06 11:16:43 (2 years ago)
- Files:
-
- branches/message-handling-refactor-branch/src/hefeweizen_big_ania.rb (modified) (9 diffs)
- branches/message-handling-refactor-branch/src/hefeweizen_library_b2b_system.rb (modified) (2 diffs)
- branches/message-handling-refactor-branch/src/hefeweizen_library_ebMS_message2.rb (modified) (6 diffs)
- branches/message-handling-refactor-branch/src/taskers/hefeweizen_tasker_application_send_ebXML_message.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/message-handling-refactor-branch/src/hefeweizen_big_ania.rb
r235 r238 453 453 command, expectation = start_delivery( transaction, command_hash['b2b_system_name'] ) 454 454 if command.nil? then 455 @logger.warn "Unable to proceed with start deli ervy."456 transaction.fail "Error starting delivery "455 @logger.warn "Unable to proceed with start delivery." 456 transaction.fail "Error starting delivery." 457 457 return true 458 458 else … … 462 462 end 463 463 elsif result == false then 464 @logger.debug "Problems processing new directive xx." 465 # ??? what TODO? 466 return false 464 msg = "Problems processing new directive. Check the logs." 465 @logger.debug msg 466 transaction.fail msg 467 return true 467 468 end 468 469 elsif result.class == String then … … 637 638 ebMS_info = get_ebMS_info ebXML_message_id, b2b_system_name 638 639 if ebMS_info.nil? then 639 @logger.warn "Problems gettig the ebXML Message Info struct ore from the message data store for ebXML message with id #{ebXML_message_id}"640 @logger.warn "Problems gettig the ebXML Message Info structure from the message data store for ebXML message with id #{ebXML_message_id}" 640 641 return false 641 642 end … … 643 644 644 645 # # adding delivery informationn to the ebMS_info 645 # ebMS_info.merge! = get_delivery_info ebMS_info 646 647 #store_ebMS_info ebMS_info, b2b_system_name646 delivery = ebMS_info['delivery'] = Hash.new 647 delivery['start delivery'] = Time.now.to_s 648 store_ebMS_info ebMS_info, b2b_system_name 648 649 649 650 ebXML_message_file_path = "#{@config['MESSAGE_DIR']}/#{b2b_system_name}/#{ebMS_info['ebXML_message']['ebXML_message_id']}/ebXML_message.ebMS2" … … 677 678 def start_delivery transaction, b2b_system_name 678 679 @logger.debug "Starting the delivery process." 679 transaction.transition_to_new_state "ebXML message delivery process started"680 680 681 681 expectation = "start_ebXML_message_delivery" … … 779 779 780 780 781 # This method processes a new directive. 782 # This method will forward the request to process the directive 783 # to the the b2b_system. If the b2b system could process the directive 784 # then this method updates the transaction to know about the new ebXML message 785 # and ebXML message info. 781 786 def process_new_directive2 command, command_hash, transaction 782 787 … … 827 832 end 828 833 829 # Some transaction stuff 830 path = "#{@config['MESSAGE_DIR']}/#{b2b_system.system_name}/#{ebMS_info['ebXML_message']['ebXML_message_id']}" 831 complete_ebXML_message_file_path = "#{path}/ebXML_message.ebMS2" 832 complete_ebXML_message_parameters_file_path = "#{path}/ebXML_message_parameters.yml" 833 834 transaction.attach_file complete_ebXML_message_file_path, "outgoing ebXML message" 835 transaction.attach_file complete_ebXML_message_parameters_file_path, "outgoing ebXML message parameters" 836 837 # attach the ebXML message to the transaction 838 transaction.transition_to_new_state "plain outgoing ebXML message created" 839 @logger.debug "Setting ebXML message id '#{ebMS_info['ebXML_message']['ebXML_message_id']}' to transaction." 840 transaction.add_ebXML_message_id_reference ebMS_info['ebXML_message']['ebXML_message_id'] 841 842 843 # ebXML message is created. 834 add_ebXML_message_info_to_transaction transaction, b2b_system.system_name, ebMS_info 835 836 transaction.transition_to_new_state "directive processed." 837 844 838 # Continue with processing 845 839 … … 868 862 end 869 863 864 return true 865 end 866 867 # Add the information of an ebXML message to a transaction. 868 def add_ebXML_message_info_to_transaction transaction, b2b_system_name, ebMS_info 869 @logger.debug "Adding ebXML message information to transaction" 870 path = "#{@config['MESSAGE_DIR']}/#{b2b_system_name}/#{ebMS_info['ebXML_message']['ebXML_message_id']}" 871 complete_ebXML_message_file_path = "#{path}/ebXML_message.ebMS2" 872 complete_ebXML_message_parameters_file_path = "#{path}/ebXML_message_parameters.yml" 873 874 transaction.attach_file complete_ebXML_message_file_path, "outgoing ebXML message" 875 transaction.attach_file complete_ebXML_message_parameters_file_path, "outgoing ebXML message parameters" 876 877 # attach the ebXML message to the transaction 878 @logger.debug "Setting ebXML message id '#{ebMS_info['ebXML_message']['ebXML_message_id']}' to transaction." 879 transaction.add_ebXML_message_id_reference ebMS_info['ebXML_message']['ebXML_message_id'] 880 870 881 return true 871 882 end … … 1214 1225 1215 1226 def close_open_connection command_hash, instruction_pipe, transaction 1216 if command_hash['transport_protocol'].upcase == 'HTTP' then1217 if command_hash["transport_request_or_response"] = "response" then1218 @logger.debug "There is nothing to be closed because we are already on the HTTP response leg."1219 return true1220 end1221 end1227 # if command_hash['transport_protocol'].upcase == 'HTTP' then 1228 # if command_hash["transport_request_or_response"] = "response" then 1229 # @logger.debug "There is nothing to be closed because we are already on the HTTP response leg." 1230 # return true 1231 # end 1232 # end 1222 1233 1223 1234 command_to_http_server = { branches/message-handling-refactor-branch/src/hefeweizen_library_b2b_system.rb
r233 r238 173 173 end 174 174 175 # This message processes a directive. This typically invloves to create an ebXML message. 175 # This message processes a directive. 176 # This typically invloves 177 # o to create an ebXML message. 178 # o add the ebXML message to the message store 179 # This method returns the ebXML message info that includes the 180 # ebXML message id etc. 176 181 def process_directive directive 177 182 # get the ebXML Message information 178 # this will hold all the required information about what has to be179 # in the ebXML message plus how it has to be sent.180 183 ebMS_message_info = get_ebMS_message_info directive 181 184 if ebMS_message_info.nil? then … … 198 201 dev['ebXML_message_id'] = metadata['ebXML_message_id'] 199 202 dev['ebXML_message_conversation_id'] = metadata['ebXML_message_conversation_id'] 203 dev['ebXML_message_is_mutliparty'] = metadata['ebXML_message_is_multiparty'] 200 204 201 205 # add directive stuff to ebMS_info branches/message-handling-refactor-branch/src/hefeweizen_library_ebMS_message2.rb
r233 r238 71 71 72 72 # creating the ebXML message 73 success = TempEBMessage2.create_message( party_ids, directive, ebMS_message_info,73 success, is_multiparty = TempEBMessage2.create_message( party_ids, directive, ebMS_message_info, 74 74 file_path, @config, message_id, conversation_id) 75 75 … … 85 85 'temp_ebXML_message_file_path' => file_path, 86 86 'ebXML_message_id' => message_id, 87 'ebXML_message_conversation_id' => conversation_id} 87 'ebXML_message_conversation_id' => conversation_id, 88 'ebXML_message_is_multiparty' => is_multiparty 89 } 88 90 89 91 end … … 391 393 def TempEBMessage2.create_message party_ids, directive, ebMS_message_info, complete_ebXML_message_file_path, 392 394 config, message_id, conversation_id 395 396 is_multiparty = false 393 397 394 398 # Party Identities … … 426 430 427 431 ebXML_message.close 428 return true 432 return true, is_multiparty 429 433 430 434 else … … 460 464 my_payloads = Array.new 461 465 if !directive.payloads.nil? and !directive.payloads.empty? then 466 is_multiparty = true 462 467 config['LOGGER'].debug "Number of payloads in directives is #{directive.payloads.size.to_s}." 463 468 errors = false … … 559 564 end 560 565 561 return true 566 return true, is_multiparty 562 567 563 568 end branches/message-handling-refactor-branch/src/taskers/hefeweizen_tasker_application_send_ebXML_message.rb
r233 r238 120 120 # TODO 121 121 extra_header = 'Content-Type: type="text/xml";' 122 if @ebXML_message_parameters[' is_multipart']then122 if @ebXML_message_parameters['ebXML_message']['is_multiparty'] == true then 123 123 extra_header += ' multipart/related; boundary="HefeWeizenBoundary"' 124 124 end
