Before I move onto the solution, I'll mention that as an alternative you could take the PortStartTime from the receive location and use a continuation to link it to your orchestration.
To work around this I'm going to call the BAM API directly. Firstly we drop an expression shape in the orchestration and call BeginActivity
Microsoft.BizTalk.BAM.EventObservation.OrchestrationEventStream.BeginActivity(<<activity name>>, <<activity instance>>);The activity name can be taken from the activity you created from the BAM addin for Excel. The activity instance is any id. Normally TPE uses ActivityID. You won't have access to this value from within your orchestration so you will need to provide a new one. So go ahead and drag a new id such as MessageID or InterchangeID onto the ActivityID in TPE like so
Microsoft.BizTalk.BAM.EventObservation.OrchestrationEventStream.BeginActivity("my activity", receivedMessage(BTS.MessageID));
Microsoft.BizTalk.BAM.EventObservation.OrchestrationEventStream.UpdateActivity("my activity", receivedMessage(BTS.MessageID), "DateTime", System.DateTime.UtcNow);
Microsoft.BizTalk.BAM.EventObservation.OrchestrationEventStream.EndActivity("my activity", receivedMessage(BTS.MessageID));And that's it. We call the BAM API and update the activity providing it the current datetime.
No comments:
Post a Comment