Introduced `ConverterHelper` and `ExpandoObjectConverter` to handle conversions from .NET dynamic objects to JavaScript objects. Updated integration tests to validate the conversion and sorting functionalities.
Fixes#5895
* Add optional refresh parameter
Renamed several `RefreshDescriptors` methods to `RefreshDescriptorsAsync` to reflect their asynchronous nature consistently. Added an optional refresh parameter in the `ListActivityDescriptorsRequest` class and updated related endpoints to handle this parameter, triggering a registry refresh if necessary.
* Update version to 3.2.0-rc5 in GitHub Actions
Modified the `packages.yml` workflow to change the version from `3.2.0-rc4` to `3.2.0-rc5` for non-tagged releases. This ensures version consistency with the new release candidate.
Switched to dictionary index access for "ResumeAt" in Delay.cs to ensure more efficient updating. Added handling for byte[] in ObjectConverter.cs to correctly deserialize from base64 strings.
Introduced customizable database exception handlers across various modules, enabling specific error handling strategies for different DbContexts. Implemented a generic interface for exception handling and provided specific implementations for PostgreSQL and a No-op handler. Updated the code to utilize these handlers in various persistence features, enhancing error management and modularity.
This change integrates the MyEvent activity into the Elsa Workflow engine configuration. It ensures that the MyEvent activity is available for workflows in the console application. This setup is essential for utilizing custom events within the application's workflow definitions.
This commit changes the ElsaStudioVersion property from 3.2.0-rc3 to 3.2.0-rc4.473 in the Directory.Build.props file. This update ensures compatibility with the latest features and bug fixes in the new release candidate version.
The packages.yml file was modified to use version 3.2.0-rc4 instead of 3.2.0-rc3. This change ensures that the latest pre-release version is correctly set during the workflow execution.
* Refactor workflow context extension structure
Removed unused WorkflowContextWorkflowDefinitionExtensions and renamed several extension and middleware classes for clarity and consistency. Simplified context provider type handling using JsonArray in custom properties.
* Refactor context provider and update email workflow
Refactored `CustomerWorkflowContextProvider` to use constructor parameter directly, removing redundant fields and constructors. Updated comments and list syntax in `CustomerCommunicationsWorkflow`. Improved README.md documentation for workflow contexts and context providers.
* Adjust logging levels and improve workflow logic
Modified `appsettings.json` to reduce the verbosity of logging by adjusting log levels. Updated `CustomerCommunicationsWorkflow` to include a timer activity and simplified the workflow context parameter setting.
* Remove PropertyBag and related functionalities.
Deleted the PropertyBag class and extension methods, and removed all instances where PropertyBag was utilized across various modules. This simplifies the workflow configuration and management by relying solely on CustomProperties for storing metadata.
* Add workflow context management extensions and optimizations
Introduces `WorkflowExecutionContextExtensions` for loading and saving workflow contexts more efficiently. Replaces `JsonArray` usage with `List<object>` for context provider types, simplifying the type management in the workflow execution context. Streamlines `WorkflowContextActivityExecutionMiddleware` by removing redundant service scope creation and enhancing readability.
* Remove redundant timer in CustomerCommunicationsWorkflow
The timer activity that was set to not start the workflow has been removed to streamline the workflow process. Updated the README to include instructions on how to start the CustomerCommunicationsWorkflow using the REST API or Elsa Studio.
* Refactor middleware to streamline context management
Removed dependency on `IServiceScopeFactory` and refactored middleware to directly load and save workflow contexts. Simplified workflow context provider invocation, enhancing code readability and maintainability.
* Remove redundant PropertyBag property
The PropertyBag property was commented out and is no longer needed in the WorkflowDefinition class. This change removes the commented-out code to clean up the class definition.
* Add JsonSerializerOptions for deserialization
Introduce JsonSerializerOptions with camelCase policy and case insensitivity for property names. This ensures consistent deserialization of custom properties in activity workflow context settings.
* Add activity execution log sink
Introduced an interface `IActivityExecutionLogSink` for storing workflow execution log records and implemented it as `StoreActivityExecutionLogSink`. This centralizes and streamlines the handling of persisting execution logs into the workflow's runtime, thus making the process more modular and maintainable. The `PersistActivityExecutionLogMiddleware` has also been refactored to use this sink, replacing the direct usage of the workflow execution log store.
* Refactor logging interfaces and implementations
Replaced specific logging interfaces and implementations with generic ones. The individual interfaces for workflow and activity execution logging have been replaced with a single ILogRecordExtractor and ILogRecordSink interface. Specific implementations have been adjusted to use these new interfaces. This allows for greater flexibility and reuse of logging code.
* Introduce ILogRecordStore interface
The `ILogRecordStore` interface has been introduced to provide a centralized place for handling log records. Both `IActivityExecutionStore` and `IWorkflowExecutionLogStore` have been updated to inherit from this new interface. As a result of this change, the `SaveManyAsync` methods in these two interfaces have been removed to avoid redundancy.
Corrected the ElsaStudioVersion property to match the expected version format, removing the incorrect suffix. This ensures compatibility and proper version tracking in the build process.
Moved specific services from Scoped to Singleton in SchedulingFeature and SystemClockFeature for better performance and consistency. Refactored DefaultWorkflowScheduler to use a constructor with an IScheduler parameter and removed redundant private field. Removed attribute RequiresUnreferencedCode in WorkflowManagementFeature.
Unskip the test for workflow reload after updating the source provider and fix the issue with activity name formatting using Humanizer library. Ensure activity names are consistent for both workflow versions in the test.
* Rename and refactor journal update endpoint
Replaced `/workflow-instances/{id}/journal/has-updates` endpoint with `/workflow-instances/{id}/updated-at` to simplify API responses. Deleted `HasUpdates` related classes and introduced `GetUpdatedAtResponse` for consistency and clarity. Updated client contracts accordingly.
* Remove HasUpdates endpoint and refactor workflow observer
Deleted the HasUpdates endpoint and refactored related code to use an updated timestamp approach instead. Improved nullable handling in WorkflowInstanceDesigner and ensured proper observer disposal to avoid memory leaks. Updated workflow observer factory and observer implementations to support observer names and enhanced logging.
* Rename updated workflow instance endpoint and handle execution state
Renamed the endpoint from "/updated-at" to "/execution-state" to better reflect its purpose. Updated related response models and documentation to capture workflow execution state details such as status, sub-status, and last updated timestamp.
* Enable SignalR for real-time workflows
Add a flag to use SignalR and activate real-time workflows when enabled. Refactor code to wrap SignalR setup in conditional checks based on the new flag. This enhances the application's interactivity through real-time capabilities.
* Remove obsolete endpoints and rename execution state paths
Deleted the outdated Api1 and DynamicWorkflows endpoints under Elsa.Server.Web. Also, renamed paths related to execution state models and endpoint to remove "Journal" from the namespace for better clarity and organization.
* 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.
Introduced three new functions: `getWorkflowDefinitionId`, `getWorkflowDefinitionVersionId`, and `getWorkflowDefinitionVersion`. These functions provide easy access to specific workflow definition details within the JavaScript evaluator. Removed redundant constructor in CommonFunctionsDefinitionProvider to streamline the code.
This change updates the ElsaStudioVersion property to the latest release candidate. It ensures compatibility with recent updates and bug fixes provided in version 3.2.0-rc3.443.
Replaced the use of ActivityId with ActivityNodeId when retrieving distinct activity IDs. This change ensures that we are using the correct node identifier for logging workflow progress.
Refactor `AddElsaApiKeyClient`, `AddElsaClient`, and related methods to improve readability and maintainability. Introduced `AddDefaultApiClientsUsingApiKey`, `AddDefaultApiClients`, and `AddApiClients` for a more structured approach, consolidating redundant code and ensuring better configurability.
Enhanced the Revert endpoint to return a summary of the newly created workflow definition and include its location. Adjusted the API contract and endpoint configuration accordingly.
Included Elsa.Caching.Distributed.MassTransit and Elsa.Caching.Distributed as project references in Elsa.ServerAndStudio.Web.csproj. This integration aims to enhance caching capabilities in the application.
Introduced the DistributedCachingTransport enum to define caching transport options. Also cleaned up the code by removing an unnecessary using directive and a commented summary in the MassTransitBroker enum.
Deleted the project reference to Elsa.Server.Web.csproj from Elsa.ServerAndStudio.Web.csproj. This reference is no longer needed and was causing redundancy in the project configuration.