Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Workflow Context Feature #5861

Merged
merged 9 commits into from
Aug 6, 2024
Merged

Conversation

sfmskywalker
Copy link
Member

@sfmskywalker sfmskywalker commented Aug 6, 2024

This PR refactors the Workflow Context implementation with fixes and improvements.


This change is Reviewable

Removed unused WorkflowContextWorkflowDefinitionExtensions and renamed several extension and middleware classes for clarity and consistency. Simplified context provider type handling using JsonArray in custom properties.
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.
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.
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.
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.
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.
Removed dependency on `IServiceScopeFactory` and refactored middleware to directly load and save workflow contexts. Simplified workflow context provider invocation, enhancing code readability and maintainability.
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.
Introduce JsonSerializerOptions with camelCase policy and case insensitivity for property names. This ensures consistent deserialization of custom properties in activity workflow context settings.
@sfmskywalker sfmskywalker merged commit d2fc7fb into patch/3.2.x Aug 6, 2024
2 checks passed
@sfmskywalker sfmskywalker deleted the workflow-context-rework branch August 6, 2024 20:36
fanslead pushed a commit to fanslead/elsa-core that referenced this pull request Aug 14, 2024
…core into feature/catchflow

* 'feature/catchflow' of https://github.com/fanslead/elsa-core: (200 commits)
  [Fix] Replace "bundles" with "apps" in the content of README.md to align with current source code structure. (elsa-workflows#5885)
  Rename Model to ServiceProfile across the codebase.
  Add TenantId to workflow definition and skip multitenancy test
  Fix background activity completion (elsa-workflows#5882)
  Update persistence feature base classes to include self-type
  Refactor journal data access and improve byte[] handling (elsa-workflows#5878)
  Changed RegisterClassMap to TryRegisterClassMap on SerializedKeyValuePair classmap registration (elsa-workflows#5877)
  Add Orchard Core Integration + Agents Module (elsa-workflows#5871)
  Add customizable DB exception handlers
  Refactor workflow execution and pipeline handling
  Update elsa-v3-avatar.png
  Add new Elsa v3 avatar to design and update README
  Add MyEvent activity to Elsa services
  Add TODO
  Fix logger type
  Update ElsaStudioVersion to 3.2.0-rc4.473
  Fix incorrect serializer reference
  Update pre-release version in GitHub Actions workflow
  Rework Workflow Context Feature (elsa-workflows#5861)
  Add engine exception handling middleware
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Compatibility Problem with Workflow Context Providers in Upgrade from 3.0.5 to 3.2
1 participant