BTS.SendPortTransformHint - biztalk

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.

Related

Where is the documentation for BizTalk SendPort filters?

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.

How can I access context property (incoming file name) in transformation (custom xslt)?

Many historical posts about BizTalk Context Accessor (CodePlex), but all links are broken. Is there a state-of-the-art context accessor functoid / component to be used today? Or, is there any other way like creating helper class or something like it?
My aim is to add file name (without path) into the destination message in a map using Custom XSLT. No existing orchestration, only picking up a file and running a map to transform message from source to destination format (that requires source file name added to it...).
I solved my problem (this time) using an orchestration where I can access the context of the incoming message easily, and after mapping, inject/update the outgoing message with the file name.
I had one additional problem to solve that helped me accept using orchestration as solution this time. Two flies in one stroke.
(Problem was - note to self - I wanted to reuse destination schema in another debatching scenario, i.e. it was a envelope schema. Funny thing, BizTalk was not able to resolve body content schema if map was run in receive port. However, running map inside an orchestration, it was able to resolve the body content schema and mapping to envelope schema as destination worked.)
An alternative to the Context Accessor functiod is to use the BRE Pipeline Framework, and read the context property and inject it into the XML Payload.

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.

Biztalk filter send port inbound maps

Currently I am using a Static Solicit-Response Send port to communicate with an external webservice.
This external webservice returns following format:
- WebserviceResponse
- Header
- IsFaulted
- ErrorMessage
- Body
- ResultObject
- ResultElement1
- ResultElement2
- ResultElementX
If IsFaulted is true, the Body is empty but the error message is filled.
Is there any way how I can use this response in two different maps, based on the IsFaulted value?
So I want:
If IsFaulted == true use Map_WebserviceResponse_To_InternalFaultedResponse.btm
If IsFaulted == false use Map_WebserviceResponse_To_InternalSuccessResponse.btm
If you need a messaging-only solution, promote the IsFaulted property, create two more send ports that filter on that promoted property with a map assigned.
If you need the transforms to be applied on the single send port based on that field, you can probably get away with setting it as a distinguished field and then doing one of two things:
Have your consuming orchestration (or create a consuming orchestration) parse the distinguished field and call the correct map.
Custom pipeline component that parses that property from the context and call the map from the pipeline component.
If you're using the ESB toolkit, you could also look into:
Use/create an ESB itinerary for the message and use the ESB toolkit to dynamically resolve the map.

SignalR : create own id factory

I know that in previous versions of signalR I have ability to manage connectionId values using IConnectionIdFactory or IConnectionIdGenerator. Now for this purpose HubPipelineModule exists but I have no idea how to use.Can anybody share link or provide simple example? Thanks.
You can't choose a connection id (that interface has been long removed from SignalR) but you can associate a UserId with one or more connections using an IUserIdProvider (by default it'll use the current' user name).
This sample shows how you register and author one of these:
https://github.com/DamianEdwards/SignalR-2.x-demo/blob/master/SignalR2x/Web/Startup.cs#L17
https://github.com/DamianEdwards/SignalR-2.x-demo/blob/master/SignalR2x/Web/Startup.cs#L28

Resources