Question about the Tracking Service
Hello
I have a workflow that looks like this, and I have the SqlTrackingService enabled and running for it:
Workflow1
SequenceActivity1
SequenceActivity2
CodeActivity1
SequenceActivity3
CodeActivity2
The CodeActivity1 just throws an exception, like "throw new Exception("Exception");"
When I'm using the SqlTrackingQuery.TryGetInstance for this workflow, on the SqlTrackingWorkflowInstance.ActivityEvents, I'm just getting:
Workflow1, Faulting.
Workflow1, Closed.
And if I do not throw that exception on the CodeActivity, then I get all the trace correctly.
I would like to get the events from the Sequences and from the CodeActivity when an exception is thrown too. Can I do that, or I'm missing something?
I'm still on Beta 2...
Thanks in advance,
Matias
[893 byte] By [
Matt] at [2007-12-22]
Note: I recommend upgrading to our July CTP. There were some bugs in the batching logic that were fixed post beta2. You may be seeing one of these bugs.
In regards to IsTransactional - did you perhaps mean to say that you set IsTransactional=false? Setting it to false will write event data to the db as the event is received by the SqlTrackingService. This is desireable for tracing, auditing and debugging scenarios. In this mode no events will be discarded if the runtime throws away a work batch due to an exception. Performance will generally be a little slower in this mode as batching the Sql calls for multiple events is more efficient for us.
Thanks,
Joel West
MSFTE - SDE in WF runtime and hosting
This posting is provided "AS IS" with no warranties, and confers no rights
Yes, sorry, I meant IsTransactional=false.
I have another question.
Given a SqlTrackingWorkflowInstance, how can I know the ExecutionResult from an Activity?
In the workflow I showed above, imagine that CodeActivity1 throws an exception, but it is handled by the FaultHandler of his parent SequenceActivity, so, the ExecutionResult of the CodeActivity is Faulted and the state of the Sequence is Succeded.
How can I check those values, since the ActivityTrackingRecord shows me only the ActivityExecutionStatus, and if I use that value, both activities enter on Faulting state, and then Closed, but I can't know if the execution faulted or succeded.
p.d. I'm still on Beta 2, can't upgrade right now.
Thanks in advance.
You don't directly get the execution result in tracking (although this is something we can consider for a future version). What you can do in this scenario is have your profile specify that you want to receive Faulting events (and potentially Cancelling as well as activities that are executing when a exception occurs may be canceled depending on where they are in the workflow, where the exception occurs and where and if it is handled). Now there have been some changes to how Faulting and Canceling work and unfortunately I don't remember the exact semantics that we had in beta2. This is what you want to do for RTM (either the June or July CTP contain versions of our RTM RCs where this functionality is in it's final version). Try it on beta2 and see how it goes. It should work to some extent but you may need to upgrade to the final RTM behavior to determine if these events will work for what you need to do.
Thanks,
Joel West
MSFTE - SDE in WF runtime and hosting
This posting is provided "AS IS" with no warranties, and confers no rights