[Fix #1395] AllStrategyCorrelation persistence#1396
Draft
fjtirado wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #1395 by extending the persistence API to better support “all/AND” event correlation and enabling persistence implementations to clean up correlated CloudEvents once a workflow instance has started.
Changes:
- Add persistence hooks for “all strategy” correlation (
correlateEvent) and CloudEvent cleanup (removeCloudEvents), plus a helperPersistenceAllStrategyCorrelationInfo. - Propagate correlated CloudEvent IDs via workflow instance metadata, and remove those events during persistence
started(...). - Update scheduling flow to pass
WorkflowInstance(not justWorkflowModel) so metadata can be attached before starting.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| impl/persistence/api/src/main/java/io/serverlessworkflow/impl/persistence/TransactedPersistenceInstanceWriter.java | Adjust executor invocation to pass WorkflowDefinitionData instead of full context. |
| impl/persistence/api/src/main/java/io/serverlessworkflow/impl/persistence/PersistenceInstanceOperations.java | Add default persistence extension points for CloudEvent cleanup and “all strategy” correlation. |
| impl/persistence/api/src/main/java/io/serverlessworkflow/impl/persistence/PersistenceExecutor.java | Change executor API to accept WorkflowDefinitionData and add Supplier-based execution. |
| impl/persistence/api/src/main/java/io/serverlessworkflow/impl/persistence/PersistenceAllStrategyCorrelationInfo.java | New helper implementing AllStrategyCorrelationInfo using persistence operations + executor. |
| impl/persistence/api/src/main/java/io/serverlessworkflow/impl/persistence/AbstractPersistenceInstanceWriter.java | On workflow start, remove persisted CloudEvents referenced in instance metadata. |
| impl/persistence/api/src/main/java/io/serverlessworkflow/impl/persistence/AbstractAsyncPersistenceExecutor.java | Implement new PersistenceExecutor API (Runnable + Supplier overloads). |
| impl/core/src/main/java/io/serverlessworkflow/impl/WorkflowMutableInstance.java | Introduce metadata key constant and metadata helper methods. |
| impl/core/src/main/java/io/serverlessworkflow/impl/WorkflowInstanceData.java | Add findMetadata to surface instance metadata. |
| impl/core/src/main/java/io/serverlessworkflow/impl/WorkflowInstance.java | Add addMetadataIfAbsent to allow attaching metadata before starting instances. |
| impl/core/src/main/java/io/serverlessworkflow/impl/scheduler/ScheduledInstanceRunnable.java | Switch scheduling runner to accept WorkflowInstance directly. |
| impl/core/src/main/java/io/serverlessworkflow/impl/scheduler/ScheduledEventConsumer.java | Attach correlated CloudEvent IDs to the instance before scheduling start. |
| impl/core/src/main/java/io/serverlessworkflow/impl/scheduler/DefaultWorkflowScheduler.java | Update cron runner to align with WorkflowInstance-based scheduling runner. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ff67ce9 to
d929a3b
Compare
4141a67 to
9af4051
Compare
…lation Signed-off-by: fjtirado <ftirados@redhat.com>
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.
Fix #1395