Wednesday, August 03, 2005

Bam Business Milestones

So you are starting to realize the potential of BAM, but you notice that the times in your Business Milestones are a bit off. This is because BizTalk logs Business Milestones in UTC. So, I thought I would help you all fix this to show the time in your local time zone.

If you get into the DB call BAMPrimaryImport, and look for a SP call bam_ActivityName_PrimaryImport we are going to add a few statements after the BEGIN statement.

--A variable to hold the difference between UTC and your local time
DECLARE @TimeDifference int

--Calculate the difference
SELECT @TimeDifference = ROUND(DATEDIFF(mi, GetUTCDate(), GetDate()), -1)

--Fix the time difference
SELECT @BusinessMilestone = DATEADD(mi, @TimeDifference, @BusinessMilestone)
SELECT @2ndBusinessMilestone = DATEADD(mi, @TimeDifference, @2ndBusinessMilestone)

Ther you go! Now you will need to do this for each Activity you defined.

1 Comments:

Blogger hung said...

Good post.
Can you put some simple sample step by step BAM project up?

10:20 AM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home