Commit graph

12 commits

Author SHA1 Message Date
Raymond den Haan ab3ee3ee1c Merge branch 'main' into feature/service-bus-pub-sub
# Conflicts:
#	src/modules/Elsa.MassTransit.AzureServiceBus/Features/AzureServiceBusFeature.cs
#	src/modules/Elsa.MassTransit.RabbitMq/Features/RabbitMqServiceBusFeature.cs
#	src/modules/Elsa.MassTransit/Features/MassTransitWorkflowDispatcherFeature.cs
#	src/modules/Elsa.MassTransit/Implementations/MassTransitWorkflowDispatcher.cs
#	src/modules/Elsa.MassTransit/Services/MassTransitWorkflowCancellationDispatcher.cs
#	src/modules/Elsa.Workflows.Runtime/Responses/DispatchWorkflowDefinitionResponse.cs
2024-02-20 13:34:29 +01:00
Sipke Schoorstra ef3431c57a
Implement dispatch channels (#4949)
* Add DispatchWorkflowOptions and update MassTransit configuration

Introduced a new class `DispatchWorkflowOptions` to provide workflow dispatch options. Updated MassTransit configuration to include NET6.0 and NET7.0 support, and ensure correct MassTransit version usage per target framework version.

* Add support for configurable MassTransit message dispatching

Implemented a feature which allows for configurable MassTransit message dispatching. Added support for specifying channels and message brokers. Message dispatching code was massively refactored and relevant endpoints and response models were updated to support new message dispatching features.

* Add IEndpointChannelFormatter interface and implementation

An interface for formatting channel queue names, 'IEndpointChannelFormatter', has been added, along with its default implementation 'DefaultEndpointChannelFormatter'. The code that uses hardcoded queue name formatting has been modified to use the new formatter instead, making it more configurable and reusable. The implementation of the formatter uses the 'Humanizer' library to kebab-case the channel names.

* Add channel dispatch option to workflow activities

Introduced `WorkflowDispatcherChannelOptionsProvider` to provide dropdown channel options for workflow dispatch-related activities. Updated `DispatchWorkflow` and `BulkDispatchWorkflows` activities to include a new dropdown input for specifying a dispatch channel. Also, included the selected channel name in the `DispatchWorkflowOptions` during workflow dispatching process.

* Update MassTransit configurations and remove unused code

The MassTransit setup in Elsa.MassTransit module has been simplified by removing conditional code for different .NET versions. Additionally, unused parameter '__X_Channel' in 'DispatchWorkflowDefinition' was removed. Lastly, the MassTransit broker in Elsa.Server.Web was switched from RabbitMq to AzureServiceBus.

* Refactor dispatch workflow classes and methods

Simplified the class, method and variable names related to workflow dispatching in the Elsa.Workflows.Runtime module. For example, the 'WorkflowDispatcherChannelDescriptor' class was renamed to 'DispatcherChannel'. This refactoring was performed to make code more readable and maintainable by removing redundant wording in the naming convention.

* Update GitHub Workflow to support feature and issue branches

The workflow changes add support for feature and issue branches. Now, it extracts the branch name and verifies the commit exists in the given branch rather than just 'main'. The versioning scheme is also modified to include the branch name and not just the run number.

* Add 'bug/*' to triggering branches in packages workflow

The 'bug/*' pattern was missing from the triggers that initiate the GitHub actions within our packages workflow. This update includes any branch with a 'bug/' prefix to the list, allowing bug-related branches to start jobs in our CI/CD pipeline.

* Remove 'issue/*' and 'bug/*' branches from packages workflow

The 'issue/*' and 'bug/*' branches have been removed from the GitHub action workflow for packages. This change was made to simplify the workflow and optimize the triggering of package building.

* Update GitHub workflow to handle main branch versioning

This commit modifies the GitHub workflow script to accommodate changes when the branch name is "main." If the branch name is "main", a preview version is used. It also updates script execution to print the branch name for easier debugging and verifies commit existence on the correct branch instead of dispatch channels.

* Enclose branch names in quotes in packages.yml

The update modifies the branch names in the packages.yml GitHub Actions workflow file. The change consists of enclosing the branch names 'main' and 'feature/*' in single quotes, ensuring compatibility and preventing potential string interpretation issues.

* Update GitHub workflows package configuration

The workflows package configuration has been updated to specifically watch for changes on 'feature/dispatch-channels' rather than on all feature branches. This change will prevent unnecessary builds on less relevant feature branches.

* Update trigger branches in packages workflow

The triggering branches in the packages workflow have been updated. Previously, only changes in the 'main' and 'feature/dispatch-channels' would trigger the workflow, now any 'feature/*' branch will. This will cause more frequent and comprehensive testing.

* Add 'patch/*' to workflow trigger branches

This update adds 'patch/*' to the list of branches in .github/workflows/packages.yml that can trigger the workflow. It will allow the workflow to be initiated not just for main and feature branches, but also for patches.

* Add 'preview/*' to workflow triggers

This commit adds a new trigger for the GitHub Actions workflow. It now also responds to push events on 'preview/*' branches, allowing for automated testing and building of these preview branches.

* Update branch name extraction in GitHub Actions

The extraction of the branch name has been slightly modified in the packages.yml GitHub workflow file. This alteration ensures the correct branch name is obtained for further processing within the workflow without any discrepancy.

* Update branch name extraction in packages.yml

Corrected the syntax for extracting the branch name within the packages.yml github workflow file. Added an extra line to print out the ref which might be useful for debugging.

* Update branch name extraction in GitHub workflow

The commit simplifies the way the branch name is being extracted from the GitHub ref in the packages.yml workflow file. The new method employs straightforward string manipulation, making it easier to understand and debug in case of potential issues.

* Add extraction of branch name in workflow

Added a new line in the GitHub workflow file (.github/workflows/packages.yml) to extract the last part after the final slash from the branch name. This enhancement allows cleaner naming conventions, especially in cases where branches are named feature/issue-123, as it will only retain 'issue-123'.

* Update package naming in Github workflow

The Github workflow has been updated to handle package naming more effectively. Previously, the branch name was used directly for package versioning. Now, the last part of the branch name is extracted and used as the package prefix. If the branch name is "main", the package prefix is set to "preview".

* Move and add environment variable assignments

The placement of the assignment for BRANCH_NAME environment variable was moved for better readability. Additionally, the PACKAGE_PREFIX environment variable was also added. These environment variables are crucial for subsequent steps in the GitHub workflow.

* Add workflow dispatch validation and response handling

Removed several specific dispatch response classes and consolidated all types of dispatch responses into a single DispatchWorkflowResponse class. Added a new ValidatingWorkflowDispatcher service to validate dispatch requests before they're sent. Updated several classes to work with these changes, including the BackgroundWorkflowDispatcher, MassTransitWorkflowDispatcher, and the API endpoint class.

* Handle dispatch workflow failures with exceptions

The DispatchWorkflow and BulkDispatchWorkflows activities now throw a FaultException when the dispatch operations fail. Previously, these operations were not checking for success and could fail silently. Now, an unsuccessful dispatch response results in a FaultException with an error message from the dispatch response.
2024-02-16 10:56:30 +01:00
Sipke Schoorstra 055377accf Add workflow cancellation functionality
Created classes and implemented the basic architecture for workflow cancellation. This includes command handlers, dispatchers, and consumers. However, the actual cancellation logic needs to be implemented later. Also, the Elsa solution file was cleaned up by deleting unnecessary entries.
2024-01-09 21:07:57 +01:00
jdevillard 9175322774
Add a more generic UIHandler to customize how inputAttributes can be handle by UI (#4688)
* add a more generic UIHandler to customize how inputAttributes can be handle by the ui

* Add IPropertyUIHandlerResolver and update PropertyUIHandlerResolver

Introduced a new interface, IPropertyUIHandlerResolver, to resolve UI options for a property. Refactored PropertyUIHandlerResolver to implement this interface and removed the unnecessary partial class structure. Also, cleaned up some unnecessary usings in various files for better code organization.

* Refactor variable name and description in InputDescriptor

The 'uISpecifications' variable in the InputDescriptor model is renamed to 'uiSpecifications' for better readability. Additionally, the associated comment was revised to explain that the dictionary is used by the UI.

* "Refactor codebase for improved organization and cleaner architecture"

The codebase has been significantly refactored, moving several classes to more appropriate namespaces for improved organization and cleaner architecture. This includes shifting UI hint handlers, activities, and memory-related components, amongst others. The changes should improve code readability and maintainability, but as this is a broad refactoring effort, thorough regression testing is advised.

* Add CheckList UIHint with associated handler and provider

This update introduces a new UIHint called CheckList to the Elsa.Workflows.Core. This includes the necessary handler and provider classes. The handler is registered in the WorkflowsFeature.cs, and the CheckList UIHint key has been added to the InputUIHints.cs. Various associated files have been created in both the Elsa.Api.Client and Elsa.Workflows.Core project to support this new UIHint.

---------

Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2023-12-26 18:56:29 +01:00
Sipke Schoorstra 3aedf27727 Update workflow handling and simplify codebase
Refactored the workflow handling logic and simplified numerous components in the codebase. Major changes include the enhancement of the Workflow Runtime handler, altering the broadcast and deliver functions in the Default Workflow Inbox, and the removal of unnecessary details in the Workflow Runtime feature. Also, unnecessary services and requests were removed for better code efficiency and readability.
2023-12-18 16:11:48 +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 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 30d48351e2 Update namespace of notification 2023-09-07 22:27:27 +02:00
Sipke Schoorstra 4fe7518976 Add initial support for persisting workflow input 2023-08-31 21:04:19 +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 95cefe631f
Bookmarks & Activity Instances (#4301)
* Add ActivityInstanceId to bookmark model

* Fix Telnyx activity resumption

* Fix missing activity instance ID forwarding to workflow inbox
2023-08-09 13:02:20 +02:00
Sipke Schoorstra 72f4461ca3 Implement cascading deletion 2023-07-20 00:05:43 +02:00