views:

837

answers:

5

Hi!

I have an external program that will generate an xml document out from the db and pass it to BizTalk. Is it possible to create a transaction id or something(the id the message as in the DB) so I can keep track of the message in BizTalk, and store information in a BizTalk custom Pipeline to the database with the given transaction id?

I want to store if it failes or not, and I have custom pipelines that catch this information for storing. I don’t want to be depending on HAT for error handling.

How is the best way to keep track of messages in BizTalk, sent from external programs that need to store information about the BizTalk processing? Any link/book tips would be helpful too. Thanks!

A: 

If you post a message to BizTalk, it returns to you by default the SubmissionHandle. This is a Context property available to you from the receive port. It can then be captured in an orchestration and used to correlate errors back to the original submission.

Optionally, you can use a two way receive HTTP port and send back whatever you want to the calling application. You can either return instantly with a message or wait to return a success or failure based on what occurs during processing.

Good Luck

ChrisLoris
A: 

Thanks for the answer! I will try, If you and anyone have links to best practice on how to do it, so I start the right way, I will appreciate it.

+1  A: 

From an architectural point of view, as is often the case, there are several ways to achieve what you want, and how the solution would look like will vary greatly depending on your exact scenario.

Within BizTalk, the best way to track a flow intiated by a particular message is the interchage id.

The interchange ID is a contexy property that flows as the processing of an incomig message progresses and is copied from one message to another throughout the process(es). Technically it is the message id of the received message that started the interchange.

If you need a single ID to group "everything" together, this is it.

If, in your scenario you have the option to return this back to your caller it would be able to link it to anything you need (in and out of the database).

If you can't, but the caller can pass you the ID it has assigned to this request, you can update the database record with the interchange ID to link the two.

As the processes progresses (succesfully or not) you can alwasys go back and update that record as you ALWAYS have access to the interchange id within BizTalk.

I hope this makes snese?

Yossi Dahan
A: 

Thanks for the answer Yossi, sorry for my late response! I've been working on something else. I haven't come up with a solution for this. Your answer makes sense, and I see how I can track things. I track most things in BizTalk with BAM today. What I don't understand is how I can track it back to the application sending the file to BizTalk. How they can get the ID so they can do their own queries, knowing it is the file they want to follow.

When I started I thought this was a usual need, like this example: Another company sends a message to our server, and want to track it the whole way thru BizTalk, they need some kind of an id. Most of them don't have any unique ID in their messages, and we can't make them change that, and we have too many schemas to change all to make room for a unique field. The best for us would have been an application getting the message from the user, send the message to a receive port for BizTalk and wait for BizTalk to send back the interchange ID it creates, thru a custom pipeline or something. Is this impossible?

How do you or someone else usually deliver trace info for external users?

Thanks for all help!

+1  A: 

It could be a good thing to really think about what you want. Probably you want the sending customer/internal system to follow their message in some way, but does the status have to be read by an application or is it some users that needs the status of the message?

One way is, like mentioned above, to give them a correlating interchange id (in a response message), but then what? It is quite difficult to set up a service that an application can query about status which also is easy to maintain (regarding process changes). I've built one and you can get information about all the instances the message passes, but it won't make your customer any "wiser" since they probably cannot translate your orchestration, or pipeline, names into something understandable.

Another approach is to use BAM and make a web site the customer can use to find status of their message, like most delivery company have, DHL for example. It might need some more effort, but I think it's better to tailor made the solution for the needs.

With BAM you can extract data without changing your BizTalk projects at all. "Just" analyze your needs to find out what data to extract, or aggregate, in the BAM-Excel, export it to BizTalk database, activate and connect it with the Tracking Profile Editor.

Then you can show important mile stones to the customer in a web site. I know it's not that easy as I described above, but it will be good :)

Kind Regards Martin Bring

Martin Bring