Added Fork Activity (#17)
* Incremental work on track and trace * Implemented logging * Updated package references * Added Fork activity
This commit is contained in:
parent
99afdcd5f8
commit
04e95d8a38
|
|
@ -29,7 +29,7 @@ namespace Elsa.Activities.Http
|
|||
Category,
|
||||
T["HTTP Request"],
|
||||
T["Execute a HTTP request."],
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
a => a.SupportedStatusCodes.Select(x => T[x.ToString()]));
|
||||
|
||||
|
|
|
|||
10
src/activities/Elsa.Activities.Primitives/Activities/Fork.cs
Normal file
10
src/activities/Elsa.Activities.Primitives/Activities/Fork.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using System.Collections.Generic;
|
||||
using Elsa.Models;
|
||||
|
||||
namespace Elsa.Activities.Primitives.Activities
|
||||
{
|
||||
public class Fork : Activity
|
||||
{
|
||||
public IList<string> Forks { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Elsa.Activities.Primitives.Activities;
|
||||
using Elsa.Models;
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
|
@ -24,6 +25,14 @@ namespace Elsa.Activities.Primitives
|
|||
T["Iterate over a list of items."],
|
||||
T["Next"], T["Done"]);
|
||||
|
||||
yield return ActivityDescriptor.For<Fork>(
|
||||
ControlFlowCategory,
|
||||
T["Fork"],
|
||||
T["Fork workflow execution into separate paths of execution."],
|
||||
false,
|
||||
true,
|
||||
a => a.Forks.Select(x => T[x]));
|
||||
|
||||
yield return ActivityDescriptor.ForAction<IfElse>(
|
||||
ControlFlowCategory,
|
||||
T["If/Else"],
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
using Elsa.Activities.Primitives.Activities;
|
||||
using Elsa.Handlers;
|
||||
using Elsa.Models;
|
||||
using Elsa.Results;
|
||||
|
||||
namespace Elsa.Activities.Primitives.Drivers
|
||||
{
|
||||
public class ForkDriver : ActivityDriver<Fork>
|
||||
{
|
||||
protected override ActivityExecutionResult OnExecute(Fork activity, WorkflowExecutionContext workflowContext)
|
||||
{
|
||||
return TriggerEndpoints(activity.Forks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@ namespace Elsa.Activities.Primitives.Extensions
|
|||
.AddPrimitiveWorkflowDescriptors()
|
||||
.AddActivityDriver<SetVariableDriver>()
|
||||
.AddActivityDriver<ForEachDriver>()
|
||||
.AddActivityDriver<ForkDriver>()
|
||||
.AddActivityDriver<IfElseDriver>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,10 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="OrchardCore.Application.Mvc.Targets" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Resources" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Settings" Version="1.0.0-beta3-70362" />
|
||||
<!--<PackageReference Include="OrchardCore.Application.Mvc.Targets" Version="1.0.0-beta3-70705" />-->
|
||||
<PackageReference Include="OrchardCore.Application.Cms.Targets" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.Resources" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.Settings" Version="1.0.0-beta3-70705" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -9,9 +9,12 @@ namespace SampleDashboard.Web
|
|||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services
|
||||
.AddRouting(options => options.LowercaseUrls = true)
|
||||
.AddOrchardCoreTheming();
|
||||
services.AddOrchardCms();
|
||||
|
||||
// TODO: Temporarily disabled until I figured out why it's broken.
|
||||
// services
|
||||
// .AddRouting(options => options.LowercaseUrls = true)
|
||||
// .AddOrchardCoreTheming();
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.0.0-beta3-70705" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70705" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -19,11 +19,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70362" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Views\_ViewImports.cshtml" />
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70705" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Elsa.Activities.Primitives.Activities;
|
||||
using Elsa.Web.Activities.Primitives.ViewModels;
|
||||
using Elsa.Web.Drivers;
|
||||
using Enumerable = System.Linq.Enumerable;
|
||||
|
||||
namespace Elsa.Web.Activities.Primitives.Drivers
|
||||
{
|
||||
public class ForkDisplay : ActivityDisplayDriver<Fork, ForkViewModel>
|
||||
{
|
||||
protected override void EditActivity(Fork activity, ForkViewModel model)
|
||||
{
|
||||
model.Forks = string.Join(", ", activity.Forks ?? Enumerable.Empty<string>());
|
||||
}
|
||||
|
||||
protected override void UpdateActivity(ForkViewModel model, Fork activity)
|
||||
{
|
||||
activity.Forks = !string.IsNullOrWhiteSpace(model.Forks)
|
||||
? (IList<string>) model.Forks
|
||||
.Split(new[] { "," }, StringSplitOptions.None)
|
||||
.Select(x => x.Trim())
|
||||
.Where(x => !string.IsNullOrWhiteSpace(x))
|
||||
.ToList()
|
||||
: new string[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70705" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -25,4 +25,8 @@
|
|||
<Content Include="Views\_ViewImports.cshtml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="ViewModels" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ namespace Elsa.Web.Activities.Primitives
|
|||
.AddPrimitiveWorkflowDescriptors()
|
||||
.AddActivityDisplay<IfElseDisplay>()
|
||||
.AddActivityDisplay<ForEachDisplay>()
|
||||
.AddActivityDisplay<ForkDisplay>()
|
||||
.AddActivityDisplay<SetVariableDisplay>()
|
||||
.AddActivityDisplay<UnknownActivityDisplay>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Elsa.Web.Activities.Primitives.ViewModels
|
||||
{
|
||||
public class ForkViewModel
|
||||
{
|
||||
[Required]
|
||||
public string Forks { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
@model Elsa.Web.ViewModels.ActivityShapeModel<Elsa.Activities.Primitives.Activities.Fork>
|
||||
@{
|
||||
var activityDescriptor = Model.Activity.Descriptor;
|
||||
}
|
||||
<h4 class="card-title"><i class="far fa-code-fork"></i>@activityDescriptor.DisplayText</h4>
|
||||
<p>@activityDescriptor.Description</p>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
@model Elsa.Web.ViewModels.ActivityShapeModel<Elsa.Activities.Primitives.Activities.Fork>
|
||||
|
||||
<header>
|
||||
<h4><i class="far fa-code-fork"></i>@Model.DisplayText</h4>
|
||||
</header>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
@model Elsa.Web.Activities.Primitives.ViewModels.ForkViewModel
|
||||
<div class="form-group">
|
||||
<label asp-for="Forks">@T["Forks"]</label>
|
||||
<input asp-for="Forks" class="form-control"/>
|
||||
<span asp-validation-for="Forks" class="text-danger"></span>
|
||||
<small class="form-text text-muted">@T["A comma-separated list for fork names."]</small>
|
||||
</div>
|
||||
|
|
@ -14,9 +14,9 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Resources" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.Resources" Version="1.0.0-beta3-70705" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OrchardCore" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.FileStorage.FileSystem" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Mvc.Core" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.ResourceManagement" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Infrastructure" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Settings" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.FileStorage.FileSystem" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.Mvc.Core" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.ResourceManagement" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.Infrastructure" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.Settings" Version="1.0.0-beta3-70705" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Elsa.Web.Management.Theming
|
|||
|
||||
public Task<ThemeSelectorResult> GetThemeAsync()
|
||||
{
|
||||
var currentThemeName = shellSettings.Configuration["CurrentTheme"];
|
||||
var currentThemeName = shellSettings["CurrentTheme"];
|
||||
|
||||
var result = new ThemeSelectorResult
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70362"/>
|
||||
<PackageReference Include="OrchardCore.FileStorage.FileSystem" Version="1.0.0-beta3-70362"/>
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-beta3-70705"/>
|
||||
<PackageReference Include="OrchardCore.FileStorage.FileSystem" Version="1.0.0-beta3-70705"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.ResourceManagement" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.Theme.Targets" Version="1.0.0-beta3-70362" />
|
||||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.ResourceManagement" Version="1.0.0-beta3-70705" />
|
||||
<PackageReference Include="OrchardCore.Theme.Targets" Version="1.0.0-beta3-70705" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Reference in a new issue