-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(stepfunctions): add comment ability for when condition #27010
Changes from 6 commits
a69e6aa
274b4ae
9539cd3
7165b37
d28c139
927f628
a17422f
dd616be
1a9e47a
feb3c0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":"32.0.0"} | ||
{"version":"34.0.0"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "32.0.0", | ||
"version": "34.0.0", | ||
"testCases": { | ||
"integ.state-machine": { | ||
"stacks": [ | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -318,16 +318,16 @@ export abstract class State extends Construct implements IChainable { | |||||
/** | ||||||
* Add a choice branch to this state | ||||||
*/ | ||||||
protected addChoice(condition: Condition, next: State) { | ||||||
this.choices.push({ condition, next }); | ||||||
protected addChoice(condition: Condition, next: State, options?: IChoiceTransitionOptions) { | ||||||
this.choices.push({ condition, next, ...options }); | ||||||
next.startState.addIncoming(this); | ||||||
if (this.containingGraph) { | ||||||
next.startState.bindToGraph(this.containingGraph); | ||||||
} | ||||||
} | ||||||
|
||||||
/** | ||||||
* Add a paralle branch to this state | ||||||
* Add a parallel branch to this state | ||||||
*/ | ||||||
protected addBranch(branch: StateGraph) { | ||||||
this.branches.push(branch); | ||||||
|
@@ -479,7 +479,7 @@ export interface FindStateOptions { | |||||
/** | ||||||
* A Choice Transition | ||||||
*/ | ||||||
interface ChoiceTransition { | ||||||
interface ChoiceTransition extends IChoiceTransitionOptions { | ||||||
/** | ||||||
* State to transition to | ||||||
*/ | ||||||
|
@@ -491,13 +491,26 @@ interface ChoiceTransition { | |||||
condition: Condition; | ||||||
} | ||||||
|
||||||
/** | ||||||
* Options for Choice Transition | ||||||
*/ | ||||||
export interface IChoiceTransitionOptions { | ||||||
/** | ||||||
* An optional description for the choice transition | ||||||
* | ||||||
* @default No comment | ||||||
*/ | ||||||
comment?: string; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this fix the JSII error maybe?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jogold It did. Good shout, Jonathan. I was following the pattern of |
||||||
} | ||||||
|
||||||
/** | ||||||
* Render a choice transition | ||||||
*/ | ||||||
function renderChoice(c: ChoiceTransition) { | ||||||
return { | ||||||
...c.condition.renderCondition(), | ||||||
Next: c.next.stateId, | ||||||
Comment: c.comment, | ||||||
}; | ||||||
} | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msambol what was the reason for naming this
IChoiceTransitionOptions
? I assume you ran into some linter rule that yelled at you? Want to find out because I don't think it makes sense here, and we should exempt this from that rule if thats the caseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaizencc Yep, I got:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaizencc From what I'm reading there isn't a way to silence JSII errors? Hmm..