8000 Remove obsolete properties and refactor activity evaluation by sfmskywalker · Pull Request #6603 · elsa-workflows/elsa-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove obsolete properties and refactor activity evaluation #6603

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

Merged
merged 2 commits into from
Apr 18, 2025

Conversation

sfmskywalker
Copy link
Member
@sfmskywalker sfmskywalker commented Apr 18, 2025

Refactored activity input and log persistence property evaluation using improved notification handlers. Removed redundant ActivityState property and associated serialization logic, ensuring payloads are only serialized when necessary. All changes streamline workflow processing and enhance maintainability.


This change is Reviewable

Refactored activity input and log persistence property evaluation using improved notification handlers. Removed redundant `ActivityState` property and associated serialization logic, ensuring payloads are only serialized when necessary. All changes streamline workflow processing and enhance maintainability.
Replaced the separate variable for the cancellation token with an inline reference for clarity and reduced redundancy. This simplifies the code without altering functionality.
@sfmskywalker sfmskywalker requested a review from Copilot April 18, 2025 14:17
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the obsolete ActivityState property and refactors several aspects of activity evaluation and log persistence to streamline workflow processing. Key changes include:

  • Removing the redundant ActivityState property and associated serialization logic.
  • Refactoring payload serialization in log stores and mappers.
  • Adding improved notification handlers to ensure parent activity properties and log persistence modes are properly evaluated.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/modules/Elsa.Workflows.Runtime/Services/WorkflowExecutionLogRecordExtractor.cs Removed extraction of outdated ActivityState.
src/modules/Elsa.Workflows.Runtime/Services/DefaultActivityExecutionMapper.cs Replaced payload extraction with journal data and removed legacy method.
src/modules/Elsa.Workflows.Runtime/LogPersistence/Handlers/EvaluateParentInputProperties.cs Introduced handler for evaluating parent input properties.
src/modules/Elsa.Workflows.Runtime/LogPersistence/Extensions/ActivityExecutionContextExtensions.cs Added HasLogPersistenceModeMap method.
src/modules/Elsa.Workflows.Runtime/Features/WorkflowRuntimeFeature.cs Added notification handler for EvaluateParentLogPersistenceModes.
src/modules/Elsa.Workflows.Runtime/Entities/WorkflowExecutionLogRecord.cs Marked ActivityState as obsolete.
src/modules/Elsa.Workflows.Core/Notifications/InvokingActivityCallback.cs Introduced new notification record for invoking activity callbacks.
src/modules/Elsa.Workflows.Core/Middleware/Activities/ExecutionLogMiddleware.cs Removed the payload from the "Suspended" log entry.
src/modules/Elsa.Workflows.Core/Handlers/EvaluateParentInputProperties.cs Ensured properties are evaluated before parent invocation.
src/modules/Elsa.Workflows.Core/Extensions/ActivityExecutionContextExtensions.cs Updated canceled log entry to remove payload.
src/modules/Elsa.Workflows.Core/Contexts/ActivityExecutionContext.Complete.cs Updated completed log entry to remove payload.
src/modules/Elsa.Workflows.Core/Contexts/ActivityExecutionContext.Cancel.cs Updated canceled log entry to remove payload.
src/modules/Elsa.Workflows.Core/Behaviors/ScheduledChildCallbackBehavior.cs Updated child callback behavior to invoke parent evaluation via a notification.
src/modules/El 8000 sa.Workflows.Core/Abstractions/Activity.cs Refactored constructors and property defaults.
src/modules/Elsa.Workflows.Api/Models/ExecutionLogRecord.cs Marked ActivityState as obsolete on API models.
src/modules/Elsa.Scheduling/Activities/Cron.cs Updated constructor defaults from default to null.
src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/WorkflowExecutionLogStore.cs Refactored payload serialization logic.
src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperWorkflowExecutionLogStore.cs Refactored payload serialization and mapping for log records.
Comments suppressed due to low confidence (1)

src/modules/Elsa.Workflows.Core/Behaviors/ScheduledChildCallbackBehavior.cs:35

  • The variable 'context' is not defined in this scope. Consider using an available cancellation token (for example, from activityExecutionContext or passing a cancellation token variable) to ensure the notification is sent with the appropriate cancellation settings.
await mediator.SendAsync(invokingActivityCallbackNotification, context.CancellationToken);

@sfmskywalker sfmskywalker merged commit c8ed08c into rc/3.4.0 Apr 18, 2025
5 checks passed
@sfmskywalker sfmskywalker deleted the enh/6602 branch April 18, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants
0