Posted by: techsavygal | January 10, 2007

Filter Properties for Receive/Send Pipeline in BTS 2004/2006!

I seem to forget these properties nowadays…hence, i thought its best to have a link of them from Stephen Kaufman’s old post http://blogs.msdn.com/skaufman/archive/2004/10/24/247001.aspx

The 14 receive pipeline items are (including the associated namespace):

 1.  ReceivedFileName (http://schemas.microsoft.com/BizTalk/2003/file-properties)

 2.  InboundTransportLocation (http://schemas.microsoft.com/BizTalk/2003/system-properties)

 3.  InterchangeID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

 4.  ReceivePortID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

 5.  ReceivePortName (http://schemas.microsoft.com/BizTalk/2003/system-properties)

 6.  WasSolicitResponse (http://schemas.microsoft.com/BizTalk/2003/system-properties)

 7.  AuthenticationRequiredOnReceivePort (http://schemas.microsoft.com/BizTalk/2003/system-properties)

 8.  InboundTransportType (http://schemas.microsoft.com/BizTalk/2003/system-properties)

 9.  LRPMsgBodyTracking (http://schemas.microsoft.com/BizTalk/2003/system-properties)

10. MessageExchangePattern (http://schemas.microsoft.com/BizTalk/2003/system-properties)

11. PortName (http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties)

12. ReceivePipelineID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

13. MessageType (http://schemas.microsoft.com/BizTalk/2003/system-properties)

14. SchemaStrongName (http://schemas.microsoft.com/BizTalk/2003/system-properties)

 

While the 31 send pipeline items are

1.  CopyMode (http://schemas.microsoft.com/BizTalk/2003/file-properties)

2.  LTPMsgBodyTracking (http://schemas.microsoft.com/BizTalk/2003/system-properties)

3.  ReceivedFileName (http://schemas.microsoft.com/BizTalk/2003/file-properties)

4.  SPID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

5.  ActualRetryCount (http://schemas.microsoft.com/BizTalk/2003/system-properties)

6.  FileName (http://schemas.microsoft.com/BizTalk/2003/file-properties)

7.  PartyName (http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties)

8.  ReceivePortName (http://schemas.microsoft.com/BizTalk/2003/system-properties)

9.  WasSolicitResponse (http://schemas.microsoft.com/BizTalk/2003/system-properties)

10. AllowCacheOnWrite (http://schemas.microsoft.com/BizTalk/2003/file-properties)

11. RetryInterval (http://schemas.microsoft.com/BizTalk/2003/system-properties)

12. OutboundTransportCLSID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

13. SPName (http://schemas.microsoft.com/BizTalk/2003/system-properties)

14. InboundTransportLocation (http://schemas.microsoft.com/BizTalk/2003/system-properties)

15. InterchangeID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

16. ReceivePortID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

17. SPTransportID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

18. TransmitPipelineID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

19. AuthenticationRequiredOnReceivePort (http://schemas.microsoft.com/BizTalk/2003/system-properties)

20. InboundTransportType (http://schemas.microsoft.com/BizTalk/2003/system-properties)

21. LRPMsgBodyTracking (http://schemas.microsoft.com/BizTalk/2003/system-properties)

22. MessageExchangePattern (http://schemas.microsoft.com/BizTalk/2003/system-properties)

23. OutboundTransportLocation (http://schemas.microsoft.com/BizTalk/2003/system-properties)

24. PortName (http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties)

25. ReceivePipelineID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

26. SourcePartyID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

27. MessageType (http://schemas.microsoft.com/BizTalk/2003/system-properties)

28. OutboundTransportType (http://schemas.microsoft.com/BizTalk/2003/system-properties)

29. PartNames (http://schemas.microsoft.com/BizTalk/2003/messageagent-properties)

30. RetryCount (http://schemas.microsoft.com/BizTalk/2003/system-properties)

31. SchemaStrongName (http://schemas.microsoft.com/BizTalk/2003/system-properties)

 

Thanks Stephen and Benny….it helps!

 

To get access to these properties you need to get access to the context object.  The following method shell shows how we can do that.

 

public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)

{

IBaseMessageContext context = pInMsg.Context;

 

Place code here to work with the context object (look at this blog entry to get more details on this method)

.

.

.

}

 

Now that we have a method to gain access to the context, what if we want to get access to the internal promoted properties?  We can iterate through all of the default promoted properties by using the context.ReadAt method (which produces the list of the items above).  This method takes an index and returns, through 2 out parameters, the name and namespace of the properties. 

 

We can also use the context.Read method to access the value of each of these promoted properties.  The Read method returns an object type containing the value of the promoted property when passing in the name and namespace of the property.

 

So, to retrieve the source file name we would use this following line of code:

 

string srcFileName = context.Read(“ReceivedFileName”, “http://schemas.microsoft.com/BizTalk/2003/file-properties”).ToString();

Advertisements

Responses

  1. Hi, don’t forget – these are the common system based properties, but realistically we can stick any property (and it’s value) in the context – we can even have an array of name value pairs for one property.

    Also each individual message part has it’s own Context (aka PropertyBag)

    To get access to these can be done right throughout the message’s lifetime from a variety of places – not just a pipeline component.

    Adapters – IBaseMessage
    Pipelines – IBaseMessage
    Orchestrations – XLangMessage
    Schemas – IDocSchema

    etc.

    One last thing – if you’re looking at filtering on these (Orch activating receive, Send Port/Group) then make sure the props are Promoted – they can be in the context, but not promoted.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: