I have a requirement:
If I get a file, I am putting the content of that file into a database,
If there is any error in that file, I am putting it in an error folder.
Can I do something like this? Suppose I have a folder “processed” and another one “unprocessed”. In case of an error, result will go in “unprocessed” and if there is no error it will go into “processed”.
I don’t know how to achieve that if biztalk processed some file then only put into some folder.
I suppose if I will put filter option BTS.ReceivePortName it will also put the error file into process folder.
It’s very easy to create an extra send port that archives all input files.
If there’s an error you just find the file, fix the issue, and re-drop it.
Create a send port, set up the filters to select the input you want (like BTS.ReceivePortName as you already know), use a pass through pipeline, then configure it as to write files. Write your files to a backup directory.
If you only want to catch errors then you will have to do extra setup. You must use an orchestration. Put a scope shape around your normal processing in the orchestration. Place an exception to catch errors on the scope shape. In the exception handler use a send shape to construct and write a copy of the original message to a send port. Add an expression to write some helpful message to the event log so you can debug the failure.