Merge branch 'develop' into feature/elsa-2.0

# Conflicts:
#	src/activities/Elsa.Activities.ControlFlow/Activities/ForEach.cs
#	src/core/Elsa.Abstractions/Extensions/WorkflowExtensions.cs
#	src/core/Elsa.Abstractions/Models/WorkflowInstance.cs
#	src/core/Elsa.Core/Expressions/LiteralEvaluator.cs
#	src/dashboard/Elsa.Dashboard/Extensions/DashboardServiceCollectionExtensions.cs
#	src/dashboard/Elsa.Dashboard/Theme/argon-dashboard/package-lock.json
#	src/dashboard/Elsa.Dashboard/Theme/argon-dashboard/package.json
#	src/persistence/Elsa.Persistence.DocumentDb/Extensions/ServiceConfigurationExtensions.cs
#	src/persistence/Elsa.Persistence.EntityFrameworkCore/Extensions/EFCoreServiceCollectionExtensions.cs
#	src/persistence/Elsa.Persistence.EntityFrameworkCore/Migrations/MySql/MySqlContextModelSnapshot.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Migrations/MySql/20200402200706_Update01.Designer.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Migrations/MySql/20200402200706_Update01.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Migrations/PostgreSql/20200402200555_Update01.Designer.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Migrations/PostgreSql/20200402200555_Update01.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Migrations/SqlServer/20200402200549_Update01.Designer.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Migrations/SqlServer/20200402200549_Update01.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Migrations/Sqlite/20200402200519_Update01.Designer.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Migrations/Sqlite/20200402200519_Update01.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Migrations/Sqlite/SqliteContextModelSnapshot.cs
#	src/samples/Sample24/Program.cs
#	src/scripting/Elsa.Scripting.JavaScript/Services/JavaScriptHandler.cs
This commit is contained in:
Sipke Schoorstra 2020-04-17 20:34:39 +02:00
commit c542a5a531
23 changed files with 191 additions and 97 deletions

10
.gitattributes vendored Normal file
View file

@ -0,0 +1,10 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

1
.gitignore vendored
View file

@ -34,7 +34,6 @@ packages/
#Ignore git-related files
*.orig
.gitattributes
#Rider
.idea

45
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,45 @@
# Contributing to Elsa Workflows
We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer
## We develop with Github
We use github to host code, to track issues and feature requests, as well as to accept pull requests.
## We use [Github Flow](https://guides.github.com/introduction/flow/index.html), So all code changes happen through pull requests
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
1. Fork the repo and create your branch from `develop`.
1. Issue that pull request!
## Any contributions you make will be under the New BSD License
In short, when you submit code changes, your submissions are understood to be under the same [New BSD License](https://github.com/elsa-workflows/elsa-core/blob/master/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern.
## Report bugs using Github's [issues](https://github.com/elsa-workflows/elsa-core/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/elsa-workflows/elsa-core/issues/new); it's that easy!
## Write bug reports with detail, background, and sample code
**Great Bug Reports** tend to have:
- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
People *love* thorough bug reports. I'm not even kidding.
## Use a Consistent Coding Style
As a default, I am applying [Microsoft's Coding Conventions for .NET](https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference).
## License
By contributing, you agree that your contributions will be licensed under its [New BSD License](https://github.com/elsa-workflows/elsa-core/blob/master/LICENSE).
## References
This document was adapted from the following [Gist](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62)

View file

@ -65,6 +65,9 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Persistence.YesSql", "src\providers\Elsa.Persistence.YesSql\Elsa.Persistence.YesSql.csproj", "{235DA54C-336A-408F-903E-CD935012CEBC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E12F5CD9-0738-4F23-9438-26B65A0C53AA}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripting", "scripting", "{5E230C5F-7A64-4E95-A790-DF40CC66DA31}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Scripting.JavaScript", "src\scripting\Elsa.Scripting.JavaScript\Elsa.Scripting.JavaScript.csproj", "{DA91DAF2-4C59-4468-8F1D-6A500D218A1E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Core.UnitTests", "test\unit\Elsa.Core.UnitTests\Elsa.Core.UnitTests.csproj", "{715A6E74-05CD-4236-9287-1643B074117E}"
EndProject
@ -120,10 +123,6 @@ Global
{5A3C9D59-21FE-4BE3-A00A-FF3F198EEC97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A3C9D59-21FE-4BE3-A00A-FF3F198EEC97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A3C9D59-21FE-4BE3-A00A-FF3F198EEC97}.Release|Any CPU.Build.0 = Release|Any CPU
{72DA50EC-8A99-4D4F-BF61-DEF105BDAE10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{72DA50EC-8A99-4D4F-BF61-DEF105BDAE10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72DA50EC-8A99-4D4F-BF61-DEF105BDAE10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{72DA50EC-8A99-4D4F-BF61-DEF105BDAE10}.Release|Any CPU.Build.0 = Release|Any CPU
{DA91DAF2-4C59-4468-8F1D-6A500D218A1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA91DAF2-4C59-4468-8F1D-6A500D218A1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA91DAF2-4C59-4468-8F1D-6A500D218A1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -196,9 +195,7 @@ Global
{C4939482-9447-47D1-B6AF-E9F8C6323841} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{BC0F57E2-AB64-4026-B6E3-E03D9133DB26} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{5A3C9D59-21FE-4BE3-A00A-FF3F198EEC97} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{9E1AF14C-0BEC-4BC2-810C-85FC25A9DDD4} = {DA71CDAA-8DD3-4D5F-9FBD-8E4B37A2D925}
{5E230C5F-7A64-4E95-A790-DF40CC66DA31} = {DA71CDAA-8DD3-4D5F-9FBD-8E4B37A2D925}
{72DA50EC-8A99-4D4F-BF61-DEF105BDAE10} = {9E1AF14C-0BEC-4BC2-810C-85FC25A9DDD4}
{DA91DAF2-4C59-4468-8F1D-6A500D218A1E} = {5E230C5F-7A64-4E95-A790-DF40CC66DA31}
{9A2D1E3E-328F-4E02-86F8-84974925C1E3} = {5E230C5F-7A64-4E95-A790-DF40CC66DA31}
{ED2A4FE5-821B-46F7-B72F-E66DE0D66C93} = {35F44BE9-13D0-417C-A01A-F0787BEE6DC3}

View file

@ -1,6 +1,6 @@
BSD 3-Clause License
Copyright (c) 2019, Sipke Schoorstra
Copyright (c) 2020, .NET Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without

View file

@ -191,4 +191,13 @@ In order to build & run Elsa on your local machine, follow these steps:
2. Run NPM install on all folders containing packages.json (or run `node npm-install.js` - a script in the root that recursively installs the Node packages)
3. Execute gulp build from the directory src\dashboard\Elsa.Dashboard\Theme\argon-dashboard
4. Open a shell and navigate to `src/samples/Sample16` and run `dotnet run`.
5. Navigate to https://localhost:8632/elsa/home
5. Navigate to https://localhost:8632/elsa/home
# Code of Conduct
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
### .NET Foundation
This project is supported by the [.NET Foundation](https://dotnetfoundation.org).

View file

@ -79,6 +79,7 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Persistence.MongoDb", "src\providers\Elsa.Persistence.MongoDb\Elsa.Persistence.MongoDb.csproj", "{36A6F881-1B40-438D-9B6D-80F01CE76D51}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Persistence.YesSql", "src\providers\Elsa.Persistence.YesSql\Elsa.Persistence.YesSql.csproj", "{DA825F41-EE97-47B3-801E-C694A6C53AEC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample18", "src\samples\Sample18\Sample18.csproj", "{616AA0BA-FBDD-4ABE-B688-A3F79F38C698}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Samples.Timers", "src\samples\Elsa.Samples.Timers\Elsa.Samples.Timers.csproj", "{071DD6EC-D00C-4513-82B6-3FE8438061E3}"
EndProject
@ -154,6 +155,14 @@ Global
{102626A4-8BA6-45A8-A69C-F5EB1F155BE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{102626A4-8BA6-45A8-A69C-F5EB1F155BE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{102626A4-8BA6-45A8-A69C-F5EB1F155BE7}.Release|Any CPU.Build.0 = Release|Any CPU
{616AA0BA-FBDD-4ABE-B688-A3F79F38C698}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{616AA0BA-FBDD-4ABE-B688-A3F79F38C698}.Debug|Any CPU.Build.0 = Debug|Any CPU
{616AA0BA-FBDD-4ABE-B688-A3F79F38C698}.Release|Any CPU.ActiveCfg = Release|Any CPU
{616AA0BA-FBDD-4ABE-B688-A3F79F38C698}.Release|Any CPU.Build.0 = Release|Any CPU
{2AEA0028-96D6-4823-A88F-24294E4BA4E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2AEA0028-96D6-4823-A88F-24294E4BA4E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AEA0028-96D6-4823-A88F-24294E4BA4E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AEA0028-96D6-4823-A88F-24294E4BA4E8}.Release|Any CPU.Build.0 = Release|Any CPU
{258F624E-98D7-4498-AE2E-F612D8ECA763}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{258F624E-98D7-4498-AE2E-F612D8ECA763}.Debug|Any CPU.Build.0 = Debug|Any CPU
{258F624E-98D7-4498-AE2E-F612D8ECA763}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -246,6 +255,8 @@ Global
{01DC21DD-C6E2-4B21-864E-97D29448F777} = {9C3C685E-3D7D-4638-A031-24F71CF74B52}
{0D276728-DDA8-46A0-91A9-D44401D66DA9} = {DA71CDAA-8DD3-4D5F-9FBD-8E4B37A2D925}
{102626A4-8BA6-45A8-A69C-F5EB1F155BE7} = {0D276728-DDA8-46A0-91A9-D44401D66DA9}
{616AA0BA-FBDD-4ABE-B688-A3F79F38C698} = {5E5E1E84-DDBC-40D6-B891-0D563A15A44A}
{2AEA0028-96D6-4823-A88F-24294E4BA4E8} = {5E5E1E84-DDBC-40D6-B891-0D563A15A44A}
{258F624E-98D7-4498-AE2E-F612D8ECA763} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{468E498C-59DB-4541-8D8A-0D89DE9083AB} = {DA71CDAA-8DD3-4D5F-9FBD-8E4B37A2D925}
{D91E2F7B-D5B7-4D1C-A3F0-B0475C33F539} = {468E498C-59DB-4541-8D8A-0D89DE9083AB}

View file

@ -60,23 +60,31 @@ namespace Elsa.Extensions
/// </summary>
public static IEnumerable<string> GetInboundActivityPath(this Workflow workflow, string activityId)
{
return workflow.GetInboundActivityPathInternal(activityId, activityId).Distinct().ToList();
var inspectedActivityIDs = new HashSet<string>();
return workflow.GetInboundActivityPathInternal(activityId, activityId, inspectedActivityIDs)
.Distinct().ToList();
}
private static IEnumerable<string> GetInboundActivityPathInternal(this Workflow workflowInstance, string activityId, string startingPointActivityId)
private static IEnumerable<string> GetInboundActivityPathInternal(this Workflow workflowInstance,
string activityId,
string startingPointActivityId,
HashSet<string> inspectedActivityIDs)
{
foreach (var connection in workflowInstance.GetInboundConnections(activityId))
{
// Circuit breaker: Detect workflows that implement repeating flows to prevent an infinite loop here.
if (connection.Source.Activity.Id == startingPointActivityId)
if (inspectedActivityIDs.Contains(connection.Source.Activity.Id))
yield break;
yield return connection.Source.Activity.Id;
foreach (var parentActivityId in workflowInstance
.GetInboundActivityPathInternal(connection.Source.Activity.Id, startingPointActivityId)
.Distinct())
foreach (var parentActivityId in workflowInstance.GetInboundActivityPathInternal(connection.Source.Activity.Id, startingPointActivityId, inspectedActivityIDs)
.Distinct())
{
inspectedActivityIDs.Add(parentActivityId);
yield return parentActivityId;
}
}
}
}

View file

@ -49,7 +49,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\utils\Elsa.AutoMapper.Extensions\Elsa.AutoMapper.Extensions.csproj" />
<ProjectReference Include="..\Elsa.Abstractions\Elsa.Abstractions.csproj" />
</ItemGroup>

View file

@ -3,9 +3,9 @@ using AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
namespace Elsa.AutoMapper.Extensions
namespace Elsa.Extensions
{
public static class ServiceCollectionExtensions
public static class AutoMapperServiceCollectionExtensions
{
public static IServiceCollection AddAutoMapper(this IServiceCollection services, ServiceLifetime lifetime)
{
@ -18,7 +18,8 @@ namespace Elsa.AutoMapper.Extensions
public static IServiceCollection AddAutoMapperProfile<TProfile>(this IServiceCollection services, ServiceLifetime lifetime) where TProfile : Profile
{
services.AddAutoMapper(lifetime);
return services.AddTransient<Profile, TProfile>();
services.TryAddProvider<Profile, TProfile>(lifetime);
return services;
}
private static IConfigurationProvider CreateConfigurationProvider(IServiceProvider serviceProvider)

View file

@ -8,6 +8,7 @@ using Elsa.AutoMapper.Extensions;
using Elsa.Builders;
using Elsa.Converters;
using Elsa.Expressions;
using Elsa.Extensions;
using Elsa.Mapping;
using Elsa.Messaging;
using Elsa.Messaging.Distributed;

View file

@ -8,6 +8,9 @@ namespace Elsa.Persistence.EntityFrameworkCore.Entities
public string ActivityId { get; set; }
public WorkflowDefinitionVersionEntity WorkflowDefinitionVersion { get; set; }
public string Type { get; set; }
public string Name { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public int Left { get; set; }
public int Top { get; set; }
public Variables State { get; set; }

View file

@ -25,19 +25,28 @@ namespace Elsa.Persistence.EntityFrameworkCore.Mapping
CreateMap<ActivityDefinition, ActivityDefinitionEntity>()
.ForMember(d => d.Id, d => d.Ignore())
.ForMember(d => d.ActivityId, d => d.MapFrom(s => s.Id));
.ForMember(d => d.ActivityId, d => d.MapFrom(s => s.Id))
.ForMember(d => d.WorkflowDefinitionVersion, d => d.Ignore());
CreateMap<ActivityDefinitionEntity, ActivityDefinition>()
.ForCtorParam("id", p => p.MapFrom(s => s.ActivityId))
.ForMember(d => d.Id, d => d.MapFrom(s => s.ActivityId));
CreateMap<ActivityInstance, ActivityInstanceEntity>()
.ForMember(d => d.Id, d => d.Ignore())
.ForMember(d => d.ActivityId, d => d.MapFrom(s => s.Id));
.ForMember(d => d.ActivityId, d => d.MapFrom(s => s.Id))
.ForMember(d => d.WorkflowInstance, d => d.Ignore());
CreateMap<ActivityInstanceEntity, ActivityInstance>().ForMember(d => d.Id, d => d.MapFrom(s => s.ActivityId));
CreateMap<BlockingActivity, BlockingActivityEntity>().ReverseMap();
CreateMap<ConnectionDefinition, ConnectionDefinitionEntity>().ReverseMap();
CreateMap<BlockingActivity, BlockingActivityEntity>()
.ForMember(d => d.Id, d => d.Ignore())
.ForMember(d => d.WorkflowInstance, d => d.Ignore())
.ReverseMap();
CreateMap<ConnectionDefinition, ConnectionDefinitionEntity>()
.ForMember(d => d.Id, d => d.Ignore())
.ForMember(d => d.WorkflowDefinitionVersion, d => d.Ignore())
.ReverseMap();
}
}
}

View file

@ -15,7 +15,7 @@ namespace Elsa.Persistence.EntityFrameworkCore.Migrations.PostgreSql
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
.HasAnnotation("ProductVersion", "3.0.1")
.HasAnnotation("ProductVersion", "3.1.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("Elsa.Persistence.EntityFrameworkCore.Entities.ActivityDefinitionEntity", b =>
@ -28,9 +28,18 @@ namespace Elsa.Persistence.EntityFrameworkCore.Migrations.PostgreSql
b.Property<string>("ActivityId")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("DisplayName")
.HasColumnType("text");
b.Property<int>("Left")
.HasColumnType("integer");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("State")
.HasColumnType("text");

View file

@ -15,7 +15,7 @@ namespace Elsa.Persistence.EntityFrameworkCore.Migrations.SqlServer
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.0")
.HasAnnotation("ProductVersion", "3.1.1")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
@ -30,9 +30,18 @@ namespace Elsa.Persistence.EntityFrameworkCore.Migrations.SqlServer
b.Property<string>("ActivityId")
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(max)");
b.Property<int>("Left")
.HasColumnType("int");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("State")
.HasColumnType("nvarchar(max)");

View file

@ -1,8 +1,9 @@
// <auto-generated />
// <auto-generated />
using System;
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Elsa.Persistence.EntityFrameworkCore.Migrations.Sqlite
{
@ -13,20 +14,30 @@ namespace Elsa.Persistence.EntityFrameworkCore.Migrations.Sqlite
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.0.1");
.HasAnnotation("ProductVersion", "3.1.1");
modelBuilder.Entity("Elsa.Persistence.EntityFrameworkCore.Entities.ActivityDefinitionEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("ActivityId")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.HasColumnType("TEXT");
b.Property<int>("Left")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("State")
.HasColumnType("TEXT");
@ -50,7 +61,8 @@ namespace Elsa.Persistence.EntityFrameworkCore.Migrations.Sqlite
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("ActivityId")
.HasColumnType("TEXT");
@ -125,7 +137,8 @@ namespace Elsa.Persistence.EntityFrameworkCore.Migrations.Sqlite
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("DefinitionId")
.HasColumnType("TEXT");
@ -166,7 +179,8 @@ namespace Elsa.Persistence.EntityFrameworkCore.Migrations.Sqlite
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTime?>("AbortedAt")
.HasColumnType("TEXT");

View file

@ -5,10 +5,10 @@ We should generate migration sets per provider as described here: https://docs.m
Example commands:
```bash
dotnet ef migrations add InitialCreate --context SqliteContext --output-dir Migrations/Sqlite
dotnet ef migrations add InitialCreate --context SqlServerContext --output-dir Migrations/SqlServer
dotnet ef migrations add InitialCreate --context PostgreSqlContext --output-dir Migrations/PostgreSql
dotnet ef migrations add InitialCreate --context MySqlContext --output-dir Migrations/MySql
dotnet ef migrations add Update01 --context SqliteContext --output-dir Migrations/Sqlite
dotnet ef migrations add Update01 --context SqlServerContext --output-dir Migrations/SqlServer
dotnet ef migrations add Update01 --context PostgreSqlContext --output-dir Migrations/PostgreSql
dotnet ef migrations add Update01 --context MySqlContext --output-dir Migrations/MySql
```

View file

@ -1,6 +1,7 @@
using System;
using Elsa.AutoMapper.Extensions;
using Elsa.AutoMapper.Extensions.NodaTime;
using Elsa.Extensions;
using Elsa.Persistence.YesSql.Indexes;
using Elsa.Persistence.YesSql.Mapping;
using Elsa.Persistence.YesSql.Schema;

View file

@ -2,27 +2,27 @@
This list of sample implementations showcase a variety of workflows using ELSA.
1. [Hello World: Strongly Typed](src/samples/WorkflowCore.Sample01) - A minimal workflows program defined in code with a strongly-typed workflow class.
2. [Hello World: Fluent Builder](src/samples/WorkflowCore.Sample02) - A minimal workflows program defined in code using fluent workflow builder and Console activities.
3. [Hello World: Workflow Definition](src/samples/WorkflowCore.Sample03) - A minimal workflows program defined as data (workflow definition) and Console activities.
4. [Calculator](src/samples/WorkflowCore.Sample04) - A strongly-typed, long-running workflows program demonstrating scripting, branching and resuming suspended workflows by providing user driven stimuli.
5. [Recurring](src/samples/WorkflowCore.Sample05) - A minimal workflows program defined in code with a strongly-typed workflow class.
6. [HttpRequest/HttpResponse](src/samples/WorkflowCore.Sample06) - Example of a workflow that intercepts a HttpRequest and handles the HttpResponse.
7. [Document Approval](src/samples/WorkflowCore.Sample07) - Example of a Document Approval workflow.
8. [Create and Handle Orders](src/samples/WorkflowCore.Sample08) - Example of a workflow that creates and handles orders.
9. [Calculator: Defined in Json](src/samples/WorkflowCore.Sample9) - A simple console program that loads & executes a workflow designed with the HTML5 workflow designer.
10. [Hellow World: YesSql](src/samples/WorkflowCore.Sample10) - A simple demonstration of using YesSql persistence providers.
11. [Correlation](src/samples/WorkflowCore.Sample11) - Demonstrates workflow correlation.
12. [User Task](src/samples/WorkflowCore.Sample12) - Demonstrates workflow correlation & user tasks.
13. [Activity Output](src/samples/WorkflowCore.Sample13) - A strongly-typed workflows program demonstrating scripting, and branching.
14. [Hellow World: Entity Framework Core](src/samples/WorkflowCore.Sample14) - A simple demonstration of using Entity Framework Core persistence providers.
15. [Hello World: MongoDb](src/samples/WorkflowCore.Sample15) - A simple demonstration of using the MongoDB persistence providers. Docker(optional)
16. [ELSA Dashboard: Web App, MongoDb Persistence](src/samples/WorkflowCore.Sample16) - ELSA Dashboard MVC wep application.
17. [Create Person: Console Application](src/samples/WorkflowCore.Sample17) - Example of a workflow that creates a Person entity.
18. [Email Reminder: Console Application](src/samples/WorkflowCore.Sample18) - Example of a workflow that sends email reminders on a timer until a condition is met.
19. [ELSA Dashboard: Web App, SqlLite Persistence](src/samples/WorkflowCore.Sample19) - Example of created a web application that hosts a ELSA Dashboard.
20. [Reflection Activities](src/samples/WorkflowCore.Sample20) - Demonstrates Reflection activities.
21. [Shopping Cart: Mass Transit & Quartz Scheduling](src/samples/WorkflowCore.Sample21) - Example of a workflow that tracks a shopping cart. Uses Mass Transit and Quartz scheduling.
22. [Hellow World: SQL Server](src/samples/WorkflowCore.Sample22) - A simple demonstration of using Entity Framework Core persistence providers with SQL Server.
23. [Hello World Custom Schema: Sqllite](src/samples/WorkflowCore.Sample23) - A simple demonstration of using Entity Framework Core persistence providers with SqlLite and Custom Schema.
24. [Hello World: MySql with migration](src/samples/WorkflowCore.Sample24) - A simple demonstration of using Entity Framework Core MySql persistence provider. A migration is also demonstrated.
1. [Hello World: Strongly Typed](Sample01) - A minimal workflows program defined in code with a strongly-typed workflow class.
2. [Hello World: Fluent Builder](Sample02) - A minimal workflows program defined in code using fluent workflow builder and Console activities.
3. [Hello World: Workflow Definition](Sample03) - A minimal workflows program defined as data (workflow definition) and Console activities.
4. [Calculator](Sample04) - A strongly-typed, long-running workflows program demonstrating scripting, branching and resuming suspended workflows by providing user driven stimuli.
5. [Recurring](Sample05) - A minimal workflows program defined in code with a strongly-typed workflow class.
6. [HttpRequest/HttpResponse](Sample06) - Example of a workflow that intercepts a HttpRequest and handles the HttpResponse.
7. [Document Approval](Sample07) - Example of a Document Approval workflow.
8. [Create and Handle Orders](Sample08) - Example of a workflow that creates and handles orders.
9. [Calculator: Defined in Json](Sample9) - A simple console program that loads & executes a workflow designed with the HTML5 workflow designer.
10. [Hellow World: YesSql](Sample10) - A simple demonstration of using YesSql persistence providers.
11. [Correlation](Sample11) - Demonstrates workflow correlation.
12. [User Task](Sample12) - Demonstrates workflow correlation & user tasks.
13. [Activity Output](Sample13) - A strongly-typed workflows program demonstrating scripting, and branching.
14. [Hellow World: Entity Framework Core](Sample14) - A simple demonstration of using Entity Framework Core persistence providers.
15. [Hello World: MongoDb](Sample15) - A simple demonstration of using the MongoDB persistence providers. Docker(optional)
16. [ELSA Dashboard: Web App, MongoDb Persistence](Sample16) - ELSA Dashboard MVC wep application.
17. [Create Person: Console Application](Sample17) - Example of a workflow that creates a Person entity.
18. [Email Reminder: Console Application](Sample18) - Example of a workflow that sends email reminders on a timer until a condition is met.
19. [ELSA Dashboard: Web App, SqlLite Persistence](Sample19) - Example of created a web application that hosts a ELSA Dashboard.
20. [Reflection Activities](Sample20) - Demonstrates Reflection activities.
21. [Shopping Cart: Mass Transit & Quartz Scheduling](Sample21) - Example of a workflow that tracks a shopping cart. Uses Mass Transit and Quartz scheduling.
22. [Hellow World: SQL Server](Sample22) - A simple demonstration of using Entity Framework Core persistence providers with SQL Server.
23. [Hello World Custom Schema: Sqllite](Sample23) - A simple demonstration of using Entity Framework Core persistence providers with SqlLite and Custom Schema.
24. [Hello World: MySql with migration](Sample24) - A simple demonstration of using Entity Framework Core MySql persistence provider. A migration is also demonstrated.

View file

@ -71,13 +71,15 @@ namespace Elsa.Scripting.JavaScript.Services
if (value.IsNull())
return default;
if (targetType == typeof(bool) && value.IsBoolean())
var targetIsObject = targetType == typeof(object);
if (value.IsBoolean())
return value.AsBoolean();
if (targetType == typeof(DateTime) && value.IsDate())
if ((targetIsObject || targetType == typeof(DateTime)) && value.IsDate())
return value.AsDate().ToDateTime();
if ((targetType.IsNumeric() || targetType.IsObject()) && value.IsNumber())
if (targetType.IsNumeric() && value.IsNumber())
{
var numericType = targetType.IsNumeric() ? targetType : typeof(double);
return Convert.ChangeType(value.AsNumber(), numericType);

View file

@ -1,33 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<PackageVersion>1.0.0</PackageVersion>
<Authors>Elsa Contributors</Authors>
<Description>
Elsa is a set of workflow libraries and tools that enable super-fast workflowing capabilities in any .NET Core application.
This package provides extension methods that simplify registration of AutoMapper and profiles.
</Description>
<Copyright>2019</Copyright>
<PackageProjectUrl>https://github.com/elsa-workflows/elsa-core</PackageProjectUrl>
<RepositoryUrl>https://github.com/elsa-workflows/elsa-core</RepositoryUrl>
<RepositoryType>GitHub</RepositoryType>
<PackageTags>elsa, workflows</PackageTags>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<None Include="icon.png">
<Pack>True</Pack>
<PackagePath />
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.1" />
<PackageReference Include="NodaTime" Version="3.0.0-beta01" />
</ItemGroup>
</Project>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB