After remove multiple execution scopes , Persistence related items also need to be updated. (#429)
* Update WorkflowInstanceDocument.cs * Remove multiple execution scopes * Remove multiple execution scopes * Fix Yessql * Remove yessql from web project Co-authored-by: hyz <hyz@DESKTOP-KJ2A9G2>
This commit is contained in:
parent
d5095f7a69
commit
5716de88cc
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -50,4 +50,6 @@ node_modules/
|
|||
#github
|
||||
.github/
|
||||
|
||||
App_Data/
|
||||
App_Data/
|
||||
/src/samples/Elsa.Samples.HelloWorldHttp/Properties/launchSettings.json
|
||||
/src/samples/Elsa.Samples.CustomActivities/Properties/launchSettings.json
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
|
|
|||
|
|
@ -23,31 +23,31 @@ namespace Elsa.Dashboard.Web
|
|||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
var elsaSection = Configuration.GetSection("Elsa");
|
||||
|
||||
|
||||
services
|
||||
// Add workflow services.
|
||||
.AddElsa(x => x.AddMongoDbStores(Configuration, "Elsa", "MongoDb"))
|
||||
|
||||
|
||||
// Add activities we'd like to use.
|
||||
// Configuring the activities as is done here is only required if we want to be able to actually run workflows form this application.
|
||||
// Otherwise it's only necessary to register activities for the workflow designer to discover.
|
||||
.AddHttpActivities(options => options.Bind(elsaSection.GetSection("Http")))
|
||||
.AddEmailActivities(options => options.Bind(elsaSection.GetSection("Smtp")))
|
||||
.AddTimerActivities(options => options.Bind(elsaSection.GetSection("Timers")))
|
||||
|
||||
|
||||
// Add Dashboard services.
|
||||
.AddElsaDashboard();
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
if (env.IsDevelopment())
|
||||
app.UseDeveloperExceptionPage();
|
||||
|
||||
app
|
||||
// This is only necessary if we want to be able to run workflows containing HTTP activities from this application.
|
||||
.UseHttpActivities()
|
||||
|
||||
|
||||
.UseStaticFiles()
|
||||
.UseRouting()
|
||||
.UseEndpoints(endpoints => endpoints.MapControllers())
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ namespace Elsa.Persistence.DocumentDb.Documents
|
|||
public IDictionary<string, ActivityInstance> Activities { get; set; } =
|
||||
new Dictionary<string, ActivityInstance>();
|
||||
|
||||
[JsonProperty(PropertyName = "scopes")]
|
||||
public Stack<WorkflowExecutionScope> Scopes { get; set; }
|
||||
[JsonProperty(PropertyName = "scope")]
|
||||
public WorkflowExecutionScope Scope { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "input")] public Variables Input { get; set; }
|
||||
|
||||
|
|
@ -53,4 +53,4 @@ namespace Elsa.Persistence.DocumentDb.Documents
|
|||
|
||||
[JsonProperty(PropertyName = "fault")] public WorkflowFault Fault { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,10 +94,10 @@ namespace Elsa.Persistence.EntityFrameworkCore.DbContexts
|
|||
entity.Property(x => x.Status).HasConversion<string>();
|
||||
|
||||
entity
|
||||
.Property(x => x.Scopes)
|
||||
.Property(x => x.Scope)
|
||||
.HasConversion(
|
||||
x => Serialize(x),
|
||||
x => DeserializeScopes(x)
|
||||
x => Deserialize<WorkflowExecutionScope>(x)
|
||||
);
|
||||
|
||||
entity
|
||||
|
|
@ -178,12 +178,6 @@ namespace Elsa.Persistence.EntityFrameworkCore.DbContexts
|
|||
private T Deserialize<T>(string json)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<T>(json, serializerSettings);
|
||||
}
|
||||
|
||||
private Stack<WorkflowExecutionScope> DeserializeScopes(string json)
|
||||
{
|
||||
var reversedScopes = JsonConvert.DeserializeObject<Stack<WorkflowExecutionScope>>(json, serializerSettings);
|
||||
return reversedScopes is { } ? new Stack<WorkflowExecutionScope>(reversedScopes) : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Elsa.Persistence.EntityFrameworkCore.Entities
|
|||
public DateTime? FinishedAt { get; set; }
|
||||
public DateTime? FaultedAt { get; set; }
|
||||
public DateTime? AbortedAt { get; set; }
|
||||
public Stack<WorkflowExecutionScope> Scopes { get; set; }
|
||||
public WorkflowExecutionScope Scope { get; set; }
|
||||
public Variables Input { get; set; }
|
||||
public ICollection<LogEntry> ExecutionLog { get; set; }
|
||||
public WorkflowFault Fault { get; set; }
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ namespace Elsa.Persistence.YesSql.Documents
|
|||
public DateTime? FaultedAt { get; set; }
|
||||
public DateTime? AbortedAt { get; set; }
|
||||
public IDictionary<string, ActivityInstance> Activities { get; set; } = new Dictionary<string, ActivityInstance>();
|
||||
public Stack<WorkflowExecutionScope> Scopes { get; set; }
|
||||
public WorkflowExecutionScope Scope { get; set; }
|
||||
public Variables Input { get; set; }
|
||||
public HashSet<BlockingActivity> BlockingActivities { get; set; }
|
||||
public ICollection<LogEntry> ExecutionLog { get; set; }
|
||||
public WorkflowFault Fault { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue