Skip to content

Web Editor doesn't generate the diagram for my specific workflow #587

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
Assignees

Comments

@hbelmiro
Copy link
Contributor

hbelmiro commented Feb 1, 2022

What happened: When I use the following workflow definition and click the button to generate the diagram, nothing happens.

{
  "id": "jsongreet",
  "specVersion": "0.8",
  "name": "Greeting workflow",
  "expressionLang": "jsonpath",
  "description": "JSON based greeting workflow",
  "start": "ChooseOnLanguage",
  "functions": [
    {
      "name": "greetFunction",
      "type": "custom",
      "operation": "sysout"
    }
  ],
  "states": [
    {
      "name": "ChooseOnLanguage",
      "type": "switch",
      "dataConditions": [
        {
          "condition": "{{ $.[?(@.language  == 'English')] }}",
          "transition": "GreetInEnglish"
        },
        {
          "condition": "{{ $.[?(@.language  == 'Spanish')] }}",
          "transition": "GreetInSpanish"
        }
      ],
      "defaultCondition": {
        "transition": "GreetInEnglish"
      }
    },
    {
      "name": "GreetInEnglish",
      "type": "inject",
      "data": {
        "greeting": "Hello from JSON Workflow, "
      },
      "transition": "GreetPerson"
    },
    {
      "name": "GreetInSpanish",
      "type": "inject",
      "data": {
        "greeting": "Saludos desde JSON Workflow, "
      },
      "transition": "GreetPerson"
    },
    {
      "name": "GreetPerson",
      "type": "operation",
      "actions": [
        {
          "name": "greetAction",
          "functionRef": {
            "refName": "greetFunction",
            "arguments": {
              "message": "$.greeting $.name"
            }
          }
        }
      ],
      "end": {
        "terminate": true
      }
    }
  ]
}

What you expected to happen: I expected the diagram to be generated

How to reproduce it: Using the above json

Anything else we need to know?:

Environment:

  • Specification version used: 0.8
@antmendoza
Copy link
Contributor

thank you! I am going to have a look

antmendoza pushed a commit to antmendoza/serverlessworkflow_sdk-typescript that referenced this issue Feb 1, 2022
antmendoza pushed a commit to antmendoza/serverlessworkflow.github.io that referenced this issue Feb 1, 2022
@antmendoza antmendoza self-assigned this Feb 1, 2022
tsurdilo added a commit to serverlessworkflow/sdk-typescript that referenced this issue Feb 2, 2022
@tsurdilo
Copy link
Contributor

tsurdilo commented Feb 2, 2022

@antmendoza thanks bro!!!

@hbelmiro try again, Antonios prs are merged now.

@hbelmiro
Copy link
Contributor Author

hbelmiro commented Feb 2, 2022

It works now 🎉
Thank you @tsurdilo and @antmendoza.

@tsurdilo
Copy link
Contributor

tsurdilo commented Feb 2, 2022

@hbelmiro Antonio did all the work :)

But just fyi, you don't have to set "terminate": true on end definition in SW unless you have "keepActive" top-level prop set to true. Glad tho you did it so we could uncover the issue.

antmendoza added a commit to serverlessworkflow/sdk-typescript that referenced this issue Apr 18, 2022
commit 17fad27
Merge: 6d4dfb5 0cf8067
Author: Tihomir Surdilovic <[email protected]>
Date:   Tue Feb 1 20:52:32 2022 -0500

    Merge pull request #164 from antmendoza/fix-diagram-generation

    fix diagram generation serverlessworkflow/specification#587

commit 0cf8067
Author: Antonio Mendoza Pérez <[email protected]>
Date:   Tue Feb 1 22:54:21 2022 +0100

    fix diagram generation serverlessworkflow/specification#587

    Signed-off-by: Antonio Mendoza Pérez <[email protected]>

commit 6d4dfb5
Author: Antonio Mendoza Pérez <[email protected]>
Date:   Tue Jan 11 08:18:08 2022 +0100

    Fix workflow validator (#163)

    fix WorkflowValidator

commit 2636805
Author: Antonio Mendoza Pérez <[email protected]>
Date:   Mon Jan 10 21:46:11 2022 +0100

    ignore js files in test phase (#162)

commit b335771
Author: Antonio Mendoza Pérez <[email protected]>
Date:   Mon Jan 10 21:39:13 2022 +0100

    Handle compensatedBy in diagram generation (#161)

     handle compensatedBy diagram generation

commit a89acd0
Author: Antonio Mendoza Pérez <[email protected]>
Date:   Tue Dec 28 14:41:38 2021 +0100

    Code formatting (#160)

    * order-properties-on-serialization

    Signed-off-by: Antonio Mendoza Pérez <[email protected]>

    * code-formating

    Signed-off-by: Antonio Mendoza Pérez <[email protected]>

commit 219768d
Author: Antonio Mendoza Pérez <[email protected]>
Date:   Tue Dec 28 09:16:38 2021 +0100

    order-properties-on-serialization (#159)

commit 96763b9
Author: Antonio Mendoza Pérez <[email protected]>
Date:   Sat Dec 25 20:16:46 2021 +0100

    Fix default values are removed on serialization  (#156)

    * fix-remove-default-values

    Signed-off-by: Antonio Mendoza Pérez <[email protected]>

    * removed-ifObject

    Signed-off-by: Antonio Mendoza Pérez <[email protected]>

commit d6fd5d8
Author: Antonio Mendoza Pérez <[email protected]>
Date:   Sat Dec 25 16:04:44 2021 +0100

    update-package-version-4.0.0 (#157)

    * update-package-version-4.0.0

    Signed-off-by: Antonio Mendoza Pérez <[email protected]>

    * update-package-version-4.0.0

    Signed-off-by: Antonio Mendoza Pérez <[email protected]>

commit 955dab0
Merge: 255c834 5424a3d
Author: Antonio Mendoza Pérez <[email protected]>
Date:   Thu Dec 9 01:24:04 2021 +0100

    Merge pull request #154 from serverlessworkflow/3.0.x

    changed-package-version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment