Commit graph

58 commits

Author SHA1 Message Date
Sipke Schoorstra bf205c72b9 Fix SetOutput handling 2023-11-17 20:59:09 +01:00
Sipke Schoorstra 3a4b15be13 Fix output mapping naming collision 2023-11-15 15:13:19 +01:00
Sipke Schoorstra e4d6ad22c4
Decouple Expression Types (#4622)
* Refactor Expressions model

* Enable expression type filtering

* Implement dynamic enablement of satelite dependencies
2023-11-14 20:44:42 +01:00
Sipke Schoorstra f0f39bec77 Fix flowchart completion miss
Added a check to take into account scheduled work who's owner is tje flowchart
2023-11-10 22:08:35 +01:00
Sipke Schoorstra cd33d29768 Add support for direct-output binding
This change enables activity output to be directly bound to workflow output.
2023-11-09 13:35:02 +01:00
Sipke Schoorstra 5d1a1aaf86
Add C# expression support (#4594)
* Initial version of c# expressions

* Add support for strongly-typed workflow variable accessors

* Fix type casting

* Rename c# to C# in XML comments

* Rename Globals.Context to ExecutionContext and Variables to Context

* Move RunJavaScript activity to Elsa.JavaScript

* Add RunCSharp activity

* Add CSharpOptions

* Add common workflow properties and methods
2023-11-03 20:28:10 +01:00
Sipke Schoorstra abff7f3907 Add test for activities and variables 2023-10-20 13:42:18 +02:00
Sipke Schoorstra 3ae9d0a023 Add integration test for direct output mapping 2023-10-18 19:34:04 +02:00
Nokecy 4056434e45
fix: fix hashSet deserialize error (#4545)
* update hangfire version to 1.8.5

* fix: fix hashSet deserialize error

* fix: replace HashSet to ISet<T>

* Update polymorphic converter and tests

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2023-10-17 23:14:40 +02:00
solutionmania 1f014c9264
Corrected behaviour of 'For' activity. (#4497)
* Add 'Auto Step Direction' option to 'For' activity.

* Adjusted 'For' behaviour to be more consistent with generally expected behaviour.
2023-10-07 23:31:16 +02:00
Sipke Schoorstra bddf522e55
Activity Preconditions (#4507)
* Add CanExecuteAsync precondition method

* Rename GetInput to GetWorkflowInput to disambiguate between input sent to workflow and input sent to indiviudal activities.
2023-10-07 14:22:51 +02:00
Sipke Schoorstra 523f301bf7
Feature: Alterations (#4501)
* Implement Alteration types and engine

* Implement Alteration APIs

* Refactor activity work item with support for activity input

* Serialize scheduled activities as part of workflow state

* Add signal to schedule child activity

* Implement stores for plans and jobs

* Add EF Core provider

* Add Retry endpoint

* Keep root context as always active. The root context is the workflow execution context and contains persistent variable state

* Regenerate EF Core migrations

* Handle orphaned activity execution contexts

* Refactor workflow execution factory

* Enable configuring Jint from Program

* Update ModifyVariable alteration with support for type deserialization

* Use ShortGuid for identity

* Cleanup WorkflowServer host
2023-10-07 12:47:36 +02:00
Sipke Schoorstra a5d13e4e9b
Enhance HTTP Endpoint + Flowchart fix (#4469)
* Fix flowchart next activity scheduling bug

This fixes a bug where the Flowchart activity would schedule connected activities regardless of the outcome of the completed activity.

* Cancel activity execution when cancellation token is triggered.

* Enable user to handle HTTP endpoint validation failures as outcomes

* Don't respond with full details in case of HTTP Endpoint faults for security
2023-09-22 18:45:18 +02:00
Sipke Schoorstra 89f94a2261
File Uploads (#4457)
* Initial support for receiving files via HTTP Endpoint activity

* Implement HTTP endpoint request timeout

* Implement request time out handling

* Implement request size validation

* Formatting

* Implement application and system level cancellation tokens

* Create CancellationTokens struct

* Cleanup HttpEndpoint

* Implement file size validation

* Implement file extension validation

* Implement mime type validation

* Update usages of cancellation tokens
2023-09-19 22:42:53 +02:00
Sipke Schoorstra 7f0b3cb8fc Fix cascaded handling of SetOutcome 2023-09-14 16:30:18 +02:00
Sipke Schoorstra 03b608410b
Incidents (#4436)
* Implement Incident Strategy interface and resolver

* Add ActivityIncident model

* Add IncidentCount and Incidents properties and update migrations

* Expose incident strategies API endpoint

* Update API client with Incident Strategy models

* Replace Fault with Incidents

* Register fault status when any children have faulted

* Map incident count

* Remove unnecessary AlreadyCompleted result

* Ensure next activities are scheduled only if activity completed normally

* Incident roundtrip and fix workflow instance realtime updates

* Remove unused variable

* Add integration tests
2023-09-14 10:50:02 +02:00
Sipke Schoorstra 6fddd5223d Add execution context affinity and prevent duplicate scheduling for Join
This fixes the issue where the Join activity executes twice and potentially one instance never completes.
2023-09-12 20:27:36 +02:00
Sipke Schoorstra f6c4ffb934 Fix tag not passed to child completion callback
Fixes #4387
2023-09-10 18:34:40 +02:00
Sipke Schoorstra 018b3a3672 Fix flowchart not completing when using explicit WaitAny joins 2023-09-08 21:15:40 +02:00
Sipke Schoorstra 003bf4e335 Fix output accessors and add tests 2023-09-06 22:57:01 +02:00
Sipke Schoorstra 69744bd63c Fix naming collision between workflow input and activity input 2023-09-06 13:50:08 +02:00
Sipke Schoorstra 45d194125d
Remove WorkflowStateStore (#4374)
* Remove WorkflowStateStore and use WorkflowInstanceStore instead

* Delete RunningWorkflows actor

* Cleanup
2023-08-30 15:42:16 +02:00
Sipke Schoorstra ca25b78457
Fix Break behavior (#4365)
* Fix Break behavior

* Ensure removal of completion callbacks
2023-08-26 01:11:10 +02:00
Sipke Schoorstra 4d37c2a1da
Fix Default Workflow Runtime Race condition (#4362)
* Refactor Telnyx activities to use instance ID for correlating events

* Ensure SetVariable sets value in correct scope

* Fix race condition between new instances that are being resumed

* Fix tests
2023-08-24 21:41:45 +02:00
Sipke Schoorstra 7c99037de2
EF Core NoTracking (#4323)
* Use NoTracking for EF Core

* Use Activity ID as Node ID for modern tooling

* Fix DispatchWorkflow activity

* Update tests and remove redundant ToolVersion
2023-08-12 16:41:16 +02:00
Sipke Schoorstra 166e11c416
Fix loss of source file + line number (#4293)
Fixes #4287
2023-08-06 20:55:24 +02:00
Sipke Schoorstra 815b544f53 Update Flowchart completion logic
In addition to taking into account scheduled work, also check if there are actual activity instances still running
2023-08-04 11:45:07 +02:00
Sipke Schoorstra e1784f7f6c Rename GetVariableByName to GetVariable and increase XML coverage 2023-07-31 20:03:41 +02:00
gurkanguran d29df110d2
Fixed getting and setting variables in context (#4267)
* Fixed getting and setting variables in context

* Added unit tests

* Add test for named variable

* Search variable in parent contexts

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2023-07-31 18:53:50 +02:00
Sipke Schoorstra 9671d85013 Cleanup namespaces 2023-07-09 14:02:41 +02:00
Sipke Schoorstra fe2a897a30 Restructure models in Workflows.Core 2023-07-09 13:12:13 +02:00
Sipke Schoorstra 466c4b922e Fix tests, remove named variables
Only reference variables by C# reference or reference ID
2023-07-03 21:31:03 +02:00
Sipke Schoorstra b356cdb52b
Refactor connection model (#4146) 2023-06-18 14:32:48 +02:00
Sipke Schoorstra c216185c5e
Update Workflow model with support for Inputs, Outputs and Outcomes (#4112)
* Fix mutable prop changes warning

* Fix graph no longer scrolling to content

* Remove unused namespace imports

* Update Workflow model with support for input, output and outcomes

* Update sample with EF core persistence

* Rename FluentStorage to BlobStorage
2023-06-08 11:39:19 +02:00
Sipke Schoorstra 0bb2ddcfee
Support sub-workflow dependency handling of JSON workflows (#4098)
* Change "Usable as Activity" setting into checkbox

* Update client model

* Update query to use shadow property

* Update UsableAsActivity usages

* Implement staged provisioning of workflows

* Add tests

* Update migrations
2023-06-03 12:28:10 +02:00
Sipke Schoorstra a7f4aac97b Add tests for workflow result variable 2023-04-28 15:16:09 +02:00
Sipke Schoorstra a67361c6ae Fix variable type serialization 2023-04-28 14:31:38 +02:00
Sipke Schoorstra 316d35e796 Remove unused code 2023-04-28 11:42:36 +02:00
Sipke Schoorstra 5d766e921b Merge remote-tracking branch 'origin/v3' into v3 2023-04-28 11:38:13 +02:00
Sipke Schoorstra 885119c768 Add events for ActivityExecuting and ActivityExecuted 2023-04-28 11:37:01 +02:00
herblinernexxbizz a0bdf45851
Features/fix serialization issues (#3966)
* run locally

* commit created test

* updated test

* Island

* Commented code

* creating tests

* upodate tests

* revert

* create working tests

* fix test roundtrip Jobject

* update tests

* finish tests

* create branch without getdefinition by keys

* move test files add @

* Special properties deserialization test

* refactor tests make it shorter

* clean PolymorphicObjectConverter

* rename properties

* Escape keys starting with reserved symbols

* Fix fix of converter

* Add newline normalization

* Minor cleanup and handling nullability warnings

* compact tests

---------

Co-authored-by: Marius Vasile Vușcan <marius.vuscan@nexxbiz.io>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2023-04-28 10:29:06 +02:00
Sipke Schoorstra b5f1d53e33 Fix named variable issue
Fixes an issue when referencing variables not previously set in higher scope.
2023-04-24 14:30:13 +02:00
Sipke Schoorstra 10c5d0c848 Fix serialization bug and update AllInOne reference app with support for webhooks 2023-04-24 13:44:34 +02:00
Sipke Schoorstra 285feea5b1 Update tests 2023-04-22 00:01:37 +02:00
Sipke Schoorstra 3eb304e1ec
Fix flowchart completion bug (#3928)
* Ensure Flowchart completes when no more work

* Fix workflow instance JSON serializer

* Add tests that cover flowchart completion
2023-04-18 21:28:23 +02:00
Sipke Schoorstra c3ed7e7865
Improve JSON serializationfor workflow state (#3913)
* Incremental work on WorkflowStateSerializer

* Update Flow HTTP Request activity to default to Done outcome

* Fix reference handling

* Fix polymorphic object converter

* Add comments

* Add support for registering type alias during DI setup via options

* Fix trigger and bookmark payload persistence

* Update sample model

* Add support for custom dictionary types

* Split general serializer options provider into focused serializer services

* Formatting

* Update migrations
2023-04-17 00:11:58 +02:00
Sipke Schoorstra 7a09944732
Refactor scheduling and background activity execution (#3884)
* Refactor background activity execution

* Refactor scheduler

* Remove Jobs module

* Add XML comments
2023-04-09 23:35:32 +02:00
Sipke Schoorstra 5331476081 Add support for implicit looping constructs
Fixes the issue where a workflow would not complete, even though all flow chart activities executed
2023-04-06 22:37:53 +02:00
MariusVuscanNx 45f27f91f5
Import publish execute integration test (#3872)
* Import publish execute integration test

* Update test

* Extracted import logic into WorkflowDefinitionImporter

* Removed the WorkflowDefinitionRequest model and done a model rename

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2023-04-05 19:07:04 +02:00
herblinernexxbizz ef1ec1ed08
Features/v3 test setvar getvar (#3870)
* adding set var and main/sub workflow tests

* Deprecate SetWorkflowOutput and replace with SetOutput

* cleanup code

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2023-04-04 08:18:54 +02:00