Bug fixes

This commit is contained in:
Sipke Schoorstra 2019-01-05 15:02:22 +01:00
parent 35875402e5
commit d6c73201f7
12 changed files with 38 additions and 30 deletions

View file

@ -57,10 +57,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleHost.Web", "src\sampl
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Web.Activities.Http", "src\web\modules\Elsa.Web.Activities.Http\Elsa.Web.Activities.Http.csproj", "{F4EC0B11-8E24-43C8-983B-38B7321FC4F9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Web.Dashboard", "src\web\dashboard\Elsa.Web.Dashboard\Elsa.Web.Dashboard.csproj", "{35DD61F1-878A-4198-97F3-0F19E8E5D22F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Web.BootstrapTheme", "src\web\themes\Elsa.Web.BootstrapTheme\Elsa.Web.BootstrapTheme.csproj", "{B5E36E84-1978-43C7-8859-F5184C9A657C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleDashboard.Web", "src\samples\SampleDashboard.Web\SampleDashboard.Web.csproj", "{27BD3AE7-8D3B-4D19-A8E3-4DC6922C2213}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -135,14 +135,14 @@ Global
{F4EC0B11-8E24-43C8-983B-38B7321FC4F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4EC0B11-8E24-43C8-983B-38B7321FC4F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4EC0B11-8E24-43C8-983B-38B7321FC4F9}.Release|Any CPU.Build.0 = Release|Any CPU
{35DD61F1-878A-4198-97F3-0F19E8E5D22F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35DD61F1-878A-4198-97F3-0F19E8E5D22F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35DD61F1-878A-4198-97F3-0F19E8E5D22F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35DD61F1-878A-4198-97F3-0F19E8E5D22F}.Release|Any CPU.Build.0 = Release|Any CPU
{B5E36E84-1978-43C7-8859-F5184C9A657C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5E36E84-1978-43C7-8859-F5184C9A657C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5E36E84-1978-43C7-8859-F5184C9A657C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5E36E84-1978-43C7-8859-F5184C9A657C}.Release|Any CPU.Build.0 = Release|Any CPU
{27BD3AE7-8D3B-4D19-A8E3-4DC6922C2213}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27BD3AE7-8D3B-4D19-A8E3-4DC6922C2213}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27BD3AE7-8D3B-4D19-A8E3-4DC6922C2213}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27BD3AE7-8D3B-4D19-A8E3-4DC6922C2213}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -162,7 +162,6 @@ Global
{1D63E1B4-2386-4BEC-9090-C3F3CBF25703} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{E7DE9E53-2CF0-4F45-BF82-C470A19F0CF7} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{05D06E92-E52D-4186-9382-C27D293AE4D1} = {C55090FE-8506-4FDA-928F-5ACBB9CBE019}
{35DD61F1-878A-4198-97F3-0F19E8E5D22F} = {C55090FE-8506-4FDA-928F-5ACBB9CBE019}
{444A7B77-ECB1-4D3B-A0F2-B9A41C6E8ACD} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
{F4EC0B11-8E24-43C8-983B-38B7321FC4F9} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
{B588D068-1ADE-4DB3-84BB-D8BA95897FAC} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
@ -171,6 +170,7 @@ Global
{7A30960A-1B95-4564-B2C8-2DFDDB06C594} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
{E04F98D6-F6B3-475F-BCAA-F0D586EE3965} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
{B5E36E84-1978-43C7-8859-F5184C9A657C} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
{27BD3AE7-8D3B-4D19-A8E3-4DC6922C2213} = {C55090FE-8506-4FDA-928F-5ACBB9CBE019}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8B0975FD-7050-48B0-88C5-48C33378E158}

View file

@ -17,7 +17,7 @@ namespace Elsa.Activities.Http
protected override IEnumerable<ActivityDescriptor> Describe()
{
yield return ActivityDescriptor.ForAction<HttpRequestTrigger>(
yield return ActivityDescriptor.ForTrigger<HttpRequestTrigger>(
Category,
T["HTTP Request Trigger"],
T["Triggers when an incoming HTTP request is received."],

View file

@ -35,7 +35,7 @@ namespace Elsa.Extensions
{
return activityLibrary
.ListAsync(x => x.Name == name, cancellationToken)
.SingleAsync();
.SingleOrDefaultAsync();
}
}
}

View file

@ -31,5 +31,10 @@ namespace Elsa.Extensions
{
return (await task).Single();
}
public static async Task<T> SingleOrDefaultAsync<T>(this Task<IEnumerable<T>> task)
{
return (await task).SingleOrDefault();
}
}
}

View file

@ -8,14 +8,14 @@ namespace Elsa.Extensions
public static IServiceCollection AddActivityDescriptors<T>(this IServiceCollection services)
where T : class, IActivityDescriptorProvider
{
services.TryAddSingleton<IActivityDescriptorProvider, T>();
services.AddSingleton<IActivityDescriptorProvider, T>();
return services;
}
public static IServiceCollection AddActivityDriver<T>(this IServiceCollection services)
where T : class, IActivityDriver
{
services.TryAddSingleton<IActivityDriver, T>();
services.AddSingleton<IActivityDriver, T>();
return services;
}
}

View file

@ -53,6 +53,8 @@ namespace Elsa.Models
DisplayText = displayText;
Description = description;
GetEndpoints = a => endpoints;
IsTrigger = isTrigger;
IsBrowsable = isBrowsable;
}
public bool IsBrowsable { get; set; } = true;

View file

@ -15,16 +15,16 @@ namespace Elsa.Extensions
services.TryAddSingleton<IIdGenerator, DefaultIdGenerator>();
services.TryAddScoped<IWorkflowSerializer, WorkflowSerializer>();
services.TryAddScoped<IWorkflowTokenizer, WorkflowTokenizer>();
services.TryAddScoped<IActivityHarvester, TypedActivityHarvester>();
services.AddScoped<IActivityHarvester, TypedActivityHarvester>();
services.TryAddScoped<IActivityLibrary, ActivityLibrary>();
services.AddActivityDescriptors<ActivityDescriptors>();
services.TryAddSingleton<ITokenFormatter, JsonTokenFormatter>();
services.TryAddSingleton<ITokenFormatter, YamlTokenFormatter>();
services.TryAddSingleton<ITokenFormatter, XmlTokenFormatter>();
services.AddSingleton<ITokenFormatter, JsonTokenFormatter>();
services.AddSingleton<ITokenFormatter, YamlTokenFormatter>();
services.AddSingleton<ITokenFormatter, XmlTokenFormatter>();
services.TryAddSingleton<ITokenFormatterProvider, TokenFormatterProvider>();
services.TryAddSingleton<ITokenizerInvoker, TokenizerInvoker>();
services.TryAddSingleton<ITokenizer, DefaultTokenizer>();
services.TryAddSingleton<ITokenizer, ActivityTokenizer>();
services.AddSingleton<ITokenizer, DefaultTokenizer>();
services.AddSingleton<ITokenizer, ActivityTokenizer>();
return services;
}
@ -34,8 +34,8 @@ namespace Elsa.Extensions
services.TryAddSingleton<IWorkflowInvoker, WorkflowInvoker>();
services.TryAddSingleton<IActivityInvoker, ActivityInvoker>();
services.TryAddSingleton<IActivityDriverRegistry, ActivityDriverRegistry>();
services.TryAddSingleton<IExpressionEvaluator, PlainTextEvaluator>();
services.TryAddSingleton<IExpressionEvaluator, JavaScriptEvaluator>();
services.AddSingleton<IExpressionEvaluator, PlainTextEvaluator>();
services.AddSingleton<IExpressionEvaluator, JavaScriptEvaluator>();
services.TryAddSingleton<IWorkflowExpressionEvaluator, WorkflowExpressionEvaluator>();
return services;

View file

@ -94,7 +94,8 @@ namespace Elsa.Serialization.Tokenizers
{
var name = token["name"].Value<string>();
var descriptor = await GetActivityDescriptorAsync(name, cancellationToken);
var activity = descriptor != null ? (IActivity) token.ToObject(descriptor.ActivityType) : new UnknownActivity();
var activityType = descriptor?.ActivityType ?? typeof(UnknownActivity);
var activity = (IActivity)token.ToObject(activityType);
activity.Descriptor = descriptor;
return activity;

View file

@ -1,7 +1,7 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
namespace Elsa.Web.Dashboard
namespace SampleDashboard.Web
{
public class Program
{

View file

@ -22,13 +22,13 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\modules\Elsa.Web.Activities.Console\Elsa.Web.Activities.Console.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Web.Activities.Http\Elsa.Web.Activities.Http.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Web.Activities.Primitives\Elsa.Web.Activities.Primitives.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Web.Components\Elsa.Web.Components.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Web.Management\Elsa.Web.Management.csproj" />
<ProjectReference Include="..\..\modules\Elsa.Web.Persistence.FileSystem\Elsa.Web.Persistence.FileSystem.csproj" />
<ProjectReference Include="..\..\themes\Elsa.Web.BootstrapTheme\Elsa.Web.BootstrapTheme.csproj" />
<ProjectReference Include="..\..\web\modules\Elsa.Web.Activities.Console\Elsa.Web.Activities.Console.csproj" />
<ProjectReference Include="..\..\web\modules\Elsa.Web.Activities.Http\Elsa.Web.Activities.Http.csproj" />
<ProjectReference Include="..\..\web\modules\Elsa.Web.Activities.Primitives\Elsa.Web.Activities.Primitives.csproj" />
<ProjectReference Include="..\..\web\modules\Elsa.Web.Components\Elsa.Web.Components.csproj" />
<ProjectReference Include="..\..\web\modules\Elsa.Web.Management\Elsa.Web.Management.csproj" />
<ProjectReference Include="..\..\web\modules\Elsa.Web.Persistence.FileSystem\Elsa.Web.Persistence.FileSystem.csproj" />
<ProjectReference Include="..\..\web\themes\Elsa.Web.BootstrapTheme\Elsa.Web.BootstrapTheme.csproj" />
</ItemGroup>
</Project>

View file

@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Web.Dashboard
namespace SampleDashboard.Web
{
public class Startup
{

View file

@ -6,7 +6,7 @@
},
"AllowedHosts": "*",
"FileStore": {
"RootDirectory": "C:\\Activities\\Projects\\Elsa\\src\\web\\dashboard\\Elsa.Web.Dashboard\\App_Data\\Sites\\Default\\elsa\\workflows",
"RootDirectory": "C:\\Activities\\Projects\\Elsa\\src\\web\\dashboard\\SampleDashboard.Web\\App_Data\\Sites\\Default\\elsa\\workflows",
"Format": "YAML"
}
}