Commit graph

399 commits

Author SHA1 Message Date
Sipke Schoorstra 883ca85753 Handle workflows marked as activities with duplicate names 2023-11-10 22:08:59 +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 6552af5c59 Merge remote-tracking branch 'origin/v3' into v3 2023-11-09 13:35:08 +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
jdevillard 1b48305418
Enhancement/runtime options provider#4491 (#4614)
* add Endpoint to fetch data from options provider

* add Api Client Contract

* add context object in Endpoint

* Update Api Client Contract for Context

---------

Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2023-11-09 13:01:51 +01:00
Sipke Schoorstra ab32474c29 Refactor C# expression APIs 2023-11-03 22:01:19 +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 591fdd670b Update ActivityNotFoundActivity to throw exception when executed 2023-10-26 14:54:21 +02:00
Sipke Schoorstra 2b34f1d72c
Update NotFoundActivity display text + description (#4578) 2023-10-26 14:37:18 +02:00
Sipke Schoorstra 02ec4c2391
Include NodeId for unique addressability within graph (#4575)
* Leverage ActivityNode for graph querying

* Make workflow definition activity Root port non-browsable

* Update Join activity

* Make NodeId first-class citizen
2023-10-25 22:46:06 +02:00
Sipke Schoorstra 1cbbc920b7 Introduce WorkflowStarted and WorkflowFinished events
#4468
2023-10-20 14:52:53 +02:00
Sipke Schoorstra 796b92967b Safe activity node lookup 2023-10-20 09:08:37 +02:00
Sipke Schoorstra 08d91d1852 Update display name of FlowSwitch to distinguish from sequential Switch 2023-10-19 18:18:17 +02:00
Sipke Schoorstra 443e608a05 Fix FlowJoin completion issue
The order here is important. Before this change, the flowchart would determine that there was still pending work, after which the FlowJoin would then cancel that work, leaving the Flowchart uncompleted.
2023-10-19 17:41:48 +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
Sipke Schoorstra 170a14c914 Update FlowDecision 2023-10-17 22:42:16 +02:00
Sipke Schoorstra 9ad3b1423c Update builder API to use type name for workflow name by default 2023-10-15 12:02:18 +02:00
Sipke Schoorstra c2d9ec4fd2 Make programmatic workflow variable IDs deterministic 2023-10-15 11:32:13 +02:00
Sipke Schoorstra cdf5f9f614 Rename Port Resolver to Activity Resolver
In the scenario where this resolver is used, it's not about discovering ports, but about constructing a graph from the workflow by going through each activity or activities property.
2023-10-15 11:31:24 +02:00
Sipke Schoorstra 4f50850a1e
Capture activity state (#4530) 2023-10-13 10:34:21 +02:00
Sipke Schoorstra a770decc7f Update Flowchart to adhere to CanStartWorkflow 2023-10-12 11:52:05 +02:00
Sipke Schoorstra 2b909997bc Fix duplicate key issue for older definition formats 2023-10-10 12:55:44 +02:00
Sipke Schoorstra ca5692e3bc
Alteration Improvements and fixes (#4518)
* Remove unused NOOP stores

* Add activity execution manager and FindAsync method to store

The notification is used to broadcast changes to SignalR clients.

* Refactor ActiveActivityExectionContexts

Instead, the workflow state extractor is in control of what gets extracted.

* Add missing files for activity execution deleted broadcast

* Update Flowchart to not fault when child faults

* Update Flowchart to support scheduling existing activity instances

* Update namespaces from Services to Stores

* Improve activity cancellation alteration

* Update ScheduleActivity alteration
2023-10-10 12:34:32 +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 2a7ca95456 Make ConnectionComparer more resilient 2023-09-28 14:09:34 +02:00
Sipke Schoorstra f6f1d930e2 Rename display text of Flow Node 2023-09-28 13:38:37 +02:00
Sipke Schoorstra 6b969799bb Add XML comments 2023-09-25 10:30:37 +02:00
Sipke Schoorstra 28dbd7d961 Improve WorkflowBuilder with common default behavior 2023-09-25 10:25:48 +02:00
Sipke Schoorstra 713ccc63f3 Add XML comments 2023-09-24 12:38:06 +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 a201672584 FlowSendHttpRequest improvements 2023-09-22 11:13:23 +02:00
Sipke Schoorstra fc14cfb7b0
Exclude Activity from being serialized in instance and execution log (#4464) 2023-09-21 18:09:48 +02:00
Sipke Schoorstra 841628011a Add metadata to control non-serialized output 2023-09-20 22:55:58 +02:00
Sipke Schoorstra a4750883f5 Fix HTTP Endpoint activity 2023-09-20 22:02:37 +02:00
Sipke Schoorstra 710950a287 Cleanup 2023-09-19 22:43:44 +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 fbdd555dd9 Implement workflow-level exception handling
Fixes #4451
2023-09-18 20:52:53 +02:00
Sipke Schoorstra e52c4eb91f Add support for registering customized output names
Issue #4174
2023-09-18 19:45:49 +02:00
Sipke Schoorstra 635d4f6948
Terminal Activities (#4454)
* Implement terminal node behavior

* Cleanup
2023-09-18 14:23:43 +02:00
Alexander Rose a21751672d
make type name helper aware of generics (#4442)
* make type name helper aware of generics

* fix ActivityTypeNameHelper.GenerateTypeName for generic types specifying a type name in the activity attribute
2023-09-17 20:08:38 +02:00
Sipke Schoorstra bb2fa55d0e
WriteHttpFileResponse Activity (#4445)
* Incremental work on WriteFileHttpResponse activity

* BREAKING Schema change - Increase bookmark flexibility

* Implement zipped file response
2023-09-16 11:06:56 +02:00
Sipke Schoorstra 12f9e0844b Add logging of composite completion signal 2023-09-14 17:27:42 +02:00
Sipke Schoorstra 7f0b3cb8fc Fix cascaded handling of SetOutcome 2023-09-14 16:30:18 +02:00
Sipke Schoorstra 1f3851b652 Add debug logging to Flowchart activity 2023-09-14 12:51:10 +02:00
Sipke Schoorstra 45169d0e71 Add incident timestamp 2023-09-14 11:19:05 +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 287442ca7e Update middleware to also inspect memory block for output values 2023-09-11 21:58:27 +02:00