Commit graph

62 commits

Author SHA1 Message Date
Sipke Schoorstra 3decb12680
feat: extend shells integration and modular server support (#7399)
* refactor(deps): use local CShells project refs

Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules.

* Handle assembly load errors in feature discovery

Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files.

* Refactor configuration and service extension methods.

Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes.

* Introduce ManagementServiceCollectionExtensions to streamline activity and variable registration

Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy.

* Add resilience strategy registration to HTTP feature

Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods.

* Add new configuration options to JavaScriptFeature

Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine.

* refactor(workflows): unify graph caching

Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries.
Centralize cache creation and change-token registration to remove duplicated caching logic.
Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow.

* refactor(tests): centralize default IDs and materializer setup

Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases.

* extend(tests): enhance cache key verification in AutoUpdateTests

Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage.

* refactor(projects): update CShells project paths and solution configuration

Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration.

* Add `IWorkflowReferenceGraphBuilder` to `WorkflowManagementFeature`; rename `ResilienceShellFeature` to `ResilienceFeature`.

* Refactor `HttpFeature` to use `IMiddlewareShellFeature`, include `HttpWorkflowsMiddleware`, and update `HttpActivityOptions` defaults.

* Add `AddTypeAlias` and `AddVariableTypeAndAlias` extension methods to service collections

- Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases.
- Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases.

* Remove shell reload API endpoints, orchestrator, and associated tests from the codebase.

* Introduce `DefaultAdminUser` options and refactor `AdminUserInitializer` to use `IOptions`.

* Add user management endpoints: Delete, List, Update with enhanced user store functionality

* Implement `DefaultAdminUser` feature for initial admin bootstrap, decouple `SecurityRoot` from user management endpoints, update related documentation and permissions.

* Add role management endpoints: Delete, List, and Update, including role data models and handle obsolete SecurityRoot policy.

* Update CShells package references to version 0.0.12-preview.66 and refactor `TenantTaskManager` for improved task lifecycle management.

* Replace project references with package references in csproj files and remove unused folders.

* Integrate Nuplane features, add sample packages, and update dependency handling within ModularServer Web.

* Improve `CShells` startup endpoint registration and resolver handling

- Address duplicate endpoint registration by adding state-aware tracking and deduplication
- Resolve `WebRoutingShellResolver` constructor ambiguity by switching to factory-based registration
- Implement a startup-specific filter to prevent redundant endpoint remapping during `ShellsReloaded`
- Update project to use project references for `CShells` and `Nuplane` components in csproj files.

* Update logging configuration in appsettings for Development and Production

- Change default log level to 'Warning' in Development settings
- Adjust Microsoft.Hosting and Elsa.SamplePackage log levels to 'Information'
- Remove Microsoft.EntityFrameworkCore log level entry from Production settings

* Refactor assembly retrieval methods and update endpoint calls for consistency.

* Add `SampleEndpointFeature` and enhance logging and service integration

- Implement `SampleEndpointFeature` with a new endpoint for handling requests.
- Log endpoint access and integrate `ISampleService` with method `DoSomething`.
- Update logging configuration to include `CShells` and `Nuplane` log levels in Development settings.
- Update `Elsa.SamplePackage` to version 1.0.1 and manage dependencies with project and assembly references.
- Modify JSON configuration for `SampleEndpoint`.

* Update package versions for `CShells` to 0.0.13 and `Nuplane` to 0.0.1-preview.15 in props file.

* Refactor `DefaultAdminUserFeature` by renaming `ConfigureServices` to `Apply` and adjusting service registration method.

* Replace project references with package references across multiple projects and remove obsolete cshells-related solution entries.

* Remove `SampleCatalogEndpointExtensions.cs` and related endpoint mappings.

* Improve `TenantTaskManager` by using `TryRemove` for state clean-up and clarify `SemaphoreSlim` disposal behavior.

* Remove hardcoded default admin credentials and add warning for unconfigured AdminRoleName in admin user setup.

* Address unresolved review comments: fix doc comments, security defaults, compilation issue, and restore reload response contracts

Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9

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

* Refine reload endpoints: use specific exceptions, add error messages, rename ReloadedAt to Timestamp, remove unused model

Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9

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

* Potential fix for pull request finding 'Generic catch clause'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Potential fix for pull request finding 'Generic catch clause'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Potential fix for pull request finding 'Generic catch clause'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Add `ExceptionExtensions` with `IsFatal` method and simplify exception handling in `TenantTaskManager`. Remove unused properties from `Directory.Build.props`.

* Add unit tests for `TenantTaskManager` and fix potential state orphaning issue.

* Potential fix for pull request finding 'Generic catch clause'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Fix logger dependency in `SampleEndpointFeature` constructor to use correct type.

* Add unit tests for Elsa Shells API endpoints and update solution configuration.

* Refactor ShellReload models: remove ShellReloadItemResult, update ShellReloadResponse properties.

* Potential fix for pull request finding 'Generic catch clause'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-18 14:33:34 +02:00
Sipke Schoorstra ff487fad80 Merge remote-tracking branch 'origin/blueberry' into enh/multi-tenancy-refactorings 2024-10-11 19:45:40 +02:00
Sipke Schoorstra 7c31332529
Fix variable serialization (#5974)
* Improve dispatched workflow input handling

Addressed input handling in dispatch messages by adding `SerializedInput` property. Also removed initialization logic and moved input deserialization to a helper method, ensuring compatibility with both new and deprecated input property formats.

* Update workflow Docker images and version tags

Changed Docker image tags from v3-2-0-rc3 to v3-2-1-preview across multiple GitHub workflows. Updated the VERSION environment variable in packages.yml to reflect the new versioning scheme. These changes ensure consistency with the new preview release.

* Update versioning to include 'preview' in package workflow

Modified the workflow to append 'preview' to the version number for non-tagged builds. This ensures clearer differentiation between stable and non-stable versions in the CI pipeline.

* Add WorkflowInstanceStorageDriver for workflow variable storage

Introduced a new storage driver, WorkflowInstanceStorageDriver, to store workflow variables directly in the workflow state. Updated relevant classes and methods to incorporate this new storage driver, ensuring seamless read/write/delete operations and extending support for it throughout the codebase.

* Refactor object conversion and update variable retrieval.

Switched from JsonObject to JsonNode for object conversion and corrected a typo in the summary comment. Changed the return type of GetVariablesDictionary method and updated its implementation to use VariablesDictionary.

* Rename 'input' to 'serializedInput' in DispatchWorkflowDefinition.

This change clarifies that the input provided to the workflow should be serialized. It enhances the readability and accuracy of the code documentation, ensuring that developers understand the expected format of the input parameter.

* Add priority and deprecation attributes to storage drivers

Introduced a priority attribute to the `IStorageDriver` interface and implemented it in various storage drivers. Additionally, marked `WorkflowStorageDriver` as deprecated and reordered storage driver listing based on priority.

* Switch MassTransit broker to in-memory and refactor converter

Changed MassTransit broker from AzureServiceBus to in-memory for improved performance in development environment. Simplified PolymorphicObjectConverterFactory by removing redundant constructor and dependencies. Removed unused folder from the project file.
2024-09-19 16:18:56 +02:00
Sipke Schoorstra 329a79be2e
Secrets API (#5967)
* Add initial implementation for Elsa Secrets modules

This commit introduces new projects for managing secrets within the Elsa framework: `Elsa.Secrets.Api`, `Elsa.Secrets.Core`, and `Elsa.Secrets.Management`. These projects include essential interfaces, models, entities, and endpoints to handle secret storage, retrieval, and management. Specific features include API endpoints for listing secrets, models for secret filtering, and interfaces for encryption key handling.

* Add weavers

* Refactor encryption handling in secrets management

Implemented a new architecture for handling encryption keys and algorithms within the secrets management system. Replaced old encryption key entities and related interfaces with a more modular and extensible approach. Added new services and models to improve encryption and decryption processes, enhancing maintainability and scalability.

* Add IEncryptor interface for encryption functionality

Introduced the IEncryptor interface to standardize encryption operations within the Elsa.Secrets.Management module. This interface includes the EncryptAsync method to handle encryption using a specified key ID and value.

* Add dependency on SecretsFeature and configure secrets provider

Integrate the SecretsFeature dependency and configure a secrets provider within the SecretsManagementFeature class. This adds the StoreSecretProvider to the service collection and ensures the secrets provider is correctly set up. Also, rename method from WithSecretsProvider to UseSecretsProvider for clarity.

* Add EF Core and SQLite support for Secrets module

Introduced Entity Framework Core and SQLite support for the Secrets module, including migration files, EF Core configurations, context factory, and store implementation. Added necessary extensions and configuration code to integrate with the existing API and features. Included updates to the main web application to utilize the new persistence providers.

* Update Microsoft.SemanticKernel to version 1.18.2

Upgrade Microsoft.SemanticKernel package to the latest version to ensure compatibility and new features. Remove unused Elsa.Agents.Persistence using directive from Program.cs for code cleanliness.

* Update workflows and add Agents module

Changed workflow branch targets from `main` to `feature/secrets`. Updated Docker image tags and added the `Agents` module to the Elsa Studio WebAssembly project.

* Enable agent activities in workflow configuration

This change introduces the `.UseAgentActivities()` method in the workflow configuration, enhancing the workflow capabilities. By doing so, it ensures that agent activities are appropriately integrated and available for use in the application.

* Add EF Core migrations for MySQL and SQL Server

Added Entity Framework Core migrations and related configurations to support MySQL and SQL Server for the Agents Persistence module. These changes include new migration files, context factories, and project configurations.

* Fix migration assembly reference and update method syntax

Changed the migration assembly reference in SqlServerProvidersExtensions. Updated method syntax in WorkflowManagementFeature to use array shorthand format.

* Add secret management functionalities

Introduced secret management services with CRUD operations, notifications, and bulk actions. Added unique name generation and validation for secrets, and implemented corresponding API endpoints.

* Enhance Secret Management Feature

Added Elsa.Extensions import and updated MemorySecretStore registration to use the AddMemoryStore method with Secret. This improves code modularity and adheres to the updated registration method conventions.

* Remove encryption services and update migration

Removed multiple files related to encryption services and their dependencies, including encryption algorithms and key providers. Also updated a migration script to reflect schema changes, removing specific columns and constraints.

* Implement versioning and retrieval for secrets management

Added "IsLatest" flag and cloning mechanism for secrets to support versioning. Introduced a new API endpoint for fetching decrypted secret input models. Refactored encryption and decryption logic to handle empty values gracefully.

* Add secret management functionalities

Introduced services and interfaces for secret name generation, validation, and updating. Updated secret handling to include expiration metadata. Refactored methods in ISecretManager to streamline secret creation and update processes.

* Remove DisableSyntaxSelection class and references

Deleted the DisableSyntaxSelection class and its references from various files. This includes removing its registration as a Scoped service and associated usage in the `RunJavaScript` activity.

* Add new migration for secrets and update DefaultSecretManager

Re-created migration files for V3_3 to include the ExpiresIn column. Updated DefaultSecretManager to utilize identityGenerator for generating Id and SecretId, and added additional fields like CreatedAt, UpdatedAt, and IsLatest.
2024-09-15 17:12:13 -07:00
Sipke Schoorstra 283824fcfd
Enable Proto Actor Tracing for TraceLens (#5800)
* Add database initialization script and update dependencies

Added a script to initialize the 'tracelens' database and modified the Docker setup to include this script. Refactored and improved the ProtoActorFeature class, added OpenTelemetry dependencies, and updated project settings.

* Enable OpenTelemetry integration for Proto.Actor

Added OpenTelemetry environment configuration details to the README and included the Proto.OpenTelemetry package in the project file. Updated the ProtoActorFeature to apply tracing with OpenTelemetry to WorkflowInstanceActor.

* Refactor VariablePersistenceManager to use primary constructor

This refactor simplifies the VariablePersistenceManager by moving the storageDriverManager initialization into the primary constructor. It removes the redundant field and constructor, aligning with the concise nature of modern C# syntax, and ensures consistency in accessing the storageDriverManager throughout the class.

* Remove unused Open Telemetry code from Program.cs

The code for configuring Open Telemetry was commented out but not removed, cluttering the file. This commit cleans up Program.cs by deleting these unused lines, maintaining a cleaner and more readable codebase.

* Add metrics and tracing configurations for ProtoActorFeature

Introduced methods to enable metrics and tracing in ProtoActorFeature. Removed redundant properties and updated the workflow runtime to utilize the new configurations.

* Add Directory.Build.props for shared project settings

Introduce Directory.Build.props to centralize common project settings and dependencies. Consolidate target framework, language version, and package references to reduce duplication. Remove redundant property definitions from Elsa.Server.Web.csproj.

* Move apps from bundles to apps folder and Elsa module to modules folder
2024-07-19 20:23:32 +02:00
Sipke Schoorstra 827680b3c4 Merge remote-tracking branch 'origin/patch/3.2.x' 2024-07-18 18:25:49 +02:00
Sipke Schoorstra f448e9520a
Fix reloading logic for workflow definitions (#5781)
* Add reloading logic for workflow definitions

Introduced a new mechanism to handle reloaded workflow definitions. This includes creating a "ReloadedWorkflowDefinition" model, updating the caching logic, and modifying notification handlers to work with the enhanced workflow reloading logic. This ensures workflow definitions are updated and managed correctly when published, retracted, or deleted.

* Improve RefreshActivityRegistry documentation

Updated the XML documentation to clarify that `RefreshActivityRegistry` refreshes the `IActivityRegistry` for `WorkflowDefinitionActivityProvider` whenever workflow definitions are reloaded, instead of when they are published, retracted, or deleted.

* Add 'materializer' to user dictionary

The term 'materializer' has been added to the user dictionary to improve code spelling and naming consistency. This change ensures that 'materializer' is recognized as a correct term in the codebase.

* Organize test files by adding a 'Workflows' directory

Renamed 'http-workflow.json' to indicate it belongs under 'Workflows'. This improves file organization and clarity within the 'WorkflowDefinitionReload' scenario.

* Add TestWorkflowMaterializer and TestWorkflowProvider

Introduce `TestWorkflowMaterializer` for deserializing workflows from `TestWorkflowProvider`. Added integration of these new components in the `ReloadWorkflowTests` and `WorkflowServer`. Also renamed `RemoveReloadWorkflowTests` to `ReloadWorkflowTests`.

* Rename and expand workflow reload tests

Renamed `RemoveReloadWorkflowTests` to `ReloadWorkflowTests` to better reflect its purpose and expanded with additional test cases. Added tests to verify workflow and activity registry updates after source provider changes and workflow reloads.

* Update copy settings for workflow test scenarios

Reorganized and added 'CopyToOutputDirectory' settings for JSON files in workflow test scenarios. Ensured all necessary files are correctly included and copied during output directory builds to maintain test consistency.
2024-07-17 09:51:45 +02:00
Sipke Schoorstra ba2603ebd3
Add Bookmark Queue and Restore Background Activity Execution (#5758)
* Update package versions and add PrivateAssets attributes

Updated multiple package versions to the latest releases and added the `PrivateAssets="All"` attribute to several dependencies to improve project isolation. This ensures that the specified packages will not be propagated as transitive dependencies.

* Fix incorrect serializer and generator references.

Replaced `_payloadSerializer` and `_identityGenerator` with `payloadSerializer` and `identityGenerator` respectively. This resolves potential null reference issues and ensures the correct instances are used during workflow and definition processing.

* Refactor background activity scheduling logic

Moved the state commit outside of the deferred task to ensure workflow state is saved before scheduling activities. This change ensures the workflow instance is updated promptly, preventing potential concurrency issues.

* Add bookmark queue management system

Introduced a comprehensive bookmark queue system to manage and process bookmarks efficiently. This includes entities, stores, filters, processors, and workers for both in-memory and distributed environments. Additionally, added notifications to signal bookmark queue workers and updated related contracts.

* Add state commit handler with various implementations

Introduced ICommitStateHandler for committing workflow state. Provided NoopCommitStateHandler and StoreCommitStateHandler implementations. Updated namespaces and dependencies across the project to incorporate these changes.

* Fix order in CommitAsync method for proper task execution

Reorder `ExecuteDeferredTasksAsync` after `SaveAsync` in `CommitAsync` method to ensure that deferred tasks execute correctly after the state is saved, addressing potential issues with task execution dependencies.

* Remove unused and deprecated middleware and annotations

Deleted unused classes `ExecuteDeferredActivityTasks` and `ScheduleBackgroundActivitiesMiddleware`. Removed unnecessary summary tags and unused usings across multiple files to clean up the codebase.

* Remove unnecessary initial migration files

Deleted initial migration files for alterations, management, and identity contexts. These files are no longer needed and their removal helps keep the repository clean and maintainable.

* Add delay in TriggerBookmarkQueueWorker loop

Introduced a 10-second delay within the while loop of TriggerBookmarkQueueWorker. This change aims to alleviate potential tight loop issues, ensuring better performance and resource management.

* Enable all database providers in migration script

Uncomment the providers array and add previously commented database providers (SqlServer, Sqlite, PostgreSql, Oracle). This ensures compatibility with multiple database systems during the migration process.

* Remove unused Microsoft.Extensions.DependencyInjection import

The import statement for `Microsoft.Extensions.DependencyInjection` was not being utilized and has been removed. This cleanup helps in maintaining cleaner and more readable code without unnecessary imports.

* Add Dapper persistence support for bookmark queue

Introduced a new Dapper-based bookmark queue store and related classes for handling bookmark queue items. Various migrations were added to support the new `BookmarkQueueItems` table with tenant-specific columns. Refactored existing EF Core and in-memory bookmark queue item stores to use a unified interface.

* Add MongoBookmarkQueueStore implementation

Added a MongoDB-based BookmarkQueueStore to handle CRUD operations for bookmark queue items. Updated the workflow runtime persistence feature to include and utilize this new store for managing bookmark queue items.

* Add migration helper for altering columns and update keys

Introduced MigrationHelper to simplify altering DateTime and Boolean columns. Updated keys in KeyValueStore and KeyValueFilter classes to use 'Id' instead of 'Key'. Revised migration scripts to utilize the new helper methods for modifying column types.

* Prevent BookmarkQueueWorker.Stop from cancelling when not running

Previously, the Stop method would always cancel the token source regardless of the worker's state. By checking if the worker is running before cancelling, we avoid unnecessary operations and potential errors related to an already cancelled token source.

* Update database schema and bookmark handling logic

Refactored various database migration scripts to allow nullable `WorkflowInstanceId` fields and added new fields such as `ActivityInstanceId` and `CorrelationId`. Enhanced bookmark queue and bound workflow handling logic to support these new fields, ensuring precise and efficient workflow execution and queuing.

* Refactor BookmarkHash to StimulusHash and introduce ActivityTypeName

Renamed BookmarkHash to StimulusHash across multiple components and added ActivityTypeName to enhance traceability. Updated indices, filters, and entities for this change, ensuring consistent naming and improved functionality.

* Remove unnecessary timeouts in AzureServiceBusTests.

Eliminated redundant timeout parameters in _signalManager.WaitAsync calls to streamline test execution and reduce potential waiting time. This change ensures more efficient and accurate testing synchronization.

* Rename and refactor BookmarkQueueWorkerSignaler

Renamed IBookmarkQueueWorkerSignaler to IBookmarkQueueSignaler across the project for clarity. Updated related classes and methods to reflect this change. Added bookmark queue signaling to ensure new items are processed, and renamed BookmarkQueueStore to EFBookmarkQueueStore for consistency.

* Refactor EF Core stores and add migration field

Refactored EF Core store classes to simplify field usage and constructors. Added "CorrelationId" field and created corresponding index in SQLite and PostgreSQL migration files to support new functionality.

* Update workflow context ID and optimize Task handling

Added `ParentInstanceId` to `BulkDispatchWorkflowsStimulus` for context propagation. Also, reset `TaskCompletionSource` in `BookmarkQueueSignaler` to reduce memory usage and ensure proper task lifecycle management.

* Update async method signature and fix variable usage

Modified `AddAsync` to include the `OnSaveAsync` parameter. Corrected the variable used for `parentInstanceId` and utilized `ActivityTypeNameHelper` for generating type names.

* Reset migrations to 3.2

* Generate 3.3 migrations
2024-07-15 22:37:14 +02:00
Sipke Schoorstra fa44259cd1 Add serialization tests and refactor serialization classes
Implemented new integration tests for serialization of programmatic workflows. Additionally, major refactoring was performed on the serialization classes. This involved moving the classes to new namespaces and enhancing their functionalities to correctly handle null inputs and to support the serialization of activities and expressions. Also, updated Elsa.sln.DotSettings and JsonActivitySerializer to handle new serializers.
2024-02-06 08:45:54 +01:00
Sipke Schoorstra 611c72fa26 Implement Zstd compression and update related components
Removed ICompressionStrategyResolver interface and file, and added ICompressionCodec and ICompressionCodecResolver interface. Updated relevant classes for the new interface. Specifically, added Zstd class under Compression as a new compression method. Also modified WorkflowInstanceStore.cs, None.cs, EFCoreWorkflowInstanceStore.cs, GZip.cs, and ActivityExecutionLogStore.cs for uniform compression terminology.
2024-02-04 12:18:55 +01:00
Sipke Schoorstra bc7d52d94c Merge branch 'main' into issue(4875) 2024-02-04 00:17:20 +01:00
Sipke Schoorstra 277ac35bb1
Merge pull request #4868 from lahma/samples-to-root-level
Move samples to repository root
2024-02-04 00:14:47 +01:00
Sipke Schoorstra 0bfebccadb Add compression feature for workflow state data
This update adds a compression feature for workflow state data to reduce storage needs. A compression strategy resolver, None and GZip strategies have been implemented. Migration scripts were also updated, and a superfluous file(s) were removed.
2024-02-03 22:24:46 +01:00
Sipke Schoorstra 9c69eebe94 Add 'Unschedule' to UserDictionary
The term 'Unschedule' has been included to the UserDictionary within the Elsa solution settings. This update shows that 'Unschedule' is recognized in the context of the solution, thereby reducing the risk of related typographical errors.
2024-02-02 21:39:08 +01:00
Marko Lahma a4502e036b Move samples to repository root 2024-02-02 20:01:14 +02:00
Sipke Schoorstra 55737f24ae Refactor formatting and rearrange project reference order
Modified code formatting to enhance readability in several files including integration tests and workflow definitions. Order of project references in both Elsa.sln and Elsa.Server.Web.csproj files were rearranged. Unnecessary namespaces were also removed in BulkSuspendedWorkflow.cs and _build.csproj file saw a minor adjustment.
2024-01-26 19:55:01 +01:00
Sipke Schoorstra ae821b4494 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.
2023-12-18 16:04:33 +01:00
Sipke Schoorstra cc18e99d24 Refactor HTTP headers in Elsa
Removed HttpResponseHeaders class and refactored HttpRequestHeaders class into HttpHeaders. This commit merges the separate classes to represent HTTP headers into a single class, HttpHeaders. It also includes updates to the related files like HttpJavaScriptHandler and SendHttpRequestBase to reflect these changes.
2023-12-08 21:53:43 +01:00
Sipke Schoorstra 683f0ee6d8
Add Bulk Dispatch Workflow activity (#4683)
* Initial version of BulkDispatchWorkflow

* Update comments

* Refactor options models for running workflows and add Properties

* Fix resumption

* Add ability to provide arguments when evaluating expressions

* Update args syntax for JS

* Fix ProtoActor Runtime Properties mapping

* Use default constructor

* Provide completed workflow instance ID as input to BulkDispatchWorkflows

* Implement ChildFaulted port

* Switch to Publish to make Memory service bus work

* Update input evaluation and activity output retrieval

Refined the input evaluation process to only consider inputs with AutoEvaluate set to true. Added a comment to clarify the purpose of the GetActivitiesWithOutputs method. Removed the unnecessary check for AutoEvaluate from the EvaluateInputPropertyAsync method.
2023-12-06 22:32:08 +01:00
Sipke Schoorstra e4d6ad22c4
Decouple Expression Types (#4622)
* Refactor Expressions model

* Enable expression type filtering

* Implement dynamic enablement of satelite dependencies
2023-11-14 20:44:42 +01:00
Sipke Schoorstra 02ec4c2391
Include NodeId for unique addressability within graph (#4575)
* Leverage ActivityNode for graph querying

* Make workflow definition activity Root port non-browsable

* Update Join activity

* Make NodeId first-class citizen
2023-10-25 22:46:06 +02:00
Sipke Schoorstra cdf5f9f614 Rename Port Resolver to Activity Resolver
In the scenario where this resolver is used, it's not about discovering ports, but about constructing a graph from the workflow by going through each activity or activities property.
2023-10-15 11:31:24 +02:00
Sipke Schoorstra b7daf718f6 Remove incorrect default connection string values 2023-10-07 23:29:19 +02:00
Sipke Schoorstra 523f301bf7
Feature: Alterations (#4501)
* Implement Alteration types and engine

* Implement Alteration APIs

* Refactor activity work item with support for activity input

* Serialize scheduled activities as part of workflow state

* Add signal to schedule child activity

* Implement stores for plans and jobs

* Add EF Core provider

* Add Retry endpoint

* Keep root context as always active. The root context is the workflow execution context and contains persistent variable state

* Regenerate EF Core migrations

* Handle orphaned activity execution contexts

* Refactor workflow execution factory

* Enable configuring Jint from Program

* Update ModifyVariable alteration with support for type deserialization

* Use ShortGuid for identity

* Cleanup WorkflowServer host
2023-10-07 12:47:36 +02:00
Sipke Schoorstra bb2fa55d0e
WriteHttpFileResponse Activity (#4445)
* Incremental work on WriteFileHttpResponse activity

* BREAKING Schema change - Increase bookmark flexibility

* Implement zipped file response
2023-09-16 11:06:56 +02:00
Sipke Schoorstra d3d6b02d98
Cron activities (#3900)
* Add XML comments to Mediator module

* Add cron activity and services

* Implement activity descriptor modifiers and fix CRON cleanup
2023-04-12 21:10:07 +02:00
Sipke Schoorstra 7a09944732
Refactor scheduling and background activity execution (#3884)
* Refactor background activity execution

* Refactor scheduler

* Remove Jobs module

* Add XML comments
2023-04-09 23:35:32 +02:00
herblinernexxbizz dd919a4000
adding set var and main/sub workflow tests (#3855)
* Adding set var and main/sub workflow tests

* Deprecate SetWorkflowOutput and replace with SetOutput

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2023-04-03 14:14:39 +02:00
Sipke Schoorstra 57882a5a80 Add support for triggering event synchronous and specific workflow instance targeting 2023-03-20 21:38:00 +01:00
Sipke Schoorstra fad27d0fb0
Refactor composite activity input and scoped memory (#3815)
* Incremental work

* Enable control over when to include full compositie root

* Cleanup

* Update WorkflowDefinitionActivity

* Implement input as variables

* Delete unused class

* Remove less common types

* Rename ExpandoObject to JSON

* Implement variable scoping

* Remove parent/child relationship from MemoryRegister

* Add support for sending input to "trigger event" endpoint

* Add support for configuring input storage driver

* Remove unused namespace imports

* Auto-register activity types when running a workflow

* Fix missing variables from containers
2023-03-20 19:55:11 +01:00
gurkanguran 407bfa6913
Use workflow definition as activity (#3654)
* Implemented usage of workflow definitions as activities

* Updated designer

* Removed activity definitions module

* Allow user to mark workflow to be used as activity

* Refactor

* Refactor

* Cleanup csproj

* Cleanup WorkflowDefinitionActivity

* Pascalize typename

* Fix JS intellisense initial load issue

* Add XML comments

* Add Jobs dependency

* Hide Composite root port from designer

* Move finding workflow activities logic to lower level

* Generate unique identities across hierarchy

* Refactor

* Revert "Generate unique identities across hierarchy"

This reverts commit 74f5e7830309ee76af6ab3a000a5e1ec41f1e90c.

* Implement unique node IDs

* Introduce new VersionOptions option

* Remove unused namespaces

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2023-01-28 00:36:03 +01:00
Sipke Schoorstra 967b59d32d Fix redirect to homepage after token refresh 2023-01-25 12:34:07 +01:00
gurkanguran 0cadc9a712
Implemented PostgreSql provider for data persistence (#3581)
* Implemented PostgreSql provider for data persistence

* Refactor

Co-authored-by: Gürkan Güran <grkngrn@gmail.com>
2023-01-02 22:10:17 +01:00
Sipke Schoorstra e6536636d7
Additional samples + fixes and improvements (#3574)
* Incremental work on samples

* Rename HTTP middleware and update samples

* Rename HTTP Activities to Workflows

* Automatically register core activities when adding Elsa

* Fix feature registration bug

* Add default auth feature

* Make activity serializer more flexible

* Bump designer version

* Add workflow server + designer samples

* Simplify EntityFrameworkCore projects

* Update solution

* Add Sqlite package references to ensure the correct version is used

* Update sample project with EF Core

* Update EF extensions

* Add server + designer sample project

* Cleanup AllInOne project and add some XML comments

* Rename ci.yml and add CI for Docker file
2022-12-30 13:11:29 +01:00
Sipke Schoorstra c97457deea Cleanup 2022-12-26 18:38:41 +01:00
Sipke Schoorstra f27b26de8a Debug 2022-12-20 12:47:41 +01:00
Sipke Schoorstra 8cc8d1bcbf
Telnyx integration (#3453)
* Incremental work on Telnyx integration

* Incremental port of Telnyx activities

* Fix polymorphic JSON serialization for webhook data

* Fix IsFirstPass logic

* Fix trigger base to prevent activity auto completion

* Temporarily disable persistent snapshotting provider for testing

* Fix namespaces

* Add method to register activities in bulk using marker type

* Fix Telnyx refit client setup

* Register all Telnyx activities by default

* Incremental work on webhook driven resumption and correlation

* Incremental work on post-bookmark signaling

* Fix bookmark resolution

* Include correlation ID with bookmark

* Fix Telnyx resumption input

* Replace bookmark persisted signal with handler

* Fix SpeakText completion

* Add flow outcomes to SpeakText activity

* Update GatherUsingSpeak and GatherUsingaudio

* Refactor "is first pass" concept

* Fix WebhookEvent activity

* Add HTTP absolute URL provider

* Formatting and small changes

* Various API enhancements
2022-11-19 22:30:43 +01:00
Sipke Schoorstra 9a772af3c8
Implicit fork & join (#3331)
* Initial experiment with implicit fork and join construct

* Implement flow execution counters

* Incremental work on FlowJoin

* Implement bookmark removal behavior

* Set icon for FlowJoin
2022-10-10 15:08:30 +02:00
Sipke Schoorstra 4b0af64cee
Exportable & importable workflow state + execution (#3317)
* Incremental work on externalizing workflow state execution

* Finish resumable WriteHttpResponse
2022-10-04 11:57:01 +02:00
Sipke Schoorstra fccf4737e2
V3 modular configuration (#3070)
* Restructuring (WIP)

* Fix warnings

* Move DSL to modules

* Update namespaces

* Make design factory base reusable

* Update service registrations

* Remove unused namespaces and rename ElsaDbContext

* Incremental work on migrations

* Generate WorkflowsDbContext SQLite migrations

* Rename ServiceCollectionExtensions

* Update DbContextOptionsBuilderExtensions.cs

* Restructure

* Configuration refactorings (WIP)

* Incremental work on configurator API

* Incremental work on configuration API

* Incremental work on configuration API

* Fix workflow runtime options

* Move standard stream providers

* Implement configurator dependencies

* Cleanup configurator API

* Update configurator dependencies

* Cleanup

* Update Label API endpoints

* Fix eager configuration issue
2022-05-26 12:47:31 +02:00
Sipke Schoorstra 5f83198677 Refactor persistence configuration (memory + EF core) 2022-05-03 12:32:31 +02:00
Sipke Schoorstra 261c9cb1a5
Implement Default Workflow Invoker (#2979)
* Implement default invoker

* Proto actor improvements

* Refactor workflow registry handling

* Update migrations
2022-04-30 11:10:08 +02:00
Sipke Schoorstra 6b7caddca8 Refactor triggers 2022-03-07 12:01:27 +01:00
Sipke Schoorstra 689147b9ca Add sources from experimental repo 2022-01-04 09:42:12 +01:00
Sipke Schoorstra 42ce946d64 Reset 2022-01-04 09:38:11 +01:00
Sipke Schoorstra b007dc7574 Make boolean properties of ActivityInputAttribute non-nullable
Fixes #1390.
2021-09-03 13:10:00 +02:00
Sipke Schoorstra 1ee631b397 Deal with some warnings 2021-08-31 21:30:47 +02:00
Sipke Schoorstra 899551463e Refactor workflow collection and execution 2021-05-16 21:05:34 +02:00
Sipke Schoorstra a7a373583c Configure HTTP activities 2021-04-04 15:37:28 +02:00
Sipke Schoorstra 881f0acb7a Fix tests 2021-04-02 12:43:14 +02:00