Commit graph

6204 commits

Author SHA1 Message Date
Sipke Schoorstra 84e63f1f9e
Refactor package versioning to use shared properties for ElsaStudio and Microsoft packages. 2025-06-13 18:31:34 +02:00
Sipke Schoorstra a18dbdcb80
Update Docker image tags to version 3.6.0-preview in workflow configurations 2025-06-06 18:50:23 +02:00
Matt d71e37c4e1
Merge pull request #6714 from elsa-workflows/feat/add-ui-hint-radio-list 2025-06-06 00:50:16 +01:00
Matt 2ea755a50f Revert ChecklistItem back from Record to Class and remove left over RadioListActivity. Update Nuget packages. 2025-06-06 00:44:10 +01:00
Matt 0a7593f339
Merge pull request #6713 from elsa-workflows/feat/add-ui-hint-radio-list
Refactor checklists and radio lists to use records.
2025-06-06 00:24:01 +01:00
Matt fb4d39f3b6 Refactor checklists and radio lists to use records
Converted `CheckList` and `CheckListItem` to records,
adding XML documentation for clarity. Updated properties
in `CheckListProps`, `RadioList`, and `RadioListItem`
with similar changes. Enhanced documentation in
`DropDownOptionsProviderBase` and modified
`RadioListOptionsProviderBase` to reflect new
functionality. Overall improvements for readability
and maintainability.
2025-06-06 00:13:35 +01:00
Sipke Schoorstra ad49a29017
Merge remote-tracking branch 'origin/develop/3.5.0' 2025-06-05 20:11:44 +02:00
Sipke Schoorstra c0bc5302cf
Configures SQLite as default database provider
Configures the application to use SQLite as the default database provider.
Removes the logger dependency from the EFCoreActivityExecutionStore, simplifying the constructor.
2025-06-05 20:11:02 +02:00
Matt f6c069fc78
Merge pull request #6712 from elsa-workflows/feat/add-ui-hint-radio-list
Add RadioList support and related UI components
2025-06-05 09:50:15 +01:00
Sipke Schoorstra 3aae05317d
Refactor TriggerStore methods and update configurations.
Refactored `TriggerStore` to implement pagination and ordering for `FindManyAsync` methods with support for tenant-agnostic filtering. Modified app settings to change database provider to SQL Server and adjusted logging levels to reduce verbosity. Fixed workflow cancellation service to better handle child instances tasks.
2025-06-05 09:03:37 +02:00
Matt 6f8f8c0e41 Add radio list support and related UI components
- Renamed `CheckList` to `RadioList` in `RadioListProps`.
- Updated `WorkflowsFeature` to include `RadioListUIHintHandler` and `StaticRadioListOptionsProvider`.
- Introduced `TestRadioList` class for executing radio list functionality.
- Created `RadioList` and `RadioListItem` classes for managing radio list items.
- Added `RadioListOptionsProviderBase` for custom radio list data logic.
- Implemented `StaticRadioListOptionsProvider` for static radio list options.
2025-06-05 01:56:44 +01:00
Matt e9bdc7a421
Merge pull request #6711 from elsa-workflows/feat/add-ui-hint-radio-list
Create Api Client Models for RadioList UIHint.
2025-06-05 00:41:00 +01:00
Matt 1bfdfcaf71 Create Api Client Models for upcoming RadioList UIHint. 2025-06-05 00:36:18 +01:00
Sipke Schoorstra 59bfcf0ba5
Add distributed workflow runtime implementation.
Introduced `DistributedWorkflowRuntime` to support distributed workflow execution with locking mechanisms. Added new module `Elsa.Workflows.Runtime.Distributed` with key services, features, and client implementations for handling distributed bookmarks and workflow clients. Updated integration and component tests to use the new distributed runtime where relevant.
2025-06-03 09:58:20 +02:00
Sipke Schoorstra f5e10e4341
Merge branch 'cleanup' 2025-06-02 21:53:01 +02:00
Sipke Schoorstra 8fb797eaeb
Remove Elsa.Expressions.Dsl module and related DSL features
This commit completely removes the Elsa.Expressions.Dsl module, including all associated features, services, models, and dependencies. The DSL functionality, including its custom activities and integration options, has been fully eliminated from the project.
2025-06-02 21:52:10 +02:00
Sipke Schoorstra 1f2353cad8
Remove obsolete modules and associated code
Eliminated the `Elsa.Labels`, `Elsa.Environments`, and `Elsa.OpenTelemetry` modules along with their handlers, contracts, models, and related functionality. This cleanup improves maintainability and aligns the codebase with recent architectural changes.
2025-06-02 20:05:10 +02:00
Sipke Schoorstra ddda9639ca
Merge remote-tracking branch 'origin/develop/3.5.0' 2025-06-01 18:19:32 +02:00
Matt 5d1b0f8957 Update project files and dependencies to resolve Build issues.
- Removed `ElsaStudioVersion` from `Directory.Build.props`.
- Added `PackageVersions` group in `Directory.Packages.props` with `ElsaStudioVersion` and new `Moq` package version.
- Updated input retrieval method in `ConfigureLiquidEngine.cs` to use `ActivityInput`.
- Clarified import for `InvokingActivityCallback` in `ScheduledChildCallbackBehavior.cs`.
- Changed target framework to `net9.0` in `Elsa.Http.UnitTests.csproj` and updated package references for flexibility.
2025-06-01 15:57:42 +01:00
Max Brooks dff2576fbe
Generic activity name fix (#6698)
* Refactor ActivityRegistry to populate all activities in workflow editor page

- Modify ListAll to return distinct activity descriptors.
- Update RegisterAsync to call Add with correct parameters.
- Refactor RefreshDescriptorsAsync for better collection usage.
- Split Add method into two overloads for clarity.
- Improve logging for replacing existing activity descriptors.

* Add FuncExpressionValueConverter for JSON serialization

Implemented FuncExpressionValueConverter to handle serialization
and deserialization of Func<ExpressionExecutionContext,
ValueTask<object>> types, ensuring delegates are not serialized
and cannot be rehydrated from JSON. Updated multiple serializers
including ApiSerializer, BookmarkPayloadSerializer,
JsonActivitySerializer, JsonPayloadSerializer,
JsonWorkflowStateSerializer, and SafeSerializer to utilize
the new converter in their JSON serialization options.

* fix broken studio when when viewing suspended workflows

* fix for tests

* Refactor WorkflowStateExtractor for readability and safety

Improved code formatting and consistency in the WorkflowStateExtractor class.
Updated logic in several methods to enhance handling of input items, activity execution contexts, and completion callbacks.
Replaced `First` with `FirstOrDefault` for safer item retrieval and added null checks to prevent exceptions.
These changes improve overall code readability, maintainability, and safety within the workflow execution context.

* Enhance ActivityDescriber with new functionality

This commit introduces several improvements to the `ActivityDescriber` class, including:
- A new `GetFriendlyActivityName` method for better naming of activity types.
- Updates to `DescribeActivityAsync` to use the friendly name for `typeName` and `displayName`.
- Refactoring of `flowPorts` initialization for improved readability.
- Simplification of `GetInputProperties` and `GetOutputProperties` methods.
- Streamlined creation of `OutputDescriptor` and `InputDescriptor` in their respective methods.
- Addition of `DescribeInputPropertiesAsync` and `DescribeOutputPropertiesAsync` for asynchronous property descriptions.

---------

Co-authored-by: Max Brooks <Max@compyl.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2025-05-30 19:51:32 +02:00
Sipke Schoorstra e09f096ef9
Adds activity execution metadata support (#6699)
* Add logging to DefaultActivityExecutionMapper constructor

Introduced an ILogger dependency to DefaultActivityExecutionMapper and added a debug log statement in GetPersistableDictionary. This aids in tracking log persistence mode for improved debugging and state visibility.

* Simplify activity execution log mapping logic.

Replaced asynchronous mapping with synchronous mapping to simplify the logic flow. This change reduces task overhead and improves code clarity while maintaining functionality.

* Update activity execution mapping and comment out unused method

Replaced direct dictionary usage with a cloned dictionary to ensure data integrity in `DefaultActivityExecutionMapper`. Commented out an unused method in `ActivityExecutionExtensions` to suppress its execution for now.

* Add logging to ActivityExecutionLogStore for property tracking

Integrate ILogger to track and log details of activity execution records, specifically focusing on properties and their serialization. This enhancement improves debugging and provides better insights into the execution flow.

* Introduce Metadata field for activity execution handling

Replaces the use of Properties with Metadata across activity execution models and services for storing lightweight, persistent data. Updated serialization, database schema, and relevant APIs to support this change while ensuring backward compatibility. Adjusted logging and extension methods for Metadata integration.

* Reset V3.5 Runtime Migrations

* Add EF Core migrations for MySQL and SQL Server schema updates

Introduced migrations to support schema changes for MySQL and SQL Server. Changes include new columns for bookmarks and activity execution records, updates to existing columns, and creation of additional indexes. These updates aim to enhance database structure and query performance.

* Add support for metadata in workflow execution context

Introduce a `Metadata` property to `ActivityExecutionContextState` to enhance workflow state management. Updated `WorkflowStateExtractor` to handle metadata merging and preservation. Added an alias for `RetryAttemptRecordList` in `ExpressionOptions` for improved type handling.

* Remove logger dependency from DefaultActivityExecutionMapper

Eliminated the ILogger dependency and related logging calls from DefaultActivityExecutionMapper to simplify the class. This reduces unnecessary coupling and streamlines the activity execution mapping process.
2025-05-30 15:37:57 +02:00
Sipke Schoorstra 1c9a73b6b9 Add support for ordered and paginated trigger retrieval
Introduced new methods to enable ordered and paginated querying of triggers across various trigger store implementations. This includes the addition of `StoredTriggerOrder` to support custom ordering logic and updates to interfaces and stores to integrate this functionality.
2025-05-26 21:15:54 +02:00
Sipke Schoorstra 892099c235 Refactor UI handler hierarchy and remove sample workflows.
Replaced direct implementation of `IPropertyUIHandler` with a new `PropertyUIHandlerBase` abstract class to simplify UI handler management and introduce a priority mechanism. Removed outdated `SampleWorkflow` and `SlowActivity` code to clean up the repository. Introduced a custom checklist options provider and registered it within the application services.
2025-05-26 20:06:39 +02:00
Sipke Schoorstra bebcbd5c2b
Add stylesheet for workflows designer to host pages
Integrated `designer.css` from `Elsa.Studio.Workflows.Designer` into the `_Host.cshtml` files to ensure proper styling for workflow designer components. This update enhances the appearance and functionality of the workflows designer across relevant web pages.
2025-05-26 16:26:05 +02:00
Sipke Schoorstra 16fb757ef3
Refactor retry attempt retrieval logic in context reader.
Improved handling of retry attempt records by leveraging a conversion helper method. This ensures type safety and simplifies the code for better readability and maintainability. Also includes minor formatting adjustments.
2025-05-26 16:25:55 +02:00
Sipke Schoorstra 7b75f0c89f
Implement retry attempt capturing (#6674)
* Update default initializations and input parameters to `null`

Replaced `default!` with explicit `null` for input parameters and properties throughout various classes. Adjusted constructors' default values for consistency and readability. This change ensures better clarity and alignment with nullable reference types.

* Add Polly-based resilience integration for retry tracking

Introduce Polly diagnostics to log retry events in the execution context. Updated resilience strategy interfaces and implementations to support Polly's context and retry event tracking.

* Refactor resilience and retry handling, add flaky endpoint.

Removed custom Polly-based diagnostic listeners and observers in favor of a transient status code utility class. Introduced a mock "flaky" endpoint for testing failure scenarios and updated configuration for resilience strategies. Minor namespace fixes

* Add retry attempt recording to resilience feature

Introduce `IRetryAttemptRecorder` and its implementations to enable recording of retry attempts during activity execution. Updated `ResilientActivityInvoker` to persist retry attempts and modified `ResilienceFeature` to support configurable retry attempt recorders.

* Add retry attempt tracking and retrieval functionality

Introduced mechanisms to track and fetch retry attempts, including new interfaces, reader implementations, API endpoints, and related models. These enhancements improve resilience tracking and data access for activity execution across workflows.

* Add GetOutcome method to RetryAttempt model

Introduce a GetOutcome method to encapsulate logic for determining the retry attempt's outcome. It prioritizes the Result, falls back to the Exception message, or defaults to "Unknown" if neither is available. This improves clarity and reusability of the outcome evaluation.

* Add scoped registration for _retryAttemptReader

This change ensures that _retryAttemptReader is registered in the DI container as a scoped service.

* Refactor retry mechanism to support detailed retry metadata

Introduced a `CollectRetryDetails` method to `IResilientActivity` for enhanced retry data collection. Updated `RetryAttemptRecord` to include a `Details` dictionary for capturing metadata, replacing previous `Result` and `Exception` fields. These changes simplify the retry recording process and improve extensibility for tracking retry details across activities.

* Add support for capturing background activity properties

Introduced functionality to capture and persist background activity properties during workflow execution. This includes defining a key for properties, capturing them in middleware, and storing them in the workflow execution context. These changes ensure properties are handled consistently alongside other activity data.

* Add support for storing and propagating activity execution properties

Introduced a `Properties` dictionary to track additional metadata in activity execution records and stats, enabling richer diagnostics and tracing. Refactored resilience logic to improve retry handling and propagate retry-related flags in workflows. Enhanced database queries to map serialized properties for execution summaries.

* Add retry propagation for background activity execution

Introduced a mechanism to propagate the retry-attempted flag across activity execution contexts. Added a new notification `BackgroundActivityExecutionCompleted` and updated related middleware to send this notification. Enhanced resilience features to handle and propagate retry state effectively.

* Refactor default parameters and values to use 'null'.

Replaced 'default' with 'null' for optional parameters and values in `AddExecutionLogEntry`, improving clarity and ensuring semantic consistency with nullable types. No functional changes were introduced.

* Refactor flaky endpoint and enhance resilience support.

Replaced the "Flaky" endpoint with a more robust "SimulateResponseEndpoint" under a new module. Introduced a status code lookup utility and improved resilience strategies with configurable backoff types. Updated serialization to support enum conversions and enhanced caching behavior for response simulation.

* Update activity execution models with nullable properties

Replaced `default!` initializations with `null!` to ensure correct handling of nullable string properties in `ActivityExecutionRecord`. Added a new `Properties` dictionary to `ActivityExecutionRecordSummary` to store additional activity execution data. This enhances model flexibility and data extensibility.

* Add support for recording resilience strategy in context

Introduced a new method to store resilience strategy details in the activity execution context for enhanced diagnostics. Updated `ResilientActivityInvoker` to serialize and set the resilience strategy using this method, leveraging `JsonSerializer`.

* Remove redundant PropertyNamingPolicy assignment

The PropertyNamingPolicy was set to the default value (CamelCase), making the assignment unnecessary. This change simplifies the code while maintaining existing functionality.

* Set JSON property naming policy to camelCase

Updated JSON serialization settings to use camelCase naming for property names. This improves consistency with standard JSON naming conventions and ensures compatibility with camelCase-based APIs.

* Remove unused Endpoints folder reference from project file

The Endpoints folder reference in the project file was unnecessary and has been removed. This cleanup helps maintain a tidy and accurate project structure.

* Remove unused RetryAttemptFilter and add Polly packages

Removed the obsolete RetryAttemptFilter class as it was no longer in use. Added Polly and Polly.Extensions packages to the project to support resilience and fault-handling strategies. This update aligns with keeping dependencies relevant and reducing unused artifacts.

* Add resilience integration test for FlowSendHttpRequest (#6692)

* Refactor and fix resilience test cases for clarity and accuracy

Simplified imports, adjusted code structure, and corrected attempt indexing logic in resilience tests. These changes improve readability, maintainability, and ensure accurate validation of retry attempts in test scenarios.
2025-05-26 11:47:09 +02:00
Sipke Schoorstra 3baf11ea49
Use centralized property for ElsaStudio version
Replaced hardcoded ElsaStudio version values with a centralized `ElsaStudioVersion` property. This ensures easier version management and reduces duplication across the project.
2025-05-26 08:55:50 +02:00
Sipke Schoorstra da771e43ee Add ElsaIdentity service to Program.cs
Integrate the ElsaIdentity service into the application to enhance identity management features. This change complements the login module and ensures a more cohesive and extensible authentication setup.
2025-05-26 08:38:34 +02:00
Sipke Schoorstra c83d42ed96
Adds Copilot setup workflow
Creates a workflow to setup the environment for Copilot-related tasks.

This includes checking out the code and setting up the .NET 9 SDK, ensuring a consistent and reproducible environment for development and testing.
2025-05-25 21:18:52 +02:00
Sipke Schoorstra e6076d0c7d
Make GetUIPropertiesAsync method virtual
Allow derived classes to override the GetUIPropertiesAsync method by marking it as virtual. This change enhances flexibility and customization for implementations of DropDown and CheckList options providers.
2025-05-25 20:42:29 +02:00
Sipke Schoorstra 4101794f95
Enhance CheckListOptionsProviderBase with additional options
Introduce a `RefreshOnChange` property for dynamic UI updates and a virtual method `GetUIPropertyAdditionalOptions` for adding custom options. These changes improve extensibility and enable developers to better control checklist behavior.
2025-05-25 20:40:02 +02:00
Sipke Schoorstra f8968b5cfc
Simplify CheckListOptions logic
Refactor `StaticCheckListOptionsProvider` to inherit from the new `CheckListOptionsProviderBase` and streamline checklist item generation logic.
2025-05-25 20:38:02 +02:00
Sipke Schoorstra d44b081848
Add RefreshOnChange to support dynamic UI updates
Introduced a `RefreshOnChange` property to `DropDownOptionsProviderBase`, enabling dynamic UI updates for dropdown options. Simplified `ConnectionOptionsProvider` by overriding `RefreshOnChange` and removing redundant code.
2025-05-25 19:48:46 +02:00
Sipke Schoorstra f93ac41489 Replace default! with null! for better nullability safety
Updated default property values across activities to use `null!` instead of `default!`, ensuring clearer nullability intent. Also adjusted constructor parameter defaults to `null` for consistency.
2025-05-25 19:26:38 +02:00
Copilot d6c90b611e
Allow C# Script to use dot notation with ExpandoObject (JSON variables) (#6689)
* Initial plan for issue

* Implement special handling for ExpandoObject variables in C# Script

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Refactor ExpandoObject handling to make code more concise

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2025-05-25 12:26:59 +02:00
Copilot f041f55624
Fix EventBase child activity not executing OnEventReceived method (#6687)
* Initial plan for issue

* Add OnEventReceivedAsync call in EventBase.EventReceivedAsync

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2025-05-24 23:33:37 +02:00
Copilot 239be9bf1c
Fix ASP.NET integration test crashes by adding proper Elsa background task shutdown (#6686)
* Initial plan for issue

* Create testing extension to properly shutdown Elsa tasks

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2025-05-24 23:25:37 +02:00
Copilot a2e65a235f
Add ActivityCompleted notification for workflow activity completion (#6675)
* Initial plan for issue

* Add ActivityCompleted notification and send it when activity completes

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Prepare implementation plan for ActivityCompleted notification

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Move ActivityCompleted notification to NotificationPublishingMiddleware

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2025-05-24 23:01:41 +02:00
Copilot b9697a9e28
Fix Liquid expressions not working in sub-workflows (workflow-as-activity) (#6678)
* Initial plan for issue

* Fix Liquid expressions not working in sub-workflows

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2025-05-24 21:45:28 +02:00
Copilot 144edc3a85
Fix Content-Type header charset auto-appending in HTTP requests (#6676)
* Initial plan for issue

* Implement RawStringContent for fixing charset issue

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2025-05-24 21:39:31 +02:00
Copilot 830a04f325
Fix missing DefaultValue for OuterBoundInclusive property in For activity (#6680)
* Initial plan for issue

* Add DefaultValue=true to OuterBoundInclusive InputAttribute

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2025-05-24 21:32:46 +02:00
Matt a0b1b299c7
Merge pull request #6673 from elsa-workflows/task/move-sastokens-to-core
Add back SasToken project.
2025-05-23 15:16:57 +01:00
Matt 1ecbf5e93d Add back SasToken project. 2025-05-23 01:09:59 +01:00
Matt 609f33e790
Merge pull request #6664 from KnibbsyMan/task/move-modules-to-extensions
Realign Core and Extension Repos.
2025-05-22 11:42:45 +01:00
Matt 6b88698200 Merge 'Main' in and resolves conflicts. 2025-05-22 00:46:15 +01:00
Matt ca5340557d Apply changes that will not be resolved by merge conflict resolution. 2025-05-22 00:17:15 +01:00
Sipke Schoorstra f4ad11eb0f
Merge remote-tracking branch 'origin/develop/3.5.0' 2025-05-21 11:32:58 +02:00
Sipke Schoorstra cf01846b9d
Merge remote-tracking branch 'origin/patch/3.4.1' into develop/3.5.0 2025-05-21 11:32:21 +02:00
Sipke Schoorstra 366284aed1
Updates package versions
Updates several package versions to their latest available releases.

This ensures that the project benefits from the latest features,
bug fixes, and security updates provided by the respective libraries.
2025-05-21 11:31:58 +02:00
Sipke Schoorstra c5d312f04c
Update workflow for version 3.4.1 release tracking
Increase base_version to 3.4.1 and update branch filtering to match the new patch release naming convention. This ensures the workflow correctly handles the latest release process.
2025-05-21 11:28:39 +02:00