private static void CustomTrackingWithProfileAppConfig() { TrackingProfileLoader config = new TrackingProfileLoader("MyTrackingProfile"); FileTrackingParticipant tp = new FileTrackingParticipant(); tp.TrackingProfile = config.Profile; UpdateInventory wf = new UpdateInventory(); wf.ArgSalesOrderId = 43687; WorkflowInvoker instance = new WorkflowInvoker(wf); instance.Extensions.Add(tp); instance.Invoke(); tp.Stop(); }
private static void CustomTrackingWithProfile(Int32 profileNumber) { FileTrackingParticipant tp = new FileTrackingParticipant(); UpdateInventory wf = new UpdateInventory(); wf.ArgSalesOrderId = 43687; WorkflowInvoker instance = new WorkflowInvoker(wf); switch (profileNumber) { case 6: //Activity states for selected activities with //argument extraction and selected activity scheduled query //also adds Custom Tracking Records tp.TrackingProfile = new TrackingProfile { Name = "MyTrackingProfile", Queries = { new WorkflowInstanceQuery { States = { WorkflowInstanceStates.Started, WorkflowInstanceStates.Completed, } }, new ActivityStateQuery { ActivityName = "UpdateInventory", States = { ActivityStates.Executing }, Arguments = { "*" } }, new ActivityStateQuery { ActivityName = "InsertTranHistory", States = { "*" } }, new ActivityStateQuery { ActivityName = "UpdateProductInventory", States = { ActivityStates.Executing }, Arguments = { "SalesDetail" }, QueryAnnotations = { { "Threading Model", "Asynchronous update"} } }, new ActivityStateQuery { ActivityName = "UpdateProductInventory", States = { ActivityStates.Closed } }, new ActivityScheduledQuery { ChildActivityName = "UpdateProductInventory" }, new CustomTrackingQuery { ActivityName = "*", Name = "*" } } }; break; default: break; } instance.Extensions.Add(tp); instance.Invoke(); tp.Stop(); }