Commit graph

136 commits

Author SHA1 Message Date
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 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
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
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
Sipke Schoorstra 61c9ac48c7 Update packages 2019-12-10 15:46:49 +01:00
Sipke Schoorstra dce24b4f3b Refactor rename to updated workflow terminology 2019-11-29 13:32:05 +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
Sipke Schoorstra ac3ea9573f Add icons to packages 2019-11-22 17:34:55 +01:00
James Doran e805a74ad7 Moved WithJavaScriptOptions extension method into Elsa.Scripting.JavaScript project (#179) 2019-11-22 08:37:06 +10:30
James Doran 9556b80016 Add script options configuration (#179) 2019-11-21 21:09:58 +10:30
Sipke Schoorstra b545fd2aea
Add Dockerfile and docker-compose (#186)
Fixes #142
2019-11-19 19:25:56 +01:00
Sipke Schoorstra b0a5962f4a Fix variable serialization issues 2019-11-17 22:48:17 +01:00
Sipke Schoorstra 21f770bc48
Refactorings and fixes (#168)
* Variables are now stored including their type name for automatic deserialization into their actual type. This is important for use in expressions.
* **SplitObject** and **ExecuteMethod** now use workflow expressions instead of variable names. This allows for more flexibility.
* Improved **Join** activity to allow proper function within looping constructs.
* Improved Variables performance. Variables are no longer serialized/deserialized upon writing/reading perspectively, only when the workflow instance is persisted.
2019-11-17 20:43:16 +01:00
Andale-online 47e0795b66 Feature variables v2.01 with bugfix (#164)
* Changed Variables.cs to full IDictionary
with ConcurrentDictionary<string, object> backing

* Bugfix for long running flows
2019-11-16 15:30:04 +01:00
Sipke Schoorstra d1f7ce47b7
EF Core Provider rewrite (#165)
* Fixed EF provider

Fixes #144 , #145
2019-11-16 14:06:53 +01:00
Andale-online e3054b46c8 Changed Variables.cs to full IDictionary (#161) 2019-11-15 22:27:23 +01:00
Andale-online 58d7bc654a GetVariable(string name, Type type) (#155)
* GetVariable(string name, Type type)
2019-11-15 10:37:01 +01:00
Peter Davis 13b51f3e7c Message correlation (#158)
* Correlate messages to workflow instances

Looks like it is really important to correlate masstransit messages to workflow instances. I have updated the demo to show this as I ran a few in parallel and several errors were occurring.

* Use concurrent dictionary for memory instance store
2019-11-15 10:29:04 +01:00
James Doran 0dfa8857d8 #137 WorkflowExpressionEvaluator updated to throw WorkflowException if exception while evaluating expressions (#138)
Fixes #137
2019-11-08 11:59:32 +01:00
James Doran 0d6bae822a #135 Finding next activity based on outcome is no longer case-sensitive (#139) 2019-11-08 11:45:21 +01:00
Sipke Schoorstra 94fa8d2281 Merge branch 'master' into develop 2019-11-06 21:11:56 +01:00
Sipke Schoorstra f9af5e71d6
Improve expression evaluation (#133)
* Add test case for object-to-string target type

* Add exception handling
2019-11-06 21:11:16 +01:00
James Doran 7d4d0f919e Fixed bug where multiple activity registrations of the same type would cause duplicate key exception (#128)
* Fixed issue in ActivityResolver where multiple registrations of the same workflow type would cause dup key exception

* Updated Sample12 to remove AddUserTaskActivities() call, as this is now done in AddElsa()
2019-11-05 01:19:20 +01:00
James Doran 6e352ebed3 Fixed issue where named activities couldn't be used with Then() (#129) 2019-11-05 01:18:02 +01:00
Sipke Schoorstra a3c9af1d47
Fix version query issue (#121) 2019-11-03 17:19:00 +01:00
Sipke Schoorstra ab514ede04 Fix a serialization/casting issue in WorkflowExecutionContext.SetLastResult 2019-11-03 17:05:16 +01:00
Sipke Schoorstra 3fd0cb5270
Refactor Variable serialization to convert to JValue (#120)
This removes the confusion where a specific object will retain its type when serialized, which is not the case.
2019-11-03 14:33:34 +01:00
Sipke Schoorstra 57f116c239
Fix object disposed bug (#116)
* Refactor buggy SignalRequestHandler

For some reason, the following code is problematic:

await DecryptToken()
                .BindAsync(GetWorkflowInstanceAsync)
                .BindAsync(CheckIfExecutingAsync)
                .MapAsync(ResumeWorkflowAsync);

Basically, any lambda in the BindAsync and MapAsync could execute even after the containing method returned

* Implement better message handler registration without adding multiple IMediator services

* Abstracted Mediator service registration methods.
* Add Liquid support for JObject.
2019-10-31 21:31:18 +01:00
Sipke Schoorstra e162391c30 Update package descriptions and renamed some activities 2019-10-27 17:31:50 +01:00
Sipke Schoorstra 38a4901896 Update project details 2019-10-27 16:21:48 +01:00
Sipke Schoorstra 943398bcb2 Fix merge issues 2019-10-27 16:08:18 +01:00
Sipke Schoorstra bc04b00196 Merge branch 'develop'
# Conflicts:
#	Samples.sln
#	src/activities/Elsa.Activities.Timers/Elsa.Activities.Timers.csproj
#	src/core/Elsa.Abstractions/Services/IActivityBuilder.cs
#	src/core/Elsa.Core/Elsa.Core.csproj
#	src/core/Elsa.Core/WorkflowBuilders/ActivityBuilder.cs
#	src/samples/Sample17/Activities/CreatePerson.cs
#	src/samples/Sample17/CreatePersonWorkflow.cs
#	src/samples/Sample17/Program.cs
#	src/samples/Sample17/Sample17.csproj
2019-10-27 16:05:55 +01:00
Sipke Schoorstra aef8741d84
Add Liquid expressions (#111)
* Reorganize projects

* Implement Liquid expression evaluator

* Refactor activity references to use `Name`
2019-10-27 15:38:37 +01:00
Sipke Schoorstra cb25239fd1
Add While activity (#110)
* Implement While activity

* Variable scope bug fixes

* Merge designer attributes with activity definition

* Update package references
2019-10-26 12:46:20 +02:00
Sipke Schoorstra 06412c0cc0
Add support for custom title and description (#109) 2019-10-25 18:39:54 +02:00
Sipke Schoorstra d7fc571cdd
RC3 (#108)
* Add activity output example

* Update Sample17

* Extend SMTP options (#107)

* Remove unused imports

* Update Elsa.Scrutor package reference
2019-10-24 23:36:07 +02:00
Sipke Schoorstra 42ddf7ac49 Update Elsa.Scrutor package reference 2019-10-24 23:33:16 +02:00
Sipke Schoorstra b9878f94bb
Extend SMTP options (#107)
* Extend SMTP options

* Remove unused imports
2019-10-24 22:06:14 +02:00
Sipke Schoorstra 82ce170f8d Update Sample17 2019-10-24 21:45:19 +02:00
Sipke Schoorstra c7c41d10a5
Workflow Registry refresh upon workflow definition updates (#101)
* Fix many things. Few more samples left to fix

* Fix all the samples

* Introduce service configurator

* Implement cache signaling and refreshing workflow registry

* Add Sample16 demonstrating dashboard + workflow host combined

* Bugfix where non-published versions of worklows are triggered
2019-10-23 21:23:25 +02:00
Sipke Schoorstra 042743b5a7 Remove unused service from registration 2019-10-20 16:24:44 +02:00
Sipke Schoorstra 5a4da522c7
Migrate to .NET Core 3 (#96) 2019-10-20 13:30:38 +02:00
Sipke Schoorstra dfac2d0a4f
Implement workflow execution path visualization (#93)
* Add workflow designer models
* Fix versioning
* Implement workflow path execution trail
2019-10-19 17:03:52 +02:00
Sipke Schoorstra 012e12c51c
Implement activity execution logging (#89)
* Implement activity logging
* Update Calculator example
2019-10-14 19:46:55 +02:00