Commit graph

410 commits

Author SHA1 Message Date
Sipke Schoorstra faf8fd1df6
Enhanced ObjectConverter to Return JsonObject Instead of JsonElement (#4686)
* Incremental work

* Refactor code for JSON object handling and workflow context

This commit includes a significant rework of JSON object handling by ensuring produced JsonObject remains as JsonObject. Previously unimplemented customer and order workflow context providers have been removed. The test cases have been renamed and updated to confirm the new behavior is working as expected.
2023-12-08 20:57:07 +01:00
MariusVuscanNx 2dc584fac7
Implemeted FlowFork activity (#4684) 2023-12-07 22:29:05 +01:00
Sipke Schoorstra 683f0ee6d8
Add Bulk Dispatch Workflow activity (#4683)
* Initial version of BulkDispatchWorkflow

* Update comments

* Refactor options models for running workflows and add Properties

* Fix resumption

* Add ability to provide arguments when evaluating expressions

* Update args syntax for JS

* Fix ProtoActor Runtime Properties mapping

* Use default constructor

* Provide completed workflow instance ID as input to BulkDispatchWorkflows

* Implement ChildFaulted port

* Switch to Publish to make Memory service bus work

* Update input evaluation and activity output retrieval

Refined the input evaluation process to only consider inputs with AutoEvaluate set to true. Added a comment to clarify the purpose of the GetActivitiesWithOutputs method. Removed the unnecessary check for AutoEvaluate from the EvaluateInputPropertyAsync method.
2023-12-06 22:32:08 +01:00
Sipke Schoorstra 50ac0e9371 Exclude Start field from being serialized 2023-11-30 12:14:01 +01:00
Sipke Schoorstra 811ab7702d Fix conversion of dynamic values to T 2023-11-29 20:30:38 +01:00
Sipke Schoorstra bec8cbc322
Target .NET 8 (#4660) 2023-11-27 11:26:16 +01:00
Sipke Schoorstra 14d7ec18d6 Handle user-usage of $id key in JSON objects 2023-11-23 20:30:58 +01:00
Sipke Schoorstra 225a99f39d
Bulk Import + Export of Workflow Definitions and Instances (#4643)
* Implement bulk export of workflow definitions

* Update Import endpoint with support for file uploads

* Update Import endpoint to return imported workflow count

* Implement workflow instance (bulk) export

* Implement workflow state, bookmark, workflow + activity execution export

* Remove globally imported usings
2023-11-22 14:31:48 +01:00
Sipke Schoorstra bf205c72b9 Fix SetOutput handling 2023-11-17 20:59:09 +01:00
Borja Fernández 7fe05f491d
Complete activity if items count is 0 (#4623) 2023-11-15 21:00:34 +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 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