Strongly Typed Dataset In Orchestration - Problems

Hi Guys,

I'm hitting a brick wall. I'm hoping you can help.

I am using BAM in a project to track some information. I have created a
strongly typed dataset that allows me access to the BAM views. I have tested
this class via a c# helper utility, its works. My utility is a static class
with static methods.

In my orchestration, I want to get access to the activityid generated by BAM
when creating the new activity. Now, if I try and access these utility
methods in my orchestration, the dataset always throws an exception,

Exception type: IndexOutOfRangeException
Source: System.Data
Target Site: NodePath GetNodeByIndex(Int32)
Inner exception: There is no row at position 0.

I've used the Debug.Writeline to make sure my parameters etc are all ok.
They are. So now im wondering why it won't work inside the orchestration.

If I look in the database, i can see that the data is there, however the
lookup just refuses to work inside the orchestration.

Any help greatly appreciated.

Kind regards
TM

[1124 byte] By [etones] at [2008-1-7]
# 1

The activity that you are trying to access is for the current orchestration or already finished orchestration? If it is for the current orchestration I don't think you can access until the orchestration commits the transaction....

Thanks,

Sarbillgates

SaravanaKumar_1977 at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 2

Hi Saravana,

thanks for the reply.

My utility is only performing a SELECT query. If I look in the database, I can see that the values I need are there. Therefore, why is it i cannot access it?

Kind regards

Tarun

etones at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 3

Just to clear up why I am doing this.

I have 2 orchestrations running. "Shipment" and "Item".

When a new item is added to shipment, I need to do a lookup in BAM to find the activity id of the item so that I can add the relationship between the 2 entities.

TM

etones at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 4
I agree with Saravana Kumar, BAM is not for such task. I'm not sure you can use the BAM databases to correlate messages.
LeonidGaneline-MVP at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 5

Hi guys,

I am using BAM to track my business process, as i believe it is meant to be used. Not to correlation messages.

I need to create a relationship between entities in 2 running orchestrations. I have the activity id of the orchestration that the message arrives at, however I need to lookup the activityid of the other orchestration. Why do my SQL lookups not work? I can see that the data has been populated into the database. If I run the query in SQL management studio, I get the data back that I need.

If I run this code via the expression shape, it tells me there are no rows. I'm confused.

Any help appreciated.

Kind regards

Tarun

etones at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 6
Have you tried to link the orchestrations in other way?
For example, using the Call orchestration shape; using the correlated direct ports?
Regards,
Leonid Ganeline
http://geekswithblogs.net/leonidganeline/
LeonidGaneline-MVP at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 7

There is nothing magical about accessing the BAM Dbs. This should work like querying any other SQL view and then you are just using this data..

So let's review: Looking at the thread it seems that:

  • First a instance goes one orch and is given an activity ID (AutoGenerated)
  • Then an instance goes through another Orch and in this orch you want to query the the BAM views for the original view to find an instance ID, and crearte a relationship

I agree this should work and is certainly within the functionality of BAM

Is that about right? I have a funny feeling that the issue you are facing may one of rights.

  • First are you querying the topmost view? BAM is designed for access to the unified views and not the subviews and tables.
  • Secondly, hace you added the User Context for that host running the orchestration (BTS_Host..) to have rights to the view with the BM?
  • bm.exe add-account bm.exe add-account -AccountNameBig Smileomain\user -ViewTongue TiedalesManagerView
  • When you run in query in the SQL Management studio you are probably running as DBO. WHen running in the orchestration the query is being executed in a different user context.

Does that make sense? Let me know if it works.

Thx - brad

BradParis(MSFT) at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 8

<P align=left><FONT face=Arial size=2>Whoops, the emoticons don't show up in the text editor...&nbsp;&nbsp; </FONT></P>

BradParis(MSFT) at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 9

Could you provide us more information as to the BizTalk version you are using, whether the BAM tracking is through TPE only or a mixed of TPE-enabled tracking and EventStream API? If using EventStream, which one are you using? What kind of orchestration scope you have, how are the two orchestration linked - exec/call or independent?

In most common cases I have seen, where there are relationships between activities, the best pratice is to use a piece of data from the payload message and not the auto-generated one. This piece of data used as activity id must be unique.

Now, let's say you have Shipping Orchestration and Item Orchestration. Message going to one of them must contain the id of the other one. E.g. it does not matter when the relationship is established, you can either Item101 addrelationship to shipping UPS005 or vice versa. Internally, the system will do a reverse lookup of the relationship.


Event if you can get the dataset running without error, I would not recommend it. Depending of the orchestration scope you are using and the kind of BAM persistency used (my initial questions), the BAM event you wanted may not have been persisted yet.

KeithLim at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...