Add Notification Dispatch When Workflow Definitions Are Reloaded#7293
Merged
Conversation
…rkflow definition reloads.
Contributor
Greptile OverviewGreptile SummaryEnhanced
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/modules/Elsa.Workflows.Runtime/Services/DefaultRegistriesPopulator.cs | Added notification support to broadcast workflow definition reloads to other nodes, mirroring the pattern used in WorkflowDefinitionsReloader |
Sequence Diagram
sequenceDiagram
participant Client
participant DefaultRegistriesPopulator
participant ActivityRegistryPopulator
participant WorkflowDefinitionStorePopulator
participant NotificationSender
participant RefreshActivityRegistry
Client->>DefaultRegistriesPopulator: PopulateAsync()
Note over DefaultRegistriesPopulator: Stage 1
DefaultRegistriesPopulator->>ActivityRegistryPopulator: PopulateRegistryAsync()
ActivityRegistryPopulator-->>DefaultRegistriesPopulator: complete
Note over DefaultRegistriesPopulator: Stage 2
DefaultRegistriesPopulator->>WorkflowDefinitionStorePopulator: PopulateStoreAsync(false)
WorkflowDefinitionStorePopulator-->>DefaultRegistriesPopulator: complete
Note over DefaultRegistriesPopulator: Stage 3
DefaultRegistriesPopulator->>ActivityRegistryPopulator: PopulateRegistryAsync()
ActivityRegistryPopulator-->>DefaultRegistriesPopulator: complete
Note over DefaultRegistriesPopulator: Stage 4
DefaultRegistriesPopulator->>WorkflowDefinitionStorePopulator: PopulateStoreAsync(true)
WorkflowDefinitionStorePopulator-->>DefaultRegistriesPopulator: workflowDefinitions
Note over DefaultRegistriesPopulator: Stage 5 (NEW)
DefaultRegistriesPopulator->>NotificationSender: SendAsync(WorkflowDefinitionsReloaded)
NotificationSender->>RefreshActivityRegistry: HandleAsync(notification)
RefreshActivityRegistry-->>NotificationSender: complete
NotificationSender-->>DefaultRegistriesPopulator: complete
DefaultRegistriesPopulator-->>Client: complete
Last reviewed commit: 0a37dcc
DefaultRegistriesPopulator: add notification support for workflow definition reloads.…finition reload notifications.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update
DefaultRegistriesPopulatorto send aWorkflowDefinitionsReloadednotification after repopulating the workflow definition store, allowing other nodes to update their registries accordingly.Changes
Implementation
DefaultRegistriesPopulatorinsrc/modules/Elsa.Workflows.Runtime/Services/DefaultRegistriesPopulator.csINotificationSenderinto theDefaultRegistriesPopulatorconstructor.workflowDefinitionStorePopulator.PopulateStoreAsync(...)into a
workflowDefinitionsvariable.ReloadedWorkflowDefinitioninstances.WorkflowDefinitionsReloadednotification containing the mapped definitions.notificationSender.SendAsync(...)usingdirectives for:Elsa.Mediator.ContractsElsa.Workflows.Runtime.ModelsElsa.Workflows.Runtime.NotificationsImpact
Behavior Change
WorkflowDefinitionsReloadednotification after the workflow definition store is repopulated.Dependencies Affected
INotificationSenderimplementation to be available via dependency injection.ReloadedWorkflowDefinitionWorkflowDefinitionsReloadedBreaking Changes
DefaultRegistriesPopulatorconstructor signature by addingINotificationSender.DefaultRegistriesPopulatorPerformance / Side Effects
notificationSender.SendAsync) after repopulation.Testing Implications
INotificationSenderWorkflowDefinitionsReloadedis sent with the expected payload