Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SqlTrackingWorkflowInstance instance = null;
- //wfServiceHost is an instance of WorkflowServiceHost
- WorkflowRuntimeBehavior workflowRuntimeBehaviour = wfServiceHost.Description.Behaviors.Find<WorkflowRuntimeBehavior>();
- WorkflowRuntime wfRuntime = workflowRuntimeBehaviour.WorkflowRuntime;
- if (wfRuntime != null)
- {
- SqlTrackingService trackingService = (SqlTrackingService)wfRuntime.GetService(typeof(SqlTrackingService));
- SqlTrackingQuery sqlTrackingQuery = new SqlTrackingQuery(trackingService.ConnectionString);
- sqlTrackingQuery.TryGetWorkflow(instanceId, out instance);
- }
- this.TrackData("name", myObject)
- foreach (UserTrackingRecord userTrackingRecord in
- sqlTrackingWorkflowInstance.UserEvents)
- {
- Console.WriteLine("Key : {0} Data : {1}",
- userTrackingRecord.UserDataKey,
- userTrackingRecord.UserData.ToString());
- if (userTrackingRecord.UserDataKey == "Job")
- {
- OrderRequest request = userTrackingRecord.UserData as OrderRequest;
- if (request != null)
- {
- Console.WriteLine("nJob ID: {0}", request.JobID);
- }
- }
- }
Add Comment
Please, Sign In to add comment