forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(stepfunctions): improve Task payload encoding (aws#2706)
Improve referencing data fields for StepFunctions tasks, in preparation of callback task implementaion. Get rid of `JsonPath`, and in its place we have 2 new classes: - `Data`, for fields that come from the user payload (`$.My.Field`). Settle on the term "data" since that's the term used in most of StepFunctions' docs. - `Context`, for fields that come from the service-defined task "context" (like `$$.Execution.StartTime`, and in particular `$$.Task.Token`). These classes have been moved from the `-tasks` module to the `aws-stepfunctions` module, where it seems to make more sense for them to live. Add support for SQS and SNS tasks to publish an arbitrary JSON structure that can reference fields from context and execution data. Remove `NumberValue` since we can now encode Tokens in regular number values. BREAKING CHANGES: - **stepfunctions**: `JsonPath.stringFromPath` (and others) are now called `Data.stringAt()`. The `DataField` class now lives in the main stepfunctions module. - **stepfunctions**: `PublishToTopic` property `messageObject` used to take a JSON string, now pass `sfn.TaskInput.fromObject()` or `sfn.TaskInput.fromText()` into the `message` field. - **stepfunctions**: `SendToQueue` property `messageBody` used to take a JSON string, now pass `sfn.TaskInput.fromObject()` or `sfn.TaskInput.fromText()` into the `message` field. - **stepfunctions**: Instead of passing `NumberValue`s to StepFunctions tasks, pass regular numbers.
- Loading branch information
Showing
22 changed files
with
739 additions
and
251 deletions.
There are no files selected for viewing
This file contains 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
119 changes: 0 additions & 119 deletions
119
packages/@aws-cdk/aws-stepfunctions-tasks/lib/json-path.ts
This file was deleted.
Oops, something went wrong.
53 changes: 0 additions & 53 deletions
53
packages/@aws-cdk/aws-stepfunctions-tasks/lib/number-value.ts
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.