Commit graph

321 commits

Author SHA1 Message Date
Sipke Schoorstra 2f3e44ab82 Add comment 2020-01-18 20:56:01 +01:00
Sipke Schoorstra b9e3a0ca36 Implement immediate launch of pending workflow blocked due to existing instance 2020-01-18 20:54:17 +01:00
Sipke Schoorstra dce2c4f9db Incremental work on timer event 2020-01-18 17:08:02 +01:00
Sipke Schoorstra 26ee6b10a7 Update EF provider 2020-01-18 15:35:37 +01:00
Sipke Schoorstra 6a6edde7de Restored workflow persistence functionality 2020-01-18 13:11:11 +01:00
Sipke Schoorstra d1ce5ce897 Merge branch 'develop' into feature/elsa-2.0
# Conflicts:
#	src/core/Elsa/ElsaServiceCollectionExtensions.cs
#	src/dashboard/Elsa.Dashboard.Web/Elsa.Dashboard.Web.csproj
#	src/dashboard/Elsa.Dashboard/Extensions/DashboardServiceCollectionExtensions.cs
#	src/dashboard/Elsa.Dashboard/Theme/argon-dashboard/package-lock.json
#	src/providers/Elsa.AspNetCore.Startup/TaskExecutingServer.cs
#	src/samples/Sample01/Sample01.csproj
#	src/samples/Sample02/Sample02.csproj
#	src/samples/Sample03/Sample03.csproj
#	src/samples/Sample04/Sample04.csproj
#	src/samples/Sample06/Sample06.csproj
#	src/samples/Sample07/Sample07.csproj
#	src/samples/Sample07/Startup.cs
#	src/samples/Sample08/Sample08.csproj
#	src/samples/Sample08/Startup.cs
#	src/samples/Sample09/Sample09.csproj
#	src/samples/Sample10/Sample10.csproj
#	src/samples/Sample11/Sample11.csproj
#	src/samples/Sample12/Sample12.csproj
#	src/samples/Sample13/Sample13.csproj
#	src/samples/Sample14/Sample14.csproj
#	src/samples/Sample15/Sample15.csproj
#	src/samples/Sample17/Sample17.csproj
#	src/samples/Sample18/Sample18.csproj
#	src/samples/Sample20/Sample20.csproj
#	src/samples/Sample21/Sample21.csproj
#	src/samples/Sample21/Startup.cs
#	src/samples/Sample22/Sample22.csproj
#	src/samples/Sample23/Sample23.csproj
#	src/samples/Sample24/Sample24.csproj
#	src/server/Elsa.Server.Host/Properties/PublishProfiles/FolderProfile.pubxml
2020-01-18 12:03:00 +01:00
Sipke Schoorstra 48be0e8a87
Always add startup runner hosted service (#238) 2020-01-18 11:59:47 +01:00
Sipke Schoorstra 16e91e0de1
Replace TaskExecutingServer with StartupRunnerHostedService (#237)
This solves an issue where the Dashboard site would not be able to run in IIS, due to an IIS filter that expects a IISServer instance, while it was being decorated with a custom type.

Fortunately, as of .NET Core 3, background hosted services now execute before the server starts, which makes them perfect for async initialization.
2020-01-18 11:04:53 +01:00
Sipke Schoorstra aefe630f42 Merge branch 'develop' into feature/elsa-2.0
# Conflicts:
#	Samples.sln
#	src/core/Elsa.Abstractions/Elsa.Abstractions.csproj
#	src/core/Elsa.Core/Elsa.Core.csproj
#	src/persistence/Elsa.Persistence.EntityFrameworkCore/Extensions/EFCoreServiceCollectionExtensions.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Elsa.Persistence.EntityFrameworkCore.csproj
#	src/providers/Elsa.Persistence.YesSql/DbContexts/DesignTimeDbContextFactoryBase.cs
#	src/providers/Elsa.Persistence.YesSql/DbContexts/MySqlContext.cs
#	src/providers/Elsa.Persistence.YesSql/DbContexts/MySqlContextFactory.cs
#	src/providers/Elsa.Persistence.YesSql/Elsa.Persistence.YesSql.csproj
#	src/providers/Elsa.Persistence.YesSql/Migrations/MySql/20200113102615_InitialCreate.Designer.cs
#	src/providers/Elsa.Persistence.YesSql/Migrations/MySql/20200113102615_InitialCreate.cs
#	src/providers/Elsa.Persistence.YesSql/Migrations/MySql/MySqlContextModelSnapshot.cs
#	src/samples/Elsa.Samples.Timers/Elsa.Samples.Timers.csproj
#	src/samples/Sample05/Program.cs
#	src/samples/Sample08/Sample08.csproj
#	src/samples/Sample08/Startup.cs
#	src/samples/Sample14/Program.cs
#	src/samples/Sample14/Sample14.csproj
#	src/samples/Sample16/Sample16.csproj
#	src/samples/Sample18/Program.cs
#	src/samples/Sample18/Sample18.csproj
#	src/samples/Sample19/Sample19.csproj
#	src/samples/Sample19/Startup.cs
#	src/samples/Sample21/Sample21.csproj
#	src/samples/Sample21/Startup.cs
#	src/samples/Sample22/Program.cs
#	src/samples/Sample22/Sample22.csproj
#	src/samples/Sample23/Program.cs
#	src/samples/Sample23/Sample23.csproj
2020-01-16 21:23:45 +01:00
James Doran 434754e466 Fixed yaml serialisation and updated to YamlDotNet (#236)
* Fixed Yaml serialisation/deserialisation

Copied json serializer settings from JsonTokenFormatter, apart from CamelCasePropertyNamesContractResolver, as the yaml already had the correct case, and this would cause activity state (which has PascalCasing) to be camelCased too

* Updated YamlDotNet.Standard to YamlDotNet

Switched package as YamlDotNet.Standard has been unlisted on Nuget
2020-01-16 08:31:19 +01:00
Sipke Schoorstra 4bc499ce1d
Use Duration instead of Period (#235)
Duration is semantically more correct in the context of were it's used.
2020-01-15 23:56:57 +01:00
Sipke Schoorstra ce35cef214
Fix designer factories (#234) 2020-01-15 22:51:41 +01:00
Sipke Schoorstra e46f59d30e
Update packages (#233) 2020-01-15 22:39:47 +01:00
Sipke Schoorstra 5836e2f5f1
Fix an issue where some DB Context factories use the base ElsaContext type instead of the derived type, causing a "Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[]' while attempting to activate" error (#232) 2020-01-15 22:35:15 +01:00
Sipke Schoorstra 05a9d5453e
Refactor elsa service config (#230)
* Refactor Elsa service configuration API
2020-01-15 21:26:44 +01:00
Sipke Schoorstra 40eef28fc7
Add web farm hosting support (#229)
* Implement distributed lock provider and workflow queue worker

* Add SQL Server lock provider
2020-01-14 23:11:50 +01:00
terry-delph 1b333fec1a Feature/mysql support efcore (#226)
* Added MySqlContext
* Added MySqlContextFactory
* Added Pomelo.EntityFrameworkCore.MySql nuget package
* Added initial MySqlContext migrations

* Added support for creating derived ElsaContexts:
- Added new protected constructor based on following post
- https://github.com/dotnet/efcore/issues/7533

* Added Sample 24 - MySql provider with migration execution
* Updated other samples that needed to define the derived ElsaContext

* Added summary to ElsaContext constructor

* Updated persistence/Elsa.Persistence.EntityFrameworkCore MD file with MySql example
2020-01-14 23:01:10 +01:00
Sipke Schoorstra c889a7a5d0 Merge branch 'develop' into feature/elsa-2.0
# Conflicts:
#	src/core/Elsa.Abstractions/Converters/TypeNameHandlingConverter.cs
#	src/core/Elsa.Abstractions/Serialization/Handlers/DefaultValueHandler.cs
#	src/core/Elsa.Abstractions/Serialization/Handlers/IValueHandler.cs
#	src/core/Elsa.Abstractions/Serialization/Handlers/ObjectHandler.cs
#	src/core/Elsa.Abstractions/Serialization/Handlers/PrimitiveValueHandler.cs
2020-01-12 20:34:20 +01:00
Sipke Schoorstra 7b94637386
Code-first improvements (#223)
* Refactor workflow model and scheduler

* Improve workflow builder API
2020-01-12 20:15:57 +01:00
Sipke Schoorstra 6ea6498ca0 Fix issue due to parallel access to DbContext
Fixes #219
2020-01-06 21:11:05 +01:00
James Doran 7aa9f0510f
Fixed Serialization for Objects (#220)
Registered ObjectHandler in TypeNameHandlingConverter
Passed through object type in IValueHandler.Serialize to be written as TypeName
2020-01-06 19:32:25 +10:30
Sipke Schoorstra b2ad297a0d Fix README.md 2020-01-04 11:17:11 +01:00
Sipke Schoorstra f938c32a8f Rename destination activity to target activity 2019-12-28 20:23:33 +01:00
Sipke Schoorstra 1338dc0a95
Container Activities (#218)
* Add support for child activities.

* Add type map feature.

* Update While, For and ForEach activities
2019-12-28 10:56:12 +01:00
Sipke Schoorstra ebc2a4a89e
Added VariableExpression (#217)
* Add VariableExpression

* Workflow Runner bug fixes
2019-12-25 12:10:39 +01:00
Sipke Schoorstra 8092d166a5
Add native .NET code support + activity input/output (#216)
* Add code activity

* Refactor Workflow State to use Variables

* Update InstantEvent and SetVariable

* Update samples

* Add activity input/output
2019-12-23 21:43:11 +01:00
Sipke Schoorstra bd422f5d14
Feature/persist on every activity (#215)
* Add support for resuming crashed workflow hosts
* Add workflow persistence behavior
2019-12-21 12:34:27 +01:00
Sipke Schoorstra 452516bdfa Merge branch 'develop' into feature/elsa-2.0
# Conflicts:
#	src/persistence/Elsa.Persistence.YesSql/StartupTasks/InitializeStoreTask.cs
2019-12-21 12:32:04 +01:00
Sipke Schoorstra 0fbb47ff8f Fix broken Sample23 2019-12-21 10:45:16 +01:00
Sipke Schoorstra 80ad40824e
Fix broken date/time/nodatime serialization (#214)
Added extensible support for specialized primitive handling such as
DateTime and NodaTime primitives.

This fixes the issue where a Variable is serialized using a primitive's
string representation and losing the target type, which is needed for
reconstructing the type upon deserialization.
2019-12-21 10:05:10 +01:00
James Doran 6addf0f974
YesSql now stores schema version (#213) 2019-12-21 08:54:32 +10:30
Sipke Schoorstra 56402c33ba Merge branch 'develop' into feature/elsa-2.0 2019-12-19 17:08:13 +01:00
Sipke Schoorstra 57a8693c21
Explicit EF identity specification + DateTime serialization issue (#212)
* Explicitly specify identity for Id columns

This fixes an issue where EF Core 2.2 does not set Identity = Yes when
defining the Id columns.

* Fix DateTime serialization issue

This change fixes an issue by taking over the serialization of a DateTime value.
The problem with serializing a DateTime value as-is is that upon deserialization, the JToken type would be set as String instead of Date.
This is because NodaTime disables automatic date time handling for Instant types.
However that causes an issue when trying to serialize and deserialize DateTime values.

This change explicitly tests for DateTime values and handles it appropriately.
A future improvement might be to make this TypeNameHandlingConverter class extensible by implementing a provider-based model,
enabling developers to take control over how certain types are serialized.
2019-12-19 17:07:23 +01:00
Sipke Schoorstra 853abf4e62 Merge branch 'develop' into feature/elsa-2.0
# Conflicts:
#	Samples.sln
#	Samples.sln.DotSettings
#	src/samples/Sample04/Program.cs
2019-12-17 21:50:53 +01:00
Sipke Schoorstra 1daf8e25a0 Remove compiler warnings 2019-12-17 21:44:40 +01:00
Nate Hughey e55c17ea92 Feature - Customize Elsa.Persistence.EntityFrameworkCore Migrations and Schema (#204)
* Added PostgreSql support to Elsa.Persistence.EntityFrameworkCore via Npgsql.
* Customize Elsa.Persistence.EntityFrameworkCore Migrations and Schema.
* Added Context factory in Sample23 to use the IDbContextCustomSchema.
* Refactor the Custom Schema support to use the EFCore IDbContextOptionsExtension.
2019-12-17 21:38:58 +01:00
James Doran 205487425a
Variable fixes (#211)
* GetVariable<T> now uses Convert.ChangeType

Fixes issue where saving an Int32, serialising and deserialising, then accessing with GetVariable<int>(...) no longer causes type cast exception.
The saved value is a JValue which treats Int32 as Int64. Convert.ChangeType has a better chance of performing conversion without error.
Also returns default of T if the variable isn't found.

* Added SetVariable overload in Variables

To prevent double-wrapping objects in more than 1 Variable object
2019-12-13 17:51:01 +10:30
James Doran c8d7ac076f YesSql instance storage fixes (#209)
* WorkflowInstanceIndex now stores records correctly
* Saving a workflow instance now updates existing instance rather than creating a new document
* Fixed serialisation exception when saving existing instance containing NodaTime types
2019-12-11 08:15:05 +01:00
Sipke Schoorstra 61c9ac48c7 Update packages 2019-12-10 15:46:49 +01:00
Andale-online d9e27377b0 Feature: Startup Activities (#206)
* Feature: Startup Activities
2019-12-04 18:20:01 +01:00
Sipke Schoorstra 21744a5056 Update Sample04 with printing execution log to console 2019-12-04 13:10:47 +01:00
Sipke Schoorstra dce24b4f3b Refactor rename to updated workflow terminology 2019-11-29 13:32:05 +01:00
nhughey-evo a89897b8e1 Feature: Persistence Provider -> Added PostgreSql support to Elsa.Persistence.EntityFrameworkCore via Npgsql (#201) 2019-11-28 11:35:30 +01:00
Sipke Schoorstra 98fe6d21d7 Add SQL Server example 2019-11-26 22:54:06 +01:00
Sipke Schoorstra b7103188fd Incremental work on GraphQL 2019-11-24 22:02:14 +01:00
Sipke Schoorstra 34a3872693 Remove LastResult, refactor activity output 2019-11-24 15:25:16 +01:00
Sipke Schoorstra d9cf7c4f1c Incremental work on GraphQL 2019-11-23 15:08:40 +01:00
James Doran 7356bf10c8 Moved JavaScript DI extension method namespace (#179) (#196) 2019-11-23 08:21:20 +01:00
Antoine Griffard 6c2960e1dd Fix link on Orchard Core doc (#195) 2019-11-22 23:52:10 +01:00
Sipke Schoorstra baef007e2b Incremental work on GraphQL 2019-11-22 23:07:31 +01:00