Skip to content
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(action): add invoke/onParentComplete/Id field #93

Merged
merged 1 commit into from
Oct 4, 2022
Merged

feat(action): add invoke/onParentComplete/Id field #93

merged 1 commit into from
Oct 4, 2022

Conversation

lsytj0413
Copy link
Collaborator

Signed-off-by: lsytj0413 511121939@qq.com

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:

  • Add action.id、functionRef.invoke、workflowRef.invoke、workflowRef.onParentComplete、eventRef.invoke field

Special notes for reviewers:

Additional information (if needed):

model/workflow.go Outdated Show resolved Hide resolved
Signed-off-by: lsytj0413 <511121939@qq.com>
@spolti spolti mentioned this pull request Oct 4, 2022

// Invoke specifies if the subflow should be invoked sync or async.
// Defaults to sync.
Invoke string `json:"invoke,omitempty" validate:"required,oneof=async sync"`
Copy link
Member

Choose a reason for hiding this comment

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

isn't better to have something like this:
Invoke InvokeKindjson:"invoke,omitempty" validate:"omitempty,min=1"`

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd like to define InvokeKind enum for this value, and it's will be fixed in another PR (it seems appear in other struct too).

If we use validate with min=1, we must add a custom validate function for this struct (at this moment, the validator's oneof tag satisfy our requirement, so i use it).

Copy link
Member

Choose a reason for hiding this comment

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

Since Invoke is an enum, we need a type indeed.

@spolti
Copy link
Member

spolti commented Oct 4, 2022

relates to #70

@ricardozanini ricardozanini merged commit 2d45040 into serverlessworkflow:main Oct 4, 2022
@lsytj0413 lsytj0413 deleted the add-action-validate branch October 5, 2022 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants