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

fixed-end-condition-mermaid #141

Merged

Conversation

antmendoza
Copy link
Member

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:
closes #140

Special notes for reviewers:

Additional information (if needed):

Signed-off-by: Antonio Mendoza Pérez <antmendoza@gmail.com>
@antmendoza
Copy link
Member Author

given this workflow:


{
  "id": "applicantrequest",
  "version": "1.0",
  "specVersion": "0.7",
  "name": "Applicant Request Decision Workflow",
  "description": "Determine if applicant request is valid",
  "start": "CheckApplication",
  "functions": [
    {
      "name": "sendRejectionEmailFunction",
      "operation": "http://myapis.org/applicationapi.json#emailRejection"
    }
  ],
  "states":[
    {
      "type":"switch",
      "name":"CheckApplication",
      "dataConditions": [
        {
          "condition": "${ .applicants | .age >= 18 }",
          "transition": "StartApplication"
        },
        {
          "condition": "${ .applicants | .age < 18 }",
          "end": true
        }
      ],
      "defaultCondition": {
        "transition": "StartApplication"
      }
    },
    {
      "type": "operation",
      "name": "StartApplication",
      "actions": [
        {
          "subFlowRef": "startApplicationWorkflowId"
        }
      ],
      "end": true
    }
  ]
}

this is the output:

@tsurdilo
Copy link
Contributor

@antmendoza thank you!!

@antmendoza antmendoza merged commit d58ddad into serverlessworkflow:main Oct 24, 2021
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.

Diagram generation fails when switch state condition has an end definition
2 participants