Welcome to MSDN Blogs Sign in | Join | Help
Avoiding Message Loops using Commerce Server Biztalk Adapters.

How do we control message loops using the Commerce Server Biztalk Adapters.  The implementation to avoid message loops vary for each subsystem (Orders, Profiles, and Catalog/Inventory).

 For Profiles:
 The adapter uses the CS_Adapter_Date_Last_Changed in Profiles to:
  1.  Prevent round trip messages using the Profiles Adapter
  2.    In incremental export, to prevent the Profiles Receive
   Adapter from exporting items that the corresponding Profiles Send Adapter
   last updated.

For Catalog/Inventory : We use a field called "ExportReady" in the
 database.  The send adapter has the option to either set this value to 1 or
 0 (true or false) on import.   In Incremental Mode - the adapter will only
 export items that have changed since last execution AND has ExportReady  =
 1.  The subsystem will default the ExportReady value to 1 on all imports,unless the value is specified. The adapter should set that field to 0 (false), unless you want those items
 exported via the Catalog/Inventory Receive Adapter.


 For Orders:  We use status values to control this.  There is a
 FromStatus and a ToStatus on the Receive Endpoint configuration.  So in
 incremental mode, the customer can set FromStatus to "New Order" and set
 ToStatus to "Submitted".  With these settings, the Orders Adapter will
 export all orders that have changed from last execution time AND where
 Status = "New Order"....once those items are successfully exported, the
 adapter will update the order's status field to "Submitted", hence the
 concept of FromStatus/ToStatus.  I would expect and hope that a lot of
 customers use these status fields for all their scenarios....It's a nice
 way to enable status messages to be relayed to the end customer in a quick
 manner.

Here are two examples to illustrate:

1.  If you have a Profile Send Adapter that just imported a Profile - the
CSAdapter date last changed will equal the date_last_changed value.  If you
have a Profiles Receive Adapter that is pulling incremental changes from
the same CS instance, the newly updated profile will NOT be exported since
it was last changed by the adapter. 
2.    If you have a Profile Send Adapter that just imported a Profile - the
CSAdapter date last changed will equal the date_last_changed value.  If a
business user or customer updates that profile, the date_last_changed will
be greater than the csadapter_date_last_changed, thus the Profiles Receive
Adapter that is pulling incremental changes from the same CS instance will
export the newly updated profile since it was last changed by a business
user/customer.


As always, let me know of any questions or if you would like additional information!

-Alan

Posted: Friday, March 10, 2006 8:44 AM by akfaulkner

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker