Delivery File Exception : File with same name || Setting Dynamic Logical port File OverWrite Mode

Tuesday, September 20, 2011
Q:

Hi again.
I have another issue but I think this is due to lack of bizTalk experience. I have a BizTalk program polling a record from the database then put it out in form of flat file. In the orchestration, I have a module catching the exception. The bizTalk is working fine when there is no file of the same name in the directory. But if there are, the exception inside the orchestration does not catch it but an error is generated. Maybe the exception only catch error caused inside the orchestration?
I would like BizTalk to stop pushing the flat file out if there is an existing one out there or better yet overwriting it should it be the case, so that I do not need to make sure the file name is unique in my orchestration.
Is it possible to do that? As always, your instructions are highly appreciated.

Sol:
You can catch the exception for the file existing with same name by enabling delivery notification on the send port. Follow these steps:
1. In orchestration select the send port and in the property for the send port set 'Delivery Notification=Transmitted'.
2. Enclose the send shape attached to the above send port in a scope and add exception handler to catch the exception of type 'Microsoft.XLANGs.BaseTypes.DeliveryFailureException'.
 
If you want to overwrite the file you can do so by setting the following property in your send port file adapter properties. Change copy mode to Overwrite.


For dynamic ports, the adapter transport configuration properties are not available whithin BTS Admin console because its expected tht these will be configured from within a pipeline or whithin the orchestration. You can configure the overwrite property for the file adapter from whithin your orchestration. From within the message assignment box whithin a construct shape, please use something like below where Message_new is the message being constructed in the shape :
Message_new(FILE.CopyMode)= 2; //2=overwrite,

Regards,



No comments:

Post a Comment

Post Your Comment...