OnRamp for Commerce One MarketSite 3.5 SP1 | webMethods OnRamp for Commerce One MarketSite Adapter Documentation | webMethods OnRamp for CommerceOne MarketSite Adapter Installation and User’s Documentation | Using C1 OnRamp with webMethods Trading Networks | Create a Processing Rule for Receiving Envelopes
 
Create a Processing Rule for Receiving Envelopes
When Trading Networks receives an envelope from the WmMarketConnectTN package envelope handler service, the WmMarketConnectTN package detects the sender and receiver in the envelope and uses that information to associate the document with the Trading Networks partner profiles for the sender and receiver. By default, Trading Networks extracts the messageId and correlationId fields from the envelope header and persists them to its database as the DocumentID and ConversationID system attributes for the envelope, respectively.
If you have a processing rule for a document from which Trading Networks extracts the ConversationID system attribute, but you do not want Trading Networks to perform conversation management on the document, use the Execute a service processing action to call the Trading Networks service wm.tn.cm:disableDocument (or to call another service that calls the wm.tn.cm:disableDocument service).
In addition, the WmMarketConnectTN package calls the C1 OnRamp service getRequestMode to extract the request mode from the incoming envelope and persists the request mode to the Trading Networks database as the requestMode attribute for the envelope.
Trading Networks also persists the incoming envelope to the database as the C1EnvBytes content part, for auditing purposes.
*To create a processing rule for receiving envelopes
1. Build a C1 OnRamp envelope handler service. Have the envelope handler service first call the WmMarketConnectTN package pub.marketconnect.tn.util:getMarketConnectEnvelopeFromBizDocservice. This service extracts incoming envelopes from the Trading Networks database, translates them into the format expected by C1 OnRamp's services, and puts the translated object into your pipeline). Have the envelope handler service then call other typical C1 OnRamp services used in envelope handler services, such as getDocumentAsRecord.
Important:
You must call the pub.marketconnect.tn.util:getMarketConnectEnvelopeFromBizDoc service or you will not be able to reprocess a document in Trading Networks, nor will you be able to work with documents using the Trading Networks conversation manager or the Business Integrator.
Do not register the envelope handler service you just created with C1 OnRamp.
2. In a document type definition for an xCBL document you are receiving, you can set the DocumentID and ConversationID system attributes to information you extract from the document. For example, if you receive an envelope containing a PurchaseOrder, you can have Trading Networks extract the PO number and set the ConversationID system attribute to it.
If you want to set the DocumentID system attribute to the messageId from the document's envelope header, do not set the DocumentID system attribute or set it to an empty string (""). Likewise, if you want to set the ConversationID system attribute to the correlationId from the document's envelope header, do not set the ConversationID system attribute or set it to an empty string (""). If you want Trading Networks to associate response documents you receive in reply to an asynchronous request document, you must set the GroupIDsystemattribute of each document to the same value, set the ConversationID system attribute of each document to the same value, or both.
3. If you want Trading Networks to determine the version of an incoming xCBL document, set up the document type definition to extract the first root node in the document (that is, the document type header or the SOX header). In the identification section of the definition, define a query that specifies /pi()[0]/source() as the query and the SOX header as the value (for example, define the value as <?soxtype urn:x-commerceone:document:com:commerceone:CBL:CBL.sox$1.0?>.
4. In Trading Networks, create a processing rule for the document type you are receiving and define the criteria for the processing rule.
5. In the processing rule, call the envelope handler service you just created.
6. If the XML in the incoming envelopes contain a SOX header and you do not want the SOX header included in the objects returned by the envelope handler service, have the processing rule call the WmMarketConnectTN package service pub.marketconnect.tn.util:removeSOXHeader to remove the SOX header from the documents.