Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear waiting workflows on reset when all workflows included #229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/XrmMockupShared/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
11 changes: 7 additions & 4 deletions src/XrmMockupShared/Workflow/WorkflowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,13 @@ public Entity GetActionDefaultNull(string requestName) {
return actions.FirstOrDefault(e => e.GetAttributeValue<string>("name") == requestName);
}

internal void ResetWorkflows() {
synchronousWorkflows = new List<Entity>();
asynchronousWorkflows = new List<Entity>();
parsedWorkflows = new Dictionary<Guid, WorkflowTree>();
internal void ResetWorkflows(bool? IncludeAllWorkflows) {
if (IncludeAllWorkflows == false)
{
synchronousWorkflows = new List<Entity>();
asynchronousWorkflows = new List<Entity>();
parsedWorkflows = new Dictionary<Guid, WorkflowTree>();
}
waitingWorkflows = new List<WaitInfo>();
}
}
Expand Down