2023-09-19 20:42:53 +00:00
|
|
|
using Elsa.Expressions.Options;
|
2022-12-31 15:16:43 +00:00
|
|
|
using Elsa.Extensions;
|
2022-05-27 10:36:39 +00:00
|
|
|
using Elsa.Features.Abstractions;
|
2022-11-23 10:20:00 +00:00
|
|
|
using Elsa.Features.Attributes;
|
2022-05-27 10:36:39 +00:00
|
|
|
using Elsa.Features.Services;
|
2022-10-25 13:52:55 +00:00
|
|
|
using Elsa.Http.ContentWriters;
|
2023-09-17 20:35:13 +00:00
|
|
|
using Elsa.Http.DownloadableContentHandlers;
|
|
|
|
|
using Elsa.Http.FileCaches;
|
2022-05-26 10:47:31 +00:00
|
|
|
using Elsa.Http.Handlers;
|
2023-04-17 13:23:05 +00:00
|
|
|
using Elsa.Http.HostedServices;
|
2022-05-26 10:47:31 +00:00
|
|
|
using Elsa.Http.Options;
|
2022-10-25 13:52:55 +00:00
|
|
|
using Elsa.Http.Parsers;
|
2023-03-11 21:14:39 +00:00
|
|
|
using Elsa.Http.PortResolvers;
|
2023-08-23 08:48:12 +00:00
|
|
|
using Elsa.Http.Selectors;
|
2022-05-26 10:47:31 +00:00
|
|
|
using Elsa.Http.Services;
|
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 17:56:29 +00:00
|
|
|
using Elsa.Http.UIHints;
|
2024-10-11 18:41:49 +00:00
|
|
|
using Elsa.Workflows;
|
2023-07-14 17:19:41 +00:00
|
|
|
using Elsa.Workflows.Management.Requests;
|
|
|
|
|
using Elsa.Workflows.Management.Responses;
|
2023-09-17 20:35:13 +00:00
|
|
|
using FluentStorage;
|
2023-01-16 18:42:45 +00:00
|
|
|
using Microsoft.AspNetCore.Http;
|
2023-09-16 09:43:34 +00:00
|
|
|
using Microsoft.AspNetCore.StaticFiles;
|
2022-05-26 10:47:31 +00:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2024-10-17 17:47:55 +00:00
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
2023-09-21 17:42:41 +00:00
|
|
|
using Microsoft.Extensions.Options;
|
2022-05-26 10:47:31 +00:00
|
|
|
|
2022-05-27 10:36:39 +00:00
|
|
|
namespace Elsa.Http.Features;
|
2022-05-26 10:47:31 +00:00
|
|
|
|
2023-02-15 11:09:45 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Installs services related to HTTP services and activities.
|
|
|
|
|
/// </summary>
|
Fix WorkflowActivity to Use Cached Workflow Definitions for Consistent Behavior (#5223)
* Replace IServiceScopeFactory with IServiceProvider in WorkflowRunner
Unused dependencies were removed from the workflow runner service. The IServiceScopeFactory was replaced with IServiceProvider to better handle the creation and deletion of service scopes, resulting in cleaner code with less manual scope management. Microsoft.Extensions.DependencyInjection and System.Diagnostics.CodeAnalysis were removed as they were no longer necessary.
* Refactor WorkflowDefinitionActivity to use WorkflowDefinitionService
The WorkflowDefinitionActivity class has been refactored to make use of the WorkflowDefinitionService instead of the WorkflowDefinitionStore. This fixes #5222 by ensuring the same activity instances are used in the graph model of the workflow execution context.
* Add workflow filtering and caching functionality
Added methods to `WorkflowDefinitionService` to find workflow definitions and workflows using filter criteria. A key generation method for caching filtered workflows was also added to `WorkflowDefinitionCacheManager`. The implementation includes generating a hash of the filter parameters and using this hash as a cache key, providing efficient caching functionality for filtered searches.
* Refactor TriggerIndexer to handle only ITrigger activities
The code in TriggerIndexer has been refactored to deal specifically with ITrigger activities, streamlining its behavior. Removed code related to handling non-ITrigger activities and simplified the workflow creation process. The extraction of "startable" nodes now directly filters and casts to ITrigger, reducing complexity and increasing readability.
* Update caching service to support filter-based search
The CachingWorkflowDefinitionService has been updated to support workflow definition and workflow search based on filter criteria. The update also includes change of class scope from public to internal. Further, it resolves the missing reference by switching from Elsa.Caching.Contracts to Elsa.Caching.
* Optimize Elsa project imports and use explicit cache variable names
This commit removes superfluous import references, relocates the 'IChangeTokenSignaler' contract into the 'Elsa.Caching' namespace, and replaces ambiguous 'cache' variable names with more explicit 'memoryCache' across several files. Additionally, new package references have been added and access modifiers have been changed to improve encapsulation. Cleanup enhances readability and maintainability of the codebase.
* Add .DotSettings file to Elsa.Caching module
A new .DotSettings file has been added to the Elsa.Caching module. This file is used for namespace configuration, specifically to skip the "contracts" folder in code inspections.
* Update workflow interfaces to support filter queries
The update extends `IWorkflowDefinitionCacheManager` and `IWorkflowDefinitionService` interfaces. Functions are added to allow creating filter cache keys and finding workflow definitions and workflows using a new `WorkflowDefinitionFilter`. This enhances querying flexibility by enabling filtered searches.
* Add WorkflowDefinitionVersionId to WorkflowTriggerEqualityComparer
A new property, WorkflowDefinitionVersionId, has been added to the object being serialized in WorkflowTriggerEqualityComparer. This change allows for a more accurate comparison between workflow triggers, considering not just the workflow definition ID but also its version.
* Update service registration types in WorkflowsFeature
Changed the registration type for both IHasher and IBookmarkHasher services from Scoped to Singleton in the workflows feature configuration. This alteration aims to improve application performance and manage service lifetimes more efficiently.
* Remove Open.Linq.AsyncExtensions dependency
The Open.Linq.AsyncExtensions package reference was removed across the project. The usage within the CachingWorkflowDefinitionStore was updated accordingly to maintain functionality.
* Move System.Linq.Dynamic.Core package reference
The System.Linq.Dynamic.Core package reference was moved from the Directory.Build.props file to the Elsa.Workflows.Management.csproj file. This change reflects the specific dependency of the Elsa.Workflows.Management module on System.Linq.Dynamic.Core, without impacting other modules.
* Implement caching for HTTP workflows
This update introduces caching mechanisms for HTTP workflows, which significantly improves their performance. The changes involve creating a `CacheManager` and `CachingHttpWorkflowLookupService`, and modifying some existing components to use the new caching mechanism. Additionally, the `HttpWorkflowsCacheManager` was renamed to `HttpWorkflowsCacheInvalidationManager` to better reflect its role.
* Refactor cache management across modules
This commit refactor the cache management across various modules. The 'ICacheManager' interface now includes methods for triggering and getting change tokens, and the 'HttpWorkflowsCacheInvalidationManager' has been renamed to 'HttpWorkflowsCacheManager'. The caching functionality in 'WorkflowDefinitionService' and other similar services have been updated to use these new methods, improving consistency and maintainability.
* Enable caching in Elsa.Server.Web
The "useCaching" variable has been set to true to enable caching. Simultaneously, the method name "UseCachingStores" has been refactored to "UseCache". Conditional statements have been added to check the "useCaching" variable before invoking caching.
* Rename method UseCaching to UseCache
In the Elsa.Server.Web and Elsa.Http project files, the method UseCaching has been renamed to UseCache. This modification is aimed at bridging naming inconsistencies and maintaining naming standards across the application.
* Update HttpCacheFeature class description
The class summary for HttpCacheFeature has been revised. Originally, it stated that the class was used for installing services related to HTTP services and activities, but it actually focuses more on HTTP caching.
* Remove unused Configure method from HttpCacheFeature
The Configure method in HttpCacheFeature was found to be redundant as it wasn't doing any significant work or contributing to any functionality. It has therefore been removed to clean up the code and avoid confusion.
* Add 'bug/*' to workflow triggers
This commit includes 'bug/*' to the list of triggers in our GitHub Actions workflow. Now, any push or pull request under a 'bug/*' branch will trigger the workflow.
2024-04-15 08:06:27 +00:00
|
|
|
[DependsOn(typeof(HttpJavaScriptFeature))]
|
2024-10-14 19:27:11 +00:00
|
|
|
public class HttpFeature(IModule module) : FeatureBase(module)
|
2022-05-26 10:47:31 +00:00
|
|
|
{
|
2024-10-14 19:27:11 +00:00
|
|
|
private Func<IServiceProvider, IHttpEndpointRoutesProvider> _httpEndpointRouteProvider = sp => sp.GetRequiredService<DefaultHttpEndpointRoutesProvider>();
|
2024-10-17 17:47:55 +00:00
|
|
|
private Func<IServiceProvider, IHttpEndpointBasePathProvider> _httpEndpointBasePathProvider = sp => sp.GetRequiredService<DefaultHttpEndpointBasePathProvider>();
|
2022-05-26 10:47:31 +00:00
|
|
|
|
2023-01-16 18:42:45 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// A delegate to configure <see cref="HttpActivityOptions"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Action<HttpActivityOptions>? ConfigureHttpOptions { get; set; }
|
|
|
|
|
|
2023-09-17 20:35:13 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// A delegate to configure <see cref="HttpFileCacheOptions"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Action<HttpFileCacheOptions>? ConfigureHttpFileCacheOptions { get; set; }
|
|
|
|
|
|
2023-02-15 11:09:45 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// A delegate that is invoked when authorizing an inbound HTTP request.
|
|
|
|
|
/// </summary>
|
2023-12-28 18:46:38 +00:00
|
|
|
public Func<IServiceProvider, IHttpEndpointAuthorizationHandler> HttpEndpointAuthorizationHandler { get; set; } = sp => sp.GetRequiredService<AuthenticationBasedHttpEndpointAuthorizationHandler>();
|
2023-03-08 08:49:43 +00:00
|
|
|
|
2023-02-15 11:09:45 +00:00
|
|
|
/// <summary>
|
2024-04-19 10:14:15 +00:00
|
|
|
/// A delegate that is invoked when an HTTP workflow faults.
|
2023-02-15 11:09:45 +00:00
|
|
|
/// </summary>
|
2023-09-19 20:42:53 +00:00
|
|
|
public Func<IServiceProvider, IHttpEndpointFaultHandler> HttpEndpointWorkflowFaultHandler { get; set; } = sp => sp.GetRequiredService<DefaultHttpEndpointFaultHandler>();
|
2023-09-17 20:35:13 +00:00
|
|
|
|
2023-09-16 09:43:34 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// A delegate to configure the <see cref="IContentTypeProvider"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Func<IServiceProvider, IContentTypeProvider> ContentTypeProvider { get; set; } = _ => new FileExtensionContentTypeProvider();
|
2022-05-26 10:47:31 +00:00
|
|
|
|
2023-09-17 20:35:13 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// A delegate to configure the <see cref="IFileCacheStorageProvider"/>.
|
|
|
|
|
/// </summary>
|
2023-09-21 17:42:41 +00:00
|
|
|
public Func<IServiceProvider, IFileCacheStorageProvider> FileCache { get; set; } = sp =>
|
2023-09-17 20:35:13 +00:00
|
|
|
{
|
2023-09-21 17:42:41 +00:00
|
|
|
var options = sp.GetRequiredService<IOptions<HttpFileCacheOptions>>().Value;
|
|
|
|
|
var blobStorage = StorageFactory.Blobs.DirectoryFiles(options.LocalCacheDirectory);
|
2023-09-17 20:35:13 +00:00
|
|
|
return new BlobFileCacheStorageProvider(blobStorage);
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-16 18:42:45 +00:00
|
|
|
/// <summary>
|
2023-03-07 12:45:58 +00:00
|
|
|
/// A delegate to configure the <see cref="HttpClient"/> used when by the <see cref="FlowSendHttpRequest"/> activity.
|
2023-01-16 18:42:45 +00:00
|
|
|
/// </summary>
|
|
|
|
|
public Action<IServiceProvider, HttpClient> HttpClient { get; set; } = (_, _) => { };
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A delegate to configure the <see cref="HttpClientBuilder"/> for <see cref="HttpClient"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Action<IHttpClientBuilder> HttpClientBuilder { get; set; } = _ => { };
|
|
|
|
|
|
2023-08-23 08:48:12 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// A list of <see cref="IHttpCorrelationIdSelector"/> types to register with the service collection.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ICollection<Type> HttpCorrelationIdSelectorTypes { get; } = new List<Type>
|
|
|
|
|
{
|
2023-09-17 20:35:13 +00:00
|
|
|
typeof(HeaderHttpCorrelationIdSelector),
|
2023-08-23 08:48:12 +00:00
|
|
|
typeof(QueryStringHttpCorrelationIdSelector)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A list of <see cref="IHttpWorkflowInstanceIdSelector"/> types to register with the service collection.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ICollection<Type> HttpWorkflowInstanceIdSelectorTypes { get; } = new List<Type>
|
|
|
|
|
{
|
2023-09-17 20:35:13 +00:00
|
|
|
typeof(HeaderHttpWorkflowInstanceIdSelector),
|
2023-08-23 08:48:12 +00:00
|
|
|
typeof(QueryStringHttpWorkflowInstanceIdSelector)
|
|
|
|
|
};
|
|
|
|
|
|
2024-10-14 19:27:11 +00:00
|
|
|
public HttpFeature WithHttpEndpointRoutesProvider<T>() where T : IHttpEndpointRoutesProvider
|
|
|
|
|
{
|
|
|
|
|
return WithHttpEndpointRoutesProvider(sp => sp.GetRequiredService<T>());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HttpFeature WithHttpEndpointRoutesProvider(Func<IServiceProvider, IHttpEndpointRoutesProvider> httpEndpointRouteProvider)
|
|
|
|
|
{
|
|
|
|
|
_httpEndpointRouteProvider = httpEndpointRouteProvider;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
2024-10-17 17:47:55 +00:00
|
|
|
|
|
|
|
|
public HttpFeature WithHttpEndpointBasePathProvider<T>() where T : class, IHttpEndpointBasePathProvider
|
|
|
|
|
{
|
|
|
|
|
Services.TryAddScoped<T>();
|
|
|
|
|
return WithHttpEndpointBasePathProvider(sp => sp.GetRequiredService<T>());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HttpFeature WithHttpEndpointBasePathProvider(Func<IServiceProvider, IHttpEndpointBasePathProvider> httpEndpointBasePathProvider)
|
|
|
|
|
{
|
|
|
|
|
_httpEndpointBasePathProvider = httpEndpointBasePathProvider;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
2024-10-14 19:27:11 +00:00
|
|
|
|
2022-11-27 12:28:43 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
|
public override void Configure()
|
2022-05-26 10:47:31 +00:00
|
|
|
{
|
2023-01-16 18:42:45 +00:00
|
|
|
Module.UseWorkflowManagement(management =>
|
2022-11-27 12:28:43 +00:00
|
|
|
{
|
2024-10-14 19:27:11 +00:00
|
|
|
management.AddVariableTypes([
|
|
|
|
|
typeof(HttpRouteData),
|
2023-01-16 18:42:45 +00:00
|
|
|
typeof(HttpRequest),
|
2023-03-07 13:54:21 +00:00
|
|
|
typeof(HttpResponse),
|
2023-04-10 13:32:40 +00:00
|
|
|
typeof(HttpResponseMessage),
|
2023-12-08 20:53:43 +00:00
|
|
|
typeof(HttpHeaders),
|
2024-06-13 20:13:53 +00:00
|
|
|
typeof(IFormFile),
|
|
|
|
|
typeof(HttpFile),
|
|
|
|
|
typeof(Downloadable)
|
2024-10-14 19:27:11 +00:00
|
|
|
], "HTTP");
|
2023-03-08 08:49:43 +00:00
|
|
|
|
2023-01-16 18:42:45 +00:00
|
|
|
management.AddActivitiesFrom<HttpFeature>();
|
|
|
|
|
});
|
2022-05-26 10:47:31 +00:00
|
|
|
}
|
|
|
|
|
|
2023-04-17 13:23:05 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
|
public override void ConfigureHostedServices()
|
|
|
|
|
{
|
|
|
|
|
ConfigureHostedService<UpdateRouteTableHostedService>();
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-27 12:28:43 +00:00
|
|
|
/// <inheritdoc />
|
2022-05-26 10:47:31 +00:00
|
|
|
public override void Apply()
|
|
|
|
|
{
|
2022-11-19 21:30:43 +00:00
|
|
|
var configureOptions = ConfigureHttpOptions ?? (options =>
|
|
|
|
|
{
|
|
|
|
|
options.BasePath = "/workflows";
|
|
|
|
|
options.BaseUrl = new Uri("http://localhost");
|
|
|
|
|
});
|
2023-01-16 18:42:45 +00:00
|
|
|
|
2023-09-17 20:35:13 +00:00
|
|
|
var configureFileCacheOptions = ConfigureHttpFileCacheOptions ?? (options => { options.TimeToLive = TimeSpan.FromDays(7); });
|
|
|
|
|
|
2022-11-19 21:30:43 +00:00
|
|
|
Services.Configure(configureOptions);
|
2023-09-17 20:35:13 +00:00
|
|
|
Services.Configure(configureFileCacheOptions);
|
2022-05-26 10:47:31 +00:00
|
|
|
|
2023-03-07 12:45:58 +00:00
|
|
|
var httpClientBuilder = Services.AddHttpClient<SendHttpRequestBase>(HttpClient);
|
2023-01-16 18:42:45 +00:00
|
|
|
HttpClientBuilder(httpClientBuilder);
|
|
|
|
|
|
2022-05-26 10:47:31 +00:00
|
|
|
Services
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
.AddScoped<IRouteMatcher, RouteMatcher>()
|
|
|
|
|
.AddScoped<IRouteTable, RouteTable>()
|
|
|
|
|
.AddScoped<IAbsoluteUrlProvider, DefaultAbsoluteUrlProvider>()
|
|
|
|
|
.AddScoped<IRouteTableUpdater, DefaultRouteTableUpdater>()
|
Fix WorkflowActivity to Use Cached Workflow Definitions for Consistent Behavior (#5223)
* Replace IServiceScopeFactory with IServiceProvider in WorkflowRunner
Unused dependencies were removed from the workflow runner service. The IServiceScopeFactory was replaced with IServiceProvider to better handle the creation and deletion of service scopes, resulting in cleaner code with less manual scope management. Microsoft.Extensions.DependencyInjection and System.Diagnostics.CodeAnalysis were removed as they were no longer necessary.
* Refactor WorkflowDefinitionActivity to use WorkflowDefinitionService
The WorkflowDefinitionActivity class has been refactored to make use of the WorkflowDefinitionService instead of the WorkflowDefinitionStore. This fixes #5222 by ensuring the same activity instances are used in the graph model of the workflow execution context.
* Add workflow filtering and caching functionality
Added methods to `WorkflowDefinitionService` to find workflow definitions and workflows using filter criteria. A key generation method for caching filtered workflows was also added to `WorkflowDefinitionCacheManager`. The implementation includes generating a hash of the filter parameters and using this hash as a cache key, providing efficient caching functionality for filtered searches.
* Refactor TriggerIndexer to handle only ITrigger activities
The code in TriggerIndexer has been refactored to deal specifically with ITrigger activities, streamlining its behavior. Removed code related to handling non-ITrigger activities and simplified the workflow creation process. The extraction of "startable" nodes now directly filters and casts to ITrigger, reducing complexity and increasing readability.
* Update caching service to support filter-based search
The CachingWorkflowDefinitionService has been updated to support workflow definition and workflow search based on filter criteria. The update also includes change of class scope from public to internal. Further, it resolves the missing reference by switching from Elsa.Caching.Contracts to Elsa.Caching.
* Optimize Elsa project imports and use explicit cache variable names
This commit removes superfluous import references, relocates the 'IChangeTokenSignaler' contract into the 'Elsa.Caching' namespace, and replaces ambiguous 'cache' variable names with more explicit 'memoryCache' across several files. Additionally, new package references have been added and access modifiers have been changed to improve encapsulation. Cleanup enhances readability and maintainability of the codebase.
* Add .DotSettings file to Elsa.Caching module
A new .DotSettings file has been added to the Elsa.Caching module. This file is used for namespace configuration, specifically to skip the "contracts" folder in code inspections.
* Update workflow interfaces to support filter queries
The update extends `IWorkflowDefinitionCacheManager` and `IWorkflowDefinitionService` interfaces. Functions are added to allow creating filter cache keys and finding workflow definitions and workflows using a new `WorkflowDefinitionFilter`. This enhances querying flexibility by enabling filtered searches.
* Add WorkflowDefinitionVersionId to WorkflowTriggerEqualityComparer
A new property, WorkflowDefinitionVersionId, has been added to the object being serialized in WorkflowTriggerEqualityComparer. This change allows for a more accurate comparison between workflow triggers, considering not just the workflow definition ID but also its version.
* Update service registration types in WorkflowsFeature
Changed the registration type for both IHasher and IBookmarkHasher services from Scoped to Singleton in the workflows feature configuration. This alteration aims to improve application performance and manage service lifetimes more efficiently.
* Remove Open.Linq.AsyncExtensions dependency
The Open.Linq.AsyncExtensions package reference was removed across the project. The usage within the CachingWorkflowDefinitionStore was updated accordingly to maintain functionality.
* Move System.Linq.Dynamic.Core package reference
The System.Linq.Dynamic.Core package reference was moved from the Directory.Build.props file to the Elsa.Workflows.Management.csproj file. This change reflects the specific dependency of the Elsa.Workflows.Management module on System.Linq.Dynamic.Core, without impacting other modules.
* Implement caching for HTTP workflows
This update introduces caching mechanisms for HTTP workflows, which significantly improves their performance. The changes involve creating a `CacheManager` and `CachingHttpWorkflowLookupService`, and modifying some existing components to use the new caching mechanism. Additionally, the `HttpWorkflowsCacheManager` was renamed to `HttpWorkflowsCacheInvalidationManager` to better reflect its role.
* Refactor cache management across modules
This commit refactor the cache management across various modules. The 'ICacheManager' interface now includes methods for triggering and getting change tokens, and the 'HttpWorkflowsCacheInvalidationManager' has been renamed to 'HttpWorkflowsCacheManager'. The caching functionality in 'WorkflowDefinitionService' and other similar services have been updated to use these new methods, improving consistency and maintainability.
* Enable caching in Elsa.Server.Web
The "useCaching" variable has been set to true to enable caching. Simultaneously, the method name "UseCachingStores" has been refactored to "UseCache". Conditional statements have been added to check the "useCaching" variable before invoking caching.
* Rename method UseCaching to UseCache
In the Elsa.Server.Web and Elsa.Http project files, the method UseCaching has been renamed to UseCache. This modification is aimed at bridging naming inconsistencies and maintaining naming standards across the application.
* Update HttpCacheFeature class description
The class summary for HttpCacheFeature has been revised. Originally, it stated that the class was used for installing services related to HTTP services and activities, but it actually focuses more on HTTP caching.
* Remove unused Configure method from HttpCacheFeature
The Configure method in HttpCacheFeature was found to be redundant as it wasn't doing any significant work or contributing to any functionality. It has therefore been removed to clean up the code and avoid confusion.
* Add 'bug/*' to workflow triggers
This commit includes 'bug/*' to the list of triggers in our GitHub Actions workflow. Now, any push or pull request under a 'bug/*' branch will trigger the workflow.
2024-04-15 08:06:27 +00:00
|
|
|
.AddScoped<IHttpWorkflowLookupService, HttpWorkflowLookupService>()
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
.AddScoped(ContentTypeProvider)
|
2022-10-25 13:52:55 +00:00
|
|
|
.AddHttpContextAccessor()
|
Alterations with Queries (#5032)
* Remove Elsa.Alteration Handlers and implement workflow alteration activities
The Elsa.Alterations.Handlers, Services, and Endpoints have been removed and replaced with Elsa.Alterations.Activities for various steps in executing an alteration plan. These activities include submitting an alteration plan, generating alteration jobs, and dispatching alteration jobs. New models for ActivityFilter, AlterationWorkflowInstanceFilter, and alteration activity summaries are also introduced for better management of alteration plans.
* Add 'PrintMessage' custom activity and update naming rules
A new 'PrintMessage' activity has been added to the custom activities of the ConsoleApp, which simply writes a 'Hello world!' message. On top of this, the naming rules in the code styling settings have been expanded, introducing separate rules for instance and static private fields.
* Remove V3_1 database migration files
The V3_1 database migration files were deleted across all database providers, including MySql, SQL Server, SQLite and PostgreSQL. This is indicative of a rollback or significant revision to the data migration strategy.
* Update product version and modify tables in Elsa DB context
Updated "Elsa" DbSet product version from "7.0.11" to "7.0.14". Additionally, added new properties as well as modified existing ones in tables like "Elsa.KeyValues.Entities.SerializedKeyValuePair" to improve data structure. Also properly ignored certain entities in the Alterations DbContext.
* Add V3_1 migration for Elsa
This commit introduces the V3_1 migration for the Elsa module. Changes involve the introduction of new tables and alteration of existing tables. Specifically, a new 'KeyValuePairs' table was added and several columns on various tables were renamed or altered.
* Remove multiple Elsa.EfCore V3_1 migration files
The commit removes several migration files related to the V3_1 migration in multiple Elsa.EntityFrameworkCore modules including SqlServer, PostgreSQL, and SQLite. These files encompass changes in table structures and alterations.
* Update default value for ArgumentDefinition Type
The default value for the `Type` property in the `ArgumentDefinition` class was updated to `typeof(object)`. The `Type` property of `inputDefinition` in the `WorkflowBuilder` class was also modified to be set as `typeof(T)`. These modifications enable more flexible type handling.
* Refactor SafeSerializer and serialization services
The SafeSerializer service and related serialization services have been comprehensively refactored. This includes the removal of internal notifications, the incorporation of [RequiresUnreferencedCode] attributes, and changes in method signatures. Methods have been simplified to return ValueTasks directly from the JsonSerializer, and the notification sender dependency was removed.
* Add JSON serialization for alterations
Implemented a JSON serializer and a custom converter for the IAlteration interface in the Elsa.Alterations.Core.Serialization namespace. Also, introduced a new IJsonSerializer interface and an implementation for standard JSON serialization in Elsa.Common. These serialization changes enhance modularity and extensibility of JSON operations, and improve handling of IAlteration objects.
* Add "IsSystem" field to Workflow Definitions and Instances
This update introduces a new boolean field "IsSystem" to the Workflow Definition and Workflow Instance models. This field is designed to identify system workflows which aren't meant to be modified by users. Management and Runtime module code, API endpoints, database migrations, and related classes have been updated to include this new field. The MongoDB indices and Dapper migrations have been updated as well, and serialization/deserialization processes for these types have been modified to handle this new attribute.
* Remove outdated database migrations
Deleted database migration files from the MySql, SqlServer, and PostgreSql projects.
* Add V3_1 migration for Elsa.EntityFrameworkCore.Sqlite
This commit introduces the V3_1 migration for the Elsa.EntityFrameworkCore.Sqlite module. It includes changes in Alterations, Runtime, Management, and Identity contexts. These changes involve table alterations, addition of new columns, and creation of new tables. Each context alteration encapsulates relevant changes for specific functionalities of the module.
* Add `IsSystem` property to workflow classes
The `IsSystem` property has been added to several sections of the codebase related to workflows, such as `WorkflowStateMapper.cs`, `ListWorkflowDefinitionsRequest.cs`, `WorkflowDefinitionStore.cs`, and `ListWorkflowInstancesRequest.cs`. This property flag allows us to include or filter system workflows in our queries and results.
* Add 'UsedImplicitly' attribute to Alteration Handlers and Types
The 'UsedImplicitly' attribute from JetBrains.Annotations has been added to all Alteration Handlers and Alteration Types in the Elsa.Alterations module. This change specifies that these classes are being used implicitly and helps tools like ReSharper prevent false unused code detection.
* Update migration script for efcore-3.1
The migration script efcore-3.1.sh has been updated. Module "Alterations" and provider "Sqlite" are added back into the lists while unused elements are removed for cleanup. The script now covers all necessary modules and providers, improving its overall effectiveness.
* Remove PrintMessage class from Elsa.Server.Web bundle
This commit deletes the PrintMessage.cs file that was previously part of the Elsa.Server.Web bundle.
* Refactor MassTransit service configuration
This commit reduces line code length by merging splitted long lines into one, improves maintainability of code. It also updates the Service configuration and removes unused namespaces across files, which help to simplify the codebase. Changes have also been made to switch the MassTransit broker from RabbitMq to memory and adjust the endpoint name formatter configuration.
* Remove extra whitespace in Program.cs
Removed a trailing whitespace on the line declaring the useSqlServer constant in the Program.cs file. No functionality changes were made, simply a minor formatting correction to maintain clean and consistent code.
* Remove AlterationJsonConverter and update other files
The AlterationJsonConverter class has been removed, simplifying the serialization process. The AlterationSerializer.cs file was updated with additional attribute tags, giving more information about serialization expectations. Lastly, the AlterationSerializationOptionConfigurator.cs was simplified by removing unnecessary overrides and the Elsa.Alterations.Core.csproj file was tidied up by removing unused services folder reference.
* Refactor code for improved readability and maintainability
The diff shows changes across multiple files in multiple modules. Primarily, these changes revolve around formatting edits such as removing unnecessary spaces or line breaks and adjusting alignments. A significant change was also made to the MySQL server version in the `DbContextOptionsBuilder.cs` file. These adjustments help improve the readability and maintainability of the code, making it easier to understand and modify in future iterations.
* Remove unnecessary notification files and refactor code
Several files pertaining to workflow serialization notifications were deemed unnecessary and removed. The Endpoint class in the `Elsa.Workflows.Api` module has been refactored for efficient usage of the `IWorkflowDefinitionStore` store, and similarly the `HttpFeature.cs` and `DesignTimeDbContextFactoryBase.cs` files have been slightly refactored for better readability and optimization.
* Refactor HttpFeature class on variable types order
The variable types order within the HttpFeature class in the Elsa Http module has been reorganized for cleaner code. No functional changes have been made - only the order of the types has been rearranged. This refactoring contributes to better readability and code maintenance.
* Add 'issue/*' branch to GitHub workflow triggers
This update includes 'issue/*' branches in the trigger configuration of GitHub workflows. Now, these branches will trigger specified GitHub actions, facilitating more effective issue tracking and resolution.
* Change version option in WorkflowDefinitionManager
The version option in the WorkflowDefinitionManager has been updated. Previously it was set to "LatestAndPublished", but this has been changed to "LatestOrPublished", adjusting the way the manager handles workflow versions.
* Update GitHub Actions to remove duplicate branch pattern
Removed the duplicated 'issue/*' entry from the branch trigger list in packages.yml to prevent redundancy in GitHub Actions workflow triggers. This ensures workflows are triggered correctly and efficiently for branch patterns intended for CI processes.
* Refactor job generation in GenerateAlterationJobs
Refactored the GenerateAlterationJobs activity to enhance code readability and maintainability. Broke down the ExecuteAsync method into smaller, purpose-specific private methods and added the missing `Elsa.Alterations.Core.Models` namespace.
* Refactor consumer concatenation logic in MassTransitFeature
Removed the commented-out code that filtered temporary queues, simplifying the concatenation of consumer types with workflow message consumers.
* Refactor whitespace and improve readability
Removed extraneous whitespaces and reformatted the `IsEmpty` property for better code readability. This enhances the code structure without affecting functionality.
* Refactor MassTransitFeature configuration
Moved transport configuration logic into the dedicated `ConfigureInMemoryTransport` method and removed unused usings to simplify the `MassTransitFeature` class setup. This streamlines setting up MassTransit in-memory transport and improves code maintainability.
---------
Co-authored-by: Raymond den Haan <raymond.den.haan@nexxbiz.io>
Co-authored-by: Marius Vasile Vușcan <marius.vuscan@nexxbiz.io>
2024-03-13 19:34:46 +00:00
|
|
|
|
2023-11-14 19:44:42 +00:00
|
|
|
// Handlers.
|
|
|
|
|
.AddRequestHandler<ValidateWorkflowRequestHandler, ValidateWorkflowRequest, ValidateWorkflowResponse>()
|
|
|
|
|
.AddNotificationHandler<UpdateRouteTable>()
|
2022-10-25 13:52:55 +00:00
|
|
|
|
Add caching to workflow runtime and workflow management stores (#5174)
* Add caching to workflow runtime and workflow management stores
The update introduces caching to workflow runtime and workflow management stores to enhance performance. This is achieved by adding decorators for several stores, which cache records to reduce database fetches. Additionally, a signaler for change tokens allows for cache invalidation when changes occur. The MemoryCache feature has also been updated to include Scrutor for decoration and the caching duration can be configured through the new CachingOptions class.
* Refactor WorkflowsMiddleware for HTTP Endpoint bookmarks and triggers
The WorkflowsMiddleware has been extensively refactored to handle HTTP Endpoint bookmarks and triggers. This involves breaking down the InvokeAsync method by extracting parts of its functionality into separate helper methods such as FindTriggersAsync and FindBookmarksAsync. Moreover, Assist with authorization checks, workflow execution within request timeout, and handling of workflow faults has been improved to be more efficient and clearly segmented.
* Update HTTP endpoint authorization to use Workflow context
The authorization process in the AuthenticationBasedHttpEndpointAuthorizationHandler class has been updated to use the Workflow context instead of the WorkflowInstanceId string. The AuthorizeHttpEndpointContext model has been correspondingly changed to include a Workflow property, thereby strengthening the link between authorization and specific workflows.
* Add FindAsync methods to trigger and bookmark stores
The code adjustments add new FindAsync methods to the trigger and bookmark store contracts as well as all their concrete implementations (MongoDb, Memory and EFCore). These methods support fetching the first record matching a given filter. The adjustments also include minor syntax improvements and the addition of [UsedImplicitly] attributes where needed.
* Refactor WorkflowsMiddleware for improved workflow handling
The code was refactored to simplify the flow of handling workflows in the WorkflowsMiddleware class. Specifically, the methods to start and resume a workflow have been extracted to improve code readability. Further, handleErrorMiddlewares was also updated to better manage instances where no valid workflows or base paths are found.
* Add caching functionality to WorkflowsMiddleware
Added IMemoryCache usage in the WorkflowsMiddleware to cache lookup results for workflows and their associated triggers. This will reduce the number of database operations required when searching for workflows, thus improving performance. The cache is maintained for one minute before it is refreshed.
* Implement dynamic cache duration for workflows
The code has been updated to have a dynamic cache duration for the workflows instead of a hardcoded one minute. By using the CachingOptions service, the cache duration can now be set in the configuration making it more flexible and adaptable to different performance needs.
* Add HttpWorkflowsCacheManager for caching HTTP workflows
This commit includes the implementation of IHttpWorkflowsCacheManager for caching of HTTP workflows. New handlers have been added to invalidate cache on workflow updates. Additionally, WorkflowsMiddleware has been renamed to HttpWorkflowsMiddleware.
* Refactor workflow trigger handling and caching
The refactoring includes deletion of `IndexWorkflowTriggersHandler.cs` and creation of `IndexTriggers.cs` thus revising the workflow trigger indexing approach. Also, revamped the `ITriggerIndexer` interface which now handles deletion of triggers with specific workflow and filter. Furthermore, the caching mechanism in `HttpWorkflowsCacheManager.cs` is modified to handle eviction of workflow definitions and triggers separately boosting its efficiency.
* Add summary to IndexedWorkflowTriggers
A summary has been added to the 'IndexedWorkflowTriggers' class, providing a brief description. This description outlines that it represents a collection of indexed workflow triggers, promoting clearer understanding for future reference.
* Refactor memory caching feature into separate module
This commit separates the memory caching feature from the Elsa.Common module into a distinct Elsa.Caching module. This includes moving and renaming related files, such as the MemoryCacheFeature class and associated dependencies. The references in other modules and in the main solution file have been updated accordingly to include the new Elsa.Caching module.
* Add distributed caching and update async methods
Introduced a distributed caching feature with extensible change token signal publishing. Updated various cache-related methods to be asynchronous for improved performance and responsiveness. Also updated some workflow identity references for clarity.
* Add distributed caching with MassTransit support
This addition includes the implementation of a distributed caching system with MassTransit transport. The changes introduce necessary interfaces and services, new distributed caching feature along with the support for MassTransit as a transport option. Moreover, the instance management feature has been renamed to clustering feature for better clarity.
* Refactor queue naming and scope of MassTransitChangeTokenSignalPublisher
Queue name construction is adjusted in the RabbitMqServiceBusFeature and AzureServiceBusFeature modules for better organization and readability. MassTransitChangeTokenSignalPublisher is now a singleton service, ensuring the signal publisher can be shared across the application, increasing efficiency and performance. Also, introduced use of DistributedCacheFeature in MassTransitDistributedCacheFeature module for better modularization.
* Add caching capabilities to workflow definition service
This commit introduces caching to the workflow definition service, improving the performance for retrieving workflow definitions. 4 new classes have been created (`CachingWorkflowDefinitionService`, `EvictWorkflowDefinitionServiceCache`, `WorkflowDefinitionCacheManager`, and `IWorkflowDefinitionCacheManager`), and several existing classes have been updated to support caching. The caching also includes invalidation mechanisms, ensuring data consistency.
* Refactor caching mechanism in workflow definition
In the workflow definition module, the explicit caching functionality related to workflow definition versioning has been removed in favor of a more streamlined approach. Additionally, the manner in which services are registered has been altered. As a result, the caching now directly involves the overall workflow definition rather than individual versions, simplifying the caching logic and potentially improving the performance.
* Update MassTransitBroker and enable RealTimeWorkflows and SignalRHubs
The MassTransitBroker has been updated to Memory from RabbitMq. In addition, the RealTimeWorkflows and UseWorkflowsSignalRHubs features are now enabled in the code. This change will impact how the service communicates and processes real-time requests for workflow operations.
* Reformat variable types in HttpFeature
The reformatting involves a list of variable types in the HttpFeature module. Each type now appears on a new line for improved readability, making the code easier to maintain and review.
* Update HTTP workflows cache invalidation handler XML comment
* Remove unnecessary using directives
Unnecessary using directives were deleted across several files in the Elsa.Http module. This simplifies the code and will possibly improve execution speed. Specific deletions include those for Encoding, Unicode, Extensions, Collections.Generic, Linq, Text, and Tasks namespaces.
* Refactor HttpWorkflowsMiddleware constructor
This commit simplifies the HttpWorkflowsMiddleware class constructor. It removes the intermediary variables `_next` and `_options` and directly uses the passed arguments in the constructor. Now, the `next` and `options` parameters are used directly throughout the middleware.
* Simplify workflow retrieval in HttpWorkflowsMiddleware
This refactoring replaces the use of FindWorkflowDefinitionAsync and MaterializeWorkflowAsync with a single method, FindWorkflowAsync. This simplifies the middleware code and likely improves performance by reducing the number of database queries or service calls required to retrieve a workflow.
* Refactor workflow retrieval in HttpBookmarkProcessor
Simplified the workflow retrieval process in HttpBookmarkProcessor.cs. Replaced FindWorkflowDefinitionAsync and MaterializeWorkflowAsync methods with a single FindWorkflowAsync call. This reduces the complexity and improves efficiency in retrieving workflow.
* Optimize FindWorkflowAsync method in HttpWorkflowsCacheManager
Removed redundant lines of code to simplify workflow search functionality. This change simplified the FindWorkflowAsync method by directly calling the FindWorkflowAsync function in the workflowDefinitionService, thus increasing code readability and efficiency.
* Refactor Endpoint.cs for workflow retrieval
The method for obtaining a workflow in the Endpoint.cs script has been refactored and streamlined. The 'GetWorkflowDefinition' method is replaced by the 'GetWorkflowAsync' method which directly retrieves the workflow, without the intermediate step of materializing the workflow definition. This shortens the code and simplifies the process.
* Refactor InputFunctionsDefinitionProvider constructor
The constructor for InputFunctionsDefinitionProvider has been simplified by removing unnecessary private fields. Services are now directly used in the method instead of being stored in fields. This improves readability and reduces complexity in the class structure.
* Refactor WorkflowInstance with improved state handling
Simplified the methods for handling workflow and workflow state in the WorkflowInstance class. The refactoring also included some code clean-ups and variable renaming. The new implementation provides better readability and maintainability of the code by reducing unnecessary lines and improving structuring of objects and responses.
* Remove unused IBookmarkManager and update workflow functions
IBookmarkManager from ProtoActorWorkflowRuntime.cs file is removed due to its redundant status. Additionally, the "FindAsync" method has been updated to use a cancellation token. Also, annotations were added to the "ExportWorkflowStateAsync" and "ImportWorkflowStateAsync" methods to flag calls to functions that require unreferenced code.
* Remove unused ReSharper directive
Unused ReSharper directive in the file IndexTriggers.cs was identified and therefore removed. This change makes the code cleaner and easier to read.
* Update activity invocation in workflow runtime
Updated the DefaultBackgroundActivityInvoker service in the Elsa.Workflows.Runtime module to annotate the ExecuteAsync method with "RequiresUnreferencedCode" attribute. This change is made considering the potential code trimming issue. Additionally, simplified the process of fetching workflow by directly using FindWorkflowAsync method instead of FindWorkflowDefinitionAsync and MaterializeWorkflowAsync methods.
* Refactor code to simplify workflow definition loading
The code for finding and materializing workflow definitions has been simplified. Instead of loading the definition and materializing it into a workflow in separate steps, a new method called FindWorkflowAsync has been introduced to perform both actions at once. This reduces redundancy and makes the code more readable.
* Refactor WorkflowHostFactory to streamline workflow creation
This commit simplifies the workflow creation process in WorkflowHostFactory. It removes redundant code and extraneous methods, specifically the overloaded CreateAsync method which used WorkflowDefinition. Now, it directly finds and uses the Workflow instance, thereby simplifying the code base and improving maintainability.
* Refactor workflow retrieval in WorkflowInstance.cs
Changed the way workflow instances are retrieved from the WorkflowDefinitionService. Instead of obtaining the workflow definition and then materializing the workflow from it, the workflow is directly retrieved using the FindWorkflowAsync function. This simplifies the code and avoids unnecessary null-checks.
* Remove unnecessary whitespace in WorkflowInstance.cs
An extraneous whitespace character was identified and removed in the WorkflowInstance.cs file. This change contributes towards maintaining clean and readable code in the Elsa.ProtoActor module.
* Remove unnecessary comment in ProtoActorWorkflowRuntime
The unnecessary comment ("Load the workflow definition.") in the method TryStartWorkflowAsync of the ProtoActorWorkflowRuntime.cs file was removed. This is part of an ongoing effort to keep the codebase clean and readable.
* Update workflow management features and handlers
Added explicit notification handlers for DeleteWorkflowInstances and RefreshActivityRegistry in WorkflowManagementFeature.cs. Also, renamed RefreshActivityRegistryHandler.cs to RefreshActivityRegistry.cs for better clarity.
* Add multiple log record support to workflow execution log stores
The major change of this commit is the addition of methods to add multiple log records in the WorkflowExecutionLogStore, across different storage modules such as EntityFramework, MongoDB, Dapper, Elasticsearch and Memory. This ensures consistency and uniform behavior across different storage types. Furthermore, some reformatting and tidying up of the code were undertaken to maintain readability and clarity.
* Remove redundant workflow definition check
The workflow definition existence check and related service retrieval were removed from HttpWorkflowsMiddleware.cs. It was determined that this check was unnecessary as the workflow definition's existence is guaranteed at this point in the process, reducing redundancy in the code.
* Improve cancellation token usage in workflow execution
This commit refines the usage of cancellation tokens during the execution of workflows in Elsa.Server and HttpWorkflowsMiddleware. Previously, a cancellation token pair was created before ExecuteWithinTimeoutAsync was called, which limited duration control solely to that method. Now, cancellation tokens are included within ExecuteWithinTimeoutAsync method. This allows the method to observe any cancellation initiated by outer scopes, enhancing control over the timeout of operations.
* Add PersistStateAsync method to WorkflowHost
A new PersistStateAsync method has been added to the WorkflowHost, which enables the host to directly persist its own state. The method has been integrated into the DefaultWorkflowRuntime and HttpWorkflowsMiddleware. This update eliminates the need to continuously get instances of IWorkflowInstanceManager to save state, which improves efficiency and code readability.
* Refactor DefaultAlterationRunner service
This update simplifies the DefaultAlterationRunner service, reducing the number of code lines and removing unnecessary references. The workflow materialization step has been merged with the find workflow step, and unused namespaces have been dropped.
* Refine wording in IWorkflowHost interface documentation
The documentation for the 'CanStartWorkflowAsync' method in the IWorkflowHost interface has been cleaned up. The superfluous "or not" verbiage has been removed, making it easier to understand the method's function.
* Remove Redis from DistributedCachingTransport
The Redis option was removed from the DistributedCachingTransport enumeration. This transport isn't currently implemented.
* Remove 'useDistributedCaching' constant
The 'useDistributedCaching' constant was removed from `Program.cs`, and conditional logic was updated to use `distributedCachingTransport != DistributedCachingTransport.None`. A new option 'None' was added to the `DistributedCachingTransport` enum to facilitate this change.
* Update package tags in MassTransit project file
The package tags in the Elsa.Caching.Distributed.MassTransit project file was updated to consolidate the tags, changing 'mass-transit' to 'masstransit'. This change better aligns with standard naming conventions and improves searchability.
* Refactor distributed caching implementation
This commit involves an extensive refactor of the distributed caching implementation. Distributed caching related code and resources were moved into an independent 'Elsa.Caching.Distributed' module. The interface 'IDistributedChangeTokenSignaler' was deleted and its functionality was replaced by 'IChangeTokenSignalInvoker'.
* Refactor order of parameters in GetOrCreateAsync method
The order of parameters in the GetOrCreateAsync method within the CachingWorkflowDefinitionStore class has been changed. This change ensures that the `key` parameter is now first, followed by the `factory` parameter. This improves code readability and aligns with standard coding practices.
* Refactor cache retrieval in Workflow service
Refactoring was done to streamline the way objects are retrieved from cache in the Workflow service. Duplicated code was condensed into a new `GetFromCacheAsync` method, which is now called in the existing methods, thus increasing maintainability and reducing the possibility of errors.
* Update method descriptions and fix comments formatting
Method descriptions in various contracts have been updated to more accurately reflect their function regarding record addition and updating in the persistence store. All double comment markers (/// ///) have also been corrected to the standard (///) across multiple classes.
* Remove unused caching methods in ModuleExtensions
The commit removes the unused methods, `UseMemoryCache` and `UseDistributedCache` from the `ModuleExtensions.cs` file. The removal is part of a wider cleanup and refactoring effort to streamline the codebase and improve legibility.
* Remove redundant PrimaryKeyName in DapperWorkflowExecutionLogStore
The "PrimaryKeyName" constant was removed in DapperWorkflowExecutionLogStore. This change simplifies the initialization of the '_store' property, reducing unnecessary redundancy and complexity. The refactored code maintains the same functionality but improves readability and maintainability.
* Refactor SaveAsync methods in Elsa.Dapper Store
The SaveAsync functions have been updated in the Store.cs file inside the Elsa.Dapper module. They now include cancellation token parameters and specify that they add or update records, providing clearer distinction and flexibility.
* Refactor store initialization in Elsa.Dapper modules
Removed the redundant usage of primary keys during the store initialization across Elsa.Dapper module. Simplified the SaveAsync methods by removing the parameter for primary key, making the code cleaner and more maintainable. This refactoring does not affect the module's functionality.
* Refactor UserStore in Elsa.Dapper module
The code was adjusted to improve readability within the Elsa.Dapper module's UserStore. Two lines that were previously combined have now been separated into distinct lines, making the code structure more clear.
* Refactor constructor arguments in MongoDb module
Simplified several classes in the MongoDb module by injecting dependencies directly through the constructor instead of assigning them to private readonly fields. This improves readability and removes unnecessary code lines. Also added JetBrains.Annotations where applicable.
* Fix comment syntax in IWorkflowInstanceStore
A syntax error in the comments for the method SaveManyAsync (in IWorkflowInstanceStore interface) has been corrected. This change ensures that the remarks section of the method is properly formatted and correctly displayed in documentation.
* Remove ComputeBookmarkHash from IHttpWorkflowsCacheManager
The ComputeBookmarkHash method was removed from IHttpWorkflowsCacheManager to declutter the interface. The functionality was moved and adapted in the HttpWorkflowsMiddleware class to maintain the original functionality.
* Add logging to HttpWorkflowsMiddleware
In this update, the HttpWorkflowsMiddleware class has been modified to include logging. Specifically, warning logs have been added to track workflow-related processes and to notify if mentioned bookmarks or workflow instances are not found.
* Update consumer configuration in MassTransitFeature
This commit modifies the consumer configuration in the MassTransitFeature. Instead of hardcoding the consumer type to DispatchCancelWorkflowsRequestConsumer, it now uses the dynamic consumer type retrieved from the context, making the feature more adaptable for different scenarios.
* Change default MassTransitBroker to Memory
The default value for the variable useMassTransitBroker in Elsa.Server.Web's Program.cs file has been modified. It has been changed from RabbitMq to Memory to change the message broker used by MassTransit in the application.
* Remove Datadog.Trace package from Directory.Packages.props
The Datadog.Trace package with version 2.49.0 has been removed from the Directory.Packages.props file. This change reflects the fact that this package is no longer required in our project.
2024-04-10 09:51:40 +00:00
|
|
|
// Content parsers.
|
2024-01-21 09:52:46 +00:00
|
|
|
.AddSingleton<IHttpContentParser, JsonHttpContentParser>()
|
|
|
|
|
.AddSingleton<IHttpContentParser, XmlHttpContentParser>()
|
2024-06-13 20:13:53 +00:00
|
|
|
.AddSingleton<IHttpContentParser, PlainTextHttpContentParser>()
|
2024-05-28 19:06:22 +00:00
|
|
|
.AddSingleton<IHttpContentParser, TextHtmlHttpContentParser>()
|
2024-06-13 20:13:53 +00:00
|
|
|
.AddSingleton<IHttpContentParser, FileHttpContentParser>()
|
Add caching to workflow runtime and workflow management stores (#5174)
* Add caching to workflow runtime and workflow management stores
The update introduces caching to workflow runtime and workflow management stores to enhance performance. This is achieved by adding decorators for several stores, which cache records to reduce database fetches. Additionally, a signaler for change tokens allows for cache invalidation when changes occur. The MemoryCache feature has also been updated to include Scrutor for decoration and the caching duration can be configured through the new CachingOptions class.
* Refactor WorkflowsMiddleware for HTTP Endpoint bookmarks and triggers
The WorkflowsMiddleware has been extensively refactored to handle HTTP Endpoint bookmarks and triggers. This involves breaking down the InvokeAsync method by extracting parts of its functionality into separate helper methods such as FindTriggersAsync and FindBookmarksAsync. Moreover, Assist with authorization checks, workflow execution within request timeout, and handling of workflow faults has been improved to be more efficient and clearly segmented.
* Update HTTP endpoint authorization to use Workflow context
The authorization process in the AuthenticationBasedHttpEndpointAuthorizationHandler class has been updated to use the Workflow context instead of the WorkflowInstanceId string. The AuthorizeHttpEndpointContext model has been correspondingly changed to include a Workflow property, thereby strengthening the link between authorization and specific workflows.
* Add FindAsync methods to trigger and bookmark stores
The code adjustments add new FindAsync methods to the trigger and bookmark store contracts as well as all their concrete implementations (MongoDb, Memory and EFCore). These methods support fetching the first record matching a given filter. The adjustments also include minor syntax improvements and the addition of [UsedImplicitly] attributes where needed.
* Refactor WorkflowsMiddleware for improved workflow handling
The code was refactored to simplify the flow of handling workflows in the WorkflowsMiddleware class. Specifically, the methods to start and resume a workflow have been extracted to improve code readability. Further, handleErrorMiddlewares was also updated to better manage instances where no valid workflows or base paths are found.
* Add caching functionality to WorkflowsMiddleware
Added IMemoryCache usage in the WorkflowsMiddleware to cache lookup results for workflows and their associated triggers. This will reduce the number of database operations required when searching for workflows, thus improving performance. The cache is maintained for one minute before it is refreshed.
* Implement dynamic cache duration for workflows
The code has been updated to have a dynamic cache duration for the workflows instead of a hardcoded one minute. By using the CachingOptions service, the cache duration can now be set in the configuration making it more flexible and adaptable to different performance needs.
* Add HttpWorkflowsCacheManager for caching HTTP workflows
This commit includes the implementation of IHttpWorkflowsCacheManager for caching of HTTP workflows. New handlers have been added to invalidate cache on workflow updates. Additionally, WorkflowsMiddleware has been renamed to HttpWorkflowsMiddleware.
* Refactor workflow trigger handling and caching
The refactoring includes deletion of `IndexWorkflowTriggersHandler.cs` and creation of `IndexTriggers.cs` thus revising the workflow trigger indexing approach. Also, revamped the `ITriggerIndexer` interface which now handles deletion of triggers with specific workflow and filter. Furthermore, the caching mechanism in `HttpWorkflowsCacheManager.cs` is modified to handle eviction of workflow definitions and triggers separately boosting its efficiency.
* Add summary to IndexedWorkflowTriggers
A summary has been added to the 'IndexedWorkflowTriggers' class, providing a brief description. This description outlines that it represents a collection of indexed workflow triggers, promoting clearer understanding for future reference.
* Refactor memory caching feature into separate module
This commit separates the memory caching feature from the Elsa.Common module into a distinct Elsa.Caching module. This includes moving and renaming related files, such as the MemoryCacheFeature class and associated dependencies. The references in other modules and in the main solution file have been updated accordingly to include the new Elsa.Caching module.
* Add distributed caching and update async methods
Introduced a distributed caching feature with extensible change token signal publishing. Updated various cache-related methods to be asynchronous for improved performance and responsiveness. Also updated some workflow identity references for clarity.
* Add distributed caching with MassTransit support
This addition includes the implementation of a distributed caching system with MassTransit transport. The changes introduce necessary interfaces and services, new distributed caching feature along with the support for MassTransit as a transport option. Moreover, the instance management feature has been renamed to clustering feature for better clarity.
* Refactor queue naming and scope of MassTransitChangeTokenSignalPublisher
Queue name construction is adjusted in the RabbitMqServiceBusFeature and AzureServiceBusFeature modules for better organization and readability. MassTransitChangeTokenSignalPublisher is now a singleton service, ensuring the signal publisher can be shared across the application, increasing efficiency and performance. Also, introduced use of DistributedCacheFeature in MassTransitDistributedCacheFeature module for better modularization.
* Add caching capabilities to workflow definition service
This commit introduces caching to the workflow definition service, improving the performance for retrieving workflow definitions. 4 new classes have been created (`CachingWorkflowDefinitionService`, `EvictWorkflowDefinitionServiceCache`, `WorkflowDefinitionCacheManager`, and `IWorkflowDefinitionCacheManager`), and several existing classes have been updated to support caching. The caching also includes invalidation mechanisms, ensuring data consistency.
* Refactor caching mechanism in workflow definition
In the workflow definition module, the explicit caching functionality related to workflow definition versioning has been removed in favor of a more streamlined approach. Additionally, the manner in which services are registered has been altered. As a result, the caching now directly involves the overall workflow definition rather than individual versions, simplifying the caching logic and potentially improving the performance.
* Update MassTransitBroker and enable RealTimeWorkflows and SignalRHubs
The MassTransitBroker has been updated to Memory from RabbitMq. In addition, the RealTimeWorkflows and UseWorkflowsSignalRHubs features are now enabled in the code. This change will impact how the service communicates and processes real-time requests for workflow operations.
* Reformat variable types in HttpFeature
The reformatting involves a list of variable types in the HttpFeature module. Each type now appears on a new line for improved readability, making the code easier to maintain and review.
* Update HTTP workflows cache invalidation handler XML comment
* Remove unnecessary using directives
Unnecessary using directives were deleted across several files in the Elsa.Http module. This simplifies the code and will possibly improve execution speed. Specific deletions include those for Encoding, Unicode, Extensions, Collections.Generic, Linq, Text, and Tasks namespaces.
* Refactor HttpWorkflowsMiddleware constructor
This commit simplifies the HttpWorkflowsMiddleware class constructor. It removes the intermediary variables `_next` and `_options` and directly uses the passed arguments in the constructor. Now, the `next` and `options` parameters are used directly throughout the middleware.
* Simplify workflow retrieval in HttpWorkflowsMiddleware
This refactoring replaces the use of FindWorkflowDefinitionAsync and MaterializeWorkflowAsync with a single method, FindWorkflowAsync. This simplifies the middleware code and likely improves performance by reducing the number of database queries or service calls required to retrieve a workflow.
* Refactor workflow retrieval in HttpBookmarkProcessor
Simplified the workflow retrieval process in HttpBookmarkProcessor.cs. Replaced FindWorkflowDefinitionAsync and MaterializeWorkflowAsync methods with a single FindWorkflowAsync call. This reduces the complexity and improves efficiency in retrieving workflow.
* Optimize FindWorkflowAsync method in HttpWorkflowsCacheManager
Removed redundant lines of code to simplify workflow search functionality. This change simplified the FindWorkflowAsync method by directly calling the FindWorkflowAsync function in the workflowDefinitionService, thus increasing code readability and efficiency.
* Refactor Endpoint.cs for workflow retrieval
The method for obtaining a workflow in the Endpoint.cs script has been refactored and streamlined. The 'GetWorkflowDefinition' method is replaced by the 'GetWorkflowAsync' method which directly retrieves the workflow, without the intermediate step of materializing the workflow definition. This shortens the code and simplifies the process.
* Refactor InputFunctionsDefinitionProvider constructor
The constructor for InputFunctionsDefinitionProvider has been simplified by removing unnecessary private fields. Services are now directly used in the method instead of being stored in fields. This improves readability and reduces complexity in the class structure.
* Refactor WorkflowInstance with improved state handling
Simplified the methods for handling workflow and workflow state in the WorkflowInstance class. The refactoring also included some code clean-ups and variable renaming. The new implementation provides better readability and maintainability of the code by reducing unnecessary lines and improving structuring of objects and responses.
* Remove unused IBookmarkManager and update workflow functions
IBookmarkManager from ProtoActorWorkflowRuntime.cs file is removed due to its redundant status. Additionally, the "FindAsync" method has been updated to use a cancellation token. Also, annotations were added to the "ExportWorkflowStateAsync" and "ImportWorkflowStateAsync" methods to flag calls to functions that require unreferenced code.
* Remove unused ReSharper directive
Unused ReSharper directive in the file IndexTriggers.cs was identified and therefore removed. This change makes the code cleaner and easier to read.
* Update activity invocation in workflow runtime
Updated the DefaultBackgroundActivityInvoker service in the Elsa.Workflows.Runtime module to annotate the ExecuteAsync method with "RequiresUnreferencedCode" attribute. This change is made considering the potential code trimming issue. Additionally, simplified the process of fetching workflow by directly using FindWorkflowAsync method instead of FindWorkflowDefinitionAsync and MaterializeWorkflowAsync methods.
* Refactor code to simplify workflow definition loading
The code for finding and materializing workflow definitions has been simplified. Instead of loading the definition and materializing it into a workflow in separate steps, a new method called FindWorkflowAsync has been introduced to perform both actions at once. This reduces redundancy and makes the code more readable.
* Refactor WorkflowHostFactory to streamline workflow creation
This commit simplifies the workflow creation process in WorkflowHostFactory. It removes redundant code and extraneous methods, specifically the overloaded CreateAsync method which used WorkflowDefinition. Now, it directly finds and uses the Workflow instance, thereby simplifying the code base and improving maintainability.
* Refactor workflow retrieval in WorkflowInstance.cs
Changed the way workflow instances are retrieved from the WorkflowDefinitionService. Instead of obtaining the workflow definition and then materializing the workflow from it, the workflow is directly retrieved using the FindWorkflowAsync function. This simplifies the code and avoids unnecessary null-checks.
* Remove unnecessary whitespace in WorkflowInstance.cs
An extraneous whitespace character was identified and removed in the WorkflowInstance.cs file. This change contributes towards maintaining clean and readable code in the Elsa.ProtoActor module.
* Remove unnecessary comment in ProtoActorWorkflowRuntime
The unnecessary comment ("Load the workflow definition.") in the method TryStartWorkflowAsync of the ProtoActorWorkflowRuntime.cs file was removed. This is part of an ongoing effort to keep the codebase clean and readable.
* Update workflow management features and handlers
Added explicit notification handlers for DeleteWorkflowInstances and RefreshActivityRegistry in WorkflowManagementFeature.cs. Also, renamed RefreshActivityRegistryHandler.cs to RefreshActivityRegistry.cs for better clarity.
* Add multiple log record support to workflow execution log stores
The major change of this commit is the addition of methods to add multiple log records in the WorkflowExecutionLogStore, across different storage modules such as EntityFramework, MongoDB, Dapper, Elasticsearch and Memory. This ensures consistency and uniform behavior across different storage types. Furthermore, some reformatting and tidying up of the code were undertaken to maintain readability and clarity.
* Remove redundant workflow definition check
The workflow definition existence check and related service retrieval were removed from HttpWorkflowsMiddleware.cs. It was determined that this check was unnecessary as the workflow definition's existence is guaranteed at this point in the process, reducing redundancy in the code.
* Improve cancellation token usage in workflow execution
This commit refines the usage of cancellation tokens during the execution of workflows in Elsa.Server and HttpWorkflowsMiddleware. Previously, a cancellation token pair was created before ExecuteWithinTimeoutAsync was called, which limited duration control solely to that method. Now, cancellation tokens are included within ExecuteWithinTimeoutAsync method. This allows the method to observe any cancellation initiated by outer scopes, enhancing control over the timeout of operations.
* Add PersistStateAsync method to WorkflowHost
A new PersistStateAsync method has been added to the WorkflowHost, which enables the host to directly persist its own state. The method has been integrated into the DefaultWorkflowRuntime and HttpWorkflowsMiddleware. This update eliminates the need to continuously get instances of IWorkflowInstanceManager to save state, which improves efficiency and code readability.
* Refactor DefaultAlterationRunner service
This update simplifies the DefaultAlterationRunner service, reducing the number of code lines and removing unnecessary references. The workflow materialization step has been merged with the find workflow step, and unused namespaces have been dropped.
* Refine wording in IWorkflowHost interface documentation
The documentation for the 'CanStartWorkflowAsync' method in the IWorkflowHost interface has been cleaned up. The superfluous "or not" verbiage has been removed, making it easier to understand the method's function.
* Remove Redis from DistributedCachingTransport
The Redis option was removed from the DistributedCachingTransport enumeration. This transport isn't currently implemented.
* Remove 'useDistributedCaching' constant
The 'useDistributedCaching' constant was removed from `Program.cs`, and conditional logic was updated to use `distributedCachingTransport != DistributedCachingTransport.None`. A new option 'None' was added to the `DistributedCachingTransport` enum to facilitate this change.
* Update package tags in MassTransit project file
The package tags in the Elsa.Caching.Distributed.MassTransit project file was updated to consolidate the tags, changing 'mass-transit' to 'masstransit'. This change better aligns with standard naming conventions and improves searchability.
* Refactor distributed caching implementation
This commit involves an extensive refactor of the distributed caching implementation. Distributed caching related code and resources were moved into an independent 'Elsa.Caching.Distributed' module. The interface 'IDistributedChangeTokenSignaler' was deleted and its functionality was replaced by 'IChangeTokenSignalInvoker'.
* Refactor order of parameters in GetOrCreateAsync method
The order of parameters in the GetOrCreateAsync method within the CachingWorkflowDefinitionStore class has been changed. This change ensures that the `key` parameter is now first, followed by the `factory` parameter. This improves code readability and aligns with standard coding practices.
* Refactor cache retrieval in Workflow service
Refactoring was done to streamline the way objects are retrieved from cache in the Workflow service. Duplicated code was condensed into a new `GetFromCacheAsync` method, which is now called in the existing methods, thus increasing maintainability and reducing the possibility of errors.
* Update method descriptions and fix comments formatting
Method descriptions in various contracts have been updated to more accurately reflect their function regarding record addition and updating in the persistence store. All double comment markers (/// ///) have also been corrected to the standard (///) across multiple classes.
* Remove unused caching methods in ModuleExtensions
The commit removes the unused methods, `UseMemoryCache` and `UseDistributedCache` from the `ModuleExtensions.cs` file. The removal is part of a wider cleanup and refactoring effort to streamline the codebase and improve legibility.
* Remove redundant PrimaryKeyName in DapperWorkflowExecutionLogStore
The "PrimaryKeyName" constant was removed in DapperWorkflowExecutionLogStore. This change simplifies the initialization of the '_store' property, reducing unnecessary redundancy and complexity. The refactored code maintains the same functionality but improves readability and maintainability.
* Refactor SaveAsync methods in Elsa.Dapper Store
The SaveAsync functions have been updated in the Store.cs file inside the Elsa.Dapper module. They now include cancellation token parameters and specify that they add or update records, providing clearer distinction and flexibility.
* Refactor store initialization in Elsa.Dapper modules
Removed the redundant usage of primary keys during the store initialization across Elsa.Dapper module. Simplified the SaveAsync methods by removing the parameter for primary key, making the code cleaner and more maintainable. This refactoring does not affect the module's functionality.
* Refactor UserStore in Elsa.Dapper module
The code was adjusted to improve readability within the Elsa.Dapper module's UserStore. Two lines that were previously combined have now been separated into distinct lines, making the code structure more clear.
* Refactor constructor arguments in MongoDb module
Simplified several classes in the MongoDb module by injecting dependencies directly through the constructor instead of assigning them to private readonly fields. This improves readability and removes unnecessary code lines. Also added JetBrains.Annotations where applicable.
* Fix comment syntax in IWorkflowInstanceStore
A syntax error in the comments for the method SaveManyAsync (in IWorkflowInstanceStore interface) has been corrected. This change ensures that the remarks section of the method is properly formatted and correctly displayed in documentation.
* Remove ComputeBookmarkHash from IHttpWorkflowsCacheManager
The ComputeBookmarkHash method was removed from IHttpWorkflowsCacheManager to declutter the interface. The functionality was moved and adapted in the HttpWorkflowsMiddleware class to maintain the original functionality.
* Add logging to HttpWorkflowsMiddleware
In this update, the HttpWorkflowsMiddleware class has been modified to include logging. Specifically, warning logs have been added to track workflow-related processes and to notify if mentioned bookmarks or workflow instances are not found.
* Update consumer configuration in MassTransitFeature
This commit modifies the consumer configuration in the MassTransitFeature. Instead of hardcoding the consumer type to DispatchCancelWorkflowsRequestConsumer, it now uses the dynamic consumer type retrieved from the context, making the feature more adaptable for different scenarios.
* Change default MassTransitBroker to Memory
The default value for the variable useMassTransitBroker in Elsa.Server.Web's Program.cs file has been modified. It has been changed from RabbitMq to Memory to change the message broker used by MassTransit in the application.
* Remove Datadog.Trace package from Directory.Packages.props
The Datadog.Trace package with version 2.49.0 has been removed from the Directory.Packages.props file. This change reflects the fact that this package is no longer required in our project.
2024-04-10 09:51:40 +00:00
|
|
|
|
2023-01-24 21:39:31 +00:00
|
|
|
// HTTP content factories.
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
.AddScoped<IHttpContentFactory, TextContentFactory>()
|
|
|
|
|
.AddScoped<IHttpContentFactory, JsonContentFactory>()
|
|
|
|
|
.AddScoped<IHttpContentFactory, XmlContentFactory>()
|
|
|
|
|
.AddScoped<IHttpContentFactory, FormUrlEncodedHttpContentFactory>()
|
2023-03-02 09:27:11 +00:00
|
|
|
|
2023-02-15 11:09:45 +00:00
|
|
|
// Activity property options providers.
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
.AddScoped<IPropertyUIHandler, HttpContentTypeOptionsProvider>()
|
2024-10-17 17:47:55 +00:00
|
|
|
.AddScoped(_httpEndpointBasePathProvider)
|
2023-05-11 20:58:59 +00:00
|
|
|
|
2023-03-11 21:14:39 +00:00
|
|
|
// Port resolvers.
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
.AddScoped<IActivityResolver, SendHttpRequestActivityResolver>()
|
2023-03-02 09:27:11 +00:00
|
|
|
|
2023-09-16 09:06:56 +00:00
|
|
|
// HTTP endpoint handlers.
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
.AddScoped<AuthenticationBasedHttpEndpointAuthorizationHandler>()
|
|
|
|
|
.AddScoped<AllowAnonymousHttpEndpointAuthorizationHandler>()
|
|
|
|
|
.AddScoped<DefaultHttpEndpointFaultHandler>()
|
2024-10-14 19:27:11 +00:00
|
|
|
.AddScoped<DefaultHttpEndpointRoutesProvider>()
|
2024-10-19 08:40:36 +00:00
|
|
|
.AddScoped<DefaultHttpEndpointBasePathProvider>()
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
.AddScoped(HttpEndpointWorkflowFaultHandler)
|
|
|
|
|
.AddScoped(HttpEndpointAuthorizationHandler)
|
2024-10-14 19:27:11 +00:00
|
|
|
.AddScoped(_httpEndpointRouteProvider)
|
2023-09-17 20:35:13 +00:00
|
|
|
|
|
|
|
|
// Downloadable content handlers.
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
.AddScoped<IDownloadableManager, DefaultDownloadableManager>()
|
|
|
|
|
.AddScoped<IDownloadableContentHandler, MultiDownloadableContentHandler>()
|
|
|
|
|
.AddScoped<IDownloadableContentHandler, BinaryDownloadableContentHandler>()
|
|
|
|
|
.AddScoped<IDownloadableContentHandler, StreamDownloadableContentHandler>()
|
|
|
|
|
.AddScoped<IDownloadableContentHandler, FormFileDownloadableContentHandler>()
|
|
|
|
|
.AddScoped<IDownloadableContentHandler, DownloadableDownloadableContentHandler>()
|
|
|
|
|
.AddScoped<IDownloadableContentHandler, UrlDownloadableContentHandler>()
|
2024-04-19 10:14:15 +00:00
|
|
|
.AddScoped<IDownloadableContentHandler, StringDownloadableContentHandler>()
|
2024-06-13 20:13:53 +00:00
|
|
|
.AddScoped<IDownloadableContentHandler, HttpFileDownloadableContentHandler>()
|
2023-09-17 20:35:13 +00:00
|
|
|
|
|
|
|
|
// File caches.
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
.AddScoped(FileCache)
|
|
|
|
|
.AddScoped<ZipManager>()
|
2023-05-11 20:58:59 +00:00
|
|
|
|
|
|
|
|
// AuthenticationBasedHttpEndpointAuthorizationHandler requires Authorization services.
|
|
|
|
|
// We could consider creating a separate module for installing authorization services.
|
|
|
|
|
.AddAuthorization();
|
2023-09-16 09:06:56 +00:00
|
|
|
|
|
|
|
|
// HTTP clients.
|
|
|
|
|
Services.AddHttpClient<IFileDownloader, HttpClientFileDownloader>();
|
2023-09-17 20:35:13 +00:00
|
|
|
|
2023-08-23 08:48:12 +00:00
|
|
|
// Add selectors.
|
2023-09-17 20:35:13 +00:00
|
|
|
foreach (var httpCorrelationIdSelectorType in HttpCorrelationIdSelectorTypes)
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
Services.AddScoped(typeof(IHttpCorrelationIdSelector), httpCorrelationIdSelectorType);
|
2023-09-17 20:35:13 +00:00
|
|
|
|
2023-08-23 08:48:12 +00:00
|
|
|
foreach (var httpWorkflowInstanceIdSelectorType in HttpWorkflowInstanceIdSelectorTypes)
|
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)
* feat(scoped): move dependencies to scoped instead of singleton if possible.
* fix(scoped): Timer and LiveTest
* fix(scoped): change scope of python and csharp features
* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy
* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher
* Update title in README.md
The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.
* Remove npm-packages workflow, adjust branch triggers in workflows
The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.
* Remove obsolete files from designer packages
Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.
* Add badges to README.md
The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.
* Update README with enhanced instructions for Elsa server and studio
The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.
* Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
* Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
* Renamed AI file
* Update Elsa.Studio package versions
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.
* Reorganize README and add Docker instructions
The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.
* Update description in README.md
The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.
* Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.
Fixes #4703
* Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
* Update README to add access information when user tried to run elsa with docker (#4708)
* [no ci] add link to Elsa 2 in README
* Remove Console and ASP.NET examples, simplify README.md
Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.
* Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
* Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
* Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.
Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
* Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
* Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
* Add methods to handle activity run asynchronously flag
New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.
* Add 'Persister' to UserDictionary in DotSettings
The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.
* Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
* Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
* 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.
* Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
* Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
* Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
* Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
* Refactor code for readability and improved logging
Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.
* Refactor code structure for ServiceBus Integration tests
Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.
* Remove specific activity instance bookmarks
The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.
* Update Elsa.Studio.Login.BlazorWasm version
The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.
* Update artwork
* Implement pagination for activity descriptor fetching
Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.
Closes #4689
* Refactor task payload extraction and update workflow builder
Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.
* Update localhost port for workflow sample
The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.
* Refactor ExpressionExecutionContextExtensions module
Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.
* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)
* Add capability to add Authorization Header without validation
* Refactor authorization header handling in HTTP requests
This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.
---------
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* 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>
* Update GitHub actions for packages publishing
This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.
* Update FastEndpoints package and enable JWT Bearer Auth
The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.
* Refactor input output assignment and JSON converter
The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.
* Enhanced script language support in Elsa.AllInOne.Web
This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.
* Add logging to PythonGlobalInterpreterManager
Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.
* Refactor project structure and Docker configurations
The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.
* Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
* Update Dockerfiles and add Python 3.11
Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.
* Update Dockerfiles for Python 3.11 installation
Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.
* Add Elsa.Studio.Web project to the solution
A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.
* Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
* Update Elsa.Studio package versions
Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.
* Update Elsa.Studio packages to version 3.0.0-preview.171
The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* add sample CustomUIHandler
* Fix Httpendpoint Path
* 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.
* 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.
* 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.
* 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.
* Disable PythonEngine Shutdown to prevent deadlock
* 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.
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* 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.
* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)
* 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.
* 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.
* Refactor variable names and update notification strategy
The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.
---------
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
* Update service lifetimes and use IServiceScopeFactory for runtime activities
This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.
---------
Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 13:52:53 +00:00
|
|
|
Services.AddScoped(typeof(IHttpWorkflowInstanceIdSelector), httpWorkflowInstanceIdSelectorType);
|
2023-09-19 20:42:53 +00:00
|
|
|
|
|
|
|
|
Services.Configure<ExpressionOptions>(options =>
|
|
|
|
|
{
|
2024-07-10 16:38:11 +00:00
|
|
|
options.AddTypeAlias<HttpRequest>("HttpRequest");
|
|
|
|
|
options.AddTypeAlias<HttpResponse>("HttpResponse");
|
|
|
|
|
options.AddTypeAlias<HttpResponseMessage>("HttpResponseMessage");
|
|
|
|
|
options.AddTypeAlias<HttpHeaders>("HttpHeaders");
|
2024-10-14 19:27:11 +00:00
|
|
|
options.AddTypeAlias<HttpRouteData>("RouteData");
|
2023-09-19 20:42:53 +00:00
|
|
|
options.AddTypeAlias<IFormFile>("FormFile");
|
|
|
|
|
options.AddTypeAlias<IFormFile[]>("FormFile[]");
|
2024-06-14 20:46:47 +00:00
|
|
|
options.AddTypeAlias<HttpFile>("HttpFile");
|
|
|
|
|
options.AddTypeAlias<HttpFile[]>("HttpFile[]");
|
|
|
|
|
options.AddTypeAlias<Downloadable>("Downloadable");
|
|
|
|
|
options.AddTypeAlias<Downloadable[]>("Downloadable[]");
|
2023-09-19 20:42:53 +00:00
|
|
|
});
|
2022-05-26 10:47:31 +00:00
|
|
|
}
|
|
|
|
|
}
|