feat(plugin): add onOperationChange hook#527
Open
nvasiu wants to merge 1 commit into
Open
Conversation
dbeb887 to
885579d
Compare
zhongkechen
approved these changes
Jul 10, 2026
| durableConfig | ||
| .getPluginRunner() | ||
| .onOperationChange(PluginInfoConverter.toOperationChangeInfo( | ||
| requestId, durableExecutionArn, updatedOperations, operationStorage.values())); |
Contributor
There was a problem hiding this comment.
Is it a concern to pass the same object to multiple plugins? One plugin could potentially modify the object and impact the others
Contributor
Author
There was a problem hiding this comment.
Updated, the maps inside OperationChangeInfo are now immutable, so this shouldnt be a concern anymore.
885579d to
11a94fd
Compare
zhongkechen
approved these changes
Jul 10, 2026
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.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
#513
Description
Adds an
onOperationChangeplugin hook, matching the one in the JS SDK. This hook fires when a checkpoint response changes the status of one or more operations.Changes
MODIFICATIONS
ExecutionManager.javaExecutionManagerclass now has a Lambda Context field and constructor parameter. The context is used to retrieve the request ID, to pass to theonOperationChangehook.onCheckpointCompletehas been updated:onOperationChangehook is called. The request ID, execution ARN, list of changed operations, and a snapshot of all operations are passed to the hook.DurableExecutor.javalambdaContextinto theExecutionManagerconstructor.BaseDurableOperation.javaextractErrorFromOperationandgetErrorObjecthelpers have been madepublic staticso that they can be reused inPluginInfoConverter.javaADDITIONS
OperationChangeItemInfo.javaOperationChangeInfo.java.OperationInfo.javacontains, with the addition oferror(Throwabletype) andstatus(AWSOperationStatustype) fields.OperationChangeInfo.java<String, OperationChangeItemInfo>).DurableExecutionPlugin.javaonOperationChange(OperationChangeInfo)hook.PluginInfoConverter.javatoOperationChangeItemInfo()which converts rawOperations intoOperationChangeItemInforecords.extractErrorFromOperationfromBaseDurableOperation.javato get the throwable from the rawOperation.toOperationChangeInfo()which createsOperationChangeInforecords, and their associated maps.PluginRunner.javaonOperationChangedispatch.TESTS
PluginRunnerTest.javaonOperationChangecall to the existing all-hooks test.PluginIntegrationTest.javaAll existing tests constructing
ExecutionManagerwere updated to passnullto the new context parameter.Demo/Screenshots
Checklist
Testing
Unit Tests
Have unit tests been written for these changes? YES
Integration Tests
Have integration tests been written for these changes? YES
Examples
Has a new example been added for the change? (if applicable) N/A