none
Check send location if empty RRS feed

  • Question

  • Hey,

    I'm creating an application where I need to check the sendlocation in an orchestration to see if it's empty. This is because I need to wait until an external company picked up the last file, so I can drop the next one. Is it possible to get this location in an orchestration?

    Thank you!

    Tuesday, July 30, 2013 7:18 AM

Answers

  • Not WMI, but ExploerOM should have this.  You'd have to start at your Orchestration, then enumerate it's Ports, then parse the Port conf for the uri.

    Note, ExplorerOM will run only in a 32bit process.

    You might also want to investigate the sample File Adapter in the BizTalk SDK.  There you could implement a check on the outbound file name.

    • Marked as answer by Pengzhen Song Wednesday, August 7, 2013 12:27 PM
    Thursday, August 1, 2013 12:51 PM
    Moderator

All replies

  • Hi Sorjar,

    Send port location is identified based on subscription. This location is resolved much later in the process. If you have a static send port location or if the send location is known upfront, you can use a c# help method to check if the file in the static location (which can get from any configuration like) is been process/removed with something like this..

    public static bool IsFileProcessed(string sSendPortLocation) { if (!File.Exists(sSendPortLocation)) return true; else return false; }

    If this method confirms file has been processed, then you can send the file to send port otherwise, wait/delay for few minutes before you retry to send the file/message to send shape in Orchestration.

    Tuesday, July 30, 2013 8:07 AM
  • That is the problem the port has the location set as "specify later". The location is different in different environments. I was hoping to extract the location dynamically.
    Tuesday, July 30, 2013 8:48 AM
  • Even if the send port is specified as “specify later” while developing the Orchestration, you should have a send location while configuring send port in admin console. While doing so you can add the send location in a configuration file which you can get it from the run time of the Orchestration. i.e you would specify the send location in two places. 1-in Send port,2-in configuration file for your c# method to retrieve the path during Orchestration runtime.

    Why do need to wait until an external company picked up the last file? Are you dropping the file with some static file name while copying file to destination system or this is the restriction from destination system? Because you can explore different “Copy modes” in send port like “Append”, “Create New” etc

    Other option is to write a custom adapter to copy the file to destination only if the file(s) in the destination is already processed.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

    Tuesday, July 30, 2013 9:08 AM
  • I could also put the send location in the environment variables. I consider this dangerous since if the location gets changed an I forget to change it in the environment variables (or config file) the location may appear empty but might not actually be empty.

    And indeed the file getting picked up is a file with a static name. Normally the file gets picked up in a timely fashion, but we've seen some connection errors in which case a backlog of files was created. Which have to be placed there sequentially.

    Tuesday, July 30, 2013 9:17 AM
  • For deployment/ configuration you can use a deployment script rather than doing it manually. This could avoid error could be introduced by humans. You have to update both the send port and the config store with same value to achieve. Yes, its discipline you have to follow (small price you have to pay) if you want to achieve your requirement without any complex work like custom adapter or any custom process which would trigger you when the file has been processed..


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

    Tuesday, July 30, 2013 9:36 AM
  • There is no built in support for what you're asking so it's a pattern you will have to implement yourself, especially if you're sending the message by FILE or FTP or HTTP.

    Assuming you have read, query, list access to the target location, your best immediate option is to use a helper class in the Orchestration that can reach out and peek at the location, then return some value you can use.

    Unless you're using a Dynamic Send Port, you'll have to keep the target location as config somewhere.

    Tuesday, July 30, 2013 12:07 PM
    Moderator
  • How many times do you retry to place the file.Instead doing the things from orchestration if not exist delay some time and retry sending the file again.



    Drop the file in another temp shared folder lets say FolderB,Create a scheduled job which polls for the file exist in the FolderA(which others will pick the file ) ,If not exists then copy 1 file (you can copy the first copied file i.e. using file createdDtm )from the FolderB to FolderA.


    Srikanth Peddy. MCTS-BizTalk Server Please mark as answered .

    Thursday, August 1, 2013 10:40 AM
  • would it be possible using wmi to search for the send port address while searching for the logical sendportname (logical over physical, since you can only change the logical portname in the code in visual studio, whereas you can change the physical portname easily in biztalk.
    Thursday, August 1, 2013 11:37 AM
  • Sorbjar,

    can you please explain in detail ,I didnt get your question.


    Srikanth Peddy. MCTS-BizTalk Server Please mark as answered .

    Thursday, August 1, 2013 12:10 PM
  • Hi Sorbjar,

    WMI to find Send port location? I hope you wanted to check whether the file has been processed in sendlocation from an orchestration before you send a file. I think you have some good suggestion to achieve your case. Are you looking find a solution for some different problem now using WMI?


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.


    Thursday, August 1, 2013 12:20 PM
  • well the real problem is that I need the send location from a send port. I know how to check if the location is empty, but I didn't want to hard- code the location where the orchestration has to check, so I wanted to get the send port address before I actually got to the sending part of the orchestration, but I can't get that location. I have now found out that I can use Wmi to find the address, but I can only check for the Name of the port in BizTalk (not the logical name used in Visual Studio). If it's not possible to get the logical name, I'll just make do with my current physical name.

    Thanks for all the response so far!

    Thursday, August 1, 2013 12:36 PM
  • Not WMI, but ExploerOM should have this.  You'd have to start at your Orchestration, then enumerate it's Ports, then parse the Port conf for the uri.

    Note, ExplorerOM will run only in a 32bit process.

    You might also want to investigate the sample File Adapter in the BizTalk SDK.  There you could implement a check on the outbound file name.

    • Marked as answer by Pengzhen Song Wednesday, August 7, 2013 12:27 PM
    Thursday, August 1, 2013 12:51 PM
    Moderator