Take a look at the TrackingParticipant workflow class.
He acts in all activities in the workflow similar to AOP in the field.
It emits information about entering and exiting actions.
Create a class that inherits from TrackingParticipant and overrides the Track method:
protected override void Track(TrackingRecord record, TimeSpan timeout) { ActivityStateRecord activityStateRecord = record as ActivityStateRecord; string CurrentActivityName = activityStateRecord.Activity.Name, }
Then attach your tracking class to the workflow before it starts.
_workflowApplication.Extensions.Add(_yourWorkFlowTrackingClass); _workflowApplication.Run();
You can also enable TrackingRecord in WorkflowInstanceRecord. Between them, ActivityStateRecord and WorkflowInstanceRecord provide a lot of information about the workflow and its actions.
Richard210363
source share