Where is the documentation for BizTalk SendPort filters? - biztalk

I'm talking about this list. I can't find the documentation online. Is it available anywhere?
Here's a fine example, how would I fill this out if I wanted to use it? That's why I need documentation.

Short answer
Each item in that list is defined in a Property Schema that defines the type and hence what the value type in the filter should be. By adding new property schemas, there will be more items in the list. So there won't be any definitive documentation for all of them.
Filters will mostly only work on Message Context Properties that are Promoted.
Long explanation:
This is the documentation Setting Filter Expressions on Send Ports, but it is very bare bones and just tells you how to set a filter. What you need refer to for out of the box is Message Context Properties e.g. File Adapter Property Schema and Properties
But what you need to know is that each item in that list is associated with a Property Schema. If you add more property schemas, those properties will also show in that list, so it is not a static list, but a dynamically generated one. Adding some adapters will add more context properties.
If you look at the context properties for a message from a file receive location you can see the FileCreationTime property there and the value, if it is promoted or not (Type), and the Namespace of the Property Schema it is associated with.
e.g.
Name: FileCreationTime
Value: 19/05/2022 9:59:23 p.m.
Type: Not Promoted
Namespace: http://schemas.microsoft.com/BizTalk/2003/file-properties
Also if you set a value to that filter and try and Enlist it and it is not the right type you get the following error.
You can see the type in the Property Schema
The FileCreationTime is not a Promoted Property, which generally means you generally can't subscribe to it, however there are some exceptions to this, but this is not one of them.
When I changed the rule to > and the value to 19/05/2022 9:59:23 p.m., the send port Enlisted, but did not subscribe to a message.
Below are the properties that are Promoted from a file receive by default
InboundTransportLocation http://schemas.microsoft.com/BizTalk/2003/system-properties
ReceivePortID http://schemas.microsoft.com/BizTalk/2003/system-properties
ReceivePortName http://schemas.microsoft.com/BizTalk/2003/system-properties
InboundTransportType FILE Promoted http://schemas.microsoft.com/BizTalk/2003/system-properties
MessageType Transaction Promoted http://schemas.microsoft.com/BizTalk/2003/system-properties
Note: MessageType will only be present if you've disassembled a message.
You either need to use the properties that are promoted, or to promote the property you do want, or have logic in either an Orchestration or Pipeline Component that inspects that context properties and then sets promoted properties so that you can route the message.
For example I used the BRE Pipeline Framework to Promote the FileCreationTime property, and then the Filter does work.

Related

Content based routing based on calculated property in BizTalk

I need to route a message based on a calculated property/field, but the same attribute/element does not exist in my outgoing schema. Is this possible?
Eg. Suppose I get an inbound message with containing employee name and date of birth. I calculate the age of the employee in orchestration or using functoid in maps. Now I want to send the message based on a condition on age, but the age property does not exist in the outgoing schema.
So Is content based routing possible on calculated properties?
You need a property schema with a property called "Age" and make sure you set this property as "MessageContextPropertyBase" by changing "Property Schema Base" from "Properties" of the node Age. Once you have the property schema then you can promote this property after your calculation either in Orchestration or in a custom receive pipeline component.
If you go with an Orchestration approach, then you need to create a correlation type with Age property and initialize the correlation on Send shape. Make sure you also set Age property on your outgoing message with Message_1(...). Deploy the property schema before using it in orchestration. if you are creating it in a different assembly then add a reference to it.
Or You can also create a custom pipeline component and promote the same Age property using Promote method in Execute method.
I'm pretty sure that promoted properties need to be part of the message. But you could always create a new message type which imports the original schema but with your new fields included and route based on that. Then you can map back to the original message type on an Outgoing map in your Send Port.
You will of course need to make sure that this new message passes through a pipeline with property promotion such as XMLReceive. So your Orch will need to handle that or alternatively, you could map to this new message in your Receive Port and do your routing before this Orch that you speak of. Difficult to say the best approach with knowing the specifics.
Yeah you can calculate the age and route the inbound message with a local variable.

how to implement source filter property page?

I have followed the instructions at http://msdn.microsoft.com/en-us/library/windows/desktop/dd375010%28v=vs.85%29.aspx to create a property page for my CSourceStream based stream.
When testing with amcap I can see that amcap now shows the menu item to show the capture pin properties (ISpecifyPropertyPages::GetPages is queried). The problem is that when amcap calls OleCreatePropertyFrame it returns with E_FAIL and I am not sure why, it does not seem to even get to the stage of quering my dll for the factory method to instantiate the CBasePropertyPage based property class.
The problem was my DllRegisterServer only registered my filter.
I can use AMovieDllRegisterServer2 to register all components in g_Templates but that function does not register source filters properly so for the moment I am just calling AMovieDllRegisterServer2 and then re-registering my filter with source filter specific code.

message data property <promoted property> in correlation <correlation> does not exist in message <messagename>

When trying to compile my orchestration that contains a correlation set I get the following error:
message data property <promoted property> in correlation <correlation> does not exist in message <messagename>
The Orchestration references a dll which contains the HL7v2 schema where the promoted property DOES exist, yet for whatever reason the orchestration/correlation set can't see it during compilation and the project won't compile due to the above stated error.
Details:
in the Orchestration view, the Correlation Type and Correlation Set is all setup successfully.
In the Correlation Properties of my Correlation Type I am able to browse to and see the reference to the promoted field and select it successfully.
I've been removing/re-adding the dll reference every time to ensure it's not a stale reference
I've been checking the GAC and the dll is being updated when I re-compile the Schema
Tried changing namespaces on the Property Schema to custom and default and back and still no help.
I'm wondering now
does the schema containing the promoted property have to be in the same project as the orchestration?
Is there something special about correlations and the HL7 schemas (all the correlation examples are on a 'Hello World' level, so it doesn't help much)
anything else I can try to get this work, we need to correlate 2 messages using a couple promoted properties.
You cannot use Properties derived from MessageDataPropertyBase for Subscriptions, which is what the Correlation set would create.
Change "Property Schema Base" to MessageContextPropertyBase. This on the property element in the Property Schema.
Why does it show up on the list when you create the Correlation Type? An oversight (bug) in that property list.

Index Specific Type without Its Contained Types

I add a FieldIndex for my content type according to the Plone.org instructions.
In the ZMI, I can see the indexed items at /mysite/portal_catalog/Indexes/Building. My content type (providing IMyType, with one field building) is folderish and contains a Photo (providing IPhoto, without building field) as allowed_content_types in profiles/default/types/MyType.xml file.
I want indexing only for MyType's building field. However, it seems items of Photo type get indexed with the value from their parents. That's annoying. Does the code #indexer(IMyType) mean indexing for IMyType and its contained types? How can I index only for IMyType?
What an indexer does is to get the attribute directly from the object being indexed. In Plone that is as special wrapper, one that will use registered indexers (as created with the #indexer decorator) if they exist.
However, if you index happens to index building and that is also an attribute on your IMyType objects directly, any contained objects will have that attribute through acquisition as well. Registering an indexer for IMyType does not prevent this.
There are a few ways around this:
Use a different name for your indexer, one that doesn't match the attribute name. Note that if all you do is index an attribute the indexer is redundant though, the index could just as well retrieve the attribute directly.
Register a "catch all" indexer:
from zope.interface import Interface
#indexer(Interface)
def catchall_ignore(ob, **kw):
# Raising AttributeError means: do not index anything
raise AttributeError
Instead of direct attribute access, now this indexer method will be used instead for Photos, causing the indexer to not register a value for building.
This is how acquisition works.
here how to workaround this:
http://plone.293351.n2.nabble.com/how-to-prevent-portal-catalog-from-indexing-acquisition-values-td2650735.html
"use a custom indexer that does the aq_explicit check."

BTS.SendPortTransformHint

What is the above property for and how to set it? I have researched Google, but all I got was the MSDN documentation for the corresponding .NET class, which doesn't have any useful information. Thanks.
You use this promoted property to set the 'Outbound Map' of a Dynamic send port.
You need to supply a fully qualified type name (the string containing 'type,assembly,Version,Culture,PublicKeyToken') of the BizTalk map to be applied to the outgoing message at the end of send port processing.

Resources