Skip to content

exit flow directive isn't validated properly #67

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

Closed
JBBianchi opened this issue Nov 20, 2024 · 0 comments · Fixed by #68
Closed

exit flow directive isn't validated properly #67

JBBianchi opened this issue Nov 20, 2024 · 0 comments · Fixed by #68
Milestone

Comments

@JBBianchi
Copy link
Member

What happened:
When trying to use the exit flow directive, the validation process of the SDK returns an error.

What you expected to happen:
The exit flow directive to be valid.

How to reproduce it:

  • Try to validate the following example from the spec:
document:
  dsl: '1.0.0-alpha5'
  namespace: test
  name: sample-workflow
  version: 0.1.0
do:
  - processOrder:
      switch:
        - case1:
            when: .orderType == "electronic"
            then: processElectronicOrder
        - case2:
            when: .orderType == "physical"
            then: processPhysicalOrder
        - default:
            then: handleUnknownOrderType
  - processElectronicOrder:
      do:
        - validatePayment:
            set:
              validate: true
        - fulfillOrder:
            set:
              status: fulfilled
      then: exit
  - processPhysicalOrder:
      do:
        - checkInventory:
            set:
              inventory: clear
        - packItems:
            set:
              items: 1
        - scheduleShipping:
            set:
              address: Elmer St
      then: exit
  - handleUnknownOrderType:
      do:
        - logWarning:
            set:
              log: warn
        - notifyAdmin:
            set:
              message: something's wrong

Which results in the following errors:

The workflow definition is not valid.

/do[1]/processElectronicOrder/then:
Unreachable or undefined task
/do[2]/processPhysicalOrder/then:
Unreachable or undefined task
@JBBianchi JBBianchi reopened this Nov 20, 2024
JBBianchi added a commit to neuroglia-io/sdk-net that referenced this issue Nov 20, 2024
@cdavernas cdavernas added this to the v1.0.0 milestone Jan 10, 2025
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 a pull request may close this issue.

2 participants