Send Port Filter

Home Page Forums BizTalk 2004 – BizTalk 2010 Send Port Filter

Viewing 1 reply thread
  • Author
    Posts
    • #13191

      Have you tried it without the Send Port Group.
      Set a filter on each Send Port
      Bts.ReceivePortName=myReceivePortName
      AND
      File.ReceivedFileName=FileName1.xml

    • #13192

      I just did a quick check of the FILE.ReceivedFileName and found it is written to the message context but not promoted. This means you cannot use this property for routing.

      You have a number of options:
      1. Write a simple pipeline component that takes the FILE.ReceivedFileName and extracts the filename and promotes this into your own property

      2. Use an orchestration with a dynamc send port. This will contain logic to assign the output location based on filename.

      For speed and flexibility at runtime the pipeline component will be best.

      • #13193

        First you need to create a Biztalk project, with a property schema defining you new property. This needs to be built and deployed.

        Then you create a simple pipeline component. I would suggest using Martijn Hoogendoorn’s Pipeline Component Wizard that will create the shell project for your component.

        http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=1d4f7d6b-7d27-4f05-a8ee-48cfcd5abf4a

        You need a very simple pipeline component.
        In the Execute method you can read the FILE.ReceivedFileName property from the context,
        [code:1:b98450480e]inputMessage.Context.Read(\"ReceivedFileName\", \"http://schemas.microsoft.com/BizTalk/2003/file-properties\");[/code:1:b98450480e]
        possibly parse the string removing the path info and promote the result into your property
        [code:1:b98450480e]inputMessage.Context.Promote(<Your PropertyName>, <your property schema namespace>, <new value>);[/code:1:b98450480e]

        There is no need to to read the data stream, the most complicated part of a pipeline component. The FILE properties are set by the adapter so you can position your component in any stage except the Disassemble stage and you do not have to worry about the completion of the stream read.

        Once built you copy the resulting DLL to the [b:b98450480e]C:\\Program Files\\Microsoft Biztalk Server 2004\\Pipeline Components[/b:b98450480e] directory
        To debug, you can attach to the BTSNTSrv.exe process setting appropriate breakpoints in VS2003

        • #13194

          Hi
          l am working on direct binding, type FILE.
          l have 10 send ports, 1 send port group referencing those 10 send ports and 1 Receive Port.
          In the send port group l added the filter Bts.ReceivePortName=myReceivePortName

          but l also put filters in each send ports to distinguish the received files: File.ReceivedFileName=FileName1.xml
          File.ReceivedFileName=FileName2.xml
          …..

          But this is not working. Is the File.ReceivedFileName working in filters?

          • #13195

            I have been trying with and without the send port group.
            I also set a filter to File.ReceivedFileName = \”myfile.xml\” and another one to File.ReceivedFileName = myfile.xml, not forgetting to set the Bts.ReceivedPortName.

            l am still trying but if it doesn’t work l’ll just create as much receive ports l have send ports.

            Thanks for the quick answer.

            • #13196

              How can l write a pipeline that extracts the File. ReceivedName?
              Thanks for your answers

              • #13197

                The FILE.ReceivedName is using the full file path, for example \”c:\\test\\myfile.txt\”. That is probably why it doesn work. I have solved this problem myself by creating a string variable in my orchestration, add the FILE-ReceivedName to the variable and then call my own .NET.class-method to parse the real filename and then I add it to the message. This works great for me.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.