Commit graph

4678 commits

Author SHA1 Message Date
Sipke Schoorstra 1e1abfa100 Add support for list/array conversion in JavaScript evaluator
A StringObjectDictionaryConverter has been added, which converts all IList fields of an object to array fields. This enhances the interaction of JS expressions with list types, allowing common Array methods to be applied directly. Furthermore, defaults have been added to the ExpressionEvaluatorOptions parameters to improve usability. Lastly, adjustments were made to ensure variables are correctly set while evaluating expressions.
2024-01-30 21:22:32 +01:00
Sipke Schoorstra e7edb1d3ea Update Elsa.Studio and Elsa.Studio.Login.BlazorWasm package versions
The package versions for Elsa.Studio and Elsa.Studio.Login.BlazorWasm have been updated to 3.0.4 across multiple projects. This update allows projects to utilize the latest features and improvements from these packages.
2024-01-24 20:32:33 +01:00
Sipke Schoorstra 03743d6da1 Update version number in GitHub workflow
The version number has been updated in the GitHub actions workflow file. Previously, it was hardcoded to "3.0.3-preview", but now it's switched to "3.0.4-preview". This change keeps our software versioning consistent and up-to-date.
2024-01-24 01:21:52 +01:00
Sipke Schoorstra 792c06ee04 Update GitHub actions workflow to target v3.0.4
The GitHub actions workflow has been updated to target the version branch v3.0.4. The necessary checks and commands have been modified accordingly to ensure proper compatibility with the new branch. This update is necessary for the correct functioning of the automatic deployment activities.
2024-01-24 01:18:00 +01:00
Sipke Schoorstra a1b7afdf4f Reorder methods in WorkflowStateExtractor service
The private methods within the WorkflowStateExtractor service have been reordered for readability and maintainability. The `ApplyInput` and `GetPersistableInput` methods have been moved to a position just before the `ExtractProperties` method. This ensures that similar or related methods are grouped together, improving the logical structure of the code.
2024-01-23 22:03:02 +01:00
Sipke Schoorstra a7851175b8 Add input application to workflow state extractor
A new method ApplyInput has been added to prevent overwriting any existing input in the WorkflowExecutionContext. Now, input items are added to the workflow execution context only if they don't exist there already. The Apply method has been updated as well to add workflow state inputs appropriately.

Fixes #4705
2024-01-23 22:03:02 +01:00
Sipke Schoorstra ac9428a6e0
Allow creation of variables dynamically via setVariable (#4800)
* Disable MassTransitRabbitMq in Elsa.Server.Web.

* Create variable if not exists in Workflow.Core

The update introduced checks if a variable exists before attempting to set its value in the ExpressionExecutionContextExtensions. If the variable doesn't exist, it now creates one automatically.

Fixes #4789

* Remove unnecessary comment

The comment indicating to create a variable if it doesn't exist was deemed superfluous and removed from the ExpressionExecutionContextExtensions.cs file. This improves code cleanliness as the functionality is self-explanatory through the existing code structure.
2024-01-15 21:15:05 +01:00
Sipke Schoorstra 66d8e4b20f Updated MassTransit sample project
This commit updates the Elsa.Samples.AspNet.MassTransitActivities.csproj
2024-01-12 08:47:41 +01:00
Sipke Schoorstra faa90fddf6 Update GitHub workflow for v3.0.3
The GitHub Actions workflow has been updated to accommodate for the new version v3.0.3. Changes include adjusting the branch references and VERSION variable in the packages.yml file.
2024-01-11 21:02:29 +01:00
Sipke Schoorstra 642e700c3d
Refactor MassTransitActivityTypeProvider (#4792)
Fixed the Message input descriptor for dynamically provided MassTransit PublishMessage activities.
2024-01-11 21:00:35 +01:00
Sipke Schoorstra 42db09c689 Update Elsa.Studio packages to version 3.0.1
The Elsa.Studio, Elsa.Studio.Login.BlazorWasm, and Elsa.Studio.Core.BlazorWasm packages have been updated from version 3.0.1-preview.196 to version 3.0.1 in all projects. These updates move the projects from the preview versions to the stable 3.0.1 release.
2024-01-07 17:06:35 +01:00
Sipke Schoorstra 57920fc5c5 Update GitHub workflow to target v3.0.2 branch
The GitHub Actions workflow has been updated to focus on the v3.0.2 branch instead of the main branch. As part of this change, the verification step and VERSION setting have been adjusted to reflect the new branch name.
2024-01-07 16:49:59 +01:00
Sipke Schoorstra a8878e28a7 Merge branch 'v3.0.2' of https://github.com/elsa-workflows/elsa-core into v3.0.2 2024-01-07 16:20:10 +01:00
Sipke Schoorstra c2ec2bda5a Update handling of null outcomes in activity execution
The code was adjusted to correctly handle cases when the method `GetBackgroundOutcomes` returns null. This would cause the activity to complete prematurely.

Fixes #4763
2024-01-07 16:20:02 +01:00
Night Wu ab69e739da
Update FastEndpoints* nuget packages to 5.21.2 version (#4764)
Co-authored-by: admin <admin@admin.com>
2024-01-07 15:56:39 +01:00
Sipke Schoorstra 900aac6d56 Revert "Update FastEndpoints packages to version 5.21.2"
This reverts commit 3b48636ced.
2024-01-07 15:20:56 +01:00
Sipke Schoorstra f068b01856 Update workflow to track 'main' branch instead of 'v3.0.1'
This commit updates the Github Actions CI/CD workflow to track changes from the main branch instead of branch v3.0.1. It changes actions in package.yml to fetch, verify commits, and grep in the 'main' branch.
2024-01-06 17:27:31 +01:00
Sipke Schoorstra 71690a2903
Merge 3.0.1 (#4759)
* Update packages.yml for version 3.0.1

The packages.yml workflow file has been updated to target the v3.0.1 branch instead of main. The version also has been updated from 3.0.0 to 3.0.1 in the version prediction logic. Hotfix tags usage has been removed.

* Update git branch for commit verification in workflow

The Github workflow's step for verifying commits' existence has been updated. Instead of searching in the 'origin/main' branch, the workflow now checks in the 'origin/v3.0.1' branch. This modification ensures compatibility and consistency with the version being used.

* Update Elsa.Studio package versions

The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages in the Elsa.ServerAndStudio.Web and Elsa.Studio.Web projects have been updated from version 3.0.0-preview.177 to the stable version 3.0.0. This is to ensure we're using the stable and reliable versions of these packages in our projects.

* Add background execution to activities and update HTTP requests

Significantly enhanced the capabilities of background execution of activities. Included a change in activity type of "SendHttpRequest" from 'Task' to 'Action'. Introduced new classes for handling outcomes of context in background execution. Made some necessary adjustments to HTTP Request Task to handle sending HTTP requests from a background task. Updated several middleware classes to align with these modifications.

* Add background execution handling to activity context

This commit adds the ability to manage the background execution state directly within the activity execution context. This includes adding methods to set and verify the background execution state, and modifying the existing code to use these new methods. A method for handling activity scheduling during background execution has also been started, but its implementation is not finished yet. The HTTP Request activities were updated accordingly to reflect these changes.

* Add scheduling function for background activities

This commit achieves two main goals. Firstly, it introduces two new classes called ScheduledActivity and ScheduledActivityOptions to store scheduled activities' information. Secondly, it modifies how activities are executed in the background by capturing the scheduling information as a serializable format and storing it in the workflow execution context properties dictionary. This change allows the workflow execution context to resume the activity execution context.

* Refactor HTTP request handling by removing SendHttpRequestTask

SendHttpRequestTask was deleted and its functionality was merged into SendHttpRequestBase. This consolidation led to the addition of StatusCode and ResponseHeaders output fields in SendHttpRequestBase. Another change includes the update in FlowSendHttpRequest to indicate that it's no longer deprecated. Also, HttpHeaders class was extended to accommodate HttpResponseHeaders objects. The consolidation was done to streamline the HTTP request handling process.

* Update GitHub Actions workflow for new release

The GitHub Actions workflow configuration has been updated to target the '3.0.1' branch instead of 'main'. Furthermore, the preview version set in the workflow has been updated to '3.0.1-preview', changing from the previous '3.0.0-preview'.

* Update branch verification in GitHub workflow

The GitHub workflow configuration has been updated to verify that the commit exists in the branch 'origin/3.0.1' instead of 'origin/main'. This is done during the automated package generation process.

* New options to control retry logic for transient failures (#4750)

* Add an option to control the number of automatic retries for transient failures.

* Add SleepDurationProvider option for ElsaClientBuilderOptions

---------

Co-authored-by: admin <admin@admin.com>

* Add IExecuteWorkflowApi interface and refine retry policy configuration

A new interface, IExecuteWorkflowApi, was created to handle execution and dispatch of workflow definitions. This breaks down functionalities previously present in IWorkflowDefinitionsApi. Also, the retry policy configuration for HTTP requests has been refactored. Instead of hardcoding retry settings, now a delegate method can be optionally passed to customize the behavior. This makes it more flexible and shifts the responsibility of configuring retry policies to the client.

* Add option for synchronous broadcast in WorkflowInbox

This update introduces a new option to control synchronicity when broadcasting messages in the WorkflowInbox. The 'BroadcastWorkflowInboxMessageOptions' class allows the developer to specify whether the broadcasting will occur synchronously or asynchronously. The update also includes a new Endpoint and Workflow for demonstration and testing of this functionality.

* Update FastEndpoints packages to version 5.21.2

The current commit updates the version of all FastEndpoints packages from 5.20.1.7-beta to 5.21.2 in the 'Elsa.Api.Common' project. This ensures we are using the most recent stable release of these packages.

#4747

* Add decimal check in PolymorphicObjectConverter

In the PolymorphicObjectConverter class, the check for primitive types and specific object types was updated to include decimal.

Fixes #4714

* Refactor Dapper workflow and update migrations

Modified the store service to optimize the SaveManyAsync method by converting input to list only once. Also, enhanced deletion query in the store service to enable usage of different primary keys. Made changes in the Dapper migrations, replacing "NodeId" with "ActivityNodeId".

* Update workflow to use main branch and version 3.1.0

The workflow has been updated to work with updates on the 'main' branch rather than the 'v3.0.1' branch. Also, the version number for the 'VERSION' variable in preview mode has been updated to 3.1.0 from 3.0.1.

* Remove unnecessary Elsa Server activities

Deleted sample files: DataSourceActivity, MyEndpoint, and MyEventWorkflow from the Elsa Server Web bundle as part of our ongoing codebase optimization strategy. These files were no longer required and their removal simplifies our code structure.

* Update package workflow to reference v3.0.1

The GitHub actions workflow has been updated to pull from branch v3.0.1 instead of main. This change affects the commit verification and version setting steps, now using version 3.0.1-preview in the workflow process.

* Update Elsa.Studio packages to version 3.0.1-preview.196

This commit involves updating the versions of `Elsa.Studio`, `Elsa.Studio.Core.BlazorWasm`, and `Elsa.Studio.Login.BlazorWasm` packages in `Elsa.ServerAndStudio.Web.csproj` and `ElsaStudioWebAssembly.csproj` files to 3.0.1-preview.196. This update will incorporate the new changes and improvements included in this newer version.

* Update Elsa.Studio package versions

The Elsa.Studio and Elsa.Studio.Login.BlazorWasm package versions have been updated in the Elsa.Studio.Web project. Both package versions have been upgraded from 3.0.0 to 3.0.1-preview.196.

* Remove unused Workflow models and simplify AddStorageDriver method

The commit removes BackgroundExecutionOutcome and BackgroundExecutionResult models from Elsa.Workflows.Core, as they are no longer in use. Additionally, it simplifies the AddStorageDriver extension method in ModuleExtensions.cs, now it directly adds the service as an implementation of the IStorageDriver interface.

* Remove unnecessary dependencies in DefaultBackgroundActivityInvoker

Dependencies on IBookmarksPersister and IWorkflowStateExtractor have been removed in the DefaultBackgroundActivityInvoker.cs file. Additionally, an unused `using` statement for Elsa.Workflows.Helpers has been eliminated. This commit aims to declutter the code and increase its maintainability by eliminating unnecessary dependencies.

---------

Co-authored-by: Night Wu <lofrank@outlook.com>
Co-authored-by: admin <admin@admin.com>
2024-01-06 17:26:25 +01:00
Sipke Schoorstra 28849695d3 Fix conditional formatting in GitHub workflow
A change has been made to correct the formatting in the conditional statement within the GitHub workflow file. This rectification ensures the proper assignment of the VERSION variable when a new release is published, through proper syntax adherence.
2023-12-31 13:05:38 +01:00
Sipke Schoorstra 9c1ce0c82f Update version naming in GitHub Actions
The convention for naming versions in GitHub Actions was modified. Previously, all tags were assigned just a sequential version, even if they were already marked as a release by a tag. Now, if they are tagged and marked as a published release, they use the tag as the version. The change should provide more accurate version information.
2023-12-31 12:59:55 +01:00
Mohamed Ali 6ba6556cb4
Add Parser for Form data 'application/x-www-form-urlencoded' (#4733) 2023-12-31 10:11:47 +01:00
Sipke Schoorstra 8bb36de10f Add UIHint for FlowJoin activity
The FlowJoin activity's join mode now includes a UIHint, which indicates its input is a dropdown. This improves user interface interaction by allowing the selection of join mode from a dropdown menu rather than manual input.
2023-12-31 09:53:10 +01:00
Sipke Schoorstra cf3cab2fba Add non-generic variable accessor method
Added a non-generic version of the GetVariable method to the ExecutionContextProxy and GenerateWorkflowVariableAccessors classes in Elsa.CSharp module. Also, extended the CSharpOptions class to include additional namespaces and assemblies related to System.Text.Json. These adjustments provide a more flexible way to access workflow variables and extend the usability of JSON serialization within workflows.
2023-12-31 09:53:00 +01:00
Sipke Schoorstra af9862440f Improve handling of non-HTTP context in HttpEndpoint
Updated the HttpEndpoint class to handle non-HTTP contexts better. Instead of throwing an exception when it finds itself in a non-HTTP context, it now creates a bookmark that allows the invoker to save the state and resume execution from there. A callback has also been added to the bookmarks creation process to prepare for resumption actions.
2023-12-30 20:13:49 +01:00
Sipke Schoorstra 023ef267b5 Add System.Runtime to CSharpOptions
The System.Runtime assembly and namespace has been added to CSharpOptions. This extends the functionality capabilities within the Elsa.CSharp module by providing access to the Guid class and its related methods and properties.
2023-12-30 19:29:55 +01:00
Sipke Schoorstra eb0395e40f Update Elsa.Studio packages and modify authentication setup
The Elsa.Studio packages have been updated to version "3.0.0-preview.177" from "3.0.0-preview.174" in several project files. Additionally, in the "Program.cs" of ElsaStudioWebAssembly, the way the authentication handler is set up for the remote backend has been simplified and made more straightforward.
2023-12-29 21:54:27 +01:00
Sipke Schoorstra 01c2df380c Merge branch 'custom-uiprovider' into main 2023-12-29 21:50:34 +01:00
jdevillard b7c5f81906
Add sample CustomUIHandler (#4729)
* add sample CustomUIHandler

* Refactor code by renaming and moving classes

Renamed 'VehiculeActivity', 'VehiculeUIHandler' to 'VehicleActivity', 'VehicleUIHandler' and moved them to their separate files. A debouncer was added to InputsTab in the WorkflowDefinitionEditor to limit the rate of firing refresh requests. Optimized codes by reducing unnecessary lines and improved consistency in the 'Program.cs' file.

---------

Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2023-12-29 20:34:29 +01:00
Sipke Schoorstra d635226401 Refactor code by renaming and moving classes
Renamed 'VehiculeActivity', 'VehiculeUIHandler' to 'VehicleActivity', 'VehicleUIHandler' and moved them to their separate files. A debouncer was added to InputsTab in the WorkflowDefinitionEditor to limit the rate of firing refresh requests. Optimized codes by reducing unnecessary lines and improved consistency in the 'Program.cs' file.
2023-12-29 20:32:12 +01:00
Sipke Schoorstra cfb3d032ea Merge branch 'main' into custom-uiprovider 2023-12-29 19:44:18 +01:00
Sipke Schoorstra c33801de1f Add workflow result variable to context scope
In the ExpressionExecutionContextExtensions module, an additional check and yield operation has been implemented. This allows the inclusion of the workflow result variable, if it exists, to the current context scope.
2023-12-29 19:37:31 +01:00
Sipke Schoorstra d9781510f2 Refactor Elsa API client to use API key authentication
The Elsa API client configuration has been refactored to use API key for authentication instead of HTTP handlers. Besides, the configuration method name was changed to 'AddElsaApiKeyClient' and its parameters were simplified for ease of use. Object 'ElsaClientBuilderOptions' has also been extended with additional properties for further customization.
2023-12-29 19:23:11 +01:00
Sipke Schoorstra 17452f740c Improve variable resolution in workflow activity
Added a reference to Variable.Id in the SetVariable activity within the Elsa.Workflows.Core module to ensure the correct variable scope is utilized. This change enhances the precision of the variable resolution process by ensuring the correct variable is identified and updated.
2023-12-29 18:51:31 +01:00
Mohamed Ali cb4dfea8d3 Disable PythonEngine Shutdown to prevent deadlock 2023-12-29 15:37:43 +03:00
Sipke Schoorstra 3acd7f7c1e Add condition to return json as string
A condition has been added to check if the returnType is of type 'string'. If so, the json is returned as string directly without converting. This is particularly useful to avoid unnecessary conversion when the returnType is already a string.
2023-12-29 11:35:15 +01:00
Sipke Schoorstra 704d4cd834 Remove ElsaClient and related interfaces
Files ElsaClient.cs, IElsaClient.cs and IElsaClientFactory.cs have been deleted from the Elsa.Api.Client project. The commit also includes an update in the DependencyInjectionExtensions.cs file where IElsaClient service registration is removed, reflecting these changes.
2023-12-29 11:34:58 +01:00
Sipke Schoorstra 1d21cb3733 Add extension method to get workflow instance ID
This adds a new extension method in HttpResponseMessageExtensions class which retrieves the workflow instance ID from the response. It also includes a HeaderNames class to maintain the consistency of header names used by the Elsa API.
2023-12-29 09:30:51 +01:00
Sipke Schoorstra dc223bc273 Refactor parameter in AddElsaClient method
The parameter "configureOptions" in the AddElsaClient method has been renamed and refactored to allow direct HTTP client configuration. This change enables the actions for configuring the HTTP client to be passed directly, providing greater flexibility for customization.
2023-12-29 09:17:29 +01:00
Mohamed Ali 36791a5d25 Fix Httpendpoint Path 2023-12-29 10:51:13 +03:00
Jérémie DEVILLARD 6fe917cb7c add sample CustomUIHandler 2023-12-28 23:10:49 +01:00
Sipke Schoorstra bdc9d47c09 Add API key authentication for Elsa client
Introduced an `ApiKeyHttpMessageHandler` to use an API key as the authorization header for Elsa API client. This ensures secure interaction with the Elsa server. Also made updates to the `ElsaClientOptions` class to include the API key. An `AddElsaClient` method is added with the API key parameter in `DependencyInjectionExtensions` class for convenience.
2023-12-28 21:54:06 +01:00
Sipke Schoorstra 382abfdea1 Update Elsa.Studio packages to version 3.0.0-preview.174
The Elsa.Studio, Elsa.Studio.Login.BlazorWasm, and Elsa.Studio.Core.BlazorWasm packages have been updated to version 3.0.0-preview.174 across multiple projects. The updated packages should provide the latest functionalities and fixes from the Elsa framework.
2023-12-28 21:10:30 +01:00
Sipke Schoorstra 5d936ad34c Add UI hints for HTTP endpoint and single line fields
Introduced HttpEndpointPathUIHandler to provide additional UI options for the Path input field in the HTTP Endpoint activity. This commits also adds SingleLineProps to offer more options for SingleLine input fields across different modules. The implementation improves UI component interactions.
2023-12-28 20:52:04 +01:00
Sipke Schoorstra 5202b399c3 Add JSON editor UI hint to HTTP activities
This commit introduces a JSON editor UI hint to HTTP activities within Elsa Workflow. It includes creating new classes for a JSON editor options provider and a handler for this UI hint. Also, these additions are registered within the Elsa Workflow. The hint is applied to the 'RequestHeaders' and 'ResponseHeaders' input fields found in HTTP-related activity classes.
2023-12-28 20:21:02 +01:00
Sipke Schoorstra 2a5cf04207 Update HTTP endpoint authorization handler
The default authorization handler for HTTP endpoints is now the AuthenticationBasedHttpEndpointAuthorizationHandler instead of the AllowAnonymousHttpEndpointAuthorizationHandler. The configuration was updated in HttpFeature.cs and the override in Program.cs was removed. This provides more security to HTTP endpoints by requiring authentication.
2023-12-28 19:46:38 +01:00
Sipke Schoorstra fac292a9e3 Add UI hints to input fields in workflow core modules
Changed a number of instances in both activities and UI Hints classes across multiple modules in the workflow core to utilize UIHints. The UI hint "DropDown" has been added to relevant input fields to improve the user interface. Special handling for Enum properties in the drop-down options provider has also been created.
2023-12-28 19:41:55 +01:00
Sipke Schoorstra 0bf562f72c Add non-generic GetVariable method and Python accessors
A non-generic version of GetVariable method has been added to the ExecutionContextProxy.cs, allowing direct access to variables without specifying a type. To leverage this, Python accessors for getting and setting workflow variables have been added to GenerateWorkflowVariableAccessors.cs. This enhances the interaction between the Python scripts and the context variables.
2023-12-28 14:18:07 +01:00
Sipke Schoorstra 511f5b5aaf Update Elsa.Studio packages to version 3.0.0-preview.172
The packages Elsa.Studio, Elsa.Studio.Login.BlazorWasm and Elsa.Studio.Core.BlazorWasm have been updated to version 3.0.0-preview.172 in the Elsa.Studio.Web, Elsa.ServerAndStudio.Web, and ElsaStudioWebAssembly projects.
2023-12-28 11:19:54 +01:00
Sipke Schoorstra 14992cf5ec Add CodeEditorOptions, EditorHeight, and MultiLineOptions classes
This commit introduces three new classes to the CodeEditor namespace. CodeEditorOptions provides various configuration options for the code editor while EditorHeight defines available height options. MultiLineOptions is specifically built for managing multi-line editor settings.
2023-12-28 10:01:46 +01:00
Sipke Schoorstra a41a542856 Update Elsa.Studio package versions
The Elsa.Studio package versions in ElsaStudioWebAssembly project have been updated from "3.0.0-preview.164" to "3.0.0-preview.171". The packages include Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm.
2023-12-28 09:37:47 +01:00