Throwing exception from BizTalk custom XSLT

In one of my recent project, we get invoice files from SAP which has to be converted to EDIFACT format in BizTalk map, which is completely done using custom XSLT before sending it to customer.

I had to check inside the map if a particular field is available in IDOC and terminate immediately if the field does not exist.

I got the solution from the below link

http://btsguru.blogspot.in/2013/06/biz-talk-how-to-throw-custom-exception.html

<xsl:message terminate=”yes”>Custom error text</xsl:message>

The above XSLT  construct can be called inside any conditional statement in the BizTalk XSLT transformation to raise exception.

 

Advertisements

Edifact Vs ANSI X12

In my current project, invoice files were generated from logistics system in the XML format which is transformed to EDIFACT format EFACT_D01B_INVOIC_EAN011 in BizTalk before sending it to the customer.

The customer has given a new requirement to send invoice files in ANSI X12 format through Ariba network.

I wanted to know the equivalent ANSI X12 field for corresponding EDIFACT field.

The below link gave me fair idea of X12 and EDIFACT differences and equivalents

https://www.scribd.com/document/36877981/Edifact-vs-Ansi-x12#

The above document and comparing with X12 and EDIFACT implementation guide provided by the customer was helpful in creating mapping with X12 standard.

 

Folder Monitoring Tool

Recently I had requirement in my project to monitor certain folders to check if we are receiving files daily from certain customers.

After many analysis in google, I found there are many tools available to do folder monitoring real time. Please go through the below link to see many good tools available for folder monitoring

https://www.raymond.cc/blog/3-portable-tools-monitor-files-folders-changes/

I particularly liked the tool FolderChangesView in the above link as it was able to produce log file in html format also which makes it easy to understand at the end of the day.

But the issue I faced with all the tools is that all  had GUI to start and stop the service and so it worked only when the user was logged into the server. But we had to constantly monitor the folder, even if no user is logged into the server.

Then I came across a tool called File Watcher in the below link

https://sourceforge.net/projects/fwutilities/files/?source=navbar

The File Watcher tool is available in three different forms supporting different .net versions.

  1. Command line Console application
  2. GUI application
  3. Window service

So, I used the exe for running as window service, to monitor folders real time even when no user was logged in the system. Though the log file was like any other log file(not html), it helped me achieve real time monitoring of folders even when nobody is logged in the server.