diff --git a/src/XrmMockupShared/Core.cs b/src/XrmMockupShared/Core.cs index 3bb36351..f275b003 100644 --- a/src/XrmMockupShared/Core.cs +++ b/src/XrmMockupShared/Core.cs @@ -1121,10 +1121,7 @@ internal void DeleteSnapshot(string snapshotName) internal void ResetEnvironment() { this.TimeOffset = new TimeSpan(); - if (settings.IncludeAllWorkflows == false) - { - workflowManager.ResetWorkflows(); - } + workflowManager.ResetWorkflows(settings.IncludeAllWorkflows); pluginManager.ResetPlugins(); this.db = new XrmDb(metadata.EntityMetadata, GetOnlineProxy()); diff --git a/src/XrmMockupShared/Workflow/WorkflowManager.cs b/src/XrmMockupShared/Workflow/WorkflowManager.cs index 77be9861..f96fab4f 100644 --- a/src/XrmMockupShared/Workflow/WorkflowManager.cs +++ b/src/XrmMockupShared/Workflow/WorkflowManager.cs @@ -419,10 +419,13 @@ public Entity GetActionDefaultNull(string requestName) { return actions.FirstOrDefault(e => e.GetAttributeValue("name") == requestName); } - internal void ResetWorkflows() { - synchronousWorkflows = new List(); - asynchronousWorkflows = new List(); - parsedWorkflows = new Dictionary(); + internal void ResetWorkflows(bool? IncludeAllWorkflows) { + if (IncludeAllWorkflows == false) + { + synchronousWorkflows = new List(); + asynchronousWorkflows = new List(); + parsedWorkflows = new Dictionary(); + } waitingWorkflows = new List(); } }